Questions tagged [architecture]

How code is structured. For questions on the internal design of a game engine.

Software architecture involves finding a good high-level internal structure for a software system. This is about the structure of code, not about s.

Common examples include whether logic belongs in the s or in a manager class, or which game operations to run in separate threads ().

As for all programming questions on GameDev, this tag should be used only with relevance to game-specific code. For questions answerable by programmers generally, ask on our sister site Stack Overflow.

1426 questions
185
votes
1 answer

What is the role of "systems" in a component-based entity architecture?

I've been reading a lot about entity components and systems and have thought that the idea of an entity just being an ID is quite interesting. However I don't know how this completely works with the components aspect or the systems aspect. A…
bio595
  • 1,961
  • 3
  • 12
  • 5
160
votes
8 answers

Why are MVC & TDD not employed more in game architecture?

I will preface this by saying I haven't looked a huge amount of game source, nor built much in the way of games. But coming from trying to employ 'enterprise' coding practices in web apps, looking at game source code seriously hurts my head: "What…
timoxley
  • 1,731
  • 3
  • 11
  • 9
137
votes
1 answer

What should a main game loop do?

Generally , what are the core things that one should do in the game loop, and what are some things that one shouldn't do in the game loop?
hokiecsgrad
  • 2,498
  • 3
  • 21
  • 14
120
votes
10 answers

How does entity communication work?

I have two user cases: How would entity_A send a take-damage message to entity_B ? How would entity_A query entity_B 's HP? Here's what I've encountered so far: Message queue entity_A creates a take-damage message and posts it to entity_B 's message…
deft_code
  • 7,652
  • 5
  • 40
  • 55
106
votes
11 answers

Good resources for learning about game architecture?

Are there any good resources for learning about game architectures? I am looking for high level overviews of different architectures. I tend to find information about the various pieces of a game such as entities, physics engines, scripting, etc but…
Colin Gislason
  • 1,153
  • 7
  • 17
  • 22
87
votes
8 answers

Why don't more games use vector art?

It would seem to me that vector art is more efficient in terms of resources/scalability; however, in most cases I have seen artists using bitmap/rasterized art. Is this a limitation put on the artists by the game programmers/designers? As a…
Parris
  • 995
  • 1
  • 6
  • 9
77
votes
11 answers

How to design a replay system

So how would I design a replay system? You may know it from certain games like Warcraft 3 or Starcraft where you can watch the game again after it has been played already. You end up with a relatively small replay file. So my questions are: How to…
scable
  • 821
  • 1
  • 7
  • 5
74
votes
1 answer

Difference between Decision Trees & Behavior Trees for Game AI

What are some differences between Decision Trees and Behavior Trees for AI Game Development? For what applications would you use one over the other?
Free Lancer
  • 1,283
  • 1
  • 13
  • 18
70
votes
8 answers

Event-driven Communication in a Game Engine: Yes or No?

I am reading Game Coding Complete and the author recommends Event Driven communication among game objects and modules. Basically, all living game actors should communicate with the key modules (Physics, AI, Game Logic, Game View, etc.) via an…
Bunkai.Satori
  • 2,763
  • 9
  • 37
  • 47
61
votes
9 answers

How to avoid circular dependencies between Player and World?

I'm working on a 2D game where you can move up, down, left and right. I have essentially two game logic objects: Player: Has a position relative to the world World: Draws the map and the player So far, World depends on Player (i.e. has a reference…
futlib
  • 1,477
  • 15
  • 21
57
votes
8 answers

How can I avoid having many singletons in my game architecture?

I use cocos2d-x game engine for creating games. The engine already uses many singletons. If someone used it, then they should be familiar with some of them: Director SimpleAudioEngine SpriteFrameCache TextureCache EventDispatcher (was)…
Narek
  • 1,337
  • 4
  • 12
  • 28
55
votes
7 answers

How can I set up a flexible framework for handling achievements?

Specifically, what is the best way to implement an achievement system flexible enough to handle going beyond simple statistics-driven achievements such as "kill x enemies." I'm looking for something more robust than a statistics based system and…
lti
  • 763
  • 6
  • 8
55
votes
5 answers

How to avoid the GameManager god object?

I just read an answer to a question about structuring game code . It made me wonder about the ubiquitous GameManager class, and how it often becomes an issue in a production environment. Let me describe this. First, there's prototyping. Nobody cares…
Laurent Couvidou
  • 9,251
  • 2
  • 43
  • 58
52
votes
10 answers

Game State 'Stack'?

I was thinking about how to implement game states into my game. The main things I want for it are: Semi-transparent top states-being able to see through a pause menu to the game behind Something OO-I find this easier to use and understand the theory…
PrettyPrincessKitty FS
  • 10,355
  • 8
  • 47
  • 68
47
votes
4 answers

How can I avoid giant player classes?

There is almost always a player class in a game. The player can generally do a lot in the game which means for me this class ends up being huge with a ton of variables to support each piece of functionality the player can do. Each piece is fairly…
user441521
  • 802
  • 2
  • 8
  • 16
1
2 3
…
95 96