Skip to main content
11 events
when toggle format what by license comment
Jul 22, 2015 at 6:35 vote accept user975989
Jul 22, 2015 at 1:54 comment added jzx Another way of looking at it is this: you're making a turn based game in a real time system, both because the system doesn't stop when it's someone's turn and because you'll probably want to animate things and handle things like system menus out of turn. So a lot of things are just going to say "not my turn, do nothing," and others don't care whose turn it is. Instead of waiting on anyone, we just ask everyone if they have something to do on that turn.
Jul 22, 2015 at 1:43 history edited jzx CC BY-SA 3.0
added 381 characters in body
Jul 22, 2015 at 1:35 history edited jzx CC BY-SA 3.0
added 452 characters in body
Jul 22, 2015 at 1:30 comment added jzx You can break this down further for your purposes, but "time" could be the turn index, and you'd simply prioritize the AI component list ahead of the Action component list. When it isn't that entity's turn, Action.Update should just return. You'll probably want a separate entity to keep track of whose turn it is.
Jul 22, 2015 at 1:21 comment added user975989 I am using a playerTag component to find the player for various purposes, so Input still functions like a generic system. But the issue is that AI and Action have to be run one after another for each entity. Notice that this is a turn based game, so AI has to think about what just happened after each event. What I mean is, once anyone does an action, the next Entity to be processes should think using the AI, and so on.
Jul 22, 2015 at 1:19 comment added jzx You don't really want the input system to stall, because you might want other things to update. Rather, it should just think "nope, no input yet" or "this input doesn't need to be handled." When there is input that is significant, the input component messages other components to tell them that something has happened, and what needs to happen in response is going to be different for each component.
Jul 22, 2015 at 1:12 history edited jzx CC BY-SA 3.0
added 122 characters in body
Jul 22, 2015 at 1:10 comment added user975989 I'm still having trouble understanding how this would help my case. How do I make the Input system stall until I get a proper input?
Jul 22, 2015 at 1:09 history edited jzx CC BY-SA 3.0
added 122 characters in body
Jul 22, 2015 at 1:02 history answered jzx CC BY-SA 3.0