Converting CSBWin graphicengine to a OpenGL 3D engine

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
beowuuf
Archmastiff
Posts: 20687
Joined: Sat Sep 16, 2000 2:00 pm
Location: Basingstoke, UK

Re: Converting CSBWin graphicengine to a OpenGL 3D engine

Post by beowuuf »

Grr, rushing off to work then mother down, so can't check this out for a while.

DSAs are Design Specified Actuators. They are state machines that can remember two large numbers, use other DSAs to increase that function, and operate a bewildering amount of code all activated by either a) one of twelve normal input messages DM uses, or b) use one of the internal information strings, like fight actions or monster movement/attack actions or death action or experience action, etc.

Commands range from item creation, item and party movement, inteerrupting most aspects of the above internal messages, scanning party states and inventory, etc.

Basically, it's turned into a programming language all in itself, and is best showcased by the insane things Conflux can do with the base engine!
User avatar
zoom
Grand Master
Posts: 1819
Joined: Tue Sep 23, 2003 1:27 am
Location: far away but close enough

Re: Converting CSBWin graphicengine to a OpenGL 3D engine

Post by zoom »

There is a little problem with looking down pits:
In csb, when you leave the starting room, you get to a closing and re-opening pit. Kind of fluctuates. if you look down, which looks kinda cool, you can look down there indifferently, although the pit should really close and reopen in the meantime.

Rasmus, did you really use csbwin version 10.00? I think there are couple of better versions around.
If loading the non-existant savegame slot number 3 after trying to load e.g. savegame 2, 4 or 1(there are no saves anywhere near) I get the error message:
fatal error: Fatal record line QUeue fail System error 13192
then: Error
System Error
User avatar
Jan
Mighty Pirate
Posts: 2760
Joined: Tue Sep 23, 2008 4:55 pm
Location: Scumm Bar, Czech Republic

Re: Converting CSBWin graphicengine to a OpenGL 3D engine

Post by Jan »

Wow, Rasmus, this look-down-the pit looks superb! Fantastic! On the other hand, this may change the gameplay - in CSB as well as in many custom dungeons, the point of some puzzles or places is that you can't see what's down there. This may spoil or ruin some of the 3D puzzles. Anyway, keep going, you're doing a fantastic job.

[YesMinister]This can be your Falkland Islands.
Spoiler
And you can be General Galtieri.
:wink: [/YesMinister] No, I'm joking, of course, as usually.
Finally playing and immensely enjoying the awesome Thimbleweed Park-a-reno!
User avatar
Gambit37
Should eat more pies
Posts: 13714
Joined: Wed May 31, 2000 1:57 pm
Location: Location, Location
Contact:

Re: Converting CSBWin graphicengine to a OpenGL 3D engine

Post by Gambit37 »

Very cool! I love that looking down the pit action, works really well :-) Some bugs there at the moment: you can still look down closed or invisible pits.

I tried a quick experiment of replacing the wall and floor graphics. A few problems here: the walls are rendered upside down and the palette is wrong. My walls were a sandy colour but came out blue! Also, the game wouldn't load if my images were in 8-bit, it only works with 24-bit images.

Now we just need GG to release his source code so you can port all this to RTC too! :-) :-D
User avatar
Rasmus
Ee Master
Posts: 714
Joined: Fri May 08, 2009 1:44 am
Location: Sweden
Contact:

Re: Converting CSBWin graphicengine to a OpenGL 3D engine

Post by Rasmus »

@bit:
I feelt that too when first trying it out. Got very exited because it really fellt so unnatural for DM but still natural to do.. This was a really good idea!
@Gambit:
The colors are fixed, I noticed that red and green colors where switched.. Nothing I have thought of before because wall, floor, and roof all where in grayscale, the upsidedown walls are also fixed.
And it is now posible to load bitmaps that have 16, 256 or true color. Which is good becuse it saves ALOT of diskspace..
The look thru closed and invisible pits haven't been fixed yet, but will be soon.
It would be really nice to get my hands on the RTC code.. It has so much posibilities :D
And thanks for pointing these bugs out so that I could fix them!
@Beo:
That sounds really interesting, I noticed that CSBBuild had some options with this, have to check it out :)
@Zoom:
The pitlooking haven't been fixed yet, but soon.. Thanks for pointing out that this version I used where having some bugs, I meant to upgrade it later but did it tonight instead. So now I have v11 instead, and I noticed that Conflux II worked on it. So this is really good :)
@Jan:
Thanks :) I know that it can interfear with the gameplay, right now I am only inserting the posibilities for it.. Later on I am going to insert it so that the dungeon designer himself will allow this or not. So the next months where things may get somewhat out of controll with this project, the posibilities I insert will be for the dungeon designers to use if like too or not..

New version:
- Updated CSBWIn to version 11.0.
- Bitmaps loaded can now be in 16 or 256 colors too.
- Walls, floors and roofs now have the right colors (red and green channels where switched before), and the walls are not longer upside down!

I hope you don't mind Zyx, but this version have the Conflux maps and graphics. Some graphics are still wrong, but the posibility to use dungeons and graphics as Conflux have are now proven..

Download: http://dmtribute.webs.com/Files/CSBWin3 ... 01105).zip

And screenshot:
Image
Last edited by Rasmus on Fri Nov 05, 2010 4:07 am, edited 1 time in total.
User avatar
Zyx
DSA Master
Posts: 2592
Joined: Mon Jun 05, 2000 1:53 pm
Location: in the mind
Contact:

Re: Converting CSBWin graphicengine to a OpenGL 3D engine

Post by Zyx »

Rasmus wrote:I hope you don't mind Zyx, but this version have the Conflux maps and graphics. Some graphics are still wrong, but the posibility to use dungeons and graphics as Conflux have are now proven..
YEEEEEEHAAA... erm, I mean, I don't mind.

The link doesn't work.
User avatar
Rasmus
Ee Master
Posts: 714
Joined: Fri May 08, 2009 1:44 am
Location: Sweden
Contact:

Re: Converting CSBWin graphicengine to a OpenGL 3D engine

Post by Rasmus »

Zyx wrote:
Rasmus wrote:I hope you don't mind Zyx, but this version have the Conflux maps and graphics. Some graphics are still wrong, but the posibility to use dungeons and graphics as Conflux have are now proven..
YEEEEEEHAAA... erm, I mean, I don't mind.

The link doesn't work.
Good to hear :)
Now the link is working..
User avatar
Bit
Arch Master
Posts: 1064
Joined: Mon Mar 03, 2008 10:53 am
Location: Nuts trees

Re: Converting CSBWin graphicengine to a OpenGL 3D engine

Post by Bit »

Gambit37 wrote:Now we just need GG to release his source code so you can port all this to RTC too! :-) :-D
I really do hope that there is an easy solution for plugging it into DSB. I don't want Sophia to be upside down, but it would be a big loss if that wouldn't be done too in the end. But first let Rasmus complete the current one now. We also don't know how much his studies will leave time for him - and those should have priority one.
User avatar
Gambit37
Should eat more pies
Posts: 13714
Joined: Wed May 31, 2000 1:57 pm
Location: Location, Location
Contact:

Re: Converting CSBWin graphicengine to a OpenGL 3D engine

Post by Gambit37 »

I just had a quick test of the new version and the colour channels are still wrong: my yellow walls are displaying in blue/green.

I noticed something funny, too. If you look down a pit and then jump down it and die, when you restart the saved game your party are looking down at the floor :-)
User avatar
Rasmus
Ee Master
Posts: 714
Joined: Fri May 08, 2009 1:44 am
Location: Sweden
Contact:

Re: Converting CSBWin graphicengine to a OpenGL 3D engine

Post by Rasmus »

Hehe, I got the colors right when using 16 or 256 colors bitmap, but forgot to change it when using true colors :?
Here is something I thru together in a couple om minutes by stealing graphics from dm2..
Image

But if you test it with 256 color bitmaps it should work for now anyway..

@Bit:
I have checked out DSB editor, and I know how powerful it is. The thing is that it would have been alot easier for me doing this with DSB than with CSBWin, and the results would get alot better too.. But as I personally can't change anything inside DSB I had to do it with CSBWin.. I will release the sourcecode soon, and if sophia would like to give it a shot translating the c++ code into DSB I would gladly help. Just as it didn't need that much changes in CSBWin, I don't think it would need that much changes in DSB either..

It can sometimes feel alittle bit unfair that because I have some 3D programming knowledge can go right in and alter some work and get credit for it, when I know that the big accomplishment is in creating all the code that isn't visible. I would never be able to port CSB from atari to PC. Neither would I be able to create gameengines as complex as RTC and DSB, at least not without spending alot more time than Sophia, Paul or George has..
Anyway, I will release the sourcecode for this with the next release, I just want the extra graphics in Conflux to work in the engine first.. Then I would gladly help with porting it to any other of the DM clones if there are interest.. But I will still continue on this project because this is the only DM sourcecode I have to work with for now..

And bit, you don't have to worry about my studies ;) My teacher is still learning out in Java language how to get a image bounce around inside a window. But next year we will get a little more hardcore I hope, and with this alittle bit more studies for me..
User avatar
beowuuf
Archmastiff
Posts: 20687
Joined: Sat Sep 16, 2000 2:00 pm
Location: Basingstoke, UK

Re: Converting CSBWin graphicengine to a OpenGL 3D engine

Post by beowuuf »

Conflux: O.O
DM2 walls: O.O

Curse you entertaining parents, curse you!
User avatar
Jan
Mighty Pirate
Posts: 2760
Joined: Tue Sep 23, 2008 4:55 pm
Location: Scumm Bar, Czech Republic

Re: Converting CSBWin graphicengine to a OpenGL 3D engine

Post by Jan »

Rasmus, I can just repeat that this is incredibly inspired! You seem to be spewing the code like a volcano! But - do you ever sleep? :)
Finally playing and immensely enjoying the awesome Thimbleweed Park-a-reno!
User avatar
Rasmus
Ee Master
Posts: 714
Joined: Fri May 08, 2009 1:44 am
Location: Sweden
Contact:

Re: Converting CSBWin graphicengine to a OpenGL 3D engine

Post by Rasmus »

@Jan: As I am a night worker, I almost never sleep at night, instead I sleep between 7 am and 2 pm at the day..
Those days I am free I hang out with my friends at the evenings, but when night comes there is accually nothing else to do for me than study, watch movies or do some programming..
I really enjoy working and living like this because about 50% of the days I have a full schedual, and the other 50 % I am totally free :)

But as I said before, there is accually not that much work behind this because til now I have only upgraded the visual posibilities behind all the hard work other has put down..

@Beo: I just say, curse the real life for getting in everybodys way :D
User avatar
Adamo
Italodance spammer
Posts: 1534
Joined: Fri Apr 22, 2005 11:59 am
Location: Poland
Contact:

Re: Converting CSBWin graphicengine to a OpenGL 3D engine

Post by Adamo »

256- colour bitmaps in CSBwin? Marvelous! How did you do it, Ras??
Is there a way to update 16- colour bitmaps to 256 colour ones in Conflux? No doubt this game deserves it..
Spoiler
(\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/)
Spoiler
(@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@)
Spoiler
(>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<)
User avatar
Rasmus
Ee Master
Posts: 714
Joined: Fri May 08, 2009 1:44 am
Location: Sweden
Contact:

Re: Converting CSBWin graphicengine to a OpenGL 3D engine

Post by Rasmus »

As I don't use the CSBWin:s graphicengine anymore, most things are posible ;)
There is no way to upgrade conflux bitmaps to more than 16 colors yet.. First I have to create some sort of editor that tells CSBWin what bitmaps to replace for higher color bitmaps. This is my next task..
User avatar
Zyx
DSA Master
Posts: 2592
Joined: Mon Jun 05, 2000 1:53 pm
Location: in the mind
Contact:

Re: Converting CSBWin graphicengine to a OpenGL 3D engine

Post by Zyx »

Which are the new keys in the demo?
User avatar
Rasmus
Ee Master
Posts: 714
Joined: Fri May 08, 2009 1:44 am
Location: Sweden
Contact:

Re: Converting CSBWin graphicengine to a OpenGL 3D engine

Post by Rasmus »

It is the same keys as before. If not, check so the config file are included. Otherwise just copy the file from any other CSBWin.
User avatar
Rasmus
Ee Master
Posts: 714
Joined: Fri May 08, 2009 1:44 am
Location: Sweden
Contact:

Re: Converting CSBWin graphicengine to a OpenGL 3D engine

Post by Rasmus »

I must add that I noticed something fun when extracting the DM2 graphics.. These wallsets doesn't use the same 160x111 resolution as the original DM, they go outside the bounderies to make the walls look less "squarish", this gave me an idea. What if I did the same? Then it may increase the visuals and make it look more realistic :) Have to give it a go tomorrow!!
User avatar
beowuuf
Archmastiff
Posts: 20687
Joined: Sat Sep 16, 2000 2:00 pm
Location: Basingstoke, UK

Re: Converting CSBWin graphicengine to a OpenGL 3D engine

Post by beowuuf »

Had a quick chance to play with the pit one - I was looking for the new 'look down' key until I realised you click on the pit!
User avatar
Rasmus
Ee Master
Posts: 714
Joined: Fri May 08, 2009 1:44 am
Location: Sweden
Contact:

Re: Converting CSBWin graphicengine to a OpenGL 3D engine

Post by Rasmus »

Yeah, sorry for not saying that.. At first I was wondering what key I should use.. But then it feelt so natural to just be able to click on the pit to look down. I will do the same with the roofpit later..
About the looking 45 degrees left and right I would like something simular, but don't really know how I would make this work without using extra keys.. hmmm
User avatar
Sphenx
On Master
Posts: 566
Joined: Sun Sep 09, 2001 11:23 am
Contact:

Re: Converting CSBWin graphicengine to a OpenGL 3D engine

Post by Sphenx »

Rasmus wrote:I must add that I noticed something fun when extracting the DM2 graphics.. These wallsets doesn't use the same 160x111 resolution as the original DM, they go outside the bounderies to make the walls look less "squarish", this gave me an idea. What if I did the same? Then it may increase the visuals and make it look more realistic :) Have to give it a go tomorrow!!
Yes, because wall tiles can overlay each other. This is more true for cave walls and thicket walls to give them more relief.

Why not even use PC DM2 graphics for items and such? There are already in 256 colors!
User avatar
Rasmus
Ee Master
Posts: 714
Joined: Fri May 08, 2009 1:44 am
Location: Sweden
Contact:

Re: Converting CSBWin graphicengine to a OpenGL 3D engine

Post by Rasmus »

That could be my primary task, recreating DM2 graphics and animations piece by piece until CSBWin with OpenGL looks like DM2 :)
User avatar
Bit
Arch Master
Posts: 1064
Joined: Mon Mar 03, 2008 10:53 am
Location: Nuts trees

Re: Converting CSBWin graphicengine to a OpenGL 3D engine

Post by Bit »

Nah - the common statement here is, that DM2 couldn't reach the atmosphere of DM, even with more colors.
Adding the OpenGL features to CSBwin like you did - that is indeed a very nice feature.
Adding that to the original DM2 would not be worth the effort.
I just hope that we (and with this I mean all the other ones being pretty active again) can finally present a lot of gifts that snowwhite drops the apple ;)
User avatar
Rasmus
Ee Master
Posts: 714
Joined: Fri May 08, 2009 1:44 am
Location: Sweden
Contact:

Re: Converting CSBWin graphicengine to a OpenGL 3D engine

Post by Rasmus »

Maybe I will go in another direction..
You got mail bit ;)
User avatar
Sphenx
On Master
Posts: 566
Joined: Sun Sep 09, 2001 11:23 am
Contact:

Re: Converting CSBWin graphicengine to a OpenGL 3D engine

Post by Sphenx »

Anyway, giving the 3D look for DM2 might be more difficult because it is not just about 'flat' walls. In the case of DM walls it works ok but with cave or thicket walls (roof and floor), applying a flat texture is actually worse than original 2D bitmaps. I would go on with 3D wall models to solve the problem. But I'm not giving more ideas to Rasmus :wink: let him just finish CSBWin3D for DM/CSB.
User avatar
Bit
Arch Master
Posts: 1064
Joined: Mon Mar 03, 2008 10:53 am
Location: Nuts trees

Re: Converting CSBWin graphicengine to a OpenGL 3D engine

Post by Bit »

Or bitmaps with heightfields - not each angle must be 90° ;)
User avatar
Rasmus
Ee Master
Posts: 714
Joined: Fri May 08, 2009 1:44 am
Location: Sweden
Contact:

Re: Converting CSBWin graphicengine to a OpenGL 3D engine

Post by Rasmus »

@Bit: As I mentioned before.. This would make it posible to create hills and mountains inside the game :)
@Sphenx: Accually, it doesn't matter how "bumpy" the DM2 graphic is.. What I use is a fake parallax mapping..
I have an extra image for the walls at the sides, one that shows the wall in a side perspective!
By doing this I get a fake bumpmapping, or even better parallaxmapping!

You can compare the images below:

Walls without side image:
Image

Walls with side image:
Image
User avatar
Bit
Arch Master
Posts: 1064
Joined: Mon Mar 03, 2008 10:53 am
Location: Nuts trees

Re: Converting CSBWin graphicengine to a OpenGL 3D engine

Post by Bit »

That looks pretty okay I'd say.
User avatar
Rasmus
Ee Master
Posts: 714
Joined: Fri May 08, 2009 1:44 am
Location: Sweden
Contact:

Re: Converting CSBWin graphicengine to a OpenGL 3D engine

Post by Rasmus »

Sometimes it is both easier, better and faster to cheat with this sort of things, now when I have 90 degrees turns, it is much better just skipping all 3d modeling and extra 3d effects :)
User avatar
Sphenx
On Master
Posts: 566
Joined: Sun Sep 09, 2001 11:23 am
Contact:

Re: Converting CSBWin graphicengine to a OpenGL 3D engine

Post by Sphenx »

You make CSBWin go 3D then you fake it? :shock: :mrgreen:

I'm sorry Rasmus, but I don't really get the difference on the classic DM1 grey wall, because for me it is flat by design.
Could you make the same example with DM2 cave wall for example? Maybe I'll understand more the difference of this parallaxmapping.
Post Reply

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