Engine-design related questions. How code is structured.

learn more… | top users | synonyms (2)

16
votes
5answers
614 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
291 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
123 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
236 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
295 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
96 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
292 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
185 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
700 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
409 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
396 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
156 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 ...
5
votes
2answers
213 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
479 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
725 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
282 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
466 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
263 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
198 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
131 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
173 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
275 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
354 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
205 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
100 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
811 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
564 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, ...
1
vote
1answer
467 views

Best Practices for class usage and game architecture

I'm making a 2D game similar to mario in Java. I have some questions about class organization and proper method usage. I have the following classes: Main: runs the game in a JFrame GamePanel: ...
1
vote
1answer
146 views

Positioning sprites in a Component-Entity engine

I'm building my first component/entity engine and I'm not so sure about some of my choices. I'm here asking suggestions on my first doubt. I draw objects with 2 different behaviours: 1) Position ...
1
vote
5answers
2k views

Entity System creating Components

Over every entity system I see implemented in C++, or even in Java/C# (e.g. the Artemis framework). I see components not allocated via a new operator (or something similar, e.g. std::make_shared). For ...
9
votes
3answers
335 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 ...
8
votes
3answers
743 views

Grouping entities of the same component template to linear containers

EDIT: Looks like people are actually doing this! http://www.randygaul.net/2013/05/20/component-based-engine-design/ Another example of using this data accesing pattern. I've done a lot of research ...
4
votes
2answers
333 views

Mobile Multiplayer games and coping with high latency

I'm currently researching regarding a design for an online (realtime) mobile multiplayer game. As such, i'm taking into consideration that latencies (lag) is going to be high (perhaps higher than ...
4
votes
2answers
1k views

Allocating Entities within an Entity System

I'm quite unsure how I should allocate/resemble my entities within my entity system. I have various options, but most of them seem to have cons associated with them. In all cases entities are ...
2
votes
2answers
429 views

Level Representation in a 2D Game

I would like to create a 2D game, where a character should move on a stage/level. My stage would be static, constructed some little cubes, similar to the well-known Mario game: some of the elements ...
4
votes
4answers
322 views

Networking gampeplay - Sending controller inputs vs. sending game actions

I'm reading about techniques for implementing game networking. Some of the resources i've read state that it is a common practice (at least for some games) to send the actual controller input across ...
0
votes
3answers
545 views

Rendering order in an Entity System

Say I use a basic ES approach, and also inside Systems I hold lists of all entities that Systems are required to process. How do I maintain this list of entities in desired rendering order, i.e. for ...
4
votes
1answer
592 views

Material System

I'm designing Material/Shader System (target API DX10+ and may be OpenGL3+, now only DX10). I know, there was a lot of topics about this, but i can't find what i need. I don't want to do some kind of ...
3
votes
2answers
251 views

Important aspects to consider while making a technical design document

I'm working on a open world strategy game for which I'm planning to make technical design documentation. How do we decide exactly what we need to include to ensure the design document is as complete ...
10
votes
2answers
523 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 ...
0
votes
0answers
131 views

Resource/Asset Manager [duplicate]

I'm creating a ResourceManager. At the beginning i'm creating a groups of resources which contain a map of resources. The role of groups is to quick load/unload resources, to find some constant, never ...
2
votes
3answers
349 views

Desire advice on implementing this animation timeline system

I have read a lot of questions on here, as well as books regarding game architecture. I have a general question about the implementation of a game's animation timeline, on which many isolated ...
1
vote
1answer
98 views

How can I implement something like Destiny's public events?

Bungie has shown a gameplay trailer for their new game, Destiny. The part that really stood out for me was the 'public events' that can happen randomly while playing. Now I've thought about it for a ...
25
votes
4answers
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?
3
votes
1answer
161 views

simple adventure game mechanics stored in database

I plan to code a little adventure-like game. To be able to build multiple episodes without deploying new code I want to store any information possible in the database. This includes stuff like ...
6
votes
3answers
2k 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 ...
3
votes
1answer
812 views

Movement & Physics in an entity-component system

I'm currently playing around with entity-components systems and got started on the movement/collision/physics parts and would like to have some pointers! It's a basic 2D sidescrolling game, with the ...
2
votes
1answer
353 views

Combining 2D and 3D in game engine

I've implemented basic 3D functionality and made little "2.5D" demo in orthographic projection using OpenGL ES 2 and Box2D. Now I want to make completely two-dimensional game (using sprites) and ...