¡Hi mates! Two friends and I are planning to code a game for Android using AndEngine GLES 2.0 Anchor but we have a concept problem, we need the game to be as adaptative as possible, I mean, if we make a new map or a video, it has to be easily included on the game, making them plugable. For example:

When the game starts, shows a video as an introduction. After that, the game loads a level. When the level is finished, loads another level which is the second part of the mision, then, shows another video as outro, then shows another video, and then loads three more levels which are another mision and so.

My idea is to have a class that queries a DB or reads an XML file to determine which is the next thing the game has to load, sequentially, every time the last thing ended.

My mates said to me that it is a bad idea, a idea that breaks with the MVC pattern, because the Controller has to know by itself programatically which is the next thing that has to be loaded, but I think that my idea fits perfect on the Model, because the Controller is only a bridge between the View and the Model and I really don't like to hard code that, because I want the game to be extensible without touching any line of logic code to do that "simple task".

My mates said that one plausible solution to make adaptative without external resources is to hard code the flux secuentially on a Map on a class with constant values only, but that invalidates their argument about "Controller has to know everything" because works so similar as my idea but only a little faster because it hasn't to be loaded from a file or a DB.

There's another better way to do what we need?

(I do not look for an easy answer, I do not want someone make my job, I'm not a lecher, If someone says me that AndEngine does it for me, but not how, I will look for that by myself, but I need some guidance, because I've never programmed a game with multiple levels or some kind of "variable flux").

Thanks every one for your answers!

(I've post this on StackOverflow also, but I've found that page that seems more specialized on game development)

  • 2
    \$\begingroup\$ Hi, just a bit of friendly advice: cross-posting a question on multiple SE sites is not allowed (see here). If you want to migrate your question you'll need to contact a moderator. \$\endgroup\$ – Alex Apr 9 '13 at 14:23
  • \$\begingroup\$ How can I contact one? \$\endgroup\$ – Aitor Gonzalez Apr 9 '13 at 15:51
  • \$\begingroup\$ You can flag your question and mark it under moderator attention->other (be sure to add a note saying you want it migrated). You need to decide which site you want to keep your question on first though. \$\endgroup\$ – Alex Apr 9 '13 at 16:07

This sounds like a pretty straightforward example of a need for data driven design. Using something such as XML to represent a manifest is not uncommon or even remotely "hard coded". Either way, your game will need to parse something for a list of levels and videos that are available to it, whether that means auto identifying files in a particular folder, or using XML to parse the list at run time.

Neither of these ideas are uncommon, and it is simply up to you as to which you would prefer. Loading all the files in a folder can represent a larger risk than loading specific files listed in an xml/txt manifest.

| improve this answer | |

Not the answer you're looking for? Browse other questions tagged or ask your own question.