Skip to main content
10 votes
Accepted

A more data oriented design approach to Entity Component System game engine

What's an object? What we call an object or an entity depending on the model is, fundamentally, made of two parts: data, and behaviour. Game objects have properties and do things. Let's take a ...
Quentin's user avatar
  • 1,178
6 votes

Should components in Entity Component System pattern have logic?

I was considering voting to close this question as opinion-based, but I think there are a couple of misunderstandings about Entity-Component Systems and Data-Oriented Design here that are worth ...
DMGregory's user avatar
  • 135k
5 votes
Accepted

Appropriate Cache Friendly Associative Container For An Entity Component System

Do the simplest thing that works, especially early on. If you've ever seen videos of triple-A titles in alpha, you'll know how slow / buggy they are. This is normal; in fact, it's desirable. And it's ...
Engineer's user avatar
  • 30k
3 votes
Accepted

Should fields in components in an ECS use polymorphism?

feels like I'm violating the ECS rule There is no ECS police that will come and put you in ECS Jail. This is your architecture, you set it up how it fits your needs. having any functionality in ...
Vaillancourt's user avatar
  • 16.3k
2 votes
Accepted

Load large quantities of data in Unity3D

TL;DR Use metrics to find what's a performance problem, don't just guess what it is. TL As you're accessing it via a web interface, the datastore at the back end is irrelevant. The performance ...
BanksySan's user avatar
  • 200
2 votes

Appropriate Cache Friendly Associative Container For An Entity Component System

ArcaneEngineer's advice is good, particularly for early development (to an extent - once you configure your engine to work a particular way, it can be significantly hard to rework it later). For ...
metamorphosis's user avatar
2 votes

Implementing Runescape-style stat-based conditional buffs within an ECS

Here's one way to approach it. First throw all your base stats into one component as follows: ...
Dimu Designs's user avatar
1 vote

Tilemap collision in Pure ECS?

When you have pure tile-based yes-or-no walkability, then there are a lot of optimizations you can do because: Tiles never move Tiles always have the same size Tiles are always found at coordinates ...
Philipp's user avatar
  • 120k
1 vote

Design pattern for turn based strategy game in C++

First things first: If this is your first game and you dont plan to expand on it (except maybe for Neural Network Learing), then use your learned OOD. There is nothing wrong in doing it a certain way. ...
PSquall's user avatar
  • 1,332
1 vote
Accepted

Using polymorphism in an Entity-Component System without sacrificing data-oriented design

The way I approached this was to use a constexpr string-hash which I apply to my components at compile-time to assign each of them a unique id. I essentially do this with the use of a macro where I ...
Naros's user avatar
  • 2,022
1 vote

ECS: is it beneficial to manage the data organisation of components before updating a system?

It's great that you have taken the time to think about a couple of ways to accomplish this. Unfortunately, there is no way to tell what's the best approach before you try it with actual data in an ...
Vaillancourt's user avatar
  • 16.3k
1 vote
Accepted

ECS: is it beneficial to manage the data organisation of components before updating a system?

It's difficult to say which way is best, since we don't know how prone your setup is to cache misses without this. I think I remember Jonathan Blow describing doing this type of sort-before-update on ...
DMGregory's user avatar
  • 135k
1 vote

How can I boost cache performance when storing objects in a scene with managed languages?

Ordering the data is going to depend on existing data access patterns for your application. Profile first, and see what areas of execution are taking the longest as a result of cache misses. Once you'...
Engineer's user avatar
  • 30k
1 vote

Data-oriented design and Component Sytem cross-referencing

I would not necessarily mimic in the component system the necessary data structures your logic systems require to function. There is an advantage to keeping the component system straight forward and ...
Naros's user avatar
  • 2,022

Only top scored, non community-wiki answers of a minimum length are eligible