Background Graphics

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.
User avatar
Charlatan75
Apprentice
Posts: 59
Joined: Mon Nov 10, 2003 2:32 pm

Post by Charlatan75 »

Hmmm... Argh! It seems that you're right... but I don't understand why the link does not work.

I zipped the picture and uploaded it again here :

http://pageperso.aol.fr/TheCharlatan75/Lucyle/Pic.zip

Charlatan75

(Argh! I'm cursed or very tired, I inverted the notations 'D0', 'D1', 'D2', 'D3' in the picture. Now it should be ok)
User avatar
Paul Stevens
CSBwin Guru
Posts: 4318
Joined: Sun Apr 08, 2001 6:00 pm
Location: Madison, Wisconsin, USA

Post by Paul Stevens »

That is neat stuff. I see your problems and see
no reason that it is not simply a matter of moving
a couple lines of code up or down so that they get
done at the right time. And perhaps some test should
say 'greater' instead of 'Greater-or-equal'.

GOOD WORK!!!! THANK YOU!!!! I'll return.
User avatar
cowsmanaut
Moo Master
Posts: 4378
Joined: Fri Jun 30, 2000 12:53 am
Location: canada

Post by cowsmanaut »

hex31 4 bit planes 1 bit per pixel 16 colors

after some searching (to show I'm not opposed to learning new things ;) ) the above I guess gives me my answer to my second question.

'tis a shame, still lots of cooll things that can be done with this.

Let me know if you want the walls I showed earlier in the thread to test when you get to wall skining later on :)
User avatar
Paul Stevens
CSBwin Guru
Posts: 4318
Joined: Sun Apr 08, 2001 6:00 pm
Location: Madison, Wisconsin, USA

Post by Paul Stevens »

grass is drawn over a wall
I think you numbered the cells wrong. That is cell
number 4 that you drew at relative location (3r2)
Three ahead and 2 right. It should be cell number 1.
My initial diagram numbered the cells from left to
right 0,1,2,3,4 but I changed that quickly to be the
order that they are drawn 0,2,4,3,1.

In any case is was the mask for cell 4 (which should be
the central cell at (3,0) (three ahead) that is drawing
the grass on the wall at (3r2).
User avatar
Paul Stevens
CSBwin Guru
Posts: 4318
Joined: Sun Apr 08, 2001 6:00 pm
Location: Madison, Wisconsin, USA

Post by Paul Stevens »

when I write the correct height for these graphics (32 pixels) in the Floormask.bin file, these graphics are not displayed at all
I hope this will be better in next release later today.
User avatar
Paul Stevens
CSBwin Guru
Posts: 4318
Joined: Sun Apr 08, 2001 6:00 pm
Location: Madison, Wisconsin, USA

Post by Paul Stevens »

wall is drawn over the grass
Could this also be due to improper numbering? I
think so.
User avatar
Paul Stevens
CSBwin Guru
Posts: 4318
Joined: Sun Apr 08, 2001 6:00 pm
Location: Madison, Wisconsin, USA

Post by Paul Stevens »

Version ...test8 has the changes for the allowed height
of the graphic. It comes with a beautiful demonstration
of a grassland.

http://dianneandpaul.net/CSBwin/BackgroundGraphics.zip

There are still a couple of glitches but they are well on
their way to being corrected.
User avatar
Paul Stevens
CSBwin Guru
Posts: 4318
Joined: Sun Apr 08, 2001 6:00 pm
Location: Madison, Wisconsin, USA

Post by Paul Stevens »

I am extremely pleased with the seeming success of the
Floor graphics and I hope that the Middle and Ceiling
graphics work out equally well. Do you think it is time to
attack the Wall graphics? If so........

Can they be done in exactly the same way? I number the
walls from 0 to #walls-1. After drawing each cell
I check to see if a skin is defined for that cell.
If so I find the wall graphic for that skin. I then find
the nth wall mask and if it exists I draw the graphic using
that mask.

If this seems like a sane approach then I need to know how
many wall graphics we think there are. When the original code
draws the walls it examines 12 cells ( the four rows ahead with
one cell to each side ) but of course you cannot see all sides
of all cells. A diagram (overhead map) of the walls that need
drawing and numbered in the order that they should be drawn
would be nice.


EDIT**********************
All sides of a cell must share the same skin number because
that is how 'skins' are defined: on a cell-by-cell basis. Is this
going to be a big drawback? Should the skin for a wall be
associated with the adjacent open cell rather than with the
wall cell?
User avatar
Zyx
DSA Master
Posts: 2592
Joined: Mon Jun 05, 2000 1:53 pm
Location: in the mind
Contact:

Post by Zyx »

Should the skin for a wall be
associated with the adjacent open cell rather than with the
wall cell?
I think not. The drawback would be bigger. You may want to put a column without the need to change the floor.
Last edited by Zyx on Thu Apr 21, 2005 4:41 pm, edited 2 times in total.
User avatar
Charlatan75
Apprentice
Posts: 59
Joined: Mon Nov 10, 2003 2:32 pm

Post by Charlatan75 »

Hello! :)

Hmmm... I don't understand where you think I did number the cells wrong (?)...

I saw that you numbered them 0,2,4,3,1 (and so on...), and I understood that it was just the order in which the skins of these cells were drawn in the dungeon view...

I also understood that in the "FloorMask.bin" the order was (of course?) 0,1,2,3,4 (and so on...). Just enter the first room of the test dungeon, if I inverted cell 1 with cell 2, or cell 2 with cell 4... you will see that immediately (no?). ^^

Well... I admit that I'm now totally lost... (Argh! Help!)

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

Post by Paul Stevens »

OK. We are so very close to getting this exactly
right. Let me tell you what I see in the CSBgraphics.dat.
It could very well be me, CSBgraphics.exe, CSBwin, or
you that has made the mistake. Start from scratch------

Three graphics:
1 - skins
2 - FloorMask
10 - floor10

I exported #2 (FloorMask) and look at it with
hex editor. I see that there are 16 masks in the
following order:

Code: Select all

#       offset  destinationX  destinationY  width   height
0       64           0            66          32      10
1      132           0            66          96      10
2      288          64            66          96      10
3      444         128            66          96      10
4      600         192            66          32      10
etc....not interesting
The destinationY is the same for all. That makes sense
because they all start at the horizon. The destinationX is
what interests me. The one farthest to the right (at 192) is
the one for cell #4. But cell number 4 is the middle cell.
Why are you drawing cell #4 far to the right of cell #2????

The order is 0, 2, 4, 3, 1. You can see that cell # 4 should
be to the right of cells #0 and #2 and to the left of cells #1
and #3. Your masks place #4 at the far right at x=192.
Your masks place cell #2 in the middle at x = 64.

That is why I thought you had numbered them 0, 1, 2, 3, 4.


EDIT *********
But your argument makes perfect sense, too. So I think there
are two errors. Yours and CSBwin.
User avatar
Paul Stevens
CSBwin Guru
Posts: 4318
Joined: Sun Apr 08, 2001 6:00 pm
Location: Madison, Wisconsin, USA

Post by Paul Stevens »

No doubt about it. CSBwin was a bit schizophrenic
about this numbering. It was doing it the old way
in one place. I posted a new CustomGraphics.zip
that fixes this little problem. No guarantees that this
is the last problem, however.

P.S. I was more than a little confused there for a while.
User avatar
Charlatan75
Apprentice
Posts: 59
Joined: Mon Nov 10, 2003 2:32 pm

Post by Charlatan75 »

Hmmmm...

So CSBWin was wrong... ?

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

Post by Paul Stevens »

Several things were 'right'. I don't know about this 'thing'
that you mention. But part of CSBwin was wrong and part
of your masks was wrong. It just so happened that the
two errors ALMOST cancelled each other out.

We seem to be in a 'Write-and-edit' contest. ;-)
User avatar
Charlatan75
Apprentice
Posts: 59
Joined: Mon Nov 10, 2003 2:32 pm

Post by Charlatan75 »

I'm sorry, the 'thing' was referring to me...
I edited the previous message because what I wrote were my own depressing thoughts...

I try to do things the best that I can... not always easy...
User avatar
cowsmanaut
Moo Master
Posts: 4378
Joined: Fri Jun 30, 2000 12:53 am
Location: canada

Post by cowsmanaut »

http://dmweb.free.fr/Stuff/files/walls2.zip

that's them uncut but masked and in the correct palette. I'm unsure how you plan on zoning this stuff for the walls. But here it is ready to be chopped up.

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

Post by Paul Stevens »

how you plan
If the 'you' was meant to mean Paul Stevens then
you got the wrong man. I don't plan any of this.

But I assume that whoever does the work will do
it by putting all 5 of your graphics, along with their
reflections for a total of 10 graphics, into a single
4-color-plane bitmap. Then they will construct as many
masks as are needed to display these walls in the
proper positions within the viewport.

Before I can do MY work, I still need to know how
many such masks will be needed along with a diagram
(an overhead map) of where they are to be placed and
the order in which they should be drawn. Like this

Code: Select all

-------------------
|  1   |  2  | 3  |
|      |     |    |
|4     |5    |6   |7
|      |     |    |
-------------------
   8   | 9   | 10
       |     |
       |11   |12
       |     |       
       -------
       | 13  |
       |     |       
       |14   |15
       |  P  |
       ------ 
User avatar
cowsmanaut
Moo Master
Posts: 4378
Joined: Fri Jun 30, 2000 12:53 am
Location: canada

Post by cowsmanaut »

ok you have seperate mask images?

if someone wants to give me a basic idea of how these should be chopped I don't mind doing the work. I mean replacing the orriginal walls were time consuming but I had a template to go by there at least.. which was the original extracted images. For this I have now basis for reference.

your above map is missing two patches for the wal 13.. you can still see sections of wall (the very edges anyway) to either side of it.

Code: Select all

-------------------
|  1   |  2  | 3  |
|      |     |    |
|4     |5    |6   |7
|      |     |    |
-------------------
   8   | 9   | 10
       |     |
       |11   |12
       |     |       
   --------------
    13 | 14  | 15
       |     |       
       |16   |17
       |  P  |
       ------ 
should probably be more like that I'm guessing.

if I'm reading that right anyway.. I mean if you can see 14 and 15 in your map what happens when you take those away..

so, what I'm not clear on with this whole wall thing.. is it to be cut up based on where the walls sit I guess? used to have a screen zone coords for the whole thing somewhere.. Showing where each wall stopped and started.. damned if I can find it now. but I guess I could redo that if there is need?

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

Post by Paul Stevens »

Hmmm.... I thought that you (or someone) said once
upon a time that you could also see a bit of wall to the
left of (1) and to the right of (3).
probably be more like that I'm guessing
I will wait a bit until someone can be a bit more sure
of what is needed.

We sort of decided that (Toni was the only person who
commented so 'we' means he and I) we would provide
two skins for the backgrounds if we wanted a 'moving'
effect when the party moved or turned. The current
way of doing this is to 'reflect' the background if the
sum of the x, y, and facing is and odd number. I do not
plan to do this 'reflection'. That is why two skins are
necessary. If the skin number is 128 or greater then
the program will display the specified skin for the odd case
and the next higher skin for the even case. So you may
want to create a different skin or simply reflect the one
you have.
is it to be cut up based on where the walls sit
I do not understand the question exactly. But I think this
may help:

It is quite arbitrary. Your graphic needs to contain all the
needed pieces. But they do not have to be in any particular
arrangement because the mask for each individual piece
describes exactly which pixels from the source graphic
are to be copied to the viewport and exactly where in the
viewport they are to be placed. They one big constraint is
that the source MUST have the same left-right alignment
relative to 4-byte boundaries. The CSBwin code will do no
shifting to align the pixels. All x-offsets and widths are in
units of 4 bytes (for efficiency at runtime).
User avatar
Zyx
DSA Master
Posts: 2592
Joined: Mon Jun 05, 2000 1:53 pm
Location: in the mind
Contact:

Post by Zyx »

So, the single 4-color-plane bitmap can be of any size, as long as the masks x-offsets and widths are multiple of 16 pixels?
User avatar
Paul Stevens
CSBwin Guru
Posts: 4318
Joined: Sun Apr 08, 2001 6:00 pm
Location: Madison, Wisconsin, USA

Post by Paul Stevens »

Any size except the width must be a multiple of 16 pixels.

I said before that it must be on 32-bit boundaries but I was
wrong. I see that the code expects 16-pixel boundaries which
is 64-bit boundaries. It would not make much sense to change
half the bits in a pixel. The source bitmap might be made a
bit smaller if I allowed 32-bit boundaries (You could pack things
together more tightly) but it would be
pretty negligble.
User avatar
cowsmanaut
Moo Master
Posts: 4378
Joined: Fri Jun 30, 2000 12:53 am
Location: canada

Post by cowsmanaut »

Image

here's an image showing all the sections of the images you can see from this how many times the screen is cut up. For a total of 19 images
User avatar
Zyx
DSA Master
Posts: 2592
Joined: Mon Jun 05, 2000 1:53 pm
Location: in the mind
Contact:

Post by Zyx »

I suppose the masks can overlap. And I guess the overlapping order is from the background (furthest walls displayed first) to the foreground (closest walls dispayed last)?
User avatar
Charlatan75
Apprentice
Posts: 59
Joined: Mon Nov 10, 2003 2:32 pm

Post by Charlatan75 »

Hello! :)

Ok, I corrected my mistake and created a new FloorMask.bin file. ^^

It seems that the skin is not displayed in two cases : when the player is standing on it, and when it is two steps in front of him.

I did put all the test files in a zip but it seems that I can't upload anything for now where I usually do. Can I send the zip to you directly?

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

Post by Paul Stevens »

Can I send the zip to you directly?
Certainly. My email in CSBwin 'Help/About'.
User avatar
Paul Stevens
CSBwin Guru
Posts: 4318
Joined: Sun Apr 08, 2001 6:00 pm
Location: Madison, Wisconsin, USA

Post by Paul Stevens »

And I guess the overlapping order is from the background
I was hoping someone would tell me. I have asked a couple
of times for a map with all the pieces numbered in the
order they are to be displayed. No response yet.
User avatar
Paul Stevens
CSBwin Guru
Posts: 4318
Joined: Sun Apr 08, 2001 6:00 pm
Location: Madison, Wisconsin, USA

Post by Paul Stevens »

skin is not displayed in two cases
Fixed. I posted a CustomGraphics.zip that appears
to display your grassland perfectly. Now someone
needs to work on the blue sky with clouds. ;-)
User avatar
cowsmanaut
Moo Master
Posts: 4378
Joined: Fri Jun 30, 2000 12:53 am
Location: canada

Post by cowsmanaut »

wow walls must be rather difficult not that I think about it.. because which ones overlap what?

I can see instances where you would need them one way and for others it would change. What a pain.. hmmm

indeed though the most common I suppose would be back to front

purples, furthest cyan, greens, next cyan, blues, next cyan, reds and final cyan.

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

Post by Zyx »

Suppose we have the following configurations:

1)
. _
/ . \


2)
. _
/


3)

/ . \


If we want to allow irregular edges for walls (instead of cut off edges), we only can have it:
- wether for the front views of walls if they're displayed before the side views.
Case 2 would have frontal irregular edges, case 1 would have them hidden.
- wether for the side views of walls if they're displayed before the front views.
Case 3 would have lateral irregular edges, case 1 would have them hidden.

So I think a choice is to be made here.
User avatar
Paul Stevens
CSBwin Guru
Posts: 4318
Joined: Sun Apr 08, 2001 6:00 pm
Location: Madison, Wisconsin, USA

Post by Paul Stevens »

If necessary I am willing to use different masks for the
different cases. Each wall could have four masks, selected
depending on what is at the two ends of the wall.
You would need to supply a table (in the wall map graphic
probably) that has 19 entries ( if that is how many walls
segment exist). Each entry says which wall segment is
to be examined to the left and right to determine the mask
to use.

Would that be sufficient?

The wall directly in front of the party would depend
on the presence or absence of the walls directly left and
right of the party, for example.

Alternative: Draw each wall in two parts so that only two
masks are needed for each of the 38(?) pieces.

Alternative: Supply "edge" graphics to be applyed after the
walls have been drawn and depending on the configuration of
the walls at each of the possible corners. How many
configurations would we have to have? At least three it seems.
1) both straight edge. 2) left wall irregular. 3) right wall irregular.

Do we have to worry about these things at all possible corners
or only the ones that are close to the party?
Post Reply

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