   What kind of design patterns for plateform games ?
  Hi everybody,I'm searching for the most suitable design patterns for a simple plateform game engine. Moreover, i don't know the approach i could follow to manage the core of the game ( collision detections, physx, etc.. for all entities ). Does this is related to a design patterns ? Really thanks !   
  I forgot to say that it is for a 2D engine. Thanks for any help.   ;  Start writing your game, when faced with a problem that could be solved with a pattern, then implement it. Patterns are common solutions to common coding problems, not templates.Collision detection is not inherently related to patterns.   ;  Thanks but design pattern does not it part of the conception? I mean design pattern must be anticipated.For the game core, i don't know if i am explicit: what is the basic design which allow to manage all entities for physics and collision detection ( my collision detection system is build but i need to make a manager for manage all entities in the 2D environment ) I don't know the way to make it.   ;  Model View Controller is a sort of architecture/design pattern I would choose for a 2d graphics engine.http://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93controllerI tend to want to seperate logic from the model like this:http://en.wikipedia.org/wiki/Three_tierResulting in a sort of hybrid MVC + Logic.;Quote:Original post by NielujThanks but design pattern does not it part of the conception? I mean design pattern must be anticipated.Thats a common mistake, design patterns are tools, and you should use the right tool for the job, when all you have is a hammer, everything looks like a nail, avoid that mistake. Sometimes the problem is simple enough to be handled with a simple solution rather than complicate matters with a design pattern.Quote:Original post by NielujFor the game core, i don't know if i am explicit: what is the basic design which allow to manage all entities for physics and collision detection ( my collision detection system is build but i need to make a manager for manage all entities in the 2D environment ) I don't know the way to make it.You could start with a simple container such as a vector and build from there, you could look into scene graphs (shudder) but personally I am against those, at any rate, those are not patterns, but rather data structures.;  Design Patterns are, at the very earliest, part of the code design process, but what you seem to be asking for is patterns around which to form the design. This is backwards. As you become more familiar with the problem domains of your game, and with patterns, then the code design process will become Design-with-Patterns, but never Design-by-Patterns.The first thing you need to do is evaluate your requirements -- it sounds like you've already got at least some idea of the requirements. Next, begin to think of the systems that are needed at a high level, and how they are related to one another. Once you have that, patterns will apply to inter-system communication or organization, as well as intra-system design.Off the top of my head, here are a few that are likely to apply, but don't force it. Patterns emerge organically from design, not the other way around, if you force it not only are you doing it wrong, but you're likely to cause yourself more grief than were you to be entirely ignorant of patterns.State Pattern -- Finite State Machine controls transition between different views/game states (overworld, levels, menus, title screens.)Publisher-Subscriber -- Notifies interested parties of events which they have declared an interest in.Factory -- Automates object creation, this particularly becomes important as objects need to register with various other systems (such as registering to receive messages from various event publishers)Command Pattern -- This is useful to put a level of abstraction between input (cause) and effect. For example, most of the time, commands for the character would come from an input object which reads the keyboard/joystick, but sometimes you might want to control the character from a script (or by an AI object in 'demo' mode) -- the command pattern lets commands come from several sources.Now, the final thing to realize about patterns is that there is no "Command Pattern" in the sense that no pattern is clearly defined -- it is not a thing, it is an idea. Patterns are a recommended approach to a certain type of problem, but what ends up being the pattern implementation varies as much as the problems themselves -- Patterns are a bit like a snowflake: You know the general shape, but not the fine details. No two implementations should be exactly alike unless they solve precisely the same problem.;  Really thanks to you. I understand better now and maybe i should thinking less complex for the moment. I will thinking about a personal approach and i'll share it to you more later.Thanks again,Julien.   ;Quote:Original post by KwizatzYou could start with a simple container such as a vector and build from there, you could look into scene graphs (shudder) but personally I am against those, at any rate, those are not patterns, but rather data structures.Do you mean i could stock entities in a vector and apply a physic behavior to all of them by this vector ? Or maybe i can build a "Physic" class whose all entities class inherit ? PS: I am not sure for my english, so sorry if it's a bit confuse.;  Did you talk about this ?http://www.gamedev.net/reference/articles/article1812.asp   