Behavior

I just read the “Getting Started with the Java 3D Api Chater 4 Ineraction” to get familiar with Behaviors.

It seems that Xith3D have no support for Behaviors yet. But maybe there is someone out there who can explain me how to implement this feature.

In detail :

At which time a Behavior will be initialize with the initialize method?

How to set the method hasTriggered() ?

Whats about the methods allElements() and triggeredElements() in the class WakeupCondition ?

Behaviors are not yet implemented, and I am not sure if they are on the TODO list.

What are you trying to achieve?

Will.

Hi,

I have preliminary implementation of Behaviors, so compatible API can be easilt introduced. The questionable part is behavior scheduling mechanism, which is supposed to be very much different from Java3D. This means that nearly all WakeupOn*** things (that are not really applicable for game programming) are not implemented now.

Yuri

[quote]Behaviors are not yet implemented, and I am not sure if they are on the TODO list.

What are you trying to achieve?

Will.
[/quote]
Hi Will,

in the first instance i want to use behaviors for keyboard and mouse navigation. I know there is a workaround for this but it is still a workaround, isn’t it?

If behaviors are not on the TODO list. How can i implement interaction in xith3D in this way behaviors do?

Did you see Yuri’s responce? Looks like he is working on implementing some of them.

Will.

[quote]Hi,

I have preliminary implementation of Behaviors, so compatible API can be easilt introduced. The questionable part is behavior scheduling mechanism, which is supposed to be very much different from Java3D. This means that nearly all WakeupOn*** things (that are not really applicable for game programming) are not implemented now.

Yuri
[/quote]
Hi Yuri,

what do you mean with “that are not really applicable for game programming”? I thought the classes WakeupOn* are essential elements of Behaviors.

Would you commit you implementation to the cvs. Maybe i can help you to complete your code.

I think the problem is that Java3D behaviors were not very deterministic. They occured when they could.

With Game programming very tight control of the rendering and user interactions is essential.

JavaCoolDude presented a Xith framework that has resonable keyboard and mouse interactions in it. You can look/grab this source from the xith.org site.

[quote]I think the problem is that Java3D behaviors were not very deterministic. They occured when they could.

With Game programming very tight control of the rendering and user interactions is essential.

JavaCoolDude presented a Xith framework that has resonable keyboard and mouse interactions in it. You can look/grab this source from the xith.org site.
[/quote]
Thanks for this hint. What is about events that triggers doors or sounds? How about that without Behavoirs?

Basically what I did was based kinda on postings from dave yazel. I have a java collection of scenegraph transactions,

  • move camera
  • add sound
  • animate texture
  • etc

when a object is picked I add an animate/camera move/whatever object containing the required info door object, open direction, whatever to the transaction queue

Based on my frame rate goal, say20 frames/sec I perform a portion of the items in my trancation queue, BEFORE RENDERING,

As transactions occur I monitor frame rate and increment the number of prerender transactions I perform. If the frame reate drops to low I reduce the number per fram I process.

The advantage is your can extend the types of tranaactions as needed.

I my game I wanted to pick on a ladder, translate to it and climb it. Given the frames/sec I add N CAMERA_FORWARD transactions (small inc moves for smoothness) which moves me towards the ladder over say 2 secs and M CAMERA_ELEVATES to climb the ladder

Make sense??