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

learn more… | top users | synonyms (2)

4
votes
2answers
68 views

Which parts of game should belong to engine and which should belong to scripts?

Often, the game is splitted into engine code (i.e. C++) and scripts (i.e. Lua). The question is which parts / modules of game code should typically belong to engine, and wchich should belong ...
3
votes
0answers
75 views

How to cache resources in my homebrew rendering system

Background: I am designing a simple 3D render system for an entity component system type architecture using C++ and OpenGL. The system consists of a renderer and a scene graph. When I finish the ...
0
votes
0answers
25 views

Scene management

I viewed sources of rendering engines (ogre, irrlicht, openscenegraph) but I can't really grasp the the main ideas of their scene management systems. I also read many articles (including Game Engine ...
2
votes
3answers
88 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 ...
15
votes
3answers
5k views

Finite state machine in C++

So, I've read a lot about using FSMs to do game state management, things like what an FSM is, and using a stack or set of states for building one. I've gone through all that. But I'm stuck at writing ...
1
vote
1answer
76 views

How to avoid lots of ugly math code and constants-hoarding?

In a lot of the games I've (tried) making in the past, I often run into the problem of the code getting really heavy on ugly mathematical code. This happens especially frequently in setting up ...
0
votes
0answers
29 views

What type of networking archtitecture does Unreal Engine 4 have?

I am working on online multiplayer FPS on UE 4 with up to 16 players. I am now at the making architecture model, stage. I am doing research on possible server architecture model with respect for ...
7
votes
2answers
5k views

Tips for Component Based Entity System message handling

I'm trying to implement a component-based entity system but am a bit confused on how I should handle the messaging. There are two problems I'd like to resolve so I can test the system. Below is the ...
7
votes
3answers
2k views

How to Effectively Create Bullet Patterns

I'm currently creating a top-down shooter like Touhou. The most important factor of the game is that there are many diverse patterns and ways at which bullets are generated and shot at the player, see ...
18
votes
4answers
4k views

How to implement behavior in a component-based game architecture?

I am starting to implement player and enemy AI in a game, but I am confused about how to best implement this in a component-based game architecture. Say I have a following player character that can ...
0
votes
2answers
114 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: ...
0
votes
1answer
52 views

Inventory system does not behave correctly

I have a game with an inventory, you can pick up items by walking on them. When you walk on an item and if it isn't already in your inventory it is added to the next free slot. If it is already in ...
1
vote
1answer
94 views

Setting up an efficient OpenGL rendering loop

This is the code that I use to setup my shader char* vertexShaderSource = getResource("vert.shad"); char* fragmentShaderSource = getResource("frag.shad"); vshad = readFile(vertexShaderSource); fshad ...
0
votes
1answer
146 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 ...
1
vote
2answers
79 views

Using hard coded values for Items?

Is it a bad idea to use hard coded values for things like items (static data) that would change infrequently in an online game? I'm designing an online game in node js, and I'm trying to decide if it ...
0
votes
0answers
26 views

Implement Special Effects triggered at certain moments in game

In my turn based RPG/Puzzle game I planned to have different Special effects, which enemies, weapons and armory can have. So for example an enemy can have a "poison" effect, which has a certain ...
2
votes
1answer
56 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 ...
13
votes
1answer
6k views

How to apply Data Oriented Design with Object Oriented Programming? [closed]

I've read lots of articles about Data Oriented Design (DOD) and I understand it but I can't design an Object Oriented Programming (OOP) system with DOD in mind, I think my OOP education is blocking ...
16
votes
4answers
2k views

What can I do to avoid one-off flags and checks throughout my code?

Consider a card game, such as Hearthstone. There are hundreds of cards that do a wide variety of things, some of which are unique even to a single card! For instance, there is a card (called ...
0
votes
2answers
74 views

Resource management questions

Say I have this Cache<typename Resource> class template, which is a resource cache that contains an std::map<std::string, Resource>, mapping strings to resources. I can many different ...
0
votes
1answer
135 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 ...
20
votes
2answers
8k 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 ...
0
votes
1answer
77 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 ...
1
vote
3answers
60 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 ...
0
votes
1answer
135 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 ...
0
votes
1answer
98 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
93 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 ...
1
vote
2answers
155 views

Implementing monte-carlo tree search in a tile based game with units

I have this simple risk-like game I would like to develop an AI for. Players move their Units on the map and a simple fight resolution is done. There is a time constraint of 100ms for each round, the ...
3
votes
1answer
253 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, ...
7
votes
4answers
4k views

Per-Frame Function Calls versus Event Driven Messaging in Game Design

The traditional game design, as I know it, uses polymorphism and virtual functions to update game objects states. In other words, the same set of virtual functions are called in regular(ex: per-frame) ...
2
votes
2answers
175 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 ...
2
votes
2answers
179 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 ...
2
votes
2answers
62 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 ...
0
votes
4answers
503 views

Entity Component Architecture and Scripting without using threads

I am working on a small game engine for practicing purpose and also for putting some of my ideas into action. What I have so far is a couple of systems for rendering, sound etc. The next step is to ...
0
votes
2answers
81 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
166 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
79 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 ...
2
votes
2answers
64 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 ...
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 ...
1
vote
0answers
48 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 ...
37
votes
7answers
20k 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 ...
8
votes
3answers
1k 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 ...
4
votes
3answers
212 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
110 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 ...
61
votes
8answers
27k 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 ...
4
votes
2answers
295 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
97 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 ...
1
vote
2answers
141 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
0answers
52 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 ...
10
votes
6answers
833 views

Networking Pong Clone

I have the fundamentals of TCP sockets, UDP communication etc, but can't find much on how to apply these to a real time game environment. I have a Pong clone, with 4 players, and need to synchronise ...