I'm trying my best when creating a MUD (multiplayer interactive game)
I am in the design / conceptualization phase and I have a problem that makes me unable to find a solution. I hope some more experienced programmers get some tips.
Here is the problem, as far as I can explain it. When a player decides to perform an action, he sends a command to the server. the server then processes the command, determines whether the action can be performed, and either it does or answers the reason why this is not possible. One of the reasons that an action may fail is because the player is busy with something else. For example, if a player is in the middle of a battle and has just deployed a massive wide sword, it may take 3 seconds before he can repeat this action. If the player starts to swing again, the game will respond, indicating that he must wait x seconds before doing this. Now, I can perhaps develop without much trouble. The problem I am facing is how can I reproduce this behavior in AI creatures. All events,which are executed by the ON ITS OWN server, and not as an immediate reaction to what the player has done, should be time sensitive. Some evil monster cast a spell on you, but must wait 30 seconds before doing it again ... I think that I will probably add all these events to some kind of event queue, but how can I make this queue time in queues?
source
share