# repeatability of Havok simulations? Is it possible ? - Macromedia Director 3D

I got a nasty question. I designed a bowling lane, a ball and 10 pins. To let the ball roll I apply an impulse on it. Now here comes my problem. When I reset the whole world and apply an impulse in a certain direction with a certain power, I can for example hit 5 bowling pins. If I then reset the world again and apply exactly the same impulse as the first time, I get for example 7 bowling pins hit. Thats not the same simulation although I gave the ball the same impulse from the same location. I ...

1. ## repeatability of Havok simulations? Is it possible ?

I got a nasty question.

I designed a bowling lane, a ball and 10 pins.

To let the ball roll I apply an impulse on it.

Now here comes my problem.

When I reset the whole world and apply an impulse in a certain
direction with a certain power, I can for example hit 5 bowling pins.

If I then reset the world again and apply exactly the same impulse as
the first time, I get for example 7 bowling pins hit.

Thats not the same simulation although I gave the ball the same
impulse from the same location.

I need to find out if I can repeat the same simulation twice for a
multiplayer online bowling game. 1 player should play his ball, but
another player connected through a chatserver should be able to see
the animation on his/her pc too. This means that with the same
impulse, that PC should be able to show the same simulation on both
PCs.

Can this be done in some way?

Thanks for any help,

Bart Libert

Bart Libert Guest

2. ## Re: repeatability of Havok simulations? Is it possible ?

yes, its possible..
Make sure you're calling the havok step function the same number of times and it should work.
incremement a counter each time you call the step function see if they match..
mike
mike950 Guest

3. ## Re: repeatability of Havok simulations? Is it possible ?

strange.

If I do it here, then the first try my ball hits 5 bowling pins and
the second time it hits 7 or 8 and so on.

At start of simulation, I am at step 0, but after for example 100
steps I might expect the ball (which rolled because of an impulse) to
be in the same position ?

It seems NOT to be.

Are there maybe parameters which can influence it ?

Regards,

Bart

On Wed, 3 Aug 2005 02:17:07 +0000 (UTC), "mike950"
<webforumsusermacromedia.com> wrote:
> yes, its possible..
>Make sure you're calling the havok step function the same number of times and it should work.
>incremement a counter each time you call the step function see if they match..
>mike
Bart Libert Guest

4. ## Re: repeatability of Havok simulations? Is it possible ?

Hi Bart,

The version of Havok used in the Xtra is definitely not deterministic,
therefore you are not guaranteed the same simulation every time.

Mal
> I got a nasty question.
>
>
>
> I designed a bowling lane, a ball and 10 pins.
>
>
>
> To let the ball roll I apply an impulse on it.
>
>
>
>
>
>
>
> Now here comes my problem.
>
> When I reset the whole world and apply an impulse in a certain
> direction with a certain power, I can for example hit 5 bowling pins.
>
>
>
> If I then reset the world again and apply exactly the same impulse as
> the first time, I get for example 7 bowling pins hit.
>
>
>
> Thats not the same simulation although I gave the ball the same
> impulse from the same location.
>
>
>
>
>
>
>
>
>
> I need to find out if I can repeat the same simulation twice for a
> multiplayer online bowling game. 1 player should play his ball, but
> another player connected through a chatserver should be able to see
> the animation on his/her pc too. This means that with the same
> impulse, that PC should be able to show the same simulation on both
> PCs.
>
>
>
>
>
> Can this be done in some way?
>
>
>
> Thanks for any help,
>
>
>
> Bart Libert
>
Mal Guest

5. ## Re: repeatability of Havok simulations? Is it possible ?

try putting the dragparameters to the message window and see if they are
changing..
I've found they seem to change randomly but lately i haven't had that problem..
so try setting them to 0 before each step and see if that helps.
mike

mike950 Guest

6. ## Re: repeatability of Havok simulations? Is it possible ?

Hi Mal,
I emailed havok about that a couple years ago and the tech guy said it was deterministic..
mike
mike950 Guest

7. ## Re: repeatability of Havok simulations? Is it possible ?

i have a suggestion, that might look a bit bizare:

what if you'll take all the models transform objects, and copy it into a
non-Havok scene repeatedly?

that'll make it as a "playback", don't you think?

for the record, i havn't yet deal with Havok ...

bgsBS Guest

8. ## Re: repeatability of Havok simulations? Is it possible ?

Hi Mike,
> I emailed havok about that a couple years ago and the tech guy said it was deterministic..
It might be worth double checking on that... when I worked for them many
moons ago, I'm pretty sure that it wasn't.

If it is, then I'll get back into developing that pool game :)

Mal
Mal Guest

9. ## Re: repeatability of Havok simulations? Is it possible ?

hi mal,
yeah..i found the email from paco ..he did say it's deterministic..
I have an unfinished project that uses havok (similar to pool)...
you can see the deterministic behavior if you start up 2 browsers
and play against yourself (one catch ..you have to use 2 different browsers
like firefox and ie if it's on the same machine)
I guess it shares the data space and corrupts it)..but its at
[url]http://crokinole.biz/cb3d.htm[/url]
mike

mike950 Guest

10. ## Re: repeatability of Havok simulations? Is it possible ?

Hi Mike,
> yeah..i found the email from paco ..he did say it's deterministic..
Cool!
> I have an unfinished project that uses havok (similar to pool)...
> you can see the deterministic behavior if you start up 2 browsers
> and play against yourself (one catch ..you have to use 2 different browsers
> like firefox and ie if it's on the same machine)
> I guess it shares the data space and corrupts it)..but its at
> [url]http://crokinole.biz/cb3d.htm[/url]

'Tis time to get my old pool game code out too...

[url]http://www.candointeractive.com/prototypes/pool.htm[/url]

I had a version that tried to predict where the balls were going, and
would re-create the original setup and re-run the simulation a number of
times a second... visually, the same result occurred most of the time,
but every so often there was a glitch. I'll try to dig this out and upload.

Mal
Mal Guest

11. ## Re: repeatability of Havok simulations? Is it possible ?

yeah definitely! looks great Mal..thats the best interface to pool on the net i've seen!
mike
mike950 Guest

12. ## Re: repeatability of Havok simulations? Is it possible ?

Lets suppose I want to make a demo like a bowling game.

I create the models (a lane, 10 pins and a ball)
I declare the whole stuff in Havok. Plane = fixed, the rest moveable.

I then let the ball roll with an impulse.

Do I have to PIN down all moveable parts before repeating the
simulation or so ?

I really want to make a bowling game and a pool game, but it will be
multiplayer, but then I want of course the other player (who might be
in another country) to see the simulation of his opponent.

Any tips/hints ?

regards,

Bart
Bart Libert Guest

13. ## Re: repeatability of Havok simulations? Is it possible ?

Mal, the pool game looks great, i guess the same interface is used there too.

simething odd though, i can't see the English in there right. any suggestions?
bgsBS Guest

14. ## Re: repeatability of Havok simulations? Is it possible ?

bgsBS and Mike, thanks for the feedback on the pool UI.
> simething odd though, i can't see the English in there right. any suggestions?
It not working has nothing to do with me being Irish ;)

The English / spin hasn't been implemented yet, I dropped the
development on the game before getting it implemented.

I'll get it working ASAP though ;)

Mal
Mal Guest

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•