CSBuild Q & A
Posted: Tue Apr 15, 2003 6:55 pm
PitD has sent me the CSBuild documentation in PDF
format. Let me say that it is BEAUTIFUL. It is fortunate
that I was not in the mood to produce documentation;
I could never have made anything so nice.
In the document he implies some questions. I will try
to answer them publically because most of them have
a lot to do with the game itself as well as with the editor.
======================================
A compressed dungeon file. I had said that it was
LZW-like. I was confused. It is Huffman-like compression.
Very common byte values are represented by two bits,
less common by four bits, least common by (I believe)
ten bits. See Christophe's dungeon format document
for a precise algorithm.
I think the graphics and hint file employ an LZW-like
compression. See:
http://dogma.net/markn/articles/lzw/lzw.htm
======================================
Encryption.....PitD will not give up on this. So I will
explain. CSBuild can write an encrypted file. The
key is specified by the user at the time the file is
written. The purpose is to prevent players from peeking
at the dungeon using an editor. In order to play the
game you need a specially-compiled CSBwin that has the
key built into it. Every time I make such a CSBwin I
will try to hide the key in a different way. This
will prevent 'easy' access but is certainly not going
to stop the CIA or anybody with a few hours to spare.
=======================================
DSA State (Local|Global|Parameter B)
Lots to say here! About a small but important subject.
The DSA editor defines a 'State Machine'. When you
put a 'DSA Actuator' in a cell in the dungeon it
specifies which 'State Machine' is to be used and provides
two 'Parameters' and a four-bit 'State Field' for that
'State Machine'. The 'State Machine' can read and write
those 'parameters' and the 'State Field'. The 'Parameters'
are named 'A' and 'B' and usually would tell the machine
what door is to be opened, etc., etc., etc.
Now clearly a proper 'State Machine' needs to know what
state it is in! Under normal circumstances the 'State
Field' in the 'DSA Actuator' would be used to maintain this
state information. That is the 'Local' option. But you
object....I told you there could be unlimited states and
four bits is not sufficient. OK. I'll tell you what.
Select the 'Parameter B' option and then the state will be
kept in the second parameter field of the 'DSA Actuator'.
This is a 16-bit field. And of course that 'Parameter' becomes
useless as a parameter. But you can have 65536 states.
In both of the above cases, each 'DSA Actuator' defines
a 'State Machine', each with its own state.
Now it may be that you want a single 'State Machine' to
be scattered throughout the dungeon. There would be many
'DSA Actuators' that reference a single 'State Machine' with
but one state. There is nothing that this makes possible; but
it might make things easier. One thing that is easier is
that the 'State Machine' could be scattered over several
levels of the dungeon and sending it messages from switches
and pressure pads and so on would not require any sort of
inter-level message repeaters. In this case you select the
'Global' option. The downside of this is that if you want
more than one identical machine you must make multiple
copies using the DSA editor. The upside is that now you can
have 4294967296 states. But you object again.....I promised
unlimited states and 4294967296 is far from unlimited. Sorry.
Lunchtime. More tomorrow.
PAul
format. Let me say that it is BEAUTIFUL. It is fortunate
that I was not in the mood to produce documentation;
I could never have made anything so nice.
In the document he implies some questions. I will try
to answer them publically because most of them have
a lot to do with the game itself as well as with the editor.
======================================
A compressed dungeon file. I had said that it was
LZW-like. I was confused. It is Huffman-like compression.
Very common byte values are represented by two bits,
less common by four bits, least common by (I believe)
ten bits. See Christophe's dungeon format document
for a precise algorithm.
I think the graphics and hint file employ an LZW-like
compression. See:
http://dogma.net/markn/articles/lzw/lzw.htm
======================================
Encryption.....PitD will not give up on this. So I will
explain. CSBuild can write an encrypted file. The
key is specified by the user at the time the file is
written. The purpose is to prevent players from peeking
at the dungeon using an editor. In order to play the
game you need a specially-compiled CSBwin that has the
key built into it. Every time I make such a CSBwin I
will try to hide the key in a different way. This
will prevent 'easy' access but is certainly not going
to stop the CIA or anybody with a few hours to spare.
=======================================
DSA State (Local|Global|Parameter B)
Lots to say here! About a small but important subject.
The DSA editor defines a 'State Machine'. When you
put a 'DSA Actuator' in a cell in the dungeon it
specifies which 'State Machine' is to be used and provides
two 'Parameters' and a four-bit 'State Field' for that
'State Machine'. The 'State Machine' can read and write
those 'parameters' and the 'State Field'. The 'Parameters'
are named 'A' and 'B' and usually would tell the machine
what door is to be opened, etc., etc., etc.
Now clearly a proper 'State Machine' needs to know what
state it is in! Under normal circumstances the 'State
Field' in the 'DSA Actuator' would be used to maintain this
state information. That is the 'Local' option. But you
object....I told you there could be unlimited states and
four bits is not sufficient. OK. I'll tell you what.
Select the 'Parameter B' option and then the state will be
kept in the second parameter field of the 'DSA Actuator'.
This is a 16-bit field. And of course that 'Parameter' becomes
useless as a parameter. But you can have 65536 states.
In both of the above cases, each 'DSA Actuator' defines
a 'State Machine', each with its own state.
Now it may be that you want a single 'State Machine' to
be scattered throughout the dungeon. There would be many
'DSA Actuators' that reference a single 'State Machine' with
but one state. There is nothing that this makes possible; but
it might make things easier. One thing that is easier is
that the 'State Machine' could be scattered over several
levels of the dungeon and sending it messages from switches
and pressure pads and so on would not require any sort of
inter-level message repeaters. In this case you select the
'Global' option. The downside of this is that if you want
more than one identical machine you must make multiple
copies using the DSA editor. The upside is that now you can
have 4294967296 states. But you object again.....I promised
unlimited states and 4294967296 is far from unlimited. Sorry.
Lunchtime. More tomorrow.
PAul