Monday, November 7, 2011

Input Components & Behaviors

I've been wrestling with the different types of rendering in The Render Engine, trying to keep the two in sync so that it's really ubiquitous as to which way you go: either canvas or DOM.  The problem is that events were "simulated" in the canvas and were "actual" in the DOM.


To fix the issue, I have made all events "simulated".  What this means is that the "actual" events are captured and then proxied to the internal event handling system.  It's not as neat as just using the DOM events directly, but it fixes issues with events propagating where they shouldn't yet allowing a library like jQuery to still capture DOM events and not lose them.  This change mainly affects the mouse and touch input components.  Plus, this change allows me to stick with using the MouseInfo and TouchInfo structures which have information which is more game-related.

Another thing I've just wrapped up is the inclusion of autonomous vehicle steering behaviors.  These behaviors, adapted from a SIGGRAPH paper by Craig Reynolds, are intended to allow you to create motion without having to script everything.  There is a new BehaviorMover2D transformation component which works with the behavior logic components.  Each behavior acts upon a game object, causing it to move in a particular way.  Blending the behaviors can create more complex behaviors.  I suggest you Google "autonomous steering behaviors" for more reading on the subject.

2 comments:

  1. Hi, I just want to say your TRE engine is really great. Please continue to work on it even though the website is down and everything.

    ReplyDelete
  2. Hi, How can I compress and minify the engine with source code retrieved from GitHub?

    ReplyDelete