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.

1402 questions
107
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,163
  • 7
  • 17
  • 22
46
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
  • 792
  • 2
  • 7
  • 15
31
votes
9 answers

Starting from Scratch - Is it a Mistake if I re-invent the wheel?

Usually whenever I want to start a game, I will think to have a good basic architecture for rendering and better game loop from scratch. I usually don't want to use existing engines. The reason behind it is that I want to implement it on my own to…
Ayyappa
  • 870
  • 5
  • 13
28
votes
4 answers

If two objects interact, what holds the interaction code?

Think of a bullet and an enemy, or the player and the floor. If these objects interact, what holds the interaction code?
ThatOneGuy
  • 522
  • 5
  • 15
26
votes
4 answers

How to design a game engine in an object-oriented language?

Whenever I try and write a game in any object-oriented language, the first problem I always face (after thinking about what kind of game to write) is how to design the engine. Even if I'm using existing libraries or frameworks like SDL, I still find…
n s
  • 603
  • 1
  • 6
  • 17
20
votes
4 answers

Alternatives to Singletons / globals

I've heard countless times about the pitfalls of Singletons / globals, and I understand why they're so often frowned upon. What I don't understand is what the elegant, non-messy alternative is. It seems that the alternative to using…
vargonian
  • 829
  • 1
  • 9
  • 12
18
votes
3 answers

MVC (Model-View-Controller) Game Engine Architecture - Yes or No?

I am reading one great book, Game Coding Complete, and that book strongly recommends using MVC (Model-View-Controller) approach, with three key layers: Game Application Layer Game Logic Game View To me, this approach looks like an overkill for a…
Bunkai.Satori
  • 2,743
  • 9
  • 36
  • 47
17
votes
6 answers

Do you actually use diagrams to model games?

I mean mostly UML but any method that works is viable. So - do you actually model your games with UML/other diagrams or different methods? I had a subject at my university about modelling with UML and it seemed like more effort than actual benefit…
NPS
  • 2,314
  • 4
  • 27
  • 50
12
votes
2 answers

What are the benefits of using an entity ID system?

I'm currently reading the book Programming Game AI By Example. The book mentions assigning unique ID numbers to each entity in the game. Often when entity A needs to contact entity B, A gets a reference to B by sending B's ID number to an…
Aviv Cohn
  • 913
  • 2
  • 10
  • 26
11
votes
4 answers

Same game logic on two separate graphic libraries

What code philosophy/structure of abstraction/program design would allow a game to be used with both 2D and 3D graphics (separately) WITHOUT having to re-code the Game logic? We're talking taking the same code, changing a minimum of things (for…
Toby
  • 361
  • 2
  • 9
10
votes
2 answers

Tactics for moving the render logic out of the GameObject class

When making games you often create the following game object from which all entities inherit: public class GameObject{ abstract void Update(...); abstract void Draw(...); } So in you update loop you iterate over all the game objects and…
Roy T.
  • 10,208
  • 34
  • 56
9
votes
1 answer

Broad topics needed for teaching game development

I am going to be doing a presentation on game development to an iPhone user group in the near(ish) future. My audience are iPhone developers, but not necessarily very experienced ones, and this is meant to be an introduction. My question is, what…
livingtech
  • 357
  • 1
  • 10
9
votes
3 answers

Are there any narrative (or at least non-spatiotemporal) focused engines/frameworks?

EDIT (2): Since there are two answers and I haven't accepted any of them I figured I'd motivate what I'd consider an answer here: Either something strongly suggesting any such approach would be impossible/not at all useful or, alternatively, a…
Tilo Wiklund
  • 193
  • 5
9
votes
5 answers

Managing lists of different types of entities - is there a better way?

I am developing a 2D space game for mobile devices, but it gets realy complex and my solution is realy confusing and produces lots of repeated code segments. I hava a world class in which i have multible lists of different object like: List
Nut
  • 327
  • 1
  • 2
  • 8
8
votes
3 answers

How do you calculate game map changes, over time, when the user is not online?

With a game like "Farmville", there is both processing during gameplay, and when the user is offline (plants are always growing, for example). Many of the game maps elements depend on time. Is there a trick to make this scale? How can you possibly…
1
2 3 4 5 6