Questions tagged [architecture]

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

Filter by
Sorted by
Tagged with
185 votes
1 answer
50k views

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 ...
bio595's user avatar
  • 1,961
160 votes
8 answers
56k views

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

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 ...
timoxley's user avatar
  • 1,731
137 votes
1 answer
99k views

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?
120 votes
10 answers
21k views

How does entity communication work?

I have two user cases: How would entity_A send a take-damage message to entity_B? How ...
deft_code's user avatar
  • 7,602
107 votes
11 answers
40k views

Good resources for learning about game architecture? [closed]

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 ...
87 votes
8 answers
77k views

Why don't more games use vector art? [closed]

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 ...
Parris's user avatar
  • 985
77 votes
11 answers
26k views

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 ...
scable's user avatar
  • 821
72 votes
1 answer
38k views

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's user avatar
  • 1,263
70 votes
8 answers
43k views

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 (...
Bunkai.Satori's user avatar
60 votes
9 answers
8k views

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 ...
futlib's user avatar
  • 1,467
57 votes
8 answers
18k views

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: ...
Narek's user avatar
  • 1,327
55 votes
7 answers
9k views

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 ...
lti's user avatar
  • 763
54 votes
5 answers
13k views

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 ...
Laurent Couvidou's user avatar
52 votes
10 answers
25k views

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 ...
PrettyPrincessKitty FS's user avatar
46 votes
4 answers
14k views

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 ...
user441521's user avatar
44 votes
3 answers
5k views

Why do tutorials use different approaches to OpenGL rendering?

http://www.sdltutorials.com/sdl-opengl-tutorial-basics http://www.opengl-tutorial.org/beginners-tutorials/tutorial-2-the-first-triangle/ These two tutorials use completely different approaches to ...
reynmar's user avatar
  • 449
42 votes
7 answers
38k views

Where can I find good (well organized) examples of game code? [closed]

Where can I find good (well organized) examples of game code? I'm hoping that I can pick up some organizational tips. Most examples in books are too short and leave out lots of detail for the sake of ...
41 votes
9 answers
15k views

Why is it bad to hard-code content?

I know most games store dialogue text in files, but I've also seen a few text-based games actually program the content (map, choices, possible player commands, story text) into the game code. I can ...
user50286's user avatar
  • 509
40 votes
3 answers
35k views

What is the standard C# / Windows Forms game loop?

When writing a game in C# that uses plain-old Windows Forms and some graphics API wrapper like SlimDX or OpenTK, how should the main game loop be structured? A canonical Windows Forms application has ...
user avatar
39 votes
3 answers
25k views

When several classes need to access the same data, where should the data be declared?

I have a basic 2D tower defense game in C++. Each map is a separate class which inherits from GameState. The map delegates the logic and drawing code to each object in the game and sets data such as ...
Juicy's user avatar
  • 581
38 votes
8 answers
18k views

Should I avoid using object inheritance as possible to develop a game?

I prefer OOP features when developing games with Unity. I usually create a base class (mostly abstracted) and use object inheritance to share the same functionality to the various other objects. ...
modernator's user avatar
  • 1,213
33 votes
7 answers
3k views

Elegant way to simulate large amounts of entities within a game world

Assume you have a game in which there are many (many many) entities serving some functions, not all of which are constantly needed or need to be considered in every frame. The concrete problem I am ...
Marc Müller's user avatar
31 votes
9 answers
2k views

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 ...
Ayyappa's user avatar
  • 870
30 votes
11 answers
11k views

Alternative to Game State System?

As far as I can tell, most games have some sort of "game state system" which switches between the different game states; these might be things like "Intro", "MainMenu", "CharacterSelect", "Loading", ...
Ricket's user avatar
  • 14.8k
30 votes
5 answers
3k views

Doing powerups in a component-based system

I'm just starting really getting my head around component based design. I don't know what the "right" way to do this is. Here's the scenario. The player can equip a shield. The the shield ...
deft_code's user avatar
  • 7,602
29 votes
2 answers
7k views

Is there a way to procedurally generate the history of a world?

I am somewhat intrigued by the diagram found here representing 1800 years of cultural history in an imaginary world some guy created. This sort of thing would seem to have strong applications for ...
pdusen's user avatar
  • 389
28 votes
4 answers
2k views

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's user avatar
28 votes
5 answers
7k views

Game architecture / design question - building an efficient engine while avoiding global instances (C++ game)

I had a question about game architecture: What is the best way to have different components communicate with each other? I do really apologize if this question has already been asked a million times, ...
Awesomania's user avatar
27 votes
3 answers
8k views

How to handle a large number of pickups in a MMO game

How do games like Minecraft, or really any MMO game that has pickups, handle them? Say terrain spawns 3 pickup drops of "dirt" everytime you dig said terrain. Say every item has a rotation ...
Alakanu's user avatar
  • 705
27 votes
6 answers
9k views

Is Test Driven Development viable in game development?

As being Scrum certified, I tend to prone for Agile methodologies while developping a system, and even use some canvas from the Scrum framework to manage my day-to-day work. Besides, I am wondering ...
Will Marcouiller's user avatar
27 votes
4 answers
3k views

What is an appropriate level of granularity for component-based architecture?

I'm working on a game with a component-based architecture. An Entity owns a set of Component instances, each of which has a set ...
Jon Purdy's user avatar
  • 800
26 votes
4 answers
4k views

How to design a game's software such that it is easy to unit test?

Is it practical to use a testing framework like JUnit in a game development situation? What sort of design considerations can you follow in order to make your game more testable? What parts of a game ...
Ricket's user avatar
  • 14.8k
26 votes
5 answers
20k views

How to design an AssetManager?

What is the best approach to designing an AssestManager that will hold references to graphics, sounds, etc. of a game? Should these assets be stored in a key/value Map pair? I.e. I ask for "...
Bryan Denny's user avatar
  • 5,103
26 votes
4 answers
31k views

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

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 ...
n s's user avatar
  • 603
26 votes
3 answers
4k views

What can cause ALT-TAB to be 'annoying'/slow/glitchy?

This is more of an open ended question, but I hope to get some good insight on how to avoid the issue. When playing Games on Windows, I might want to ALT-TAB out of it. Some games have no problems, ...
Michael Stum's user avatar
  • 2,543
26 votes
3 answers
2k views

How to handle multiple story threads in a RPG game?

I designed an RPG game that has multiple story threads, meaning that, depending on the user's choice some things may or may not happen, you can achieve the same thing in several ways, the ending can ...
Rad'Val's user avatar
  • 661
25 votes
4 answers
6k views

"The Game Object" - and component-based design

I've been working on some hobby projects the last 3-4 years. Just simple 2d and 3d games. But lately I have started a bigger project. Soo in the last couple of months I've been trying to design a game ...
hayer's user avatar
  • 596
24 votes
3 answers
22k views

Memory allocation patterns used in game development

I have been researching creating my own allocator methods (that will support things such as a memory pool and profiling), however, as I continue my research I have been looking for how this was done ...
chadb's user avatar
  • 485
23 votes
3 answers
4k views

Command Ordering Architecture of Dwarf Fortress

What is the most elegant way to implement a command ordering system for AI? for example in dwarf fortress when you mark a forested area for wood cutting, the dwarfs then would do the following ...
jedt's user avatar
  • 333
23 votes
3 answers
15k views

Game engine and data driven design

I've heard about data driven design and have been researching about it for a while. So, I've read several articles to get the concepts. One of the article is Data Driven Design written by Kyle ...
Amumu's user avatar
  • 333
23 votes
4 answers
1k views

How to implement a never-rebooting test world?

Am looking for ideas on how to do the following: I want to write a simple "world" in Java. One which I could start and then add new objects later at a later date to simulate/observe different ...
d33j's user avatar
  • 486
23 votes
6 answers
8k views

What designs are there for a component based entity system that are user friendly but still flexible?

I've been interested in the component based entity system for a while, and read countless articles on it (The Insomiac games, the pretty standard Evolve Your Hierarchy, the T-Machine, Chronoclast ... ...
PrettyPrincessKitty FS's user avatar
23 votes
3 answers
10k views

How to wire finite state machine into component-based architecture? [closed]

State machines seem to cause harmful dependencies in component-based architectures. How, specifically, is communication handled between a state machine and the components that carry out state-related ...
Pup's user avatar
  • 344
22 votes
3 answers
5k views

How to avoid hard coding in game engines

My question isn't a coding question; it applies to all of game engine design in general. How do you avoid hard coding? This question is a lot deeper than it seems. Say, if you want to run a game ...
Marcus Cramer's user avatar
22 votes
4 answers
43k views

What is the most efficient container to store dynamic game objects in? [closed]

I am making a first person shooter and I know about about a lot of different container types but I would like to find the container that is the most efficient for storing dynamic objects that will be ...
msawayda's user avatar
  • 241
22 votes
4 answers
19k views

Resource Managers - Are they any good?

I've seen many a time in source code, things like this [well, this is more of a pseudo C++ idea of mine] ...
PrettyPrincessKitty FS's user avatar
22 votes
1 answer
36k views

How to edit key-value pairs (like a Dictionary) in Unity's inspector?

I have a spell system I am creating, the principle is as follows: Each spell is an autonomous prefab. It contains a script with some properties (base damage, duration...) that can be modified in the ...
nialna2's user avatar
  • 920
22 votes
4 answers
4k views

Architecture a for a central renderer rather than self-rendering [duplicate]

For the architectural side of rendering, there's two main ways: having each object render itself, and having a single renderer which renders everything. I'm currently aiming for the second idea, for ...
PrettyPrincessKitty FS's user avatar
22 votes
1 answer
7k views

How should I structure an extensible asset loading system?

For a hobby game engine in Java, I want to code a simple but flexible asset/resource manager. Assets are sounds, images, animation, models, textures, et cetera. After a few hours of browsing and some ...
user8363's user avatar
  • 600
22 votes
3 answers
2k views

Do I, and how, separate the concerns of input and game objects?

In probably every game a developer has to somehow deal with input, may it be simple keyboard and mouse events, touch events or something as accelerometer input. This input directly of indirectly ...
Robert Massa's user avatar

1
2 3 4 5
29