• entries
    437
  • comments
    1000
  • views
    335191

4E4 Update

Sign in to follow this  
evolutional

139 views

Animation system has been fixed. I ripped out all the old code and recoded it in a simpler, more central manner. It works exactly as it should now, so hopefully I won't be needing to touch it again any time soon (except to raise events when animations are complete and change animations appropriately).

I've just been having an interesting discussion with that Jeffers bloke regarding the input relay. After thinking it over, I've decided to go for the simplest of systems and giving each of the entities an array of 'states'. The input relay should work by setting these states on the objects, which are then scanned to see if any combinations exist. At its simplest level, the 'move_left', 'move_up' states can be checked and used to move the player. A more complex scenario would involve the checking of multiple states (or a sequence of states) and setting additional states based on this. When set, these states can be set to raise events on an object and hence, cause a scripted function to be called.

This still raises the issue of exactly where these states are checked for 'multi-states' combos. For movement states (left, right, up, down and the increments between) a single movement function can be called which again uses these individual states to change the position appropriately. As motion will be common to most objects it would be possible to have a natively-coded motion handler to take the pressure off the scripting VM. For other, more customised states, the scripted functions can be used as hopefully these calls won't be as common.

So, input maps will be specified with the Xml game specification. It should be fairly easy to hook up a system that detects a certain input event and sets an appropriate game/entity state. The main issue would be to handle the specialist combinations, but for now I believe that this can be ignored until the gameplay is finalised and things are working as they should. It could turn out that such an exotic system is simply not needed and in the timescales we've got, it's a good idea to cut the wheat from the chaff.

One side-effect of the Entity state system is that it automatically gives me access to a scriptable game/level state system (code reuse is good, kids). Using this to set level objectives and win conditions should be easy.
Sign in to follow this  


6 Comments


Recommended Comments

Quote:
I've just been having an interesting discussion with that Jeffers bloke regarding the input relay.


You've been hanging out with some rough company. [grin]

Share this comment


Link to comment
Guest Anonymous Poster

Posted

Quote:
Delegates!


That is kind of how things work for the events right now. It would be easy enough to hook up a key press to a scripted method (I've already done this in testing) but I want something more substantial. By hooking the system up to a state array I can give certain states precedence over others and use them to direct what's happening in the game.

Imagine, for the sake of argument, that the AI has set "walk_to_player" as a state. If the AI decides that there's danger in the area they can set the state "run_from_danger", without precedence, the AI could walk into the danger whilst trying to follow the player. The real situation would be that the AI should avoid danger before tracking the player again (or even better, to avoid the danger whilst attempting to track the player). Of course, this is a pretty specialist situation but it could happen.

What I'm doing now is deciding on what I'll need from this game and only putting in the minimum functionality in order to follow YAGNI mentality. Trying to code up a full game (including engine, game, graphics et all) is as much a time/resource juggling act as it is a coding challenge.

Share this comment


Link to comment
Quote:
Quote:
I've just been having an interesting discussion with that Jeffers bloke regarding the input relay.


You've been hanging out with some rough company. [grin]

What are you saying?? I'm a model citizen I am - never put a foot wrong [lol]

Why isn't there an [angel] smiley??

Share this comment


Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now