centipede movement in zzt++ 0.8.48

Discuss how totally awesome Bang! is here.

Moderator: Terryn

User avatar
wep
newcomer
Posts: 14
Joined: Fri Sep 24, 2004 7:05 am
Location: the netherlands

centipede movement in zzt++ 0.8.48

Post by wep »

looks easy enough, but it ain't. centipede movement.

when you place a centipede on a board using the editor, you basically add a head and some adjacent segments and zzt turns it into a proper centipede. make a mistake, and the rogue segments turn into heads.

behind this is a rather nifty routine which figures out which segments belong to the head and which don't. zzt does this in its own peculiar way. for instance, adding a head surrounded entirely by segments, causes all segments to be turned into heads.

i've written a routine today which links all segments to a head, much the same way zzt does it. the source code is available on source forge through planetzzt++.com

i'll be adding the routines to move the centipedes (easy enough) and to turn segments into heads if need be.
wep
User avatar
wep
newcomer
Posts: 14
Joined: Fri Sep 24, 2004 7:05 am
Location: the netherlands

woops

Post by wep »

easy enough was the understatement of the week...

moving centipedes is a bitch. they don't move like regular creatures at all, which is what i was anticipating. centipedes have their own style, based on intelligence and deviance. but they never back into their segments (if any) and they like moving in straight lines, so they stick to certain direction. they have some sort of memory, is what i figure. regular creatures determine their next move in each game cycle. centipedes have to set a goal and remember it for a couple of cycles, so i've added runtime information to zzt++ which doesn't get saved into the world file and is expendable.

still have to work in intelligence and deviance, but i'm not saying it'll be easy anymore. hopefully i'll get centipedes moving by this weekend.

no wonder megazeux has no centipedes and plastic's centipedes don't move yet. no wonder....it's hard.
wep
Ando
2SEXY4U
2SEXY4U
Posts: 810
Joined: Sat Sep 04, 2004 1:08 am
Location: Oak Harbor, WA
Contact:

Post by Ando »

Good luck you top ranking soldier!!!
User avatar
TTTPPP
Latest band news: "There are no news!"
Posts: 108
Joined: Sat Oct 11, 2003 7:20 pm

Post by TTTPPP »

Centipedes have three possible next moves - straight, cw or ccw. If they can't do any of them then they turn around. I think they go straight by default, with a probability of turning depending on their deviance. The probability might be different if they are aligned, or in contact with the player (?)

This may be complete rubbish as I haven't opened ZZT for months :-(
User avatar
Quantum P.
Level 17 Accordion Thief
Posts: 1433
Joined: Fri Sep 12, 2003 1:41 am
Location: Edmonds, WA
Contact:

Post by Quantum P. »

Actually, I think you got most of it right. Deviance refers to the head's deviance from a straight-line path and intelligence refers to its ability to find the player. However, after running some tests, I found that it could go in any of the four directions that weren't blocked. For most heads, this <i>is</i> straight, cw, and ccw, because they are blocked from behind by the segments that follow them. When I allowed a single head to wander around, I found that it could reverse direction even if it was not blocked on all other sides. The deviance of a head probably refers to the probability on any given cycle of it choosing a new direction.

You're right that alignment has an effect on the head. If the player is at the far corner of the board, the centipede won't chase after him, no matter how high the intelligence level is. However, as soon as the player walks past the head of the centipede (or vice versa), the head begins walking in the direction of the player. Intelligence might be the probability of the head changing direction if it is aligned with the player (or possibly the probability of checking to see if it is aligned; I don't know if it would matter which).

Now we just need to find the probabilities, assuming all is correct so far.
User avatar
Flimsy
wacky morning DJ
Posts: 244
Joined: Fri Jul 09, 2004 11:23 pm
Location: The bottom of space
Contact:

Post by Flimsy »

Image
It seems unlikely that this deeply unsatisfactory situation will be resolved by a new attempt to answer the old question; instead, as has been suggested by some of the most thoughtful students, we should expect to find that some part of the conceptual landscape in which this problematic entity resides must be reconstructed before it will come into focus.
User avatar
wep
newcomer
Posts: 14
Joined: Fri Sep 24, 2004 7:05 am
Location: the netherlands

...

Post by wep »

i programmed zzt++ now to only change direction:
a. if the head is aligned with the player
b. the head runs into something
c. the head is "being deviant"
otherwise, it'll just go straight.

then, based on it's intelligence it will move away from or toward the player. i haven't noticed a "sensitivity" factor yet. probably the head only responds to the player if it's close enough.

the only other situations are those where the head runs into a place where it can't move anywhere but back. it will reverse completely.

when you surround a head with segments, it doesn't link to any of them. all segments turn into heads. that's something i have to look into as well.

have you guys ever seen a clone with correct centipede movement? i know plastic doesn't have it....
wep
Ando
2SEXY4U
2SEXY4U
Posts: 810
Joined: Sat Sep 04, 2004 1:08 am
Location: Oak Harbor, WA
Contact:

Post by Ando »

Hey woah I just looked at some archived zzt.org thingies from like 2001 and it seems like you were a big man then. I didn't know that you were an oldbie and whatnot.

In other words GET FIST'D BITCHEZ
User avatar
wep
newcomer
Posts: 14
Joined: Fri Sep 24, 2004 7:05 am
Location: the netherlands

yup

Post by wep »

i am not new.

i am old.
wep
User avatar
FSFunky
Fergalicious
Posts: 382
Joined: Wed Jan 14, 2004 11:52 am
Contact:

Post by FSFunky »

oh ando you're so random and funny!
User avatar
Commodore
fgsdfs
Posts: 2471
Joined: Wed Mar 12, 2003 5:44 pm
Location: :noitacoL
Contact:

Re: ...

Post by Commodore »

wep wrote:i programmed zzt++ now to only change direction:
a. if the head is aligned with the player
b. the head runs into something
c. the head is "being deviant"
otherwise, it'll just go straight.

then, based on it's intelligence it will move away from or toward the player. i haven't noticed a "sensitivity" factor yet. probably the head only responds to the player if it's close enough.
I'm not sure it works that way. I think the slider "deviant" increases the rate at which the head will decide to change direction. When it comes to decide, its intellegence judges how often it takes a seek direction instead of a random one. Although you do seem to be right, a intellegent head will seem to make a sharp turn whenever alligned with the player.

Nanobot should be contacted. :O
*POW* *CLANK* *PING*
User avatar
Commodore
fgsdfs
Posts: 2471
Joined: Wed Mar 12, 2003 5:44 pm
Location: :noitacoL
Contact:

Re: ...

Post by Commodore »

wep wrote:i programmed zzt++ now to only change direction:
a. if the head is aligned with the player
b. the head runs into something
c. the head is "being deviant"
otherwise, it'll just go straight.

then, based on it's intelligence it will move away from or toward the player. i haven't noticed a "sensitivity" factor yet. probably the head only responds to the player if it's close enough.
I'm not sure it works that way. I think the slider "deviant" increases the rate at which the head will decide to change direction. When it comes to decide, its intellegence judges how often it takes a seek direction instead of a random one. Although you do seem to be right, a intellegent head will seem to make a sharp turn whenever alligned with the player.

Nanobot should be contacted. :O
*POW* *CLANK* *PING*
User avatar
Aplsos
ill make a meal of you
Posts: 429
Joined: Fri Jan 23, 2004 3:06 pm
Location: beautiful downtown joelville
Contact:

Post by Aplsos »

no, he shouldn't.

he should never be contacted.
r
User avatar
Dr. Dos
OH YES! USE VINE WHIP! &lt;3
Posts: 1772
Joined: Tue Mar 11, 2003 12:00 am
Location: Washington

Post by Dr. Dos »

boknsos wrote:no, he shouldn't.

he should never be contacted.
Visit the Museum of ZZT
Follow Worlds of ZZT on Twitter

Apologies for the old post you may have just read.
Ando
2SEXY4U
2SEXY4U
Posts: 810
Joined: Sat Sep 04, 2004 1:08 am
Location: Oak Harbor, WA
Contact:

Post by Ando »

Wouldn't it be great if we could just ask Tim Sweeny how the damn thing works?

Too bad that even he probably wouldn't remember (or care, for that matter).
Post Reply