I remember one mod (though for the life of me I can't remember who)
SiCrane.
Any suggestions as to what would be appropriate would be welcome.
The things you listed aren’t mutually exclusive.
Every professional game has a game loop. For most platforms this is a while loop, but on iOS it is a callback handler for a display link triggered systematically by the operating system on v-blank.
So “standard game loop” basically applies no matter what.
Next you have to consider how much you focus on the remaining 3.
Events: Events should be avoided as much as possible. Games are not event-driven. Events can exist inside games but they are not at all how a game is “set up” or driven. The only practical uses for events in games are map triggers, timed triggers, AI, and similar.
Not input.
Not the game loop or message pump.
Data: Games should be as data-driven as possible and feasible. Reusable frameworks are the only reason the game industry is sustainable. Frameworks take whatever data you give them and play them back, render them, animate them, or whatever. What data you give to the engine defines the game you are making.
Rules of gameplay are logic, not data, and must be coded.
I mentioned “feasible” for a reason. In the best-case scenario you would make even the renderer data-driven. Files similar to the Effects Framework would tell you how to render things and with what states, and a higher-level layer could control the entire high-level rendering flow. This is best-case, but perhaps not feasible for a first-time attempt.
In other words, find your own balance between perfectly data-driven and your ability/desire to actually make it so.
MVC: This is not widely used in video games. This is appropriate for regular event-driven desktop and mobile applications, but due to the way professional games are designed, it’s not really appropriate.
Say you decide to use a common design. You create little subroutines to handle all your display states. DrawMenu() DrawCredits() DrawGame() etc. Each of those contains it's own event handling based on polling system flags and is a self contained program.
The only reason this is “common design” is because people aren’t born automatically knowing any better. It’s inappropriate to say this is “common” without proper context: It is typical of ultra-beginners, and since most people are ultra-beginners it is thus “common”.
It’s like the use of magic numbers. Extremely far from anything you would ever want to advise someone to do, but common.
General Game/Engine Structure You then move to a platform which is based on callbacks, and your design becomes a problem.
You can't just call a new display handler, you have to respond to callbacks and suddenly you have a hell of a lot of recoding to do. Not difficult coding, but lots of it.
That while(1) kills you.
On any desktop:
while ( !bQuitCondition ) {
m_pgGame->Tick();
}
On iOS:
- (void) displayLinkHandler:(CADisplayLink*)displayLink {
m_pgGame->Tick();
}
It’s really nothing.
L. Spiro