Component based architecture .... for game!

Started by
10 comments, last by SuperG 7 years, 10 months ago

Personally, I like the Unity approach. You get most of the benefits of components without the unnecessary trouble that complete decoupling causes. None of the games I've worked on that shipped - or the ones that were cancelled! - used the "entity is just an ID" mantra because it buys you little but costs you a lot in terms of code clarity and predictability. Some of the people above will disagree, obviously.

Advertisement

>> It's how often you combine these things into game objects like ships, or cars, and make new ones with tweaks etc.

that's what i call defining a new "entity type". IE a new kind of "game object". some games must do this often and have many people who must be able to do it with various skill sets, and some games do not. like most things it depends on the work to be done, and the size and skills of the team.

IE if you were going to bang out pong, pacman, galaga, space invaders, or missile command, etc. by yourself on weekend just for fun, you wouldn't bother with ECS.

Personally, I like the Unity approach. You get most of the benefits of components without the unnecessary trouble that complete decoupling causes. None of the games I've worked on that shipped - or the ones that were cancelled! - used the "entity is just an ID" mantra because it buys you little but costs you a lot in terms of code clarity and predictability. Some of the people above will disagree, obviously.

As Norman Barrows stated. It depends on the game. The example there don't need it.
Entity is just a ID is used in the Data Oriented Design. The value of that and its features used in pure form might be noticed in much bigger game.
The way it noticed is if you got a lot of something. If entity need to change component on run time. Move components in memory. Make new entity by combining components even in run time.
I think it would be noticable the benefit if your making a game. With the scope of.
A Space tactical stratigic game , where game is about
* In game design ship types . By player content driven game. Not just data driven but beyonpd that.
* in game tweak components stats . Bigger ship can have bigger guns.
* build fleets .
* And watch the AI fight it out or act like armada Admiral player vs player etc.
* if you got carriers with dozen types of Fighters etc. It makes Entity in numbers very large.
* drone frigates it can make entities insane. Launched 300 or so in a X series game.
* Missile frigates. Missile barage like Egosoft Xseries

Then a more pure form of ECS the DOD way make sense.

There are a lot of games from small to big there is not a lot of something and no need to mutate objects. So it make no sense to go with ID for Entity. But there are game concept where it have great value.

This topic is closed to new replies.

Advertisement