Tag Info

Hot answers tagged

3

The answer to the question "Is it possible, or even feasible, to have graphics engine completely decoupled from game logic?" is "yes". I would say it is even "advisable". But in general, you'll find a lot of your game ends up tied to the engine you choose for other reasons, like input handling or use of their facebook integration or other cross-platform ...


3

It's OK to have component dependencies. And the more explicit the dependency the better. There's nothing worse than dependencies hidden behind useless layers of indirections. Your case doesn't look like a dependency hell to me. No circular dependency or unclear ownership of data: consider yourself lucky! Now I still believe that you need to reverse your ...


2

In my experiences there aren't too many ways around the fact that, you're right, all your different game entities and their components need to be aware of the state of the game and their own state. It's a mess unless you design with state machines in mind. The best way I've found to deal with it is to make sure that components are all doing small pieces of ...


1

I 'll try to manage InputController changing its behaviour at runtime (in c# can use some kind of delegates) Examples : if activated in_game state then InputController.processInput = logic1 if activated menu state then InputController.processInput = logic2 if activated inventory state then InputController.processInput = logic3 Logic1..N are alternative ...


1

In instances like this I use a stack of input maps. You already have certain buttons doing this or that while playing the game, if you can group that logic into a map (array of button/key => some event) then you can make multiple maps for the different states you have. From there you just need 'some event's that can be used to push and pop the maps from a ...


1

You aren't over complicating it at all. This is a great way to think about a game. It keeps the game flexible for any changes you want to add in the future (say a stats screen). The first place I would look is using the Strategy Pattern: Wikipedia Determine what input triggers you would need and add them to an abstract interface. Then, implement the ...


1

ECS doesn't make miracles and not all the problems should be solved by it. In some point you will need especific code about the specific logic of your game. You can put an "Invulnerable" flag inside your health component and a flag "PenetrateInvulnerability" inside the atack message and your system combat manage then.


1

Note: I'm playing fast and loose with the pseudocode here, so let me know if anything is unclear. Ideally, the player shouldn't be special - just another set of components. The main function of entities is to group components. You might think of it this way: components get updates, not entities. From the good old Evolve Your Hierarchy article: Updates ...



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