POV-Ray : Newsgroups : povray.binaries.animations : Push-Ball v1.0 example : Re: Push-Ball v1.0 example Server Time
20 Jul 2024 23:32:45 EDT (-0400)
  Re: Push-Ball v1.0 example  
From: Rune
Date: 12 Jun 2000 16:10:05
Message: <3945439d@news.povray.org>
"Greg M. Johnson" wrote:
> >  pb_goalrot   - Y Rotation of goals relative to bots' initial positions.
>
> What does this mean?

If it is set to 0, then bot X's goal is right behind bot X in the start of
the game.
Bot X must go forward and push the ball away from its goal.

If it is set to 180, then bot X's goal is rotated 180 degrees, so that it is
in the opposite side of the game field in the start of the game. Bot X must
then go around the ball and push the ball back again. This is more
challenging for the bots.

The drawing below may help if they are previewed correctly.
-----------------
         ______
        /      \
       |        |
goal X |X->O    |
       |        |
        \______/
 pb_goalrot 0
-----------------
    goal X
    ______
   / _    \
  | / V    |
  |X  O    |
  |        |
   \______/
 pb_goalrot 90
-----------------
  ______
 / ____ \
| /    \ |
|X  O<-' | goal X
|        |
 \______/
 pb_goalrot 180
-----------------

> >  pb_power     - The influence each bot has on its own movement.
> >  pb_inertia   - The influence inertia has on the bot's movements.
> >  pb_vibrate   - How much each bot vibrate (to add a random factor).
> >  pb_seednr    - Controls the random initial positions and vibrations.
>
> Ugh, these variables intimidate me!

They're not so bad... ;-)

pb_power makes sure that the bots can't change direction or speed faster
than they're allowed to. In real life it takes time for things to change
direction or speed. That's because our own strength/power/force is limited,
and in Push-Ball it's the same. The higher you set pb_power, the quicker the
bots can change direction and speed.

pb_inertia is the amount of inertia. Inertia is a "force" that keeps things
still, or keeps them in movement. In reality, when you push a ball it will
not stop rolling immediately when you stop pushing; it will keep rolling by
itself for a while. A heavier ball will have more inertia. It will be harder
to get in movement, and once it's rolling, it will also be harder to stop it
again.

pb_vibrate is just a feature I added to add a little random element to the
games. If two of the same bots were competing, and there were no random
factor, nothing would happen, and no one would win. With pb_vibrate it is a
little more likely that one of the bots will win, even if they are
identical.

pb_seednr. What's so intimidating about this?

> Q:  how would your algorithm allow some random movement?
> How does one declare a random seed: can it be done locally
> or can we access the "global" seed?

It can be done locally:

#declare MyBotSeed = seed(123);

When I think of it, the bots probably ought to have access to the frame
number, so they could do something like:

#declare MyBotSeed = seed(pb_frame);

That would be the only way to make random events that are different from
frame to frame.

I'll change the rules in the next version, so that the bots may access this
value (pb_frame).

Greetings,

Rune

---
Updated April 25: http://rsj.mobilixnet.dk
Containing 3D images, stereograms, tutorials,
The POV Desktop Theme, 350+ raytracing jokes,
miscellaneous other things, and a lot of fun!


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.