Questions tagged [design-patterns]

Design pattern is a general reusable solution to a commonly occurring problem within a given context in software design.

335 questions
19
votes
3 answers

MVC-like compartmentalization in games?

I was contemplating the design of a game (translating a boardgame to the computer, specifically, which I suppose is relevant in this case) and it occurred to me that it might make sense to build the 'game' separate from the 'display.' It would allow…
Asmor
  • 440
  • 3
  • 11
13
votes
3 answers

Design patterns for rules systems?

As a quick fun project, I tried writing a solitaire game. But when getting to writing up the rules systems, I felt dirty, because my code felt completely unstructured and inextensible, mainly because my game logic was complete spaghetti code. I've…
Dasuraga
  • 233
  • 1
  • 5
5
votes
2 answers

Which Design Patterns Should I consider for Quest Management?

I am working on an fantasy RPG and I would like to get some ideas about how I am implementing Quests. Quests in my game are very generic. The quest goal can be almost anything in the game. The goal can be: press a GUI button; pick up a certain…
LVBen
  • 544
  • 5
  • 12
4
votes
1 answer

What is the best design pattern to apply effects and abilities?

What would be the best design pattern to apply effects and abilities in a game. For example: I have a unit that has base stats like attack power, defense etc. The unit can hold several items that will boost one or more of these effects. Also the…
Thomas
  • 836
  • 2
  • 8
  • 18
2
votes
1 answer

Alternatives to Prototype pattern for Buildings

Hope some of you have ideas for this. first I will describe the Task ahead and then go on with the my thoughts about solving it and what kind of problems I see. 1) I have a number of buildings. Their data is stored in a json file and contains…
MrLowbob
  • 45
  • 3
1
vote
1 answer

Handle states in character in functional programming way

How to handle any change of state of a character with functional programming? If I'm using functional programming the character should be stateless, in my understanding. With that said, I should instantiate a new character every time a position, for…
renno
  • 115
  • 6
0
votes
1 answer

Composition and passing pointers to parent, or work inside namespaces

My application right now has a Game class, which contains other classes that receive a Game pointer. Also these classes passes the Game* pointer to their subclasses. I do this to keep communication between objects. Is this a bad way to keep all…
freesoul
  • 393
  • 4
  • 11
0
votes
1 answer

A class for all levels or for each level an own class?

My Game become more complex with each new Level or Map that I design. The game is an basic rpg game like Pokemon. For now I have one class that organize all Maps but different maps have special features and different Monsters. Better use for each…
Lirf
  • 15
  • 6