Thoughts: PureMVC for flash games

567 views Asked by At

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!

2

There are 2 answers

1
laurent On BEST ANSWER

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.

0
Vishwas On

I have used both PureMVC and Robotlegs. I used both of them for utilities, websites and applications. Both the frameworks are great especially when one wants to learn how MVC is followed. They make it easy to follow MVC, much better than what a novice would do himself. When i started using them, it was an enlightening for me, and learned how badly and wrongly i used to structure MVC myself.

However, as Laurent said, MVC sometimes become too big and complex for games. I faced this, in both. Following their rules sometimes, take such a long route, that a small code validation sometimes take a long time to code and debug.