0
\$\begingroup\$

I'm currently developing a game in Monogame / C#. I have the underlying game engine set up in the following way:

  • Entity/Component/System architecture
  • A Scene includes a map, cameras, and a list of entities
  • Systems act on the top scene in a scene stack each frame

The above approach is serving me well, but I want the engine to be able to cope with local multiplayer games in the future. Currently, the above architecture can cope with multiple players, as long as they are always in the same scene (due to the 1:1 scene/map relationship).

My question is a general one -- what changes would I need to make to facilitate multiple local players who can move between scenes independently? My initial thought is that I'd need to decouple scenes from game screens, but am having trouble visualising the relationship between scenes and cameras/entities/scene transitions/etc. in this scenario.

\$\endgroup\$
1

1 Answer 1

0
\$\begingroup\$

You would need one complete scene stack per player.

Any shared data would have to be moved either outside of, or to the root of the ECS.

In general, I do not recommend the formal ECS methodology for application under MonoGame.

Much of ECS is superseded by good C# class design, in terms of readability, coding efficiency, and speed.

\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .