Sunday, September 11, 2011

Lessons Learned, Part 1

It's never too early to start a project's postmortem, and I've had a lot of thoughts floating around in my head of things I really want to remember for my next project.  I think I can keep these thoughts from becoming regrets if I record them and learn from them, so here's my first list of lessons learned in this project.

This is not to say that the project is over, of course.  It's far from it.  I just don't want to lose these valuable lessons in the meantime.
  • First and most importantly, make all games data-driven from the start, even if they're only single-player.
    • Along these lines, all objects in the game should have ID values of some sort that allow easier serialization, database storage, and network communication.
  • Don't use networking code for single-player mode. Use the remote proxy pattern.  My original technical design specified this, but that detail was somehow lost once implementation began.
    • This type of information loss is a crime! I must not let it happen again.
  • Dynamic and finely-placed objects should not be part of game map structure.  The engine's map rendering algorithm uses coarse object placement as a matter of necessity, which makes it impossible for an object to lie randomly on the ground, or for a character to walk smoothly from one map cell to another.
  • Network modules that receive messages should use the observer pattern.  This will enable different UI components to respond immediately to high-priority messages coming in without waiting for the rest of the messages to dequeue, and allow messages of different types to be sorted upon arrival.  (System messages versus chat messages versus character movement commands, etc.)
  • Model-View-Controller principles are always relevant.  ALWAYS! Even beyond the basics of the Single Responsibility Principle.  Perhaps the high-level architecture should always begin this way and then evolve to fit the individual needs of each project. This may be worth further consideration.
  • An unrelated discovery: sliding doors can be animated in real time by generating the image and cropping it. This is a profoundly good idea.
  • Audio spatialization is crucial, especially when the entire game world doesn't fit on one screen. This shortcoming of the engine must be implemented before development of Beltzhian Marauders can begin.
There are sure to be more to come.  I know this doesn't cover them all!


No comments:

Post a Comment