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: 4322
- Joined: Sun Apr 08, 2001 6:00 pm
- Location: Madison, Wisconsin, USA
Background Graphics
I put preliminary documentation of the Background Graphic
capability at
http://dianneandpaul.net/CSBwin/documentation
None of this woks yet but it is under way and appears to
have a good chance of working someday.
It occurs to me that the 'Skin' number associated with
each cell in the dungeon could be used as a 'Zone'. Perhaps
someday we can implement things like 'Enter Zone'
messsages. But first things first.
capability at
http://dianneandpaul.net/CSBwin/documentation
None of this woks yet but it is under way and appears to
have a good chance of working someday.
It occurs to me that the 'Skin' number associated with
each cell in the dungeon could be used as a 'Zone'. Perhaps
someday we can implement things like 'Enter Zone'
messsages. But first things first.
- Paul Stevens
- CSBwin Guru
- Posts: 4322
- Joined: Sun Apr 08, 2001 6:00 pm
- Location: Madison, Wisconsin, USA
http://dianneandpaul.net/CSBwin/FloorGraphics.zip
demonstrates the ability to associate Floor, Middle, and Ceiling
graphics on a cell-by-cell basis. It has no useful graphics. I'll
leave that to you. It has a small, striped graphic for cell 0
and even that is the wrong shape, size, and placement. But it
demonstrates the capability of the runtime. You can create the
proper graphics. If someone makes the proper masks, I hope
they will share......those should not change for the most straight-
forward case.
There is as yet no way for CSBuild to set the skin numbers
for the individual cells. So the runtime has a hard-coded
skin 1 for cells where the x and y coordinate add to an odd
number. Else a skin of 0 which does nothing.
demonstrates the ability to associate Floor, Middle, and Ceiling
graphics on a cell-by-cell basis. It has no useful graphics. I'll
leave that to you. It has a small, striped graphic for cell 0
and even that is the wrong shape, size, and placement. But it
demonstrates the capability of the runtime. You can create the
proper graphics. If someone makes the proper masks, I hope
they will share......those should not change for the most straight-
forward case.
There is as yet no way for CSBuild to set the skin numbers
for the individual cells. So the runtime has a hard-coded
skin 1 for cells where the x and y coordinate add to an odd
number. Else a skin of 0 which does nothing.
- cowsmanaut
- Moo Master
- Posts: 4380
- Joined: Fri Jun 30, 2000 12:53 am
- Location: canada
how about control for left and right most walls? for the final row of walls there is no left or right graphic i just uses the same wall. So if the addition of a side wall for that row could be established and be sure that it were flipped then I could use this lighting model. These are made to work with the DM 16 colours.

moo

moo
- Paul Stevens
- CSBwin Guru
- Posts: 4322
- Joined: Sun Apr 08, 2001 6:00 pm
- Location: Madison, Wisconsin, USA
I have only implemented the Floor, Middle, and
Ceiling background graphics. The walls will follow
and you will be able to place any graphic you please
on any side of any of the 16 cells that are visible.
But a question does arise. Do I need to worry about
the flipping? I could let the artist worry about it and
have him produce different graphics for the even and
odd cases. But this would mean that the skin numbers would
have to be placed in the dungeon in checkerboard fashion.
Even that does not wok too well because it does not take into
account the party's turning. The original code did the flip if
x + y + facing was an odd number.
I suggest that we do as follows:
Skin numbers 1 through 127 are simple. No flipping as the
party moves or turns. This takes care of things like
trees that you don't want flipping back and forth.
Skin numbers 128 through 255 are 'flipping' skins. You have
to draw two graphics. When x + y + facing is even I draw the
skin specified. When x + y + facing is odd I draw the next
next higher skin (skin# + 1). Of course, the graphics can
be identical in places where you don't want the 'flipping' effect.
Ceiling background graphics. The walls will follow
and you will be able to place any graphic you please
on any side of any of the 16 cells that are visible.
But a question does arise. Do I need to worry about
the flipping? I could let the artist worry about it and
have him produce different graphics for the even and
odd cases. But this would mean that the skin numbers would
have to be placed in the dungeon in checkerboard fashion.
Even that does not wok too well because it does not take into
account the party's turning. The original code did the flip if
x + y + facing was an odd number.
I suggest that we do as follows:
Skin numbers 1 through 127 are simple. No flipping as the
party moves or turns. This takes care of things like
trees that you don't want flipping back and forth.
Skin numbers 128 through 255 are 'flipping' skins. You have
to draw two graphics. When x + y + facing is even I draw the
skin specified. When x + y + facing is odd I draw the next
next higher skin (skin# + 1). Of course, the graphics can
be identical in places where you don't want the 'flipping' effect.
- Paul Stevens
- CSBwin Guru
- Posts: 4322
- Joined: Sun Apr 08, 2001 6:00 pm
- Location: Madison, Wisconsin, USA
CSBuild185.zip and FloorGraphics.zip are posted at
http://dianneandpaul.net/CSBwin
http://dianneandpaul.net/CSBwin/documentation
They implement the Background Graphics as described
in recent posts. I am ready for suggestions and bug
reports.
http://dianneandpaul.net/CSBwin
http://dianneandpaul.net/CSBwin/documentation
They implement the Background Graphics as described
in recent posts. I am ready for suggestions and bug
reports.
- Paul Stevens
- CSBwin Guru
- Posts: 4322
- Joined: Sun Apr 08, 2001 6:00 pm
- Location: Madison, Wisconsin, USA
The release has a working example. Level 0 (5,1)post a working example
displays a Custom Floor graphic (Skin #1). The
graphic itself is nothing to write home about and it
only displays as cell 0 but that is just a matter of
drawing a better graphic and creating proper masks
rather than a simple rectangle.
By the way, CSBuild requires the updated tiles.bmp
to mark the skin locations. I forgot to say that in my
first release message above.
Ah, it helps if I download the 'floorgraphics' zip... I just downloaded CSBuild185 and read the documentation. I am a bit slow out of the blocks somedays...
Anyway, I have had a look. Is what I am looking for the 'barcode' thingy that appears in the bottom right of the screen when: facing N at 07,04; and facing E at 02,03? I can see where you put the 'skin' in CSBuild, which is at 05,01. I tried to export the graphic to view it and see if I could edit, but it wouldn't open with Paint. It will not recognise the bmp after exporting.
Anyway, I have had a look. Is what I am looking for the 'barcode' thingy that appears in the bottom right of the screen when: facing N at 07,04; and facing E at 02,03? I can see where you put the 'skin' in CSBuild, which is at 05,01. I tried to export the graphic to view it and see if I could edit, but it wouldn't open with Paint. It will not recognise the bmp after exporting.
- Paul Stevens
- CSBwin Guru
- Posts: 4322
- Joined: Sun Apr 08, 2001 6:00 pm
- Location: Madison, Wisconsin, USA
I think (as usual) my understanding of the implementation of this is seriously flawed. I think I'll sit and watch what happens here for a bit. Or stick to fixing bikes.
I think a nice demonstration would be to take the existing graphics and define mask parameters and draw in yellow around all the boundaries of the graphics which would indicate the mask in a demo game.
I think a nice demonstration would be to take the existing graphics and define mask parameters and draw in yellow around all the boundaries of the graphics which would indicate the mask in a demo game.
- Paul Stevens
- CSBwin Guru
- Posts: 4322
- Joined: Sun Apr 08, 2001 6:00 pm
- Location: Madison, Wisconsin, USA
- Paul Stevens
- CSBwin Guru
- Posts: 4322
- Joined: Sun Apr 08, 2001 6:00 pm
- Location: Madison, Wisconsin, USA
- Paul Stevens
- CSBwin Guru
- Posts: 4322
- Joined: Sun Apr 08, 2001 6:00 pm
- Location: Madison, Wisconsin, USA
I'm trying to understand how the skins, the graphics and the masks work...
Some questions:
All the custom skins have to use the same masks?
Why is there no mask for the walls?
"The definition of the skins is stored as 'Background Graphic' with ID = 2.."<- shouldn't it be ID=1?
Is there a tool to convert bmp (not the masks) from/to the structure needed for CSBgraphics.exe?
How do I import skins/masks/graphics with CSBgraphics.exe?
Some questions:
All the custom skins have to use the same masks?
Why is there no mask for the walls?
"The definition of the skins is stored as 'Background Graphic' with ID = 2.."<- shouldn't it be ID=1?
Is there a tool to convert bmp (not the masks) from/to the structure needed for CSBgraphics.exe?
How do I import skins/masks/graphics with CSBgraphics.exe?
- Paul Stevens
- CSBwin Guru
- Posts: 4322
- Joined: Sun Apr 08, 2001 6:00 pm
- Location: Madison, Wisconsin, USA
Up/Down. Right click clear. CSBuild1.87
have to be rearranged a bit to make room for a
mask number.
these Imports for months. The only thing that changes is
the 'Type' of graphic. Set it to 'Background Graphic'.
and I see ID=1 Skins; ID=2 Floor Mask; ID=10 Floor10.
What do you see?
Yep. That is a BIG mistake. The whole thing willAll the custom skins have to use the same masks?
have to be rearranged a bit to make room for a
mask number.
They are not implemented yet.Why is there no mask for the walls
Nope. I thought someone else could do this.s there a tool to convert bmp
I do not understand this question. You have been doingHow do I import skins/masks/graphics with CSBgraphics.exe?
these Imports for months. The only thing that changes is
the 'Type' of graphic. Set it to 'Background Graphic'.
Something is amiss here. I ust looked at the CSBgraphics.datThe definition of the skins is stored as 'Background Graphic' with ID = 2
and I see ID=1 Skins; ID=2 Floor Mask; ID=10 Floor10.
What do you see?
- Paul Stevens
- CSBwin Guru
- Posts: 4322
- Joined: Sun Apr 08, 2001 6:00 pm
- Location: Madison, Wisconsin, USA
- Paul Stevens
- CSBwin Guru
- Posts: 4322
- Joined: Sun Apr 08, 2001 6:00 pm
- Location: Madison, Wisconsin, USA
- Charlatan75
- Apprentice
- Posts: 59
- Joined: Mon Nov 10, 2003 2:32 pm
Hello! 
Would it be possible to make CSBWin draw the floor skin of a cell after it draws the walls which are "behind" this cell in the dungeon view ? (it seems that the floor is always drawn before the walls)
This could allow, for example, to use a floor skin representing grass that would not be "cut" according to the rectilinear edges of the walls which should appear as "behind" the grass.
Charlatan75

Would it be possible to make CSBWin draw the floor skin of a cell after it draws the walls which are "behind" this cell in the dungeon view ? (it seems that the floor is always drawn before the walls)
This could allow, for example, to use a floor skin representing grass that would not be "cut" according to the rectilinear edges of the walls which should appear as "behind" the grass.
Charlatan75
- Paul Stevens
- CSBwin Guru
- Posts: 4322
- Joined: Sun Apr 08, 2001 6:00 pm
- Location: Madison, Wisconsin, USA
- cowsmanaut
- Moo Master
- Posts: 4380
- Joined: Fri Jun 30, 2000 12:53 am
- Location: canada
- Paul Stevens
- CSBwin Guru
- Posts: 4322
- Joined: Sun Apr 08, 2001 6:00 pm
- Location: Madison, Wisconsin, USA
The latest FloorGraphics.zip attempts to do this.draw the floor skin of a cell after it draws the walls
Nope. I am overlaying the original background graphic andthey could be in the range of 256 colours now
it is in the Atari 4-color-plane format. I don't think there is anything
we are ever going to do about that unless we start from
scratch and build a program named RTC.
- Charlatan75
- Apprentice
- Posts: 59
- Joined: Mon Nov 10, 2003 2:32 pm
Hello! 
Thank you, Paul. ^^
Well, I tried to create a test dungeon with a floor skin representing grass, just like the example I talked about.
* In the first room there is only one cell, in the center, which is ornated with the floor skin. This is just to check that the skin is well drawn in all the different possible views.
NB : this skin is designed to be drawn when it is in one of the following cells (P is the position of the player):
--------------------------
| | | | | |
| | | | | | D3
--------------------------
|////| | | |////|
|////| a | | b |////| D2
--------------------------
| | | |
| | | | D1
----------------
| | | |
| | P | | D0
----------------
I did not use the possiblity to draw the floor skin in the hatched cells because the floor of these cells is never visible in the Atari ST version (you will never see the left side wall of cell 'a' or the right side wall of cell 'b' for example...).
=> In this first room you can already see that when you are standing on the cell where the "grass" is (or one step beside this cell), the bottom line of the dungeon view is not covered by the graphic of the floor skin. The reason is : when I write the correct height for these graphics (32 pixels) in the Floormask.bin file, these graphics are not displayed at all (!), so I had to "cheat" and write '31' instead of '32' (I don't know if something can be done here (?)).
* In the second room (full of grass), you'll be able to see when a wall is drawn over the grass when it should not (the right wall at D0, D1, D2 or D3 for example, or the left wall at D2). And you'll see when grass is drawn over a wall when it should not (place yourself so that one of the isolated pieces of wall in the middle of the room is just one step on your right at D3 for example).
I put all the files in the following zip :
Http://pageperso.aol.fr/TheCharlatan75/Lucyle/Test.zip
Charlatan75

Thank you, Paul. ^^
Well, I tried to create a test dungeon with a floor skin representing grass, just like the example I talked about.
* In the first room there is only one cell, in the center, which is ornated with the floor skin. This is just to check that the skin is well drawn in all the different possible views.
NB : this skin is designed to be drawn when it is in one of the following cells (P is the position of the player):
--------------------------
| | | | | |
| | | | | | D3
--------------------------
|////| | | |////|
|////| a | | b |////| D2
--------------------------
| | | |
| | | | D1
----------------
| | | |
| | P | | D0
----------------
I did not use the possiblity to draw the floor skin in the hatched cells because the floor of these cells is never visible in the Atari ST version (you will never see the left side wall of cell 'a' or the right side wall of cell 'b' for example...).
=> In this first room you can already see that when you are standing on the cell where the "grass" is (or one step beside this cell), the bottom line of the dungeon view is not covered by the graphic of the floor skin. The reason is : when I write the correct height for these graphics (32 pixels) in the Floormask.bin file, these graphics are not displayed at all (!), so I had to "cheat" and write '31' instead of '32' (I don't know if something can be done here (?)).

* In the second room (full of grass), you'll be able to see when a wall is drawn over the grass when it should not (the right wall at D0, D1, D2 or D3 for example, or the left wall at D2). And you'll see when grass is drawn over a wall when it should not (place yourself so that one of the isolated pieces of wall in the middle of the room is just one step on your right at D3 for example).
I put all the files in the following zip :
Http://pageperso.aol.fr/TheCharlatan75/Lucyle/Test.zip
Charlatan75
- Charlatan75
- Apprentice
- Posts: 59
- Joined: Mon Nov 10, 2003 2:32 pm
Oups, sorry, it seems that the drawing of the cells didn't work fine.
Well, I put a picture here for that :
Http://pageperso.aol.fr/TheCharlatan75/Lucyle/pic.gif
Charlatan75
Well, I put a picture here for that :
Http://pageperso.aol.fr/TheCharlatan75/Lucyle/pic.gif
Charlatan75
- cowsmanaut
- Moo Master
- Posts: 4380
- Joined: Fri Jun 30, 2000 12:53 am
- Location: canada