Questions tagged [architecture]

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

Filter by
Sorted by
Tagged with
13
votes
2answers
950 views

How should I check if a player has completed an achievement?

I'm making an MMO game and I just got to a point where I need to implement achievements... How do I do that? The most straight forward thing to do would be to run this once every 100ms,: ...
13
votes
3answers
2k views

How to avoid singleton pattern for Event Scheduler?

I want to make an Event scheduler for my Game, I basically want to be able to schedule the triggering of a Game Event. This can be a one time trigger, or a periodic trigger (trigger event "...
13
votes
1answer
13k views

When to use a blend tree vs state machine for animation

Im an experienced game dev hobbiest making my first game with 3d animated characters (in Unity) and am struggling to figure out when to use blend trees vs animation state machines. I understand both ...
13
votes
3answers
3k views

Best way to manage in-game events?

I'm working on a game where some in-game events need to happen once in a while. A nice example would be a tutorial. You start the game, and at several points in the game an event occurs: You ...
13
votes
5answers
11k views

Keyboard input system handling

Note: I have to poll, rather than do callbacks because of API limitations (SFML). I also apologize for the lack of a 'decent' title. I think I have two questions here; how to register the input I'm ...
13
votes
3answers
1k views

Object of arrays or array of objects?

I'm making a management sim game, something along the lines of Roller Coaster Tycoon. I want to know what the best way to structure my world objects is so to maximise performance. Let's say I have 5,...
13
votes
3answers
2k views

Does Unity have existing support for Timelines?

I am planning the development of a game in Unity3D, and trying to come to terms with what the engine has already provided, and what I must code myself. The game itself is going to be a rhythm game, ...
12
votes
9answers
12k views

How to go about GUI elements?

Note: I plan on making my own GUI system. It will be good for learning, lightweight, only have bits I need, ties in with the game, etc. I was thinking about how to do it. The elements I mean are: ...
12
votes
6answers
451 views

Should I put a soundtrack behind my strategy game? Which games need music and sound

Shuffling cards and impact noises are cool (it is a card based game), but should I invest the time/effort in hooking up background music? I have found Play Audio from Stream Using C# which could be ...
12
votes
2answers
1k views

Could I be going crazy with Event Handlers? Am I going the “wrong way” with my design?

I guess I've decided that I really like event handlers. I may be suffering a bit from analysis paralysis, but I'm concerned about making my design unwieldy or running into some other unforeseen ...
12
votes
2answers
809 views

Correct way to abstract an XBox Controller

I've got a XBox360 controller which I'd like to use as input for an application. What I can't work out is the best-practice way to expose this via an interface. Behind the scenes, the class which ...
12
votes
3answers
3k views

Identifying assets in a game engine?

I want to identify my loaded assets, but I don't know which one should I choose. There are 2 options: Name (string) This is the easiest and also fast with unordered_map ( O(1) ), but way slower then ...
12
votes
2answers
2k views

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 ...
12
votes
2answers
960 views

How do I avoid writing Manager classes?

I seem to keep reading it's a bad idea to use XxxManager style classes in game engine programming, yet even when I try to avoid their use I always end up with ...
12
votes
3answers
4k views

EXTREMELY Confused Over “Constant Game Speed Maximum FPS” Game Loop

I recently read this article on Game Loops: http://www.koonsolo.com/news/dewitters-gameloop/ And the recommended last implementation is confusing me deeply. I don't understand how it works, and it ...
12
votes
4answers
2k views

How do you allow networking code to be written in the later stages of the development?

I'm currently in the early progress of writing a game which I eventually will want to improve in most aspects. How can I skip out on writing network code yet leaving it fairly easily implemented, that ...
12
votes
2answers
2k views

What are effective strategies for a small game development team? [closed]

What are language/platform-agnostic best practices for a small game development team of intermediate to advanced developers? High-level strategies (as well as suggestions in terms of frameworks, ...
12
votes
2answers
1k views

Questions regarding games architecture with XNA

So I've finally got around to playing around with XNA and have been toying around with making a 2D game (I have a bunch of art assets from a friend who developed it on iOS) A lot of things seem to be ...
12
votes
4answers
4k views

Circular class dependency

Is it bad design to have 2 classes which need each other? I'm writing a small game in which I have a GameEngine class which has got a few ...
12
votes
3answers
5k views

Pure functional programming and game state

Is there a common technique to handle state (in general) in a functional programming language? There are solutions in every (functional) programming language to handle global state, but I want to ...
12
votes
1answer
2k views

How to keep a data structure synchronized over a network?

Context In the game I'm working on (a sort of a point and click graphic adventure), pretty much everything that happens in the game world is controlled by an action manager that is structured a bit ...
12
votes
4answers
13k views

Object-Oriented OpenGL

I have been using OpenGL for a while and have read a large number of tutorials. Aside from the fact that a lot of them still use the fixed pipeline, they usually throw all the initialisation, state ...
12
votes
2answers
2k views

How would a game-state snapshot system be implemented for networked real-time games?

I want to create a simple client-server real-time multiplayer game as a project for my networking class. I've read a lot about real-time multiplayer network models and I understand the relationships ...
12
votes
1answer
726 views

How can I cleanly and elegantly handle data and dependancies between classes

I'm working on 2d topdown game in SFML 2, and need to find an elegant way in which everything will work and fit together. Allow me to explain. I have a number of classes that inherit from an abstract ...
12
votes
1answer
5k views

Separating physics and game logic from UI code

I'm working on a simple block-based puzzle game. The game play consists pretty much of moving blocks around in the game area, so it's a trivial physics simulation. My implementation, however, is in ...
11
votes
7answers
1k views

Low coupling and tight cohesion

Of course it depends on the situation. But when a lower lever object or system communicate with an higher level system, should callbacks or events be preferred to keeping a pointer to higher level ...
11
votes
4answers
2k views

How can I use multiple meshes per entity without breaking one component of a single type per entity?

We are just switching from a hierarchy based game engine to a component based game engine. My problem is that when I load a model which has a hierarchy of meshes, and the way I understand, is that an ...
11
votes
3answers
12k views

How to organize a game engine in C++? Is my use of inheritance a good idea?

I'm a beginner both in game developping and programming. I'm trying to learn some principle in the building of a game engine. I want to create a simple game, I'm at the point where I'm trying to ...
11
votes
2answers
10k views

How should I develop my Android game efficiently? [closed]

I have attached a image of a flow chart that I made in paint. The image shows how I want to develop my game. I want a game that runs great with smart coding that is easy to update and ad features ...
11
votes
6answers
5k views

Game state management (Game, Menu, Titlescreen, etc)

Basically, in every single game I've made so far, I always have a variable like "current_state", which can be "game", "titlescreen", "gameoverscreen", etc. And then on my Update function I have a ...
11
votes
2answers
9k views

Making character's skills and abilities as commands, good practice?

I am designing for a game that consist of characters who have unique offensive skills and other abilities such as building, repairing, etc. Players can control multiple of such characters. I'm ...
11
votes
5answers
1k views

Nested input in an event-driven system

I am using an event-based input handling system with events and delegates. An example: ...
11
votes
5answers
1k views

Should beginning/indie game developers target multiple platforms initially?

Partially as a response to How do game developers target multiple platforms (Xbox 360, PS3, PC and Linux)? but mainly because there are people on here with published games, should cross platform be ...
11
votes
2answers
7k views

How many OpenGL programs should I use to render multiple objects?

My scene has multiple objects in it. (Let's say 3 cubes, 1 cylinder, 8 spheres.) I assume I should create a vertex shader for each. How many programs should I have? Alternatives: One program per ...
11
votes
3answers
16k views

Best solution for multiplayer realtime Android game [closed]

I plan to make multiplayer realtime game for Android (2-8 players), and I consider, which solution for multiplayer organization is the best: Make server on PC, and client on mobile, all communition ...
11
votes
5answers
3k views

Why use asset manifest files?

Sometimes you'll see people recommend that rather than using graphics/sound files/etc. like this... // Game code Image myImage = new Image("path/to/image.png"); ....
11
votes
3answers
3k views

Grouping entities of the same component set into linear memory

We start from the basic systems-components-entities approach. Let's create assemblages (term derived from this article) merely out of information about types of components. It is done dynamically at ...
11
votes
4answers
1k views

How to determine range of possible movement in turn-based, distance-based strategy game?

I'm creating a 2-dimensional, turn-based strategy game using c++ and SFML-2.0. Movement is distance-based rather than grid-based, with several different triangle-shaped pieces that, on a given turn, ...
11
votes
5answers
6k views

How to properly handle collision in a component-based game?

Trying to wrap my head around the ways to properly handle collision in a game designed around components. I see many examples have some sort of PhysicsComponent ...
11
votes
4answers
421 views

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 ...
11
votes
2answers
723 views

How do I make good guy attacks only hit bad guys and vice versa?

My game has many different type of good guys and many different type of bad guys. They will all be firing projectiles at each other but I don't want any accidental collateral damage to occur for ...
11
votes
3answers
886 views

I want to get rid of my make-everything-static-and-global design pattern, but how?

I'm making a little dungeon crawler in space, and I'd like to hear some advice on how to make the backend of the engine nicer. Basically, currently everything is based on a crapload of managers: ...
11
votes
3answers
1k views

How do I make complex AI manageable? [closed]

In the past, I've used simple systems like finite state machines (FSMs) and hierarchical FSMs to control AI behavior. This pattern falls apart very quickly or any complex system. I've heard about ...
11
votes
1answer
2k views

Creating a Robust Item System

My aim is to create a modular / as generic as possible item system which could handle things like: Upgradeable Items (+6 Katana) Stat Modifiers(+15 dexterity) Item Modifiers(%X chance to do Y damage, ...
11
votes
2answers
2k views

Implementing behavior in a simple adventure game

I've been entertaining myself lately by programming a simple text-based adventure game, and I'm stuck on what seems like a very simple design issue. To give a brief overview: the game is broken down ...
11
votes
1answer
3k views

Register Game Object Components in Game Subsystems? (Component-based Game Object design)

I'm creating a component-based game object system. Some tips: GameObject is simply a list of Components. There are ...
10
votes
4answers
8k views

How to make a game without OOP? [closed]

I am currenty studying game development and practicing making games. I use a lot of OOP in my games. For example, each missile that is shot is an instance of a ...
10
votes
2answers
8k views

How to implement the interaction between engine parts?

I want to ask a question about how the information exchange between game engine parts should be implemented. The engine is separated in four parts: logic, data, UI, graphics. In the beginning I made ...
10
votes
3answers
4k views

How to avoid “Blob-Systems” in an entity component system?

Currently I am facing the following problem: I am trying to write a pong clone by using an entity component system (ECS). I wrote the "framework" all by myself. So there is a class which manages ...
10
votes
3answers
3k views

How often to update a Game Client about the World?

Using socket.io, I have a communication similar to that of other MMORPGs, a steady connection with messages. In my design so far, the client sends the player's position and animation frame with every ...