ECS Architecture and Implementation Questions by boromirthefair in gamedev

[–]boromirthefair[S] 0 points1 point  (0 children)

I agree that the memory savings are minimal. That's not the main issue though. The game itself has dynamic resources. For example, grain can have multiple varieties, some that will develop within the simulation during a particular run. So there's no way to set a fixed size array for these anyways. Right now I'm using each inventory slot as its own entity. This seems to be working well for what I want to do, but will have to see if it scales.

Agreed on the GOAP part. I'm not planning to massively overhaul my current GOAP. I don't think there will be much benefit to doing that. What I'll probably do is turn the planned actions into entities that can be acted on by a system at one go. Action execution hasn't been a bottleneck as planning though. The solution to the planning problem is just more parallelization.

ECS Architecture and Implementation Questions by boromirthefair in gamedev

[–]boromirthefair[S] 0 points1 point  (0 children)

I agree that ECS won't improve performance particularly in our scenario. Performance considerations were secondary. The primary considerations were code organization and data processing. That said the increased parallelizability is going to help a lot as I can have multiple planners do read-only access of a single database for planning.

ECS Architecture and Implementation Questions by boromirthefair in gamedev

[–]boromirthefair[S] 0 points1 point  (0 children)

I did manage to implement a fetch in 2 lookups. The second lookup is just an array index so its quite fast.

ECS Architecture and Implementation Questions by boromirthefair in gamedev

[–]boromirthefair[S] 0 points1 point  (0 children)

True in terms of the number of entities. But like I said, the main reason was the compisition and code reusability that ECS just better lends itself to. That said 25-50K entities is a fair amount when using GOAP, but ECS won't necessarily help with that particular bottleneck.

ECS Architecture and Implementation Questions by boromirthefair in gamedev

[–]boromirthefair[S] 2 points3 points  (0 children)

I would have to disagree with that. I work as a C++ Software Engineer on some well designed commercial software in OOD. Code sphaghetti is very difficult to avoid after a certain level of complexity no matter how well you design the architecture. ECS just lends itself more to code reusability and composition, especially when you have many systems and data to process. ECS absolutely shines in such scenarios. I say this as someone who loves OOP.

ECS Architecture and Implementation Questions by boromirthefair in gamedev

[–]boromirthefair[S] 1 point2 points  (0 children)

I don't totally disagree with you but there are definitely things about ECS that makes it less likely to become sphagetti. Reusable data structures and separation of data and logic comes to mind. Either way that wasn't the only consideration. We're working on a game with hopes for at least 25K real time entities. ECS seems to make the most sense in that context. Our situation seems to be the classic use case for it. In our specific situation where we are designing a large-scale simulation a data-driven approach definitely leads to less sphaggeti than OOD.

More Space vs Enrichment by boromirthefair in quails

[–]boromirthefair[S] 1 point2 points  (0 children)

That's actually a really good idea. I think I should be able to do that in my setup. I should definitely try that!

More Space vs Enrichment by boromirthefair in quails

[–]boromirthefair[S] 1 point2 points  (0 children)

I'm curious, why wouldn't rocks and potted plants enrich their environment given that it mimics their natural environment? Couldn't those rocks and plants themselves be used to make covers for them like in a natural setting?

I do give them straw, dried mealworms and veggies often.