flashactionscript-3model-view-controllerpuremvc

Thoughts: PureMVC for flash games


So, after doing some research seems like adopting a pattern, in this case PureMVC, may be a good choice.

But, I dont have any experiencie using this pattern when developing a game, except on a data driven website made mostly in Flex.

The question is, are there any drawbacks of this pattern?, let say, performance for example?

If anyone implemented a game using this framework, I'd like to hear some reviews about it.

The idea is, to make a solid base thinking that the game could evolve in complexity with time.

Thanks!


Solution

  • MVC frameworks always add some overhead and force you to code in a specific way. In Flash in particular, most of them have some complicated structures to create and dispatch events. This might be fine for big enterprise projects, but not so much for games, where you're going to need to fine tune every aspect of your game engine. If you go with an MVC framework, most likely you'll have to hack around the framework to achieve what you really want to do, or for optimization.

    So most likely, assuming you want to keep control over the performance of your game, you'd be better off coming up with your own architecture and conventions. Actually, it's quite easy - just follow basic MVC principles, separate game data (model), from rendering (view) and from game logic (controller), and you should have a cleanly structured project.