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

learn more… | top users | synonyms (2)

1
vote
3answers
51 views

How to architect input code to utilise state machine?

I have an InputController which currently handles all user input, so it looks at button states and updates entity intentions according to some simple rules. I'm looking to add a new state to the game ...
2
votes
0answers
25 views

Diversified Game Object List

Recently I started creating a game in java to hone my rusty java (I work primarily with cpp) and because I thought it to be a neat idea. To better illustrate the problem, let me explain a part of the ...
0
votes
2answers
106 views

How can I handle invulnerability in an entity system?

I currently have an entity component system with messaging. The messages are delivered to each subscriber, but each subscriber gets their own copy, basically meaning that altering a message doesn't ...
1
vote
1answer
49 views

Collectible card game, cards and effects

Based on Design of a turn-based game where actions have side-effects I am building a card-game where cards can have side-effects be triggered under different circumstances. I was given a good idea ...
0
votes
1answer
27 views

How to create objects having attributes from differents java class

I have a class Creature with another class Flying and Undead that extends Creature. How could I create a object that have both the Flying and Undead attributes? class Creature(){ String name; public ...
0
votes
0answers
54 views

I don't know how much of my game should be written in C++ or Lua [closed]

NOTE: The game engine isn't done yet, so don't feel any hesitation to suggest I completely redo the whole engine design Currently I have a system where there is a C++ program, who's main purpose it ...
0
votes
1answer
70 views

Handling AI with ECS in a turn based roguelike

I am trying to implement the Entity Component System pattern to use in a roguelike game. Right now, I have 3 systems. Input, AI, and Action. The input system basically is just a system used by the ...
1
vote
2answers
88 views

How to seprate the game from the game engine (specifically the game loop), into seprate projects?

I am trying to separate my game from game engine both written in Java. Currently they are in two separate packages but I would like to separate them into different projects. A main method in Project ...
3
votes
1answer
246 views

Swapping graphics engines

Is it possible, or even feasible, to have graphics engine completely decoupled from game logic? Why I ask is because I want to start working on a game (I'm a complete beginner in game development, ...
2
votes
2answers
151 views

How to manage state in a component-based game engine?

I'm working on a small, data-driven game engine with some friends. We use GameObjects (a.k.a. Entities, Actors, or whatever it is called in your favorite engine) to represent every entity in the ...
0
votes
1answer
66 views

How to make “Events”/ Scripted Scenes

I want to make cutscenes etc, in my game. I thought of a similar System like in the RPG Maker: If you enter a certain Area, a list of commands and arguments is played. E.g. like this: [Move ...
2
votes
2answers
59 views

How can I represent prerequisites of different type of game objects?

In a strategy game, I want to declare prerequisites for various types of game objects to limit when they can be acquired/executed: technologies, buildables, resources, actions, etc. Any of these types ...
2
votes
2answers
159 views

Efficient removal and adding of Components in ECS

i'm working with the Ashley Entity-Component-System (related to libGDX) to program a server-side simulation for an online game and i stumbled upon a serious performance drawback, that is probably ...
0
votes
2answers
75 views

entity component - get object from entity system without knowing it's ID

Ive been building a game using a Entity Component system, but im having a bit of an issue finding a specific object in my entity system without knowing the Entity's Id. My game is organized in ...
3
votes
1answer
148 views

Branching quest system

I've started working in a quest system for my game, but I stumble in a zone where I have to many, if/else conditions to handle a quest, whether you have X and Y item in your inventory, whether you ...
4
votes
1answer
78 views

Cram search results into viewport (of a search minimap)?

I'm no coder, nor do I try to be. I just had one of those "it's impossible" arguments with folks who love to argue with me before they even understand what the argument is about :) So I need to ...
1
vote
0answers
44 views

How do I add scripting logic to my dialogue tree? [closed]

I'm creating 2D RPG game and I want to implement branching dialogue system which can also change player stats, add items and so on. Also I want to implement conditions for some answers so player ...
4
votes
3answers
211 views

Sphere to plane collision never rearching resting contact

I have been trying to have a sphere to plane eventually lead to the sphere coming to a resting contact, but my sphere will end up always bouncing forever. It will bounce correctly for the first few ...
1
vote
1answer
107 views

Property replication vs RPC notifications

I'm not talking about something such as an object position, which changes very often. I'm talking about some object state that may be changed infrequently, such as a door opening and closing. Would ...
2
votes
2answers
63 views

How to setup animation based events without depending on an animation?

How can I have events based off animations without relying on them? Take for example reloading in a FPS game. You'd hit a button to reload your weapon, the animation will play, then animation will hit ...
4
votes
2answers
249 views

How does Unity's Entity-Component System Work In Practice? [closed]

On the surface Entity-Component seems like a good way to program games. Everything is a game object and those game objects are made up of components. The attraction is components are very flexible, ...
4
votes
2answers
91 views

Best way to deal with a large variety of items?

I am currently working on my first java game and I am having trouble figuring out how I should implement my classes that will have heavy variety. For example, I am considering having an abstract item ...
0
votes
1answer
117 views

Solitaire Game: Transferring Cards Design in C++

So, I'm working on a Solitaire game. I already created a the classes: Card, Pile, Stock. Each work as expected on it's own. My question is: What possible design for managing moving card(s) between the ...
0
votes
0answers
49 views

Browser Game - Model or not Model

I'm planing on making a browser game just for fun and to improve my skills, but I have an issue regarding the Software Architecture of the game: I will be using an ORM to communicate with my ...
4
votes
2answers
314 views

How should entities in a game reference each other?

I've been reading a lot about design patterns, but in using these patterns there's one question that I keep coming back to. How should my entities access information about each other? Let's say I'm ...
0
votes
1answer
41 views

Client code handling its own generics when returned by an engine

I'm writing a game engine in Java 8, and have prototype client code written in Groovy. New Game objects can be created with a builder which defines everything which fills in the blanks. To simplify ...
0
votes
0answers
30 views

Deal with double coordinates and graphics

I want to draw some vectors and few sprites in a 2D world.Problem is that they should be precise. For example a vector has position (5000000.65,556666). That depends on user. He might want to add ...
0
votes
0answers
67 views

Hiding actual IP of a Game Server [closed]

I've developed a game server which has 3 layers Login Server(That connects AI Server) AI Server(That connects game logic server) Game Server I want to prevent DDOS attacks as much as possible and ...
0
votes
0answers
72 views

Manage map like The sims game

I'm trying to create a (light) tool to create houses like in the Sims game but I don't know how to manage data/make a valid architecture. For now, I think about something like that: Map: Player's ...
2
votes
1answer
211 views

How should my game characters store their abilities/spells?

I'm new to game development and a bit confused about how to effectively store an object's access to certain spells/abilities. The player and mob objects are all generated from the same class. ...
0
votes
2answers
63 views

Custom key binding/mapping

Currently I am starting to develop my first serious game. Before the games are all training, and learning how to do things in a good way. Unfortunatly, I've missed a big part in my preparation: Key ...
1
vote
2answers
130 views

Bubble shooter clone, structure for storing/adding of bubbles

Im having a few issues trying to figure out what the best data structure to use for storing bubbles on the grid, and how to connect new bubbles to the grid when a moving ball collides with a ball on ...
0
votes
2answers
56 views

Questions about property-centric game object runtime

I was reading Game Engine Architecture by Jason Gregory So according to him, I should use an array of entities, and arrays for each property, such as an array gameObjectsPosition, ...
0
votes
0answers
64 views

2D Drawing architecture

I want to create something like a game but I am going to use Direct2D and GDI for drawing API.My problem is that I want to separate drawing code from objects. For example lets say I have conduit ...
0
votes
1answer
69 views

Resetting scene state

i was wondering what are the best practices for restarting the game, say for example in a platformer game when you die the game restarts and you have to reposition all the characters or reset the ...
0
votes
2answers
101 views

Double buffer - Managing Collision

I'm thinking about how I should manage collisions in my game. I'm thinking about having a "Collision" class that checks for collision, and in case takes actions to resolve them. My problem is this: ...
1
vote
2answers
302 views

Elegant ways to handle rendering with DirectX 11

I'm looking for a design pattern that's going to help me to elegantly handle the rendering of my game objects. Lots of game development guides talk about how to handle the game objects themselves, ...
21
votes
3answers
2k 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 ...
0
votes
2answers
253 views

Good Configuration Manager System Design for medium-large sized projects?

I've create smaller games which simply needed a class which basically opens an INI file (with feather-ini-parser library) with config values for the whole game (rendering ops, music, bindings). But I ...
41
votes
3answers
4k 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 ...
3
votes
1answer
151 views

How do I let a game support different rule sets?

I'm making a MUD game engine that supports D&D , Pathfinder and other tabletop-RPG rule sets. I am starting to build out how characters interact with the world (e.g. dialog, battle, searching for ...
0
votes
1answer
60 views

Application components dependancy and decoupling

In my client application I have two major components: GameCore - wrapper that handles everything about running the actual game NetworkClient - A layer that takes care of ...
0
votes
1answer
138 views

Client/Server best way of telling client which player it is

I'm making a client/server, everything works grand its very simple, a simple login system, ID, empty variable and the X and Y positions of the player. Should my server tell my client who it is? and ...
0
votes
2answers
130 views

Do I really need a render() method in the game loop if the view subscribes to the models?

For a game that I'm working on, we've followed the MVC paradigm. However, in classic MVC, the view subscribes to the model and when the model updates it informs the view. We've implemented this as an ...
0
votes
1answer
352 views

Organising data of a turn-based strategy

I'm intermediate in Java but novice in everything which is on the server-side. I've set myself a task to rewrite an old game, so learning Java is more fun. It is a space turn-based strategy. The ...
0
votes
1answer
86 views

In lockstep networking game, how to handle sudden lags and disconnection?

I am trying to implement a game similar to "Street Fighter" by using lockstep networking model so that two players can play remotely via Internet. I have read a lot of articles about lockstep ...
2
votes
3answers
341 views

How do you filter entities in an Entitiy Component System?

I am currently writing my own ECS in C++ and I am using std::bitset. I register a component at compile time and give it an ID. Position has ID 1 Direction has ID 2 .. ...
5
votes
3answers
247 views

Decoupling AI from game logic

Imagine a game with different types of characters or "actors" which can perform actions like walking and shooting. They are implemented using the state pattern to reduce the amount of coupling: each ...
6
votes
2answers
215 views

Decoupling assets, instances and the rendering module [closed]

I am trying to redesign a home-grown hobby engine. It became apparent that it was far too tightly coupled and so I'm trying to redesign it in a more modular way. Unfortunately, I'm baffled by the ...
0
votes
0answers
49 views

Is there such thing as a design pattern for game character attributes? [duplicate]

I'm toying with the idea of a character based game. The characters, robots, monsters, heroes (and weapons I suppose) will all have various attributes as per a D&D game for example. They player ...