Page 1 of 1

Advanced running object

Posted: Thu Nov 27, 2003 8:56 pm
by Jotz
Directions:

1)Make a board with random walls all over the place
2)Put a bunch of objects on the board with this code:

[start of code]

@scared
#cycle 1
:loop
/opp seek
#if alligned if blocked e /rnd
#if alligned if blocked w /rnd
#if alligned if blocked n /rnd
#if alligned if blocked s /rnd
#if blocked w if blocked n /rnd
#if blocked w if blocked s /rnd
#if blocked e if blocked n /rnd
#if blocked e if blocked s /rnd
#loop
:touch
#become red fake

[end of code]

Watch as you see how hard some of them are to catch because of this advanced AI.

Posted: Fri Nov 28, 2003 3:31 am
by Commodore
I'm not sure I understand the purpose of the code involving the #alligned commands. If they're blocked and aligned? And catching a cycle 1 object is hard anyways, they move as fast as the player can go.

Posted: Fri Nov 28, 2003 3:40 am
by Jotz
The /rnd for all of them create a more life-like run away movement so they're harder to catch. And the #if alligned codes are for if the object is blocked in the direction its running from you. The #if blocked codes are for when the object is trapped in a corner.

Posted: Fri Nov 28, 2003 3:44 am
by Commodore
I think I see...

If the contact conditional was added as well it would make it harder.

I seem to remember something about how many non-movement/action commands were executed in a cycle, but I forgot the number. maybe 17?

Posted: Fri Nov 28, 2003 3:34 pm
by MadTom
Jotz wrote:The /rnd for all of them create a more life-like run away movement so they're harder to catch. And the #if alligned codes are for if the object is blocked in the direction its running from you. The #if blocked codes are for when the object is trapped in a corner.
Don't forget that /rnd is more likely to go east/west than it is north/south. For 'pure' random movement, you'd need /rndp rndne. It'd also probably be better to replace the slashes with question marks for a TRY command, so that the object doesn't stall if it's blocked in the random direction it moves.

Posted: Mon Dec 01, 2003 6:40 pm
by 464
Madtom is so smart.

Posted: Mon Dec 01, 2003 10:09 pm
by Dr. Dos
MadTom is PERFECT.

Saying that makes him sad :\

Posted: Tue Dec 02, 2003 2:31 am
by Ryan Ferneau
MadTom is PERFECT DARK.