Four-Ways Teleporters

Discuss Chaos Strikes Back, the "expansion pack" for Dungeon Master.
This forum may contain spoilers.
Forum rules
Please read the Forum rules and policies before posting.
Post Reply
User avatar
Paul Stevens
CSBwin Guru
Posts: 4318
Joined: Sun Apr 08, 2001 6:00 pm
Location: Madison, Wisconsin, USA

Four-Ways Teleporters

Post by Paul Stevens »

For those of you who have not figured out exactly how
those teleporters at the entries to the Four-Ways
operate.....I put a .BMP file at:
webpages.charter.net/pstevens1
filename = Trigger.zip
It shows how the pressure pads, timers, latches,
edge-detectors, and delays cooperate to make those
teleporters do what they do.

It is reassuring to know that no magic is involved. ;-)

I f anyone actually looks and wants to know what
the symbols mean....Post a followup question and I will
try to explain. These teleportes utilize many of the
mechanisms used throughout the DM and CSB.

PAul
prsteven@facstaff.wisc.edu
User avatar
ChristopheF
Encyclopedist
Posts: 1538
Joined: Sun Oct 24, 1999 2:36 pm
Location: France
Contact:

Re: Four-Ways Teleporters

Post by ChristopheF »

Here is that image
Image

I definitely think you should explain more, Paul. Tell us what are all those symbols and alphanumeric things!
Last edited by ChristopheF on Sat Oct 20, 2007 10:50 pm, edited 1 time in total.
User avatar
Paul Stevens
CSBwin Guru
Posts: 4318
Joined: Sun Apr 08, 2001 6:00 pm
Location: Madison, Wisconsin, USA

Re: Four-Ways Teleporters

Post by Paul Stevens »

OK. But there is no way I am going to type in enough
explanation to satisfy everyone on the first try. Anyone
who wants to know the whole story will have to interact
and ask more questions.

The diagram is in a form that I grew very familiar with in
the old days when my job was building computers out of
transistors. It represents an equivalent hardware
implementation of the software and data in CSB. The
diagram is a (very much) simplified form of what actually
exists in the program but the resulting function is the
same. Unless I made some mistakes. The diagram was
built painstakingly from the ASCII dump that you can get
from CSB for Windows. And it properly explains what I
see in the game.

The diagram is for only one of the four "Ways". So there
are actually four such diagrams for the "Junction".

The circles with hexadecimal numbers are time delays.
A message enters and after, for example 0x0E units of
time, the message leaves....headed in the direction of
the arrow. A unit of time is one-sixth of a second.

The semi-circles are AND-gates. The two inputs are on the
flat side and the resulting output is on the curved side.
The output is true if and only if both inputs are true. The
AND-gates with the 'Step' drawn in the interior are like
any AND-gates except that they are edge detectors.....
the output consists of a message when both inputs
become true. The time-delays can only operate on messages,
not "true" or "false". So, if, for example, one of the inputs is
true a second is false then when the second input becomes
true a message is generated. Nothing happens until at least
one of the inputs becomes false and then both become true
again. It only detects transitions (edges) from false to true.
I don't remember the numbers adjacent to the AND-gates.
They may be the index in the CSBGAME.DAT file of the
entriy performing the function.

You will see that the teleporters are enabled (The far right
AND-gate) when both latches are "Off".

The two squares on the far left are the pressure pads. They
generate a message when you step on the pad. (Other pads in
the game generate a message when you step off). The numbers
in the squares are the map coordinates.

The two squares in the middle are "latches". Each can be either
"On" or "Off". The output of these latches is the value of
the lines on their right-hand side. The names in the squares
are my attempt to make it understandable for me.
When they are "On" then the line from the top
is true and the line from the bottom is false. When they are
"Off" then the line from the top is false and the line from the
bottom is true. The latches are controlled by messages arriving
from the left side (or top-left). A message arriving at the top-
left turns the latch "On" and a message arriving at the
bottom-left turns the latch "Off".

That is all you need to know. Assuming you could make sense
of what I said. If you really want to understand, try drawing
a time-line on a piece of paper and drawing the state of each
of the components at each step of time. Start by stepping on
the pad at 10,F (10,15 in decimal). Then when you think you
know everything, try to find this structure in the ASCII DUMP.
That will deflate your ego for quite a while. It ain't easy.

And ask me if you get stuck. I just got stuck myself. I cannot
figure it out. I drew it about 18 months ago.
Oh, dear.....back to the ACSII dump listing.

PAul
prsteven@facstaff.wisc.edu
User avatar
Paul Stevens
CSBwin Guru
Posts: 4318
Joined: Sun Apr 08, 2001 6:00 pm
Location: Madison, Wisconsin, USA

Re: Four-Ways Teleporters

Post by Paul Stevens »

Well, some study (and turing on the TimerTrace (see the "Misc"
menu) has jogged my memory a bit.

The important thing I forgot was that when a message
arrives to turn a latch "on" or "off" it causes the attached
AND-gates to reevaluate their inputs and to produce
an output message if the both inputs are true. So they
are not strictly "edge-detectors" unless you think ....

Ah. A message has arrived to clear a latch. Even though the
latch is already clear, jostle the outputs a little bit so that
any attached AND-gates will be fooled into thinking that
the outputs have just changed.

With that understanding, the diagram is correct as it stands.

PAul
User avatar
beowuuf
Archmastiff
Posts: 20687
Joined: Sat Sep 16, 2000 2:00 pm
Location: Basingstoke, UK

Re: Four-Ways Teleporters

Post by beowuuf »

To clear the air about what these 'latches' and 'and gates' are, they are all one object - the wall objects with 5/85 hex.
Unlike normal wall objects, they ignore which way they (and so their graphics) are facing. All four faces are concidered all the time. The 3rd/4th byte records the state of the four faces, as each face can be on or off. A player cannot directly turn a face on or off, they are only altered by generated effects, such as from a floor pad.

Like an AND gate, only if all four faces (inputs) are 'on', it will generate its effect.
It's a little confusing, as there are four sets I've found (the flavour is wherther you can active certain faces with a close effect, or an open effect). And the hex isn't very clear - I have a copy of the hex vlaues and various states for four pads in my hex manual.

They are 'latched' in that if an effect allows all four faces to be on, the faces stay in that state (and so the effect will still be generated) until another effect switches one or more faces off, hence you can have constant weight effect tied to these pads (the original dungeon, level 2, where you need to flcik two levers to open a door).

They are 'edge triggered' in that it is the transition to this fully on state, not the fully on state itself, that allows the effect to generate. For example a pad like this with 5 0 (all faces on) is used in the puzzle room on level 6 of DM to hide the iron key...it doesn't open right away, it only activates (and toggles its graphic with an alcove containing the key) when the on state of one of the faces is reinforced with another trigger signal.
Was unable to (permenantly) kill off ian_scho (Haynuus), Ameena, oh_brother (Westian), money (Falkor), raixel (Petal) and Lord_Bones (Aurek) in the DM D&D game Time's Champions!

CONGRATULATIONS TO THOSE WHO MADE THE GAME WHAT IT WAS - GREAT!
User avatar
beowuuf
Archmastiff
Posts: 20687
Joined: Sat Sep 16, 2000 2:00 pm
Location: Basingstoke, UK

Re: Four-Ways Teleporters

Post by beowuuf »

Look at the junction of ways...there are three triggers in the initial floor area (the 7th and 8th bytes for target 0-30 and 9a) - you can spot the wall pads they point to used to control all the teleporters that make the junction possible. Since they are all in one place, all effects target the whole system, as Paul has shown.
The triggers are 1st pad and 3rd pad, a fast/slow open effect, targetting the west faces, with a delay of 7 on the 3rd pad.
The 2nd pad, a slow close, targetting north faces, with a delay of 7

How do you know what face the trigger targets? Well, the 7th byte should be a multiple of 40 to be default facing () is of course a multiple!). So if there is a +10, it's west instead, +20 it's south, and +30 its east.
What do I mean by fast and slow?
The effect is shown in the 5th byte...if its between 0 - 7f it happens instantaneously, if 80 - ff it happens normally.
The best wa yto show this is to hack the original dungeon, and go to the Librasulus trap at the front door. There is a set up here where a constant weight pad activates a teleporter so you CANNOT turn away from libby. However, if you add +80 to the 5th byte, you will find you could turn away, THEN the teleporter would activate to spin you back.

At the end of each way path, you will see another single trigger too. Each one is a slow open, with no delay, aimed at the west faces.

Now to the 10 objects in the actual teleporter controlling system. You can see 8 target the 8 teleporters (2 per way, 2nd - 9th) and 2 target back into the system (1st and 10th).
The 2nd - 9th all are the same...they all activate without delay, giving an open, constant weight effect to each teleporter.
The 1st, after a delay of 7, sends a fast close effect to the north face of the system
The 10th, after a delay of 7, sends a slow open effect to the north face of the system
All the pads have hex 85 1 - this means north/west faces are off, south and east faces are on, and all need close effects to activate a face (therefore open effects deactivate a face).
Was unable to (permenantly) kill off ian_scho (Haynuus), Ameena, oh_brother (Westian), money (Falkor), raixel (Petal) and Lord_Bones (Aurek) in the DM D&D game Time's Champions!

CONGRATULATIONS TO THOSE WHO MADE THE GAME WHAT IT WAS - GREAT!
User avatar
beowuuf
Archmastiff
Posts: 20687
Joined: Sat Sep 16, 2000 2:00 pm
Location: Basingstoke, UK

Re: Four-Ways Teleporters

Post by beowuuf »

So, what happens is this:

1) The system starts with:
North/west faces of the system off, all teleporters off
2) When you step into the JoW, it reinforces the off on the west face
3) After a delay of 7, the west face is turned on. Note that if this isn't your first time at the JoW, then this could turn on the entire system. It doesn't matter, as right after that the north face of the system is turned on, so now all the teleporters are on. Also, the two self directed objects are triggered.
4) So, after a delay of 7, the system reinforces the on of the north face, whiuch of course makes sure the self-targetting triiggers activate again. Then the system turns off the north face, which turns off all the teleporters!
5) After a further delay of 7, the self targetting objects activate again...as with 4, but this time of course all the teleporters are switched on again.

So in this way, as you can see the system keeps bouncing between 4 and 5, with the teleporters alternating between on and off with delays of 4 betwee ntoggles.
The only way to stop the system is
a) if you leave via a teleporter, and come back to the JoW...the off on the west face breaks the cycle of self-activation.
b) If you reach the end of one of the paths...the trigger there also switches off the west face, which breaks the cycle in the same way.

Umm, yeah..so that was my long explaination...hope that somehow goes in conjunction with Paul's diagram to show what is going on...

*cough*

so there you go, that was three long posts!
Was unable to (permenantly) kill off ian_scho (Haynuus), Ameena, oh_brother (Westian), money (Falkor), raixel (Petal) and Lord_Bones (Aurek) in the DM D&D game Time's Champions!

CONGRATULATIONS TO THOSE WHO MADE THE GAME WHAT IT WAS - GREAT!
User avatar
Paul Stevens
CSBwin Guru
Posts: 4318
Joined: Sun Apr 08, 2001 6:00 pm
Location: Madison, Wisconsin, USA

Re: Four-Ways Teleporters

Post by Paul Stevens »

What I call "Latches" you call "faces". In the software
business they are called "bits" and the messages set
or clear the "bits". In the hardware business they are
called "flip-flops" and the pulses arriving at the input
set and clear the "flip-flops". I called them "latches" to
try and split the difference. In the code my comments call
them "bits".

As you point out, the memory elements (latches, bits,
faces, whatever), the AND gates and the delays are
actually combined into a single element in the game.
In my code the comments refer to these as "Actuators".
You called them "wall objects" or "triggers", I believe.

I think you are wrong about the delay times. You are missing
a factor of two somewhere. The delay you called 7
should be 14. ("E" in hex) The "Timer Trace"
corroborates my version.

These can be used as "OR" gates as well as "AND" gates
by use of the (very famous) equation:

(a OR b) = NOT ((NOT a) AND (NOT b))
User avatar
beowuuf
Archmastiff
Posts: 20687
Joined: Sat Sep 16, 2000 2:00 pm
Location: Basingstoke, UK

Re: Four-Ways Teleporters

Post by beowuuf »

I was referencing the visible hex side, so you can only set a delay of 0 - 7, without knowing exactly what that relates to timing wise.

Like i aslo said, there are fast and slow activates, so this is probably where you get the factor of two coming in to play.
Hmm, unless the 5th bit of the 5th byte concatonates with the first 5 of the 6th to form the timing number..but that would be odd.

And yes, i think DM designers would have made it easier on themselves if they had made these basic pads NANDs not simply ANDs (though the ranges of inputs compenstaes and allows you to create the conditions for other logic like OR)
Still, the fact that you could construct sequential logic and sophisticated finite state machines very easily from NANDs would have been very cool...ah well
Was unable to (permenantly) kill off ian_scho (Haynuus), Ameena, oh_brother (Westian), money (Falkor), raixel (Petal) and Lord_Bones (Aurek) in the DM D&D game Time's Champions!

CONGRATULATIONS TO THOSE WHO MADE THE GAME WHAT IT WAS - GREAT!
User avatar
Paul Stevens
CSBwin Guru
Posts: 4318
Joined: Sun Apr 08, 2001 6:00 pm
Location: Madison, Wisconsin, USA

Re: Four-Ways Teleporters

Post by Paul Stevens »

No, that would not be odd. The delay is specified by the
bottom 3 bits of one byte and the topmost bit of the
next byte. Remember that in the Atari the bytes are in
big-endian order and are generally referenced as 16-bit
words rather than bytes.

Byte0Byte1Byte2Byte3Byte4Byte5Byte6Byte7

The delay is the bottom three bits of byte 4 and the
top bit of byte 5. In other words, in bits 7 through 10 of the
third word.

PAul
User avatar
ChristopheF
Encyclopedist
Posts: 1538
Joined: Sun Oct 24, 1999 2:36 pm
Location: France
Contact:

Re: Four-Ways Teleporters

Post by ChristopheF »

Here is another diagram from Paul Stevens:

Image

This is the functional diagram of one of the And/Or
"actuators" or "triggers". Each consists of four
memory elements, five configurable switches, and
a configurable delay. This is not simplified. This
is the whole thing.
Last edited by ChristopheF on Sat Oct 20, 2007 10:50 pm, edited 1 time in total.
User avatar
beowuuf
Archmastiff
Posts: 20687
Joined: Sat Sep 16, 2000 2:00 pm
Location: Basingstoke, UK

Re: Four-Ways Teleporters

Post by beowuuf »

I see about the words now...someone else mentioned the same thing in regards the 3rd/4th byte as actually being just one word too, when I tend to split it up into function and qualifier bytes

And oops, i said west face, when i meant east
D'oh
Was unable to (permenantly) kill off ian_scho (Haynuus), Ameena, oh_brother (Westian), money (Falkor), raixel (Petal) and Lord_Bones (Aurek) in the DM D&D game Time's Champions!

CONGRATULATIONS TO THOSE WHO MADE THE GAME WHAT IT WAS - GREAT!
User avatar
Paul Stevens
CSBwin Guru
Posts: 4318
Joined: Sun Apr 08, 2001 6:00 pm
Location: Madison, Wisconsin, USA

Re: Four-Ways Teleporters

Post by Paul Stevens »

I think the game designers have done something rather remarakable
here. (Unless they copied it from someone else who did something
remarkable). These "actuators" are implemented in a mere eight
bytes of memory. The "And/Or" actuators can serve as "AND", "OR",
"NAND", or "NOR" gates by configuring the 5 switches and/or (no
pun intended) turning the diagram upside-down in your head.

And what I have drawn here is just one of many possible functions
of an actuator. The same 8 bytes can be:
0 = Do nothing - Or a once-only that has been done already
1 = A simple switch that party can press
2 = ?
3 = party??
4 = ?? In an open room
5 = AND/OR - what I drew
6 = In a closed (stone) room a COUNTER
6 = In an open room this a monster generator
7 = ?
8 = In open room: Tests for party possessing object
8 = In Stone: A missile launcher
9 = ?
14 = Object Launcher
15 = Double object launcher

As you can see, I don't know everything there is to know. ;-)

And the possibilities are far from exhausted. In all likelyhood
the designers were limited by the size of memory and not
by their imagination or the capabilities of these "actuators".

PAul
User avatar
beowuuf
Archmastiff
Posts: 20687
Joined: Sat Sep 16, 2000 2:00 pm
Location: Basingstoke, UK

Re: Four-Ways Teleporters

Post by beowuuf »

Some additions (i'm copying the hex, not the decimal):

1 = for a floor pad, can be activated by anyone (including theron!)
2 = aclove activation (in wall)
3 = recoverable object activation (in walls)
4 = on floor, can be used for object activation
7 = activated by monster (floor)
9 = in wall, is for weapon shooters
a = in wall, is double spell shooter
B = as 4 for wall activtion, BUT object must be last in list
C = switch for party in wall, but must be last object in list
D = torch effect (object placed.removed from wall object
10 = swaps item in hand with item in wall.
11 = object activated wall object, wall object is destroyed along with item
12 = An ‘end game’ pad in walls
7F/FF = champion ‘mirror’
Was unable to (permenantly) kill off ian_scho (Haynuus), Ameena, oh_brother (Westian), money (Falkor), raixel (Petal) and Lord_Bones (Aurek) in the DM D&D game Time's Champions!

CONGRATULATIONS TO THOSE WHO MADE THE GAME WHAT IT WAS - GREAT!
User avatar
beowuuf
Archmastiff
Posts: 20687
Joined: Sat Sep 16, 2000 2:00 pm
Location: Basingstoke, UK

OT : level 12 DM, shifting pits

Post by beowuuf »

Since Paul has explained the Junction of Ways I thought I'd also mention the shifting pits in DM, probably the most complex part in the whole game (not that it is difficult, just everything else is even easier than it!)

There are simply 8 actuator pads, buried in a wall, all in the same tile so it creates a single system, pointing towards the four pits. There is one trigger when you first press the red cross door before the rotating pits that points to this system.

The 8 actuators are actually a mixture of all four types I mentioned..though actually they don't need to be, as far as I can tell!


Trigger: It is a close effect, targetted to the north face of the system

System: The eight objects are given in order. I've used binary for the two states, for North/East face. A 'o' beside it means the actuator needs an open effect to it's north face, x means close.

1) x '10'
2) o '00'
3) o '01'
4) x '11'

These first four target the four pits, with an open, needs constant weight effect. So if they are on (11) their respective pit is open. For some reason each of these are targettng east faces, but this doesn't matter to pits!

5) x '10' toggle to east faces of system
6) o '00' toggle to north faces of system
7) o '01' toggle to east face of system
8) x '11' toggle to north face of system

Each of the last four have a slight delay associated with them

So, what happens is the trigger effect will only affect the 1,4,5 and 8th objects, and even then it is only reinforcing the already on state of each one. However, as they are edge triggered, this is needed to get 4 and 8 to activate, and to remind all the rest that they aren't active.
So, what happens is the first pit remains open, all the other pits are shut off (the four pits start open).
As you can see, each pit trigger has a linked pad of the same type in the same state, that then affects the system

So after the delay (don't knwo the timing, think its '3' from the hex) then the north face of the system is toggeld, so now 3 and 7 are active, all others are disabled....so the next pit opens, and after a delay, another affect is generated int othe system by 7 so the east face of the system is toggled, so now only 2 and 6 is active, so another pit opens...and so on

by this alterante toggling of the ssytems faces, the stsyem cycles through the four states, and so opens each pit in turn
Quite ingenious really!
Was unable to (permenantly) kill off ian_scho (Haynuus), Ameena, oh_brother (Westian), money (Falkor), raixel (Petal) and Lord_Bones (Aurek) in the DM D&D game Time's Champions!

CONGRATULATIONS TO THOSE WHO MADE THE GAME WHAT IT WAS - GREAT!
User avatar
Paul Stevens
CSBwin Guru
Posts: 4318
Joined: Sun Apr 08, 2001 6:00 pm
Location: Madison, Wisconsin, USA

Re: Four-Ways Teleporters

Post by Paul Stevens »

It is certainly a good idea to give names to the four
memory elements in one of these "actuators. So that
we can describe them in speech and in writing. We
could call them:

0, 1, 2, 3
1, 2, 4, 8
A, B, C, D
pit, wall, stairs, door
104, 17, 87365, 12
day, night, morning, evening
Paul, Christophe, Antman, Beowuuf
up, down, left, right
fighter, ninja, wizard, priest
north, east, south, west
KU, DAIN, ROS, NETA

But it is my opinion that any but the first three of these
possibilities leads one's thoughts just a little bit astray.
They tend to imply some inappropriate meaning. The
messages that manipulate these things contain the
numbers 0, 1, 2, and 3. That is why I gave them those
names.

The memory elements take on a meaning in context
only. For example, in my first diagram I called them
"Disable" and "Inactive" (the other two were not used).

If we could get a copy of George's source code I bet we
could straighten out the editing of these things in a big
way. But I am NOT - repeat NOT - going to spend the
hundreds of hours reverse-engineering the great work
that George has done with DMute. We need 200-300
people to demonstrate in front of his house. ;-)

PAul
User avatar
beowuuf
Archmastiff
Posts: 20687
Joined: Sat Sep 16, 2000 2:00 pm
Location: Basingstoke, UK

Re: Four-Ways Teleporters

Post by beowuuf »

I always think of them as their states in bit terms .... like 0000 (going north clockwise to west), so by default that would be b0 - b3. *shrug* or as n, e, s, w

This is very ingenious configuable system btw... very cool : )
Was unable to (permenantly) kill off ian_scho (Haynuus), Ameena, oh_brother (Westian), money (Falkor), raixel (Petal) and Lord_Bones (Aurek) in the DM D&D game Time's Champions!

CONGRATULATIONS TO THOSE WHO MADE THE GAME WHAT IT WAS - GREAT!
Post Reply