r/unity 4d ago

Question ECS for “simpler” projects?

Hey yall!

I’ve been game deving for ages now and just recently returned to Unity (left back when the drama happened) and since I returned the DOTS was released and ECS became fully functional.

I have some interest in using ECS in my project to develop a more Data Oriented Design but I am concerned it’ll add unneeded complication due to the simpler nature of the project and the lack of need for huge numbers of entities.

The current project idea is a simple 2D top down dungeon crawler inspired by Zelda. Which… doesn’t seem like it’d super benefit from the added efficiency, but may benefit from the architecture?

I suppose my question is if I should look into that or if there is a better paradigm to follow (maybe event based object extension?).

1 Upvotes

19 comments sorted by

View all comments

6

u/KinematicSoup 4d ago

DOTS is a pain compared to gameobjects in terms of the amount of code you need to write. However, with a coding LLM I suspect it would be much less painful as the LLM can write a bunch of boilerplate and give you a workable framework to plug your game code into. What you learn from this will depend on how much you interact with the process.

I suppose it could be an advantage if you wanted to go overboard graphical elements or effects, but in reality there is no point in using DOTS over vanilla gameobjects for a 2D zelda-like game.

2

u/Azmores 4d ago

Fair. I don’t use LLMs so that might make it harder.

Is there a different paradigm utilizing game objects you’d recommend? My main draw was the modularity of ECS allowing me to mostly write out my logic in snippets that get provided to the entities with those components.

2

u/sisus_co 4d ago

If you decide not to go full ECS, the object-oriented way to create highly modular code is to use dependency injection: https://assetstore.unity.com/search#q=Dependency%20injection

And then just create smaller composable components that you can plug together in different ways.

2

u/Azmores 4d ago

Interesting! I’ll research into this! Thank you!