DSA questions

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
Zyx
DSA Master
Posts: 2592
Joined: Mon Jun 05, 2000 1:53 pm
Location: in the mind
Contact:

DSA questions

Post by Zyx »

About editing DSA:

1) What does the "Edit in Big Wndow(Sic)" check?

2) I think there is a possible confusion between the DSA state (from 0 to 999) and and the 2 bits position of this state (from 0 to 3). They should be explicitly differentiated with different names.

3) I probably already asked for this: could the help dialog be a multiline textbox or an editbox so I can copy and paste the help?
Another solution would be making the help dialog modeless.
For now I can´t select all the text, and I have to close the dialog to get back to the DSA window.

4) Is it possible to add a comment after each line of commands?

5) Am I right to assume that a stack operation like &= gives a result of true or false?

6) State 5C0 of the money changer has the command F alone:
F (fetch) needs 4 parameters. I guess F alone will use the values in the stack, right?

7) There is no description of the <depth> syntax.

8) For the money changer, I can´t figure the way it works once it has reached the F command at line 5C0. I guess I am predicting wrong values for the stack. Could you tell me the values of the stack the first time the DSA reaches the 5C0 line?

9) For the examples in the help dialog, could you give more letters for operations like pick and roll, so their effects is more obvious.

10) What does the &SHIFT (x<<y) operation?
User avatar
Paul Stevens
CSBwin Guru
Posts: 4322
Joined: Sun Apr 08, 2001 6:00 pm
Location: Madison, Wisconsin, USA

Re: DSA questions

Post by Paul Stevens »

Ooooooo! Lovely. Questions. Suggestions! Thanks.

1)Edit in big window? No idea! Hmmm. I think at one time
I wanted to enable a way to have a 'Full-page' editor for
each state instead of just a single line per state. But I don't
see how that check-box is going to help. I'll look into it.

2)"State" versus "Position". The state machine's states simply
MUST be called 'states'. I don't think I ever refered to the
'positions' as states. Tell me where I did and I will change it.

3)Editbox for help text. I already promised to do this and
never got around to it. I will try again.

4)Comments on lines? That is hard. Those lines are not stored
in the dungeon file as ascii....they are stored as compiled, binary
code. What you see has been de-compiled from the binary. Comments
would be very useful. I wrote it down. Perhaps something
clever will occur to me.

5)Yes...boolean operations return true or false.

6)F ("FETCH") uses parameters from the stack. That is what
the parenthses are supposed to indicate. The definition is
incomplete as it does not show the result. The syntax should be
Operation ( parameters ... result).
I will fix it.

7)<Depth> not documented... I will fix that. It is the
index of an item in the list of objects in a cell. The first
is zero, the second is one, etc.

8)The Money Changer is a very complicated program to write in
such a low-level language. Before I started, I produced detailed
diagrams to lead the way. I offered those diagrams to any
interested party. I will interpret your question as expressing
such an interest. You will find the diagrams in the
CSBwin/documentation folder at dianneandpaul.net.
The Money Changer is much more complicated because it is intended
to be very general. I am extremely impressed that you are able
to ask an intelligent question from looking only at the code.
The diagrams will help immensely.

9)Pick and Roll are such standard Forth operations that I thought
any schoolboy would need no documentation! :-) Well, maybe ;-) :-)
Sure, I will put in a couple of more examples.

10) Shift. Shift the binary bits of a number left or right.
examples:
010001 << 1 yields 100010
101100 >> 1 yields 010110
101100 >> 2 yields 001011

Another way of looking at it:
Left shift multiplies by a power of two. 3 << 2 = 12
Right shift divides by a power of two. 12 >> 2 = 3

[Eighteenth try]
User avatar
Paul Stevens
CSBwin Guru
Posts: 4322
Joined: Sun Apr 08, 2001 6:00 pm
Location: Madison, Wisconsin, USA

Re: DSA questions

Post by Paul Stevens »

I put CSBuild 0.782 at dianneandpaul.net. Mostly it
provides a way to copy/paste DSA help text:

--Copy/paste from DSA help window.
--Clarify help for DSA Pick and Roll operations.
--Repair help for DSA Fetch operation and add some discussion.

And these changes for version 0.780 that may not have
been noted here:

--Allow use of Page-up and -down during target selection.
--List status of Trick Walls in right-side text.
--Allow placement of Trick Wall on Solid Wall.
--Allow placement of Door on Solid Wall.
--Mark Party location with red cross.
--Allow searching for clothing items.
--List status of Pits in right-side text.
--Pits are open by default.

[Sixth try - Double Bogey]
Erik Svanberg

Re: DSA questions

Post by Erik Svanberg »

I have a Wishlist for CSBuild.

1. Some more windows should be resizable.
When I run CSBuild through wine in linux some text (and buttons)
is not visible within the borders. Here's a screenshot for clarity:
http://www.acc.umu.se/~svanberg/browse_shot1.png

I belive this is easily fixed if the window were resizable.


2. When a pit is created then an empty cell is automaticly created on the
level beneth.


3. Control-enter does not line-break the writings on the wall in linux.
Instead, wine behaves as if I had pressed enter alone. Would it be possible
to designate line breaks with a forward slash "/" as well?


4. The ability to move an item from one cell to another with the editor,
without deleting it an redefining it.
User avatar
Paul Stevens
CSBwin Guru
Posts: 4322
Joined: Sun Apr 08, 2001 6:00 pm
Location: Madison, Wisconsin, USA

Re: DSA questions

Post by Paul Stevens »

1) You say "MORE of the windows should be
resizable.". But NONE of the windows are
resizeable. Are they? The main window can
be made smaller but the contents stay the same
size. That will not help you.

That sample window is a dialog....When I set the
dialog to 'resizing', changing the size only changes
the size of the window, not the contents. I will
make a CSBuild with the 'Resizing' set to see if it
helps you. But I don't understand how it would.

2) Empty cell created below pit? Strange...I will check.

3) Sure...why not.

4) Cut and paste have been promised but never implemented.
I think I can do it. I plan to have a 'clipboard stack' if all
goes well. And a way to look at the contents of the 'clipboard
stack'.

[First attempt]
User avatar
Zyx
DSA Master
Posts: 2592
Joined: Mon Jun 05, 2000 1:53 pm
Location: in the mind
Contact:

Re: DSA questions

Post by Zyx »

2)" I don't think I ever refered to the 'positions' as states. "
Yes, the problem is that the positions are never refered in CSBuild, so if the user doesn't know by these forums what are these numbers from 0 to 3, he or she will probably guess wrong.

6) I suppose an operation like Fetch uses the value from the stack from the top to the bottom. So the <depth> value would be the topmost item. Am I right?

8) Alright, I'll check the documentation. Thanks for the changes by the way. Now I can't load and edit all my dungeons!

9) I don't even know what Forth is... I guess something like stack language?


10) Oh, I forgot to ask (or I forgot the answer): What does the skill check in the actuators dialogs?
User avatar
Paul Stevens
CSBwin Guru
Posts: 4322
Joined: Sun Apr 08, 2001 6:00 pm
Location: Madison, Wisconsin, USA

Re: DSA questions

Post by Paul Stevens »

2) Every target has the word "position" along with the
x and y coordinates. The DSA has 'positon' as part of
'location' and in 'position masks'. So what do you mean
that CSBuild never references 'position'?

6) I hope I listed the parameters in the order they are to
be placed on the stack. So that Depth is NOT the top....there
are three values on top of it. The <object type mask> is the
topmost. This is the way it should be. If it is not then
please let me know and I will change the documentation.
This notation is consistent with the (...x y z) notation where
z is on the top.

8) What????? You cannot load your dungeons with the new
version???? That is criminal. I won't stand for it. These things
have GOT to be backward compatible. If you have a dungeon
that can be loaded with an old version but not the new version
please get it to me so I can fix the problem.

9) One of the effects of an actuator can be to adjust the
player's skill level. See some of the actuator documentation
at dianneandpaul.net.
User avatar
Paul Stevens
CSBwin Guru
Posts: 4322
Joined: Sun Apr 08, 2001 6:00 pm
Location: Madison, Wisconsin, USA

Re: DSA questions

Post by Paul Stevens »

The Linux, truncated window problem......
That example you sent is a dialog that
I resized dynamically at runtime. I took that code
out and simply made it as large as it could
possibly need to be. Perhaps that will help.
If not, we will try something else.

See version 0.783 at dianneandpaul.net.
User avatar
Zyx
DSA Master
Posts: 2592
Joined: Mon Jun 05, 2000 1:53 pm
Location: in the mind
Contact:

Re: DSA questions

Post by Zyx »

2)
-> So what do you mean that CSBuild never references 'position'?
What I meant is that you have some words "position" on one side, and some "C0,T0,S0, C1, etc" on the other side. I saw no explicit link between the two, so the user is forced to guess.


8) Oh my god, my sentence looked awfully ironical!
It was a typo, I meant:
"Thanks for the changes by the way. Now I CAN load and edit all my dungeons!"
Sorry for the false alert!

9) When everything else has failed... read the documentation :-)
Yes, it is time I read carefully all the documentation on your site.
User avatar
Paul Stevens
CSBwin Guru
Posts: 4322
Joined: Sun Apr 08, 2001 6:00 pm
Location: Madison, Wisconsin, USA

Re: DSA questions

Post by Paul Stevens »

The C0, T0, S1 business.....Yes, I suppose that I
have never made it clear how you produce these
messages with the short, cryptic names. I'll try
to rectify that.
User avatar
Zyx
DSA Master
Posts: 2592
Joined: Mon Jun 05, 2000 1:53 pm
Location: in the mind
Contact:

Re: DSA questions

Post by Zyx »

1) For the stacks operations, correct me if I'm wrong:
1a) I assume that each time a stack value is used by an operation (example: Fetch), the value(s) is(are) erased.
So Fetch would consume the four topmost values and leave a new value (the ID).
1b) I assume the boolean stack operations consume the two values and leave a boolean value.
1c) I assume an IfElse consume the (boolean) topmost stack value.

1d) At line 6C0 of the money changer, there is a Pick followed by an IfElse. So I guess the Pick should have copied an boolean value to the top of the stack.
But the only boolean value that could have appeared is with the &= at the end of the 5C0, which is followed by an Ifelse... And I assumed an IfElse operation consume the stack value...
So once again I'm confused.

1e) Am I right to understand POKE as: "replace nth value with 0th value, then erase 0th value" ?

2) When editing a the DSA (money changer), I put the cursor on the S0 line (or any other) and then press the arrow to view another state: I got an error: "Sorry - Fix your program before selecting another state"
This won't happen if I put the cursor on the display state textbox before pressing the arrow. But it was not obvious!
User avatar
Paul Stevens
CSBwin Guru
Posts: 4322
Joined: Sun Apr 08, 2001 6:00 pm
Location: Madison, Wisconsin, USA

Re: DSA questions

Post by Paul Stevens »

The definition of an operation shows the stack before and
after. Obviously, &ROLL does not consume its parameters,
whereas &+ consumes two parameters and adds one result.
======================================
1e) Am I right to understand POKE as: "replace nth value with 0th value, then erase 0th value" ?

That seems like a correct way to say it in English.

What does 0 &POKE do? I don't know.....don't try it.
======================================
1c) I assume an IfElse consume the (boolean) topmost stack value.

Yes. I will change the Help to indicate so.

IfElse (<boolean condition> .. )
?[<J|G>[<state>][<column>]][:<J|G>[<state>][<column>]]
======================================
1d) At line 6C0 of the money changer

There is no type-checking whatsoever. Any integer can be
interpreted as a boolean. If it is non-zero then it is true and
if it is zero then it is false.

Along these lines: I think I may have said that the logical
AND and logical OR operation were boolean operations. They
are not.....they are bitwise AND and OR. The answer can be
interpreted as a boolean. But it is just an integer like any
other integer. I am speaking of the &AND and &OR.

===================================
This happens to me, also. The whole business of trying to
confine you to a 'broken' program statement (so that you are
forced to fix it before doing something else, avoiding multiple
broken states) has become a real struggle because of the
way the Microsoft's software handles the 'Gain Focus' and
'Lose Focus' messages. But I will try to fix it without breaking
too many other things.
User avatar
Zyx
DSA Master
Posts: 2592
Joined: Mon Jun 05, 2000 1:53 pm
Location: in the mind
Contact:

Re: DSA questions

Post by Zyx »

the 'Gain Focus' and 'Lose Focus' messages.

Now that I know that I must click on the show state textbox before moving to another state, it is not a problem. The problem is for the users who don't know it.
So if it is too time consuming to solve the focus problem, then you may consider adding a "Click here before choosing a new state" label...
User avatar
PicturesInTheDark
Arch Master
Posts: 1154
Joined: Mon Aug 26, 2002 4:47 pm
Location: Vienna, Austria

Re: DSA questions

Post by PicturesInTheDark »

About the pit + empty space below... I seem to remember asking about that since CSBuild at a time reported an error when pits were placed and the level below was not yet edited - naturally. Maybe it was during the course of this conversation that you implemented an "automatic" empty space below a pit placed. Not sure though.

Regards, PitD
Post Reply

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