centipede movement in zzt++ 0.8.48

Discuss how totally awesome Bang! is here.

Moderator: Terryn

User avatar
Dr. Dos
OH YES! USE VINE WHIP! <3
Posts: 1772
Joined: Tue Mar 11, 2003 12:00 am
Location: Washington

Post by Dr. Dos »

zzt 2.0 make a world called PHYSICS
Visit the Museum of ZZT
Follow Worlds of ZZT on Twitter

Apologies for the old post you may have just read.
User avatar
wep
newcomer
Posts: 14
Joined: Fri Sep 24, 2004 7:05 am
Location: the netherlands

uuhmm

Post by wep »

commodore,

i probably worded it wrong, but i meant what you said.

another weird thing: if you place a head with a couple centipedes in a place with just one empty position -behind- the last segment, all segments turn into heads.

BUT

if you take the same space an keep an empty place in front of the head, the centipede will keep reversing.

AND

when you give the centipede no room to move at all, nothing happens. segments stay segments and don't become heads.

someone should visit E3 some time and nail tim for the source code. i'm sure he didn't lose it. he just pretended to in order to concentrate on new games.
wep
User avatar
wep
newcomer
Posts: 14
Joined: Fri Sep 24, 2004 7:05 am
Location: the netherlands

Post by wep »

On Centipedes

Heads are always on the move and never stop unless there is no room to move.
Heads normally only change direction when they are at a player axis
or when they hit an obstruction. Intelligence determines the odds of
whether it will move towards or away from the player.
Deviance will influence the number of times a head will change direction
for no reason at all.
A head with the lowest intelligence will mostly just go forward until
it hits a wall and then change direction.
A higer deviance will determine how often a head will change direction.
When a head with segments cannot move in any direction but towards
its segments, the last segments becomes the head and the head becomes
the last segment.
Segments that are not part of a list will become heads.
When a centipede's head is boxed in, but there is room behind the last segment,
all segments become heads.
When a centipede's head is surrounded by segments, all segments also become
heads.
When a centipede is boxed in and there is no room to go anywhere, it just sits
there without changing. Under water, the segments aren't linked to the head.
When you save a game a split second after starting it (with centipedes on the
board), you can catch zzt setting up the centipedes. This can be seen by
looking at the "next segment" and "previous segment" pointers. Right after
saving a new board, all these segment pointer have the value 0xFFFF. But, if
you save at exactly the right moment, you will see segments with "previous
segment" pointers with a value of 0xFFFE. After the centipede has taken a single
step, this is no longer visible. This proves that zzt sets up the centipedes
at the first move of the head.
When setting up centipedes, zzt uses clock wise and counter clock wise methods:
1. a head sitting half way and to the left of a column of segments,
will link the segments in the lower half of the column (clockwise)
2. a head sitting half way and to the right of a column of segments,
will link the segments in the upper half of the column (clockwise)
3. a head sitting half way and above of a row of segments,
will link the segments in the right half of the row (counter clockwise)
4. a head sitting half way and below a row of segments,
will link the segments in the left half of the row (counter clockwise)
Regardless of these directions, a segment adjacent to a linked centipede,
will sometimes be linked at the end of the centipede and sometimes go on
as a head.
wep
User avatar
Teabone
Posts: 28
Joined: Thu Jan 01, 1970 12:32 am
Location: Canada
Contact:

Post by Teabone »

I remember back when, when i was messing around in the editor with Tim's ZZT, by placing a scroll on a "hole/black Ice/Glitch place" and a centipede that came near the scroll suddenly made the scroll one of its segments! Was cool but then crashed lol
User avatar
wep
newcomer
Posts: 14
Joined: Fri Sep 24, 2004 7:05 am
Location: the netherlands

Post by wep »

hey cool...

that's what makes programming zzt++ difficult. tim is a fine programmer, but i think that he did a lot under pressure of time or something, because some stuff is just illogical.

i'll test with this and see what happens!

thanks,
wep
wep
Post Reply