Background Graphics
Moderator: Zyx
Forum rules
Please read the Forum rules and policies before posting.
Please read the Forum rules and policies before posting.
- Paul Stevens
- CSBwin Guru
- Posts: 4318
- Joined: Sun Apr 08, 2001 6:00 pm
- Location: Madison, Wisconsin, USA
I've got it.......!!!!!! The final solution.
You can provide as many graphics and masks as you
please. 500. 1000. 5000. And you define the order
in which they are drawn.
You provide a table that says for each of the 5000 masks:
"Draw this if wall segment n exists (or does not exist) AND
wall segment m exists (or does not exist). For example,
the wall immediately in front of the party might be defined
by three masks (There are other ways to do it!):
Draw the main wall with straight edges if the wall directly
in front exists.
Draw an irregual extension to the left if the front wall
exists and the left wall does not exist.
Draw an irregular extension to the right if the front wall
exists and the right wall does not.
All this information would be in the wall mask graphic.
Then I can start to implement before you decide how you
want the graphics to work. And you can have very simple
cases of straight edges if you so choose. Or you can have
very complicated rules if you so choose.
All I need to do to start the implementation is to number the
walls and I can do that by assuming an extremely conservative
estimate of which wall segments will be of interest. You will
probably not use them all.
You can provide as many graphics and masks as you
please. 500. 1000. 5000. And you define the order
in which they are drawn.
You provide a table that says for each of the 5000 masks:
"Draw this if wall segment n exists (or does not exist) AND
wall segment m exists (or does not exist). For example,
the wall immediately in front of the party might be defined
by three masks (There are other ways to do it!):
Draw the main wall with straight edges if the wall directly
in front exists.
Draw an irregual extension to the left if the front wall
exists and the left wall does not exist.
Draw an irregular extension to the right if the front wall
exists and the right wall does not.
All this information would be in the wall mask graphic.
Then I can start to implement before you decide how you
want the graphics to work. And you can have very simple
cases of straight edges if you so choose. Or you can have
very complicated rules if you so choose.
All I need to do to start the implementation is to number the
walls and I can do that by assuming an extremely conservative
estimate of which wall segments will be of interest. You will
probably not use them all.
- Paul Stevens
- CSBwin Guru
- Posts: 4318
- Joined: Sun Apr 08, 2001 6:00 pm
- Location: Madison, Wisconsin, USA
OK. Here is what I propose. Each skin will accomodate
an arbitrary number of 'Computation Nodes' which will be
general boolean functions with up to four inputs. Each
floor, middle, ceiling, and wall mask graphic can accomodate
an arbitrary number of masks. Each mask will define which
boolean variable allows it to be drawn. All the masks will
be drawn in the order they appear so that you can decide
the order. The masks will also be able to trigger the
drawing of a cell's contents or a wall's decorations.
I think this will allow us to do things like put the moon in the
southern sky. Or to draw a path in the grassland (like
you see in 'Crusaders of the Dark Savant'). Or to draw
the four sides of a Coke machine (my apologies to purists)
from four directions.
Mostly, it is designed to be a bit open-ended so that it can
accomodate things we have not yet thought of. I am sure
that youse folks will think of something new to challenge it.
This will break Charlatan75's dungeon. But most of his work
will fit right into the new scheme.
Any serious objections? Stupendous suggestions? Cries of
fear? Comparison to DSAs? Too good to be useful? Overkill?
The computation nodes are the only part that I might have to
help you with, I think. But not because of complexity....just
unfamiliarity.
an arbitrary number of 'Computation Nodes' which will be
general boolean functions with up to four inputs. Each
floor, middle, ceiling, and wall mask graphic can accomodate
an arbitrary number of masks. Each mask will define which
boolean variable allows it to be drawn. All the masks will
be drawn in the order they appear so that you can decide
the order. The masks will also be able to trigger the
drawing of a cell's contents or a wall's decorations.
I think this will allow us to do things like put the moon in the
southern sky. Or to draw a path in the grassland (like
you see in 'Crusaders of the Dark Savant'). Or to draw
the four sides of a Coke machine (my apologies to purists)
from four directions.
Mostly, it is designed to be a bit open-ended so that it can
accomodate things we have not yet thought of. I am sure
that youse folks will think of something new to challenge it.
This will break Charlatan75's dungeon. But most of his work
will fit right into the new scheme.
Any serious objections? Stupendous suggestions? Cries of
fear? Comparison to DSAs? Too good to be useful? Overkill?
The computation nodes are the only part that I might have to
help you with, I think. But not because of complexity....just
unfamiliarity.
- Charlatan75
- Apprentice
- Posts: 59
- Joined: Mon Nov 10, 2003 2:32 pm
Hello!
Hmmm... I must say that it sounds very interesting!
I would like to ask a (stupid?) question :
If I draw a chair for example, and would like to be able to place it wherever I want, facing the direction I want - will I have to design 4 different skins for this chair (one facing North, one facing East...) or will one skin be sufficient (is there a possibility to say : "this chair is facing East and this one is facing North" for example)?
I thought about this question because of the Coke Machine... (it's right that there should be one in the Hall of Champions, because they often ask for a drink when you re-incarnate them, and it seems that they don't like water... Hmmm... Wine should give good results). ^^
Charlatan75
Hmmm... I must say that it sounds very interesting!
I would like to ask a (stupid?) question :
If I draw a chair for example, and would like to be able to place it wherever I want, facing the direction I want - will I have to design 4 different skins for this chair (one facing North, one facing East...) or will one skin be sufficient (is there a possibility to say : "this chair is facing East and this one is facing North" for example)?
I thought about this question because of the Coke Machine... (it's right that there should be one in the Hall of Champions, because they often ask for a drink when you re-incarnate them, and it seems that they don't like water... Hmmm... Wine should give good results). ^^
Charlatan75
- Paul Stevens
- CSBwin Guru
- Posts: 4318
- Joined: Sun Apr 08, 2001 6:00 pm
- Location: Madison, Wisconsin, USA
My plan would force you to have four skins if you want
chairs facing in four directions. Because there is no place
else to put that information (which way the chair is facing)
unless you were to choose the direction based on the location
in the dungeon, perhaps, or some other method.
However, keep in mind that the four skins would share the
same graphic and masks. Only the computations would
change.
Because of my planned ability to add new cmputations to
the set we might initially release, we probably would eventually
find a way to do this with a single skin if it becomes a
common need. Perhaps by putting a disabled actuator in
the cell with the chair and allowing the Computational elements
to examine parameters in that actuator.
Oooooh! What tangled webs we weave!!!! Yummy stuff.
GREAT QUESTION, by the way. Thanks.
chairs facing in four directions. Because there is no place
else to put that information (which way the chair is facing)
unless you were to choose the direction based on the location
in the dungeon, perhaps, or some other method.
However, keep in mind that the four skins would share the
same graphic and masks. Only the computations would
change.
Because of my planned ability to add new cmputations to
the set we might initially release, we probably would eventually
find a way to do this with a single skin if it becomes a
common need. Perhaps by putting a disabled actuator in
the cell with the chair and allowing the Computational elements
to examine parameters in that actuator.
Oooooh! What tangled webs we weave!!!! Yummy stuff.
GREAT QUESTION, by the way. Thanks.
- Paul Stevens
- CSBwin Guru
- Posts: 4318
- Joined: Sun Apr 08, 2001 6:00 pm
- Location: Madison, Wisconsin, USA
I have another GREAT question:
What do we do about the EDGE of the dungeon?
The cell to the left of cell (0,0)? How do we define
its skin number?
1) - Should it always have the same skin
number as the nearest cell within the dungeon?
(-1,0) -> (0,0)
(0,-1) -> (0,0)
(1,-1) -> (1,0)
That won't work well if you want a Coke machine in (0,0).
2) - Should the designer specify an 'edge' skin for each level?
That won't work well if there is water to the south and
forest to the north.
3) - Should it always be skin #0 and the designer avoids the
problem by not using the edges? We have 64 levels.
30x30x64 is still pretty big.
What else could we do? I kinda prefer a combination
of 2) and 3). An edge skin by level and the designer
avoids problem that arise by hiding the edge. Can you
see a dungeon level surrounded by Coke machines?
All facing north?
What do we do about the EDGE of the dungeon?
The cell to the left of cell (0,0)? How do we define
its skin number?
1) - Should it always have the same skin
number as the nearest cell within the dungeon?
(-1,0) -> (0,0)
(0,-1) -> (0,0)
(1,-1) -> (1,0)
That won't work well if you want a Coke machine in (0,0).
2) - Should the designer specify an 'edge' skin for each level?
That won't work well if there is water to the south and
forest to the north.
3) - Should it always be skin #0 and the designer avoids the
problem by not using the edges? We have 64 levels.
30x30x64 is still pretty big.
What else could we do? I kinda prefer a combination
of 2) and 3). An edge skin by level and the designer
avoids problem that arise by hiding the edge. Can you
see a dungeon level surrounded by Coke machines?
All facing north?
- Paul Stevens
- CSBwin Guru
- Posts: 4318
- Joined: Sun Apr 08, 2001 6:00 pm
- Location: Madison, Wisconsin, USA
Your question is well-timed. I have been putting several hoursDoes the curent version already works with skins for the wallsets
every day into the wallset graphics. I have written a compiler
that will allow you to draw all the walls, decorations, doors,
teleporters, and so on. I am rewritng the entire viewport
drawing code to use the compiler rather than the C-code that
is currently used. I have gotten as far as drawing only one
location in the viewport, namely the cell one forward and one
to the right of the party. It sounds like very little but that first
one is the tough one because the entire compiler and interpreter
must be pretty much complete before it could work.
Here is the code for cell F1R1 (forward 1 right 1) for a Stone cell:
Code: Select all
: StdDrawF1R1Stone
StdWallBitmapF1R1 StdWallRectangleF1R1 StdBltShape
F1R1 wallDecorationLeft F1R1Left StdDrawWallText
F1R1 wallDecorationLeft F1R1Left StdDrawWallDecoration
;
these built-in functions.
I have to provide you with a line-ending sequence for text.
The executable I post will contain some of this new
viewport code. There will probably be anomalies.
- cowsmanaut
- Moo Master
- Posts: 4378
- Joined: Fri Jun 30, 2000 12:53 am
- Location: canada
- Paul Stevens
- CSBwin Guru
- Posts: 4318
- Joined: Sun Apr 08, 2001 6:00 pm
- Location: Madison, Wisconsin, USA
I posted CSBwin98v52test2.
It implements the new graphic engine for cell F1L1.
It adds more information to the error messages so
that (hopefully) we can fix most things by just knowing
the error message itself without having to ship game saves.
I test a lot of things but it is hard to test them all. Please
report any problems.
It implements the new graphic engine for cell F1L1.
It adds more information to the error messages so
that (hopefully) we can fix most things by just knowing
the error message itself without having to ship game saves.
I test a lot of things but it is hard to test them all. Please
report any problems.
- Paul Stevens
- CSBwin Guru
- Posts: 4318
- Joined: Sun Apr 08, 2001 6:00 pm
- Location: Madison, Wisconsin, USA
I see one place the portrait ordinal was limited to 8 bits.External portraits with number 255 doesn't show.
I fixed that one place in 98v52test3. Let me know if it
still is broken. (There may be no way yo fix it).
Thanks. Get 98v52test3.at F2L1, objects inside walls are drawn.
98v5test3 also fixes the line breaks in &SAY.
- Paul Stevens
- CSBwin Guru
- Posts: 4318
- Joined: Sun Apr 08, 2001 6:00 pm
- Location: Madison, Wisconsin, USA
Those were included because it appeared from someone's
diagrams that a couple pixels were included. I thought it
best to have useless entries rather than missing entries.
But I cannot answer your question authoritatively. In any
case, you can use them for any purpose you like or
ignore them if you choose.
I've been out camping and which explains some delay
in getting some reported problems fixed.
diagrams that a couple pixels were included. I thought it
best to have useless entries rather than missing entries.
But I cannot answer your question authoritatively. In any
case, you can use them for any purpose you like or
ignore them if you choose.
I've been out camping and which explains some delay
in getting some reported problems fixed.
- cowsmanaut
- Moo Master
- Posts: 4378
- Joined: Fri Jun 30, 2000 12:53 am
- Location: canada
- Paul Stevens
- CSBwin Guru
- Posts: 4318
- Joined: Sun Apr 08, 2001 6:00 pm
- Location: Madison, Wisconsin, USA
Debugging this new Viewport Graphics Engine I have
made several errors. Things appear to move about
and disappear when they are drawn in the wrong
locations. Walls, doors, anything and everthing can
be made to appear in the wrong places.
If someone were REALLY clever he might take advantage
of this capability to make a level that is a real HELL.
You cannot believe your eyes. Everything is a nightmare
of unreality. You have to figure out the display problem
and know ( for example ) that when you see something
one square ahead and one to the right that you can pick
it up immediately in front of you on the left side. You have
to back off one cell to Stab that Screamer.
made several errors. Things appear to move about
and disappear when they are drawn in the wrong
locations. Walls, doors, anything and everthing can
be made to appear in the wrong places.
If someone were REALLY clever he might take advantage
of this capability to make a level that is a real HELL.
You cannot believe your eyes. Everything is a nightmare
of unreality. You have to figure out the display problem
and know ( for example ) that when you see something
one square ahead and one to the right that you can pick
it up immediately in front of you on the left side. You have
to back off one cell to Stab that Screamer.
- Paul Stevens
- CSBwin Guru
- Posts: 4318
- Joined: Sun Apr 08, 2001 6:00 pm
- Location: Madison, Wisconsin, USA
Ah!!!! The Apple-Picking Filter! No problem now
that we have Filters so well established that my
fingers can implement them without my knowledge.
Seriously, it would not be hard to implement a
pick/drop/swap filter.
"Pick up a broken apple and watch your friend on the left die
a horrible death!!!" Then only the leftmost party member would
dare to pick it up. Only a Wizard could touch that scroll. Etc.
that we have Filters so well established that my
fingers can implement them without my knowledge.
Seriously, it would not be hard to implement a
pick/drop/swap filter.
"Pick up a broken apple and watch your friend on the left die
a horrible death!!!" Then only the leftmost party member would
dare to pick it up. Only a Wizard could touch that scroll. Etc.
- Paul Stevens
- CSBwin Guru
- Posts: 4318
- Joined: Sun Apr 08, 2001 6:00 pm
- Location: Madison, Wisconsin, USA
Tell you what. I have the 'internal' portions of the Viewport
Graphic Engine about 80 percent conplete. When I am done with
that part of it I will switch to Party Attack Filter. In that way, the
internal parts can get a bit of testing before I tackle the external
parts. The engine will be used to display the viewport even for
un-modified dungeons like 'Standard DM' and will undoubtedly
have a few bugs to be worked out.
Graphic Engine about 80 percent conplete. When I am done with
that part of it I will switch to Party Attack Filter. In that way, the
internal parts can get a bit of testing before I tackle the external
parts. The engine will be used to display the viewport even for
un-modified dungeons like 'Standard DM' and will undoubtedly
have a few bugs to be worked out.
Last edited by Paul Stevens on Tue May 17, 2005 4:09 pm, edited 1 time in total.
- Paul Stevens
- CSBwin Guru
- Posts: 4318
- Joined: Sun Apr 08, 2001 6:00 pm
- Location: Madison, Wisconsin, USA
I don't know if they work in the most recent versions.
The method will be changed and I may have broken the
original method of displaying the graphics. It may also
be that it never worked for more than one custom skin.
The code was very experimental and not at all complete.
Version9.8test10 ( in BackgroundGraphics.zip ) demonstrates
the old method and works OK for one skin. You should be able
to use it for testing your graphics.
When I finish the Viewport Graphic Engine you will have
to change the way you do things. But all of your graphics
and graphic masks will be usable.
Does that answer your questions for now? The long and
short of it is that this is all a work-in-progress although if
you have no way to test your graphics then we should at
least make testing possible.
The method will be changed and I may have broken the
original method of displaying the graphics. It may also
be that it never worked for more than one custom skin.
The code was very experimental and not at all complete.
Version9.8test10 ( in BackgroundGraphics.zip ) demonstrates
the old method and works OK for one skin. You should be able
to use it for testing your graphics.
When I finish the Viewport Graphic Engine you will have
to change the way you do things. But all of your graphics
and graphic masks will be usable.
Does that answer your questions for now? The long and
short of it is that this is all a work-in-progress although if
you have no way to test your graphics then we should at
least make testing possible.
Testing and designing more with the floorsets, I stumbled upon the following idea:
the wallsets should be defined by two possible methods:
1) first, a skin on the wall tile.
2) if there's no skin on the tile of the wall, then it will use the skin of floor it is facing.
This would have several advanges:
- allowing standalone walls like columns using method 1.
- allowing tiles with up to 4 wall sets, one for each facing, matching the floor, using method 2.
- halving the time of design since you only have to skin the floors, the wall will automaticly fit
This leaves the problem of putting a standalone wall with the default wallskin in the middle of a new floorskin. Creating a wallskin with no mask, no picture (like the skin 0) will fix this.
the wallsets should be defined by two possible methods:
1) first, a skin on the wall tile.
2) if there's no skin on the tile of the wall, then it will use the skin of floor it is facing.
This would have several advanges:
- allowing standalone walls like columns using method 1.
- allowing tiles with up to 4 wall sets, one for each facing, matching the floor, using method 2.
- halving the time of design since you only have to skin the floors, the wall will automaticly fit
This leaves the problem of putting a standalone wall with the default wallskin in the middle of a new floorskin. Creating a wallskin with no mask, no picture (like the skin 0) will fix this.
- Paul Stevens
- CSBwin Guru
- Posts: 4318
- Joined: Sun Apr 08, 2001 6:00 pm
- Location: Madison, Wisconsin, USA
- Paul Stevens
- CSBwin Guru
- Posts: 4318
- Joined: Sun Apr 08, 2001 6:00 pm
- Location: Madison, Wisconsin, USA
- Paul Stevens
- CSBwin Guru
- Posts: 4318
- Joined: Sun Apr 08, 2001 6:00 pm
- Location: Madison, Wisconsin, USA
Zyx and I have been discussing all of this offline.
I have produced a new page of documentation with
my latest ideas on the subject.
http://www.dianneandpaul.net/CSBwin/doc ... phics.html
I have produced a new page of documentation with
my latest ideas on the subject.
http://www.dianneandpaul.net/CSBwin/doc ... phics.html
- Paul Stevens
- CSBwin Guru
- Posts: 4318
- Joined: Sun Apr 08, 2001 6:00 pm
- Location: Madison, Wisconsin, USA