Tagged Questions

Engine-design related questions. How code is structured.

learn more… | top users | synonyms (2)

3
votes
2answers
287 views

How to implement special weapon and armor effects (ex: vampiric, holy, damage shield, thorns)?

I'm working on the inventory system for my game, and am interested in how do I implement additional weapon and armor properties that are not just damage or armor? If all I have is damage and armor, ...
0
votes
1answer
379 views

How to use Bullet physics with Entity Component Systems?

I have an Entity Component system and I want to have a Physics Component that would add the given object to the physics simulation. My problem arises because the Bullet API requires me to add each ...
2
votes
1answer
236 views

Collision Shapes Abstraction Design

Straight to the facts. I have a base CEntity class for different entities in my game: Static entities ( those do not move, simply props and items ) Dynamic entities ( these move, jump ) Each of ...
1
vote
0answers
292 views

Gluing libraries together into a 3D engine [closed]

As I read about people wanting to write their own 3d engine from scratch and people recommending using existing engines, it occurred to me that a middle-ground exists between developing your own ...
0
votes
1answer
323 views

How or why are major video games programmed so reliably? [closed]

It seems like every five minutes, you come across yet another installer which fails to install certain components, another .NET application that throws up an unhandled or semi-unhandled error message, ...
8
votes
1answer
998 views

How to benefit from cpu cache in a entity component system game engine?

I often read in the ECS game engine documentations that is a good architecture for using cpu cache wisely. But I can't figure how we can benefit from cpu cache. If components are saved in an array ...
3
votes
1answer
244 views

Entity component systems and DDD: violation of encapsulation?

I'm using a hybrid of DDD (domain-driven development) and an entity-component system. That is to say: I have an Entity class with a list of Components, and the ability to add/remove/get components I ...
2
votes
2answers
258 views

In a ES system, how one would implement/ deal with Modifiers?

Given the normal entity-component-system architecture, lets say we a component that give the entity Strength. Now on the game flow I want to give +4 strength do to the wielded weapon. What would be ...
1
vote
1answer
131 views

How do you get player to interact with level?

I suffer from this problem where I have say a class called Player and a class called Level. Now the only way I can figure out how to say make the player interact with the level is if I do something ...
1
vote
0answers
80 views

What should the data structure of a flexible ability system look like? [duplicate]

Hi guys I am currently working on a turn-based RPG that will require me to create numerous abilities with little overlap. I've been looking to other games to see how their ability and combat system is ...
0
votes
0answers
104 views

Different Spawning Target Pattern on a Music Game App (Prototype)

I'm using Gtomee's audio spectrum decoder tutorials (from sample video or codes at GitHub) to create its own spawning pattern according to what music it played. It worked pretty nicely despite this ...
2
votes
1answer
317 views

What makes games responsive to user input?

Many games have been praised for its responsive gameplay, where each user action input correspond to a quick and precise character movement (eg: super meat boy, shank...) What makes those games ...
10
votes
3answers
627 views

How should I model an economy-based game in code?

I'd like to create an economy game based on an ancient civilization. I'm not sure how to design it. If I were working on a smaller game, like a copy of "Space Invaders," I'd have no problem ...
4
votes
1answer
144 views

Correct order of tasks in each frame for a Physics simulation

I'm playing a bit around with 2D physics. I created now some physic blocks which should collide with each other. This works fine "mostly" but sometimes one of the blocks does not react to a collision ...
5
votes
2answers
369 views

Running multiple box2D world objects on a server

I'm creating a multiplayer game using LibGdx (with Box2d) and Kryonet. Since this is the first time I work on multiplayer games, I read a bit about server - client implementations, and it turns out ...
0
votes
1answer
535 views

Node.js Lockstep Multiplayer Architecture

Background I'm using the lockstep model for a multiplayer Node.js/Socket.IO game in a client-server architecture. User input (mouse or keypress) is parsed into commands like 'attack' and 'move' on ...
13
votes
5answers
1k views

How should game objects be aware of each other?

I find it hard to find a way to organize game objects so that they are polymorphic but at the same time not polymorphic. Here's an example: assuming that we want all our objects to update() and ...
2
votes
2answers
199 views

What common interface would be appropriate for these game object classes?

Question A component based system's goal is to solve the problems that derives from inheritance: for example the fact that some parts of the code (that are called components) are reused by very ...
2
votes
1answer
148 views

Multi-Threaded Pipelined Game Engine Data Synchronization Questions

Let's say I'm setting up a worker pool based game engine with pipelining. Let's say I have 4 stages in my pipeline as such: Stage 1: Physics Stage 2: AI/Input Stage 3: Game Logic Stage 4: Rendering ...
2
votes
1answer
287 views

Material, Pass, Technique and shaders

I'm trying to make a clean and advanced Material class for the rendering of my game, here is my architecture: class Material { void sendToShader() { program->sendUniform( ...
1
vote
3answers
191 views

HTML5 2D Game Renderer

i have a question on designing a HTML5 2D game renderer. I've read that it's better to not let entities draw themselves but instead put all the drawing functions in the renderer. After coding for a ...
16
votes
4answers
622 views

How can I design lots of different attack types that can be combined?

I'm making a top down 2D game and I want to have a lot of different attack types. I'd like to make the attacks very flexible and combine-able the way The Binding of Isaac works. Here's a list of all ...
4
votes
1answer
313 views

Separating components and logic

I've been working on how to build some of my game systems using components and systems. I'm having a little trouble following the approach that components should just be bags of data and systems ...
1
vote
3answers
128 views

Can I use a translate function to implement a viewport?

I read this great question and its accompanying great answer about rendering a viewport in a top down 2D game: As for actually drawing the objects the camera can "see", you now draw all objects ...
0
votes
1answer
243 views

Where to save enemy positions in C++?

I'm wondering how and where to save the positions my enemies should spawn. My idea was to use a struct such as: struct enemy{ int x,y,type; } And save an array of it in a .dat with fwrite() ...
5
votes
1answer
306 views

Implementing Vehicles in your game

In the game i am creating as an hobby (learning is the primal goal of it all) i plan to implement a space ship that the player can enter and use to explore it. I tried to search the internet for the ...
1
vote
0answers
97 views

Abstraction/architecture between interface and “scene” in adventure game [closed]

I'm tinkering with an idea for an adventure game but am unsure how to define scenes and tie them to the game. I've got an idea but it doesn't feel quite right. To save repetition, T&D = ...
1
vote
2answers
305 views

Implementing Explosions

I want to add explosions to my 2D game, but im having a hard time with the architecture. Several game elements might be responsible for explosions, like, lets say, explosive barrels and bullets (and ...
0
votes
2answers
188 views

Game Architecture doubt on variable access

Im having a hard time figuring out a solution to a problem that seems it should be easy to answer but since i cant come up with a good solution I bid your knowledge: In my game i have a state manager ...
2
votes
1answer
790 views

Using an Entity System Architecture with Task Based Parallelism

Background I have been working on creating a multithreaded game engine in my spare time and I currently trying to decide the best way to work an entity sytem into what I have already created. So far, ...
9
votes
3answers
415 views

Flexible alternatives to many many small polymorphic classes (for use as properties or messages or events) C++

There are two classes in my game that are really useful, but slowly becoming a pain. Message and Property (property is essentially a component). They both derive from a base class and contain a ...
1
vote
0answers
458 views

Weapon Class Organization [closed]

Im making a game and i want to organise my weapons, and im having a few doubts on not only the best architecture but also on how to use it properly: The First approach is to make a single Weapon ...
1
vote
2answers
161 views

How do I separate model positions from view positions in MVC?

Using MVC in games (as opposed to web apps) always confuses me when it comes to the view. How am I supposed to keep the model agnostic of how the view is presenting things? I always end up giving ...
6
votes
2answers
219 views

Should an actor know its position (or map should know it)

In a tile-based game (in this case MMO), should an actor (e.g., player) know its position, or should only the map know its position? If an actor is placed on a grid map, it is placed on a specific ...
4
votes
0answers
515 views

Advice on NPC architecture [closed]

I'm developing a 2D Zelda game with LibGDX in Java using TileD maps. I am now adding NPCs to the engine and I'm thinking about how to make them so it's going to be easy for me to add/edit their custom ...
5
votes
3answers
786 views

When two moving objects collide, which one sends the message, and which one recieves it?

I am writing a platform game using an entity-component system. Entity-World collisions are robust and work very well, and I'm now working on collisions between entities. Just to be clear, in my code ...
2
votes
2answers
316 views

Confusion about systems implementation of ECS

For reference I am mostly imitating the architecture in this tutorial, the "Entity System" section: http://www.raywenderlich.com/24878/introduction-to-component-based-architecture-in-games NOTE: the ...
1
vote
1answer
556 views

What is the logic behind a 3D Projection 'Camera Perspective'? [closed]

Suppose I had a 3D Cube on a 2D plane (screen). And I wanted to use the keypad to move and rotate it. Without referring to a 3D Game Engine that could do this for me can you explain me the logic or ...
1
vote
1answer
277 views

Need opinions on my component based design [closed]

I have an Entity class and a Component class. The Entity class has a list of attached components, and each component also has a member variable that is a reference to the entity that it is attached to ...
0
votes
1answer
201 views

An API independent way of managing video memory?

I'm developing a game. The game architecture is very modular. I have a "Graphics Engine", which uses either a Direct3D or OpenGL renderer. However the user does not have access to the renderers ...
2
votes
1answer
132 views

Timestamps as ids in an entity manager?

I've built my own entity manager, as I found out some days ago, it is very similar to the Artemis framework. For now, I just use integers as entity ids. Behind the scenes, there is a simple integer ...
2
votes
1answer
178 views

Architechture problem of implementation of a tutorial for a game

I'm creating one for my game and I'm confused a bit. I made special TutorialManager class and a number of steps to pass for player first time entered the game. The problem is that tutorial steps are ...
5
votes
3answers
283 views

Mismatch of Entity System and Savegames

There is a theoretical mismatch of the entity system and the savegame system, which is think is common, but I haven't found resources about that. Therefore I will explain both systems first, as short ...
6
votes
4answers
365 views

Passing data between engine layers

I am building a software system (game engine with networking support ) that is made up of (roughly) these layers: Game Layer Messaging Layer Networking Layer Game related data is passed to the ...
2
votes
1answer
107 views

Using an FSM, how do you clean up state related attributes that may be used from several states?

I'm making a game that plays a bit like Diablo, but you can harvest resources like in an RTS. I have the following states in my FSM: IdleState, ApproachingTargetCoordinateState, ...
3
votes
1answer
207 views

Whats the best way to expose current settings to your classes? [duplicate]

Just as the title states, whats the best way to expose current settings like resolution to my classes? (I know this might have been asked, but I couldn't find anything) I was thinking of the ...
2
votes
1answer
101 views

How do I persist the states of distant objects?

How would one manage the state of static living things like trees in a large sandbox world? Trees in Minecraft, for example: They grow even when the player is far away. One way is to save them with a ...
1
vote
1answer
891 views

Entity-System Architecture; Pools and Factories

I'm creating a 2D game based on entity-system architecture using C++, the C++ port of Artemis, and SFML. I've had to jump through a few hoops, but it's been fairly smooth until now. In this game, I ...
1
vote
1answer
81 views

Sending entities to connecting player

When a player connects to a game, he needs to be sent all the entities currently on the map. This is done by creating entities one by one. Three ways of implementing this come into my mind. Which one ...
11
votes
4answers
599 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, ...