"Animated" dice

Hi all,

I currently have a module (and am starting another) that uses dice…rather a lot of dice.

I have images of the dice in the main window tied to the values of the hidden dice roller that is run from a trigger when a button is hit. This works great.

One thing that would be nice, however, is the ability to maybe add a 1-3 second long animation on the dice so the player knows they’re rolling…I tried to do this by simply having the trigger roll the dice 10 times and take the final result…then 20 times…then 50 times…Problem is, the rolls happen so fast, you can’t really tell! Is there a way to add a delay between triggers so that each roll could be timed to happen, say, 250ms apart? Some sort of a ‘wait’ statement?

Thanks,

Dave

You could try doing it the old-fashioned way and display a layer with an animated GIF.


Messages mailing list
Messages@forums.vassalengine.org
forums.vassalengine.org/mailman/ … engine.org

Post generated using Mail2Forum (mail2forum.com)

I brought up something similar in the Feature Requests section at one point. Personally, I think it would be a great feature …not just for graphics for other timing issues as well.

My original comments are here

http://www.vassalengine.org/forums/viewtopic.php?t=1367

I just tried to add an animated GIF to my module, only to test it, but it doesn’t work. What exactly do I have to do when adding an animation?

I’m using Beta 8 and tried to add the gif to a separate layer.

Nothing, it should just work. I have used animated gif’s as highlighting layers before and it worked with no problem.

It’s possible the new graphics processing pipeline does not support animated gif’s. Joel?


Messages mailing list
Messages@forums.vassalengine.org
forums.vassalengine.org/mailman/ … engine.org

Post generated using Mail2Forum (mail2forum.com)

Thus spake “Brent Easton”:

No, it doesn’t, because everything in the graphics pipeline is a
BufferedImage. Animated GIFs are problematic because they’re represented in
the Java API by a private subclass of Image (they’re not BufferedImages) and
as a result we have no access to their internals. The major issue is that
once you load an animated GIF there seems to be no way to stop the thread
which animates it. It will chew up CPU cycles until you quit, even if the GIF
isn’t being displayed.

Animated GIFs won’t work when we switch to JOGL, anyhow, so there’s really
no way for this feature to come back.

What are people trying to use animated GIFs to do? Maybe we can provide some
other way to achive the same thing.


J.


Messages mailing list
Messages@forums.vassalengine.org
forums.vassalengine.org/mailman/ … engine.org

Post generated using Mail2Forum (mail2forum.com)

My particular use was to provide an extremely high-visibility animated marquee to particular units to make them easier to locate.

In the end, I decided the animation was an overkill and just went with a high-contrast yellow border.

I believe Skorpio wanted to provide some animation feedback to the user clickong on a Dice Button Action Button - Show the rolling Dice to indicate something has happened.

B.


Messages mailing list
Messages@forums.vassalengine.org
forums.vassalengine.org/mailman/ … engine.org

Post generated using Mail2Forum (mail2forum.com)

Maybe we can provide some
other way to achive the same thing.


J.

Which gives me this idea for a RFE :slight_smile:

Back in DOS and other programming languages / scripts I’ve toyed with they
all seem to universally have a method of pausing “x” whatever.

A wait state would be a very neat feature to have. we could then simulate
the changing state of pieces / components in a stop-gap motion cinematic
type of way etc…

As a trait layout goes it might look something like this:

Description: _______

Length in Sec. _____

Key Command to Invoke _______

Hotkey ______________


Messages mailing list
Messages@forums.vassalengine.org
forums.vassalengine.org/mailman/ … engine.org

Post generated using Mail2Forum (mail2forum.com)

Yep, I made a little die rolling animation. It looks still a bit odd.

But what I actually had in mind was a weapon fire animation, so that you could see which unit is active. :smiley:

The animation could be active only when the mouse cursor is over the
counter itself – or something like that. We should have some
animation capability.

With respect to JOGL, having animation is certainly possible. I don’t
see how it is more technically difficult than much else.

  • M.

On 08/02/2009, Skorpio messages@forums.vassalengine.org wrote:


Michael Kiefte, Ph.D.
Associate Professor
School of Human Communication Disorders
Dalhousie University
Halifax, Nova Scotia, Canada
tel: +1 902 494 5150
fax: +1 902 494 5151


Messages mailing list
Messages@forums.vassalengine.org
forums.vassalengine.org/mailman/ … engine.org

Post generated using Mail2Forum (mail2forum.com)

Thus spake Michael Kiefte:

Sure, but if we want that we have to implement it.

I wasn’t saying that animation is impossible, just that it won’t be displayed
using the Image you get when you load an animated GIF.


J.


Messages mailing list
Messages@forums.vassalengine.org
forums.vassalengine.org/mailman/ … engine.org

Post generated using Mail2Forum (mail2forum.com)

It’s certainly not trivial. We would have to add that functionality.

I’m working on a general solution to JOGL that’ll get us going quickly on this. I’m taking the longer road right now don’t I don’t have to use as many braincells later on. Hopefully, we should be able to get JOGL up and running transparently and then we can tweak it later.

I doubt everything will work first off though :frowning:

  • M.

Post generated using Mail2Forum (mail2forum.com)

Thus spake Michael Kiefte:

Does this mean that you’ve already started on the model-view separation?


J.


Messages mailing list
Messages@forums.vassalengine.org
forums.vassalengine.org/mailman/ … engine.org

Post generated using Mail2Forum (mail2forum.com)

Not at all. I wouldn’t really know where to start with that.

What I’m working on is extending com.sun.opengl.util.texture so that it is actually useful to us. This may or may not actually get used in VASSAL, but it’s worth doing and I would definitely like to see if it will work with VASSAL. If it doesn’t, then fine. If it does, then retrofitting VASSAL to work with JOGL will get a whole lot easier.

As for the model-view stuff, I’m really not sure how to go about that. That means going through every element that actually displays something and tearing it apart. Nothing will work until it’s all done, right?

  • M.

Post generated using Mail2Forum (mail2forum.com)

Thus spake Michael Kiefte:

It would mean going through every element that displays something, yes, but
I was intending to do this incrementally, not all in one go.


J.


Messages mailing list
Messages@forums.vassalengine.org
forums.vassalengine.org/mailman/ … engine.org

Post generated using Mail2Forum (mail2forum.com)

Sorry, I’m still thinking in terms of how JOGL works. Nothing in JOGL will work until everything is converted to doc/view.

I’m working on something that will make that less true (just sort of truthy).

  • M.

Post generated using Mail2Forum (mail2forum.com)