BUCH Dragon

Members
  • Content count

    9
  • Joined

  • Last visited

Community Reputation

161 Neutral

About BUCH Dragon

  • Rank
    Newbie
  1. Framework/Engine design.

      Close call. But I believe that is not correct. Notice that that conditional is within a while loop, and the "frame" actually takes place if there is no input. So it effectively processes all input first, and deals with frame rendering/updating/whatever only if there is no input(if(Peek...) fails).       I appreciate the advice, but there is so much to learn and so little time, that I can not really afford to be browsing around much. To be honest I thought someone would recognise a common design pattern one would usually desire in such a situation and suggest it from their experience. I am more or less satisfied on how I design the structure so far(hoping it stays that way), it is just that one little Input module and handling of input that I raised the question about that concerns me.
  2. Framework/Engine design.

    Right now, the System class is running the infinite game loop. Inside, after calling Graphics::render(); it checks for the input with Input::doSomethingWithInput(). Is that not a separate subsystem or did you mean something else?   Example: System::run() { MSG msg; memset(&msg, 0, sizeof(MSG)); // Infinite game loop. while (true) { // If there is a message. if (PeekMessage(&msg, 0, 0, 0, PM_REMOVE)) { // If it is a quit message, break out of loop. if (msg.message == WM_QUIT) break; // Translate message. TranslateMessage(&msg); // Dispatch message to message processing function (WndProc). DispatchMessage(&msg); } else { /* Run game code */ // Render frame. graphics->render(); // Get time taken to render the frame... double frameTime = frameTimer.getTimePassed(); // Not sure. input->doSomethingWithInput(frameTime); // Update game. graphics->update(frameTime); } } return msg.wParam; }
  3. Hello gamedev.   I have been wondering for a while now on how to design the structure of my project. Somehow, I don't seem to be quite satisfied with the ideas that come to mind. Perhaps, your opinion might lead me to a solution of my liking.   I have a basic layout:     Now the problem is, I'm not sure on "who" should process the input. For example: the Input class declares DirectInput object and device objects(keyboard and mouse) .   If I make Input class the "processing class", then it will have to include all other classes like Graphics, Networking, etc, etc. Not only that but it will either have to have some GameState class where it stores modified information from processing inputs and everyone would have to include this GameState class to work with it. An alternative to not having a GameState class, would be to pass all references of everyone from the System class to Input class and write lots of modification(setter-like) methods for everyone, so the Input class could push the processed data down their throats using those methods.   If the System is the "processing class", then it would get inputs from the Input class, have lots of processing methods related to everyone, and would either need to provide everyone with access to that data, or like mentioned before, push the data down their throats using lots of setter-like methods written for everyone.   Another option is that everyone, would include the Input class, call it to retrieve inputs(notice how everyone would get the same inputs over and over) and have their own processing methods to deal with the inputs. This seems a bit more organised, in the sense that each class would have their on set of methods on how to deal with the inputs... a modular approach if you will. But I'm not sure I feel it. Note: I refer to "everyone", meaning lots of complex objects(of depth 1) that the System class has/would have.   I feel like there should be something clean(er) that I'm not aware of. Please share your thoughts 
  4. Jframe and events

    You might want to research a bit on the wait() and notify() methods(here is a hint).   An alternative method is to make a short "sleep loop" checking for a condition to become true, like so: // Sleep until the socket is created or re-opened. try { while(socket == null || socket.isClosed()) Thread.sleep(100); } catch (InterruptedException e) { e.printStackTrace(); } in this case if a socket is created or an existing one closed, this loop would "pass through".   You could also set that 100ms sleep to be shorter if the action should be checked for more frequently, or make a really long sleep and interrupt that Thread from another Thread.
  5. Simple and straightforward game news channel?

      Sound advice. My experiences were mostly positive though, such as cases where a structure or some part(for technical tutorials) is explained in a more casual way as opposed to lots of formal text.     It's slightly amusing how the very first news post is a game I have played and enjoyed. That website seems similar to what I was looking for, thanks for the suggestion.     Glad that's the case :)
  6. Simple and straightforward game news channel?

      Thanks for the suggestion. Unfortunately, that channel is pretty much a casual game streaming one, as opposed to review/information oriented one.     Mine is too buddy... mine is too.
  7. Simple and straightforward game news channel?

      How? It is not like I am doing this every hour so other threads would get moved to another page.     Not all of the community is present 24/7 or even within the same time period the post will stay on the first page(s).       Think of it as logic.
  8. Hello guys.   I am wondering what would be a good, straightforward gaming news source. I have been watching TotalBiscuit on Youtube for a while and enjoyed it quite a bit. I am looking for a similar format where information is important as opposed to humour or entertainment.   Unfortunately his streaming of Starcraft video notifications and childish blocks of Youtube comments annoyed me to the point to seek alternative sources.   Any suggestions?