• 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.

wanmaple

Members
  • Content count

    16
  • Joined

  • Last visited

Community Reputation

229 Neutral

About wanmaple

  • Rank
    Member

Personal Information

  • Location
    Shanghai
  1. Hi, I am a newbie on 3D game engine.   I found an open-source game engine called Urho3D several weeks ago.   I know about some knowledges about OpenGL, and have enough experience on 2D games. I have researched a lot through the samples provided by Urho3D, but still can't go across it.   Are there any great Urho3D tutorials or 3D game basis which is suitable for beginners like me.   I need your help! Thanks a lot.
  2.   Thanks for your suggestion, I own the ambition to write a library for myself, in fact I'm doing now. So I think reading the opensource engine code is helpful to me.
  3. Pretty helpful suggestion, I consulted some data about GLFW, it may be a new start for me. By the way, how about cocos2d-x? It seems that cocos2d-x is very popular in mobile game development.   How about sound? I know OpenAL is for sound, however I'm not familiar with OpenAL, but are there any opensource libraries about OpenAL? I think the sound effect is also very important in a game.
  4. Hi: I'm going to learn game programming. I have the basis of c/c++/c#. I'd like to develop 2D games first and research 3D games later, so which game engine should I choose? There are many many different opensource game engines, so I don't know which is suitable for a beginner. I have learnt some about DirectX, which is not cross-platform, so I may spend more time on OpenGL study. I prefer an opensource game engine whose graphic is based on OpenGL. Give me some suggestions, please. Thanks.
  5. You should avoid singletons, but not for this reason. The static thread method is just used to dispatch the call to the instance-specific handler. The "real" handler is not static.   Really thankful to you, I think I know what to do so. Thanks very very much.
  6. http://www.parashift.com/c++-faq/   http://www.parashift.com/c++-faq/memfnptr-vs-fnptr.html   Thanks, bro~   You cannot directly specify an instance method as method / callback parameter in Windows API in general, and not in CreateThread in particular. This is because internally instance methods have an additional parameter pointing to the class instance, so the method signature does not match the signature required by CreateThread. The usual workaround is to have a static method, pass a pointer to the instance as lpParameter, and dispatch the call in the static method to an instance method, using that parameter. class MsgListener { private: HANDLE _threadHandle; DWORD _threadId; static MsgListener *_instance; MsgListener(); DWORD Listen(); static DWORD WINAPI StaticListen(LPVOID param); public: static MsgListener *GetInstance(); void StartListen(); void StopListen(); }; MsgListener *MsgListener::_instance = new MsgListener(); MsgListener::MsgListener() { _threadHandle = 0; _threadId = 0; } DWORD WINAPI MsgListener::StaticListen(LPVOID param) { MsgListener* listener = reinterpret_cast<MsgListener*>(param); return listener->Listen(); } DWORD MsgListener::Listen() { // The method to run in a new thread.... return 0; } MsgListener *MsgListener::GetInstance() { if (!_instance) _instance = new MsgListener(); return _instance; } void MsgListener::StartListen() { this->_threadHandle = CreateThread(NULL, 0, &MsgListener::StaticListen, this, 0, &_threadId); } void MsgListener::StopListen() { CloseHandle(_threadHandle); } However, I'd use the threading support in C++11 instead. It is so much easier to specify an arbitrary worker method, even an instance method, using the std::thread ctor: http://en.cppreference.com/w/cpp/thread/thread/thread   Yeah, you are right. When I use a static method, the Singleton is meaningless, so I think I ought to change a design way to watch the device state. Thanks very much, bro.
  7. Accelerated C++ by Koenig and Moo, and C++ Primer by Lippmann, LaJoie and Moo, are both frequently recommended for beginners in C++. Even so, what problem are you trying to solve? People can probably point you to excellent resources for whatever specific problem you are looking to solve that are less complex than the path you were traveling.   Thanks, I want to create a new thread to watch the keyboard state and mouse state in DirectInput, I want to use a infinite loop to watch the message by using the GetDevice function in DirectInput. So I want to define a class which is to manage the listen thread.
  8. Thanks very much. Could you recommand some articles or books about c++ lower mechanisms and theory of c++ class. I always feel confused about some concepts in c++ class.
  9. Dear everyone, I am writing a singleton class to manage a thread, here's the code: #include <windows.h> typedef class MsgListener { private: HANDLE _threadHandle; DWORD _threadId; static MsgListener *_instance; MsgListener(); DWORD WINAPI Listen(LPVOID param); public: static MsgListener *GetInstance(); void StartListen(); void StopListen(); } MSGLISTENER, *LPMSGLISTENER; MsgListener *MsgListener::_instance = new MsgListener(); MsgListener::MsgListener() { _threadHandle = 0; _threadId = 0; } DWORD WINAPI MsgListener::Listen(LPVOID param) { // The method to run in a new thread.... } MsgListener *MsgListener::GetInstance() { if (!_instance) _instance = new MsgListener(); return _instance; } void MsgListener::StartListen() { // Here, the compiler give the error: // cannot convert 'MsgListener::Listen' from type 'DWORD (MsgListener::)(LPVOID) { aka long unsigned int (MsgListener::)(void*) }' to type 'LPTHREAD_START_ROUTINE { aka long unsigned int (__attribute__((__stdcall__)) *)(void*) }' this->_threadHandle = CreateThread(NULL, 0, Listen, 0, &_threadId); } void MsgListener::StopListen() { CloseHandle(_threadHandle); } The ide I use is Code::Blocks and the compiler is GNU GCC COMPILER. How to convert the function pointer in a class to the normal function pointer in C? And I really don't know the difference between these two kind of function pointers. Where does each kind of function pointer save in the memory?
  10. Where is your override keyword? To realize Polymorphism, you have to implement 3 conditions: 1. Contains inheritance.(Interface or base class) 2. Contains override(use abstract/override or virtual/override or realize the interface method) 3. Mutiple base class objects which point to a derived class reference.   You should use override keyword in your derived class to replace the behavior of base class. Otherwise you should use new keyword to prevent derived class to replace the method of base class.
  11. Well, you should know the concepts of relative coordinate system and world coordinate system. Your triangles should save your relative point list and the center point. Then update the relative point list when rotate for some radius and redraw it. Give some simple code: #define PI 3.1415926535 typedef struct { double x, y; } POINT, *LPPOINT; typedef class Triangle { private: POINT pointList[3]; POINT centerPoint; public: Triangle() { }; // Constructor ~Triangle() { }; // Destructor BOOL Draw(); // Realize your Draw method BOOL Rotate(double theta); // Rotate method } TRIANGLE, *LPTRIANGLE; BOOL TRIANGLE::Rotate(double theta) { double cosVal, sinVal; for (int i = 0; i < 3; i++) { cosVal = cos(theta * PI / 180); sinVal = sin(theta * PI / 180); // Compute the relative coordinate after rotate this->pointList[i].x = this->pointList[i].x * cosVal - this->pointList[i].y * sinVal; this->pointList[i].y = this->pointList[i].x * sinVal + this->pointList[i].y * cosVal; } return this->Draw(); BOOL TRIANGLE::Draw() { // In your draw method, you should change your relative coordinate to world coordinate. }
  12.   Word of advice, if you'd like some more, screw that book, most of the techniques are probably horribly outdated anyway. Some of the books from about 6 years ago with DirectX9 tended to teach practices not nearly practically usable, so I quess with your book, you'll spend more time learning things that are eigther:   - outdated, and not needed anymore (like the palette thing) or - outdated, and overly complicated or "bad" (like twenty-depth inheritance chains for game objects, yieks!)   If I where you, I'd get a decent DirectX10, or at least DirectX9 book. Also, learning DirectX10, there are better alternatives, DirectX11 is almost the same as its predecessor, just with a few more features. Unless you are stuck with Vista, why not start right there? That way you'll be most up to date ;)   Thanks for your suggestion, I'll try it~ 
  13. Yes, as Nik02 said. Palettes exist only for 8-bit and lower bitty surfaces. Anything higher than that uses direct color values.   Thanks very much~~
  14. Thanks very much. So I can't set palette in 32-bit surfaces? There is no palette concept in 32-bit mode, can I comprehend it in this way?