Separating a game engine from the game file.

BlitzMax Forums/BlitzMax Beginners Area/Separating a game engine from the game file.

Ryan Burnside(Posted 2008) [#1]
Recently I've been doing a lot of thinking about making a game engine for my games. Many of the game I will be making will be cookie cutter games. Aka very similar, so similar in fact that I think they could run on a simple game engine. Basically I want to make some shmups or scrolling 2d shooters. I feel that by changing some simple enemy types and their behaviors and fire patterns I can easily create multiple sequels. The nice thing about my current situation is that I actually want the games to play quite similar. Simply put each new sequel does not need to be better than the previous but simply maintain good quality. My question is how do I create a game engine that is completely detached from each new game.

Initially I had this thought:

First make some very generic base classes, these classes will eventually be extended by specific classes for each new game. I was wondering if it would be possible to store the game engine in one file and then have the elements of the game in generic sub folders. Perhaps the game engine just takes a single parameter (the name of the specific game being worked on) and loads all of the media from pre named folders INSIDE the specific game folder.

I would like to do something like the following if possible

(all in one folder)
GameEngine class with maybe a .txt file that names the specific folder that the game to be compiled is in.

In every game folder there would be pre named folders that the GameEngine class looks for, things like a "sprites" and "types" folder. The resource folders will have the same names but each original game folder will have a specific name. This name is simply passed to the GameEngine and it will load all of the proper resources and create the proper game.

so the structure would be a game engine class, and a seperate game folder that contains all of the resources and derived classes. The game engine just loads all of the resources and creates the game.

Is this poor structure or a good idea? Can Blitzmax even load all resources in a folder without knowing specific file names?


plash(Posted 2008) [#2]
Is this poor structure or a good idea?
Sounds pretty reasonable to me. You might want to look at how the quake3 engine is setup, with its mods and whatnot.

Can Blitzmax even load all resources in a folder without knowing specific file names?
Sure. You can sift through a folder to find all its sub-folders and files. (Take a peek at the code here)


MGE(Posted 2008) [#3]
You basically just described scripting. :) Also, instead of "x" amount of cookie cutter games, I'd focus on 1 killer game.


ImaginaryHuman(Posted 2008) [#4]
I think I'd do a mix between one really good game and then just a small handful of sequels/expansion pack things, although who knows you could come up with a game that people really do want new data for, probably more casual.


Ryan Burnside(Posted 2008) [#5]
Thanks for all the encouragement guys!

I do plan on making a quality game and sequential quality games.

I hate to use Mario as an example for making shoot em ups but the series for the NES really could have been done on the same engine. The games remain very very similar yet we play them because the action is slightly different with each game. The same could be said of the Mega Man games 1-6 and 9. They are all about the same on a technical level but they are all very entertaining in their own right.

I've been inspired by a developer called X.X who has produced some great works that appear to run on a *very* similar engine if not the same. These games are mostly just for fun and are free. The games are in English but one has to click their way through the Japanese host. It would be helpful to create games like this in maybe a month per game rather than having to write such a similar engine for each game. Shmups have remained farily simple over the years and it works. Changing a few fire patterns and a set of enemies and bosses makes a whole new game. This is why an engine would be so time saving.

X.X games:
http://shootthecore.moonpod.com/database.php?award=1&play_area=-1&type=-1&sub_genre=-1&sort_by=company_name&start=X


mikeful(Posted 2008) [#6]
This might be interesting to read before you dive into engines. http://scientificninja.com/advice/write-games-not-engines