CSBuild Q & A

Discuss Chaos Strikes Back for Windows and Linux, an unofficial port of Chaos Strikes Back to PC by Paul Stevens, as well as CSBuild, an associated dungeon editor.

Moderator: Zyx

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

CSBuild Q & A

Post by Paul Stevens »

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
User avatar
PicturesInTheDark
Arch Master
Posts: 1154
Joined: Mon Aug 26, 2002 4:47 pm
Location: Vienna, Austria

Re: CSBuild Q & A

Post by PicturesInTheDark »

Lots to update. Thank you, Paul.

Regards, PitD
User avatar
Paul Stevens
CSBwin Guru
Posts: 4318
Joined: Sun Apr 08, 2001 6:00 pm
Location: Madison, Wisconsin, USA

Re: CSBuild Q & A

Post by Paul Stevens »

I received the following from PitD on a message board
but he is gone now. So I will answer the question here.
=================================
Question:
Tried to make a starting level.
Only one champion mirror, no more. When I do it,
I cannot select the graphics.

Answer:
I assume that you tried to add an Actuator to the wall
where you wanted the Mirror to be. And you selected
"Champion Portrait" as the "Actuator Type". Then you
tried to give it a graphic but the graphic you wanted
was not listed.

Have you added the desired graphic to the list
of allowed graphics on that level?
==================================
If I misunderstood the question, sorry. Please try again.

And before you ask me to list all the available
graphics and then automatically add it to the list
for that level.......the answer is 'no'. You are going
to have to add it to the level manually before it can
be used.

PAul
User avatar
PicturesInTheDark
Arch Master
Posts: 1154
Joined: Mon Aug 26, 2002 4:47 pm
Location: Vienna, Austria

Re: CSBuild Q & A

Post by PicturesInTheDark »

Quite a clairvoyant sometimes, Paul...

Thanks for the answer, you guessed absolutely correct. I will try if it works at some later stage. By the way: I had no idea there was a kind of character editor in CSBuild - it looks nice and handy enough, although it's not too easy to find in the first place!

Apart from you guessing my next question correctly, let me ask instead why it is necessary to add graphics per level in general. I guess this is a game restriction, could you tell me a little bit more about it's limitations?

Regards, PitD
User avatar
PicturesInTheDark
Arch Master
Posts: 1154
Joined: Mon Aug 26, 2002 4:47 pm
Location: Vienna, Austria

Re: CSBuild Q & A

Post by PicturesInTheDark »

Hi Paul,

for the encryption you are only allowed to use numbers, correct? Up to how many can you use? Is the one who built the dungeon able to see the encrypted file or can't even he do it once encrypted? Is a special CSBwin needed to play it?

Regards, PitD
User avatar
Paul Stevens
CSBwin Guru
Posts: 4318
Joined: Sun Apr 08, 2001 6:00 pm
Location: Madison, Wisconsin, USA

Re: CSBuild Q & A

Post by Paul Stevens »

why it is necessary to add graphics per level

It is not necessary. But that is the way the
original DM/CSB runtime engine is built and
is the way the dungeon.dat/savegame.dat
file is built. Each level has a list of available
decorations.

Each level can have at most:
15 wall graphics
15 floor graphics
15 door decorations
2 door types

I will add a note on the "Level Info" page to
remind you of these limits.
=================================
Encryptions keys are a a series of decimal numbers
in the range 0 to 255. As many as you please.
It makes no sense to specify more than 256 of
them.

The decryption is a part of CSBwin. There is no
decryption in CSBuild. Each key will require a
specially compiled CSBwin. So even the dungeon's
builder cannot view it after it has been encrypted.
This last restriction may be relaxed when I forget
to save a plaintext version of my dungeon.
==================================
User avatar
Sphenx
On Master
Posts: 566
Joined: Sun Sep 09, 2001 11:23 am
Contact:

Re: CSBuild Q & A

Post by Sphenx »

About the limitations, there can be 15 monsters max in a level. But these limitations have meaning if we tell how many different graphics exist for each category:
there are 60 wall graphics, 9 floor graphics, 12 door graphics, 4 door types and 27 monsters.
But this means that for any level, we can have ALL floor and door graphics at the same time, so they could be already set by default, rather than setting them manually.
User avatar
ChristopheF
Encyclopedist
Posts: 1538
Joined: Sun Oct 24, 1999 2:36 pm
Location: France
Contact:

Re: CSBuild Q & A

Post by ChristopheF »

Maybe it is possible to build custom graphics.dat files with more graphics available for floors and doors. Has anyone tried? rain?
User avatar
PicturesInTheDark
Arch Master
Posts: 1154
Joined: Mon Aug 26, 2002 4:47 pm
Location: Vienna, Austria

Re: CSBuild Q & A

Post by PicturesInTheDark »

Hmm. If sphenx is correct with the door and floor graphics (which I'm sure he is), I'd rather suggest Paul to set these defaults, because what use is a manual load if all of them can be used anyway?

Something else: I've been following the chesting approaches regarding monster chesting (in chests or in other monsters). There seem to be contradictory views here, or maybe I have not understood properly. Is it yet possible to make these kinds of chesting (or one of them) without flaws?

If so, by doing what? Using one of the builders or hex editing?

Paul: The encryption means that you have to build a new CSBwin every time someone would use it and that the game could never be seen again after encryption, is that correct?

What good does it do, if that is the case?

Regards, PitD
User avatar
Paul Stevens
CSBwin Guru
Posts: 4318
Joined: Sun Apr 08, 2001 6:00 pm
Location: Madison, Wisconsin, USA

Re: CSBuild Q & A

Post by Paul Stevens »

How is encryption useful???

Wait three days and I will demonstrate.
User avatar
beowuuf
Archmastiff
Posts: 20687
Joined: Sat Sep 16, 2000 2:00 pm
Location: Basingstoke, UK

Re: CSBuild Q & A

Post by beowuuf »

Chesting monsters in chests is very buggy - sphenx has done it successfully, but with some bugs, i have never properly tried it, and anyone who tried it before and posted on the various boards had major crashes

So the advice would be play around with it yourself, but don't include it in a dungeon you are building until you've played around with it ALOT

chesting monsters in monsters is perfectly fine - don't chest multiple monsters at the same level though - a skeleton in a vexirk in a dragon is fine, a vexirk and skeleton in a dragon might create some weirdness - usually glictched graphics and trapped monsters when the dragon is killed until all the upper monsters are killed on the tile.

In general chesting in monsters is fine, and you can chest anything - monsters, floor tiles, etc
Just watch out for cloning objects - it's always best to chest the objects, then 'blank' the original object tile reference from the dungeon

Hex tricks are always best done in DMute, since its the only one wit ha hex editor, and doesn't test to see how much you are frelling up the code!
Of course, DMute is the worst for supporting other editors and game versions, so you really need to do this stuff first, or get a feeling for the dungeon format and actually use a proper hex editor to edit the raw dungeon.dat code!
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: CSBuild Q & A

Post by beowuuf »

Actually, I'm being stupid, DMBuilder chests anything in the target square and blanks it for you...sorry, I was rememberign there was a limit on it, but there's not, so use that instead!
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

Return to “Chaos Strikes Back for Windows & Linux (CSBWin) / CSBuild”