Jump to content



Help writing old-school game engine

  • You cannot reply to this topic
No replies to this topic

#1 vagosduke   Members   -  Reputation: 122

Like
0Likes
Like

Posted 19 December 2011 - 05:33 AM

Hello!

I don't know if my question is as platform-specific as I may think, so please excuse me if I am posting wrong.

Well, I have been writing an old-school platform 2D menu-based turn-based tactics/RPG game in Java for Android. So, it will be a little different from regular PC games in that although most game actions are linear, yet the animations, input, etc. will be computed at real time. IT started as an educational project, so the game engine is written from scratch.

I am afraid I am somewhat stuck at designing though. My biggest challenge so far is to design how to game engine will handle input and events such as "menu return options", "sprite animation end", etc. Unfortunately I have no experience programming such low-level game mechanics, especially this type of games. So I am searching for a professional and most elegant solutions that will respect object-oriented programming.

I had tough luck finding information on the web due to the nature of my question. I also downloaded the source of some open-source PC games, but none of them handles the things exactly how I have in mind, because PC games rely mostly on mouse cursor to get the player actions.

My preliminary thought is letting the game entities themselves handle the events (such as the characters requesting user input through a menu), but this doesn't respect much the concept of classes. The second thought is a state machine implemented as a large class with many {if then else} and {switch case} to handle input and events in each game state. Another thought is (since I'd like to be as adaptable as possible and also allow backtracking) implementing this state-machine with a "thread" of events that each event "opens" the next one. This last option though needs several of different classes for handling different events.

So, as I said since I have no experience designing game engines, here I am asking professional devs for their opinion, suggestions and pointing me to the right direction.


Thank you for your time.
ps. please excuse my bad English.

Ad:





We are working on generating results for this topic
PARTNERS