• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.

xiajia

Members
  • Content count

    29
  • Joined

  • Last visited

Community Reputation

163 Neutral

About xiajia

  • Rank
    Member
  1. Well, not just GUI, can also be some game elements. Of course, if GUI can also.For all the elements interact with  the user in the game are far-fetched called UI ? ^.^ Then taking GUI as an example to illustrate the problem. For example a calculator (this is just an example), there are a lot of button. If the calculator can "switch" between the common and scientific type, and can "minimize", "maximize"......and so on. What I mean by "Action" is used to describe the process of these changes. Of course you can through some simple variables to describe the action,  but when these movements became a lot, Variable to describe becomes very messy.
  2. there are a lot of "action"s in a game. some are simple,e.g. the disappearance of a buttom. and some are complicated.e.g.the disappearance of a button array. Is there a way to abstract the "action", making it the reuse and modification easy? e.g.The convergence of the interface elements .Combination of elements of the game action , if the package is suitable , you can make the action more delicate and rich .
  3. Thanks for Paradigm Shifter and Crusable, i get a lot of tips.I have found a good method based on CMYK. Although there are still some problems, but has almost.
  4. Description of the problem are as follows: the first color1(c1) RGB value is rgb1, the second color2(c2) RGB value is rgb2, How to calculate the RGB(rgb3) of the color3(c3) mixed with c1 and c2,the mixing ratio is x: y. For example:red and green 1:1 mixture is yellow, red and black 1:1 mixture is dark red.
  5. I am the beginner of OpenMP.the code below:   #include "windows.h" #include "math.h" #include <omp.h> #include <iostream> int main(void) {     double t1 = omp_get_wtime( );     for(int i = 0;i < 8;i ++)     {         float a = 0;         for(int j = 0;j < 10000000;j++)         {             a += sqrtf(j);         }     }     double t2 = omp_get_wtime( );     std::cout<<"time: "<<t2 - t1<<std::endl; #pragma omp parallel for     for(int i = 0;i < 8;i ++)     {         float a = 0;         for(int j = 0;j < 10000000;j++)         {             a += sqrtf(j);         }     }     t1 = omp_get_wtime( );     std::cout<<"time: "<<t1 - t2<<std::endl;     system("pause");     return 0; }   when i release with VS2010,and run,there is no upgrade!In some cases , it will decline.i don't know Y?
  6. use smart pointer or use reference counting can solve this problem.
  7. I have yet to learn the knowledge of design patterns, I learned the factory pattern to do some more in-depth discussion.
  8. do you mean call ‘new’ at the constructor?This is just one case.Not always the case.
  9. about the semicolon after the tempClassA,it is a small accident. the main function is added later.The compiler will not complain if not coupled.
  10. I think "make the destructor public" is better than "add XDELETE as a friend to class MostlyPrivate",
  11. compiling with VS2005, error C2248:'tempClass<T>::~tempClass' : cannot access private member declared in class 'tempClass<T>' line 4: delete p;
  12. template<typename T> void XDELETE(T *&p) { delete p; p = NULL; } template<class T> class tempClassA; template<class T> class tempClass { private: friend tempClassA<T>; T * m_p; tempClass() :m_p(NULL) { } ~tempClass() { XDELETE(m_p); } }; template<class T> class tempClassA { public: tempClassA() :m_a(new tempClass<T>()) { } ~tempClassA() { XDELETE(m_a); } private: tempClass<T> * m_a; }; int main() { tempClassA<int> a; return 0; } compile error. 
  13. thanks for Brother Bob,Cornstalks and rip-off.These recommendations so refreshing for me.I should solve the problem instead of ducking the issue about double delete.     Not "macro higher efficiency than function"?
  14. Thank you very much for your advice. about 2:it's true that "delete" already checks if the pointer is "NULL".(I do not know whether all compilers are like this. But vs2005 is indeed the case.) but "delete" not set the pointer to "NULL"   int *p = new int[100]; delete []p; delete []p; // this is a runtime error The actual situation may be more complicated than this. about 3:Linked content is very good (yet not try to use), but I've seen about "boost::scoped_ptr","boost::shared_ptr","boost::scoped_array","boost::shared_array","boost::weak_ptr","boost:: intrusive_ptr:, so be a bit confusing to me.
  15. Well, with a specific example to illustrate.Smart pointers.The general method is as follows:     #define XDELETE(p) { if (p != NULL) { delete p; p = NULL; } } template<class T> class _XSmartP; template<class T> class _XBackP  {  private:    friend _XSmartP<T>;     T *m_p;    size_t m_counter;    _XBackP(T *p)   :m_p(p)   ,m_counter(1)     {    printf("_XBackP constructor called!\n");     }     ~_XBackP()     {         XDELETE(m_p);    printf( "_XBackP distructor called!\n");     }  };   template<class T> class _XSmartP  {  public:     _XSmartP(T *p) :m_backP(new _XBackP<T>(p))    {    printf("_XSmartP constructor called ! use = %d\n",m_backP->m_counter);    }      _XSmartP(const _XSmartP& temp)   :m_backP(temp.m_backP)    { ++m_backP->m_counter;      printf("_XSmartP copy constructor called ! use = %d\n",m_backP->m_counter);    }       _XSmartP<T>& operator=(const _XSmartP<T>&temp)  {    if(this == &temp) return *this;   ++temp.m_backP->m_counter;    if(--m_backP->m_counter == 0)    {    XDELETE(m_backP);   }   m_backP = temp.m_backP;   return *this;   }        ~_XSmartP()     {    printf("_XSmartP distructor called ! use = %d\n",m_backP->m_counter);   if(--m_backP->m_counter == 0)    {    XDELETE(m_backP);   }    }      T *getPtr() const     {         return m_backP->m_p;     }      T getVal() const     {         return *m_backP->m_p; }     void setVal(T val)     {         *m_backP->m_p = val;     }  private:     _XBackP<T> *m_backP; };    if use as follow:     _XSmartP<int> temp(new int[20]); it will cause errors because of "delete" to "new[]".If you want to avoid this problem, you need to define a similar structure for the array.However, this will have a lot of duplicate code.Is there a way to do it to the best of both worlds?