CSB potential update
Moderator: Zyx
Forum rules
Please read the Forum rules and policies before posting.
Please read the Forum rules and policies before posting.
- cowsmanaut
- Moo Master
- Posts: 4378
- Joined: Fri Jun 30, 2000 12:53 am
- Location: canada
CSB potential update
Would anyone notice and/or care if CSB win had smoother mouse, scalable window, high DPI (it's blurry otherwise), and work with touch?
- Paul Stevens
- CSBwin Guru
- Posts: 4319
- Joined: Sun Apr 08, 2001 6:00 pm
- Location: Madison, Wisconsin, USA
Re: CSB potential update
Are you suggesting yet another clone? Unless
someone enjoys hard work, I cannot find
any need for such a thing.
Moreover, you have posted this in the CSBwin
topic. If you want to improve the engine to
use better user interface, you should probably
start with DSB.
someone enjoys hard work, I cannot find
any need for such a thing.
Moreover, you have posted this in the CSBwin
topic. If you want to improve the engine to
use better user interface, you should probably
start with DSB.
- cowsmanaut
- Moo Master
- Posts: 4378
- Joined: Fri Jun 30, 2000 12:53 am
- Location: canada
Re: CSB potential update
Not a mistake. CSBwin being the closest to all the versions of DM available, for obvious reasons, was the preferred version. The goal here is just to update a few parts of the code to adapt to the current tech, like my Surface3 . Some of these changes were done last night already, and really only apply to people who want to play the originals.. and perhaps conflux..
- cowsmanaut
- Moo Master
- Posts: 4378
- Joined: Fri Jun 30, 2000 12:53 am
- Location: canada
- Paul Stevens
- CSBwin Guru
- Posts: 4319
- Joined: Sun Apr 08, 2001 6:00 pm
- Location: Madison, Wisconsin, USA
Re: CSB potential update
Well, if you do this work and you base it on CSBwin, then
I am willing to provide any help I can, short of actual
coding. And I certainly am interested in the result.
I am willing to provide any help I can, short of actual
coding. And I certainly am interested in the result.
Re: CSB potential update
When I made my DM/CSB-clones, I enhanced all graphical things to work with truecolor,
if an appropriate graphic file is available. I then exploded the graphics.dat-file and converted
the graphics to match mask colors. But I could not adjust the graphics caching system, so at a
certain point I decided to kick it off and simply load all into memory - which is maybe even then
risky, when the graphics sizes will not be enlarged. That's one thing. Another thing is, that there
is more code to be adjusted than one may think. i.e. a fluxcage-graphic or teleporter graphic, is
splitted in seperate parts that needs different code. And then - my code is pretty different to CSBwin.
And for the mouse:
For DM2 I used Allegro 5, which is able to run different threads, so interrupts can be emulated somehow by that.
In the end (and for truecolor expansion even here), I decided to throw out most of the HMI-driver (PC-version),
and replace it with something like a client/server-interface. Data exchange works here with queues that send click rectangles, eventcode and mousecursor-graphic-informations. In fact this works now, but I have to say, that I don't
spend much time into testing. Maybe that all works just for a few minutes... and then - I have no idea how to
convert that to the Win-API. What I want to say is: that's surely all not an easy task.
However, I maybe have the one or other hint when such a project would be set up - but won't do it on my own.
The more fascinating it is, how Rasmus could port all to 3D-environment in a short time.
if an appropriate graphic file is available. I then exploded the graphics.dat-file and converted
the graphics to match mask colors. But I could not adjust the graphics caching system, so at a
certain point I decided to kick it off and simply load all into memory - which is maybe even then
risky, when the graphics sizes will not be enlarged. That's one thing. Another thing is, that there
is more code to be adjusted than one may think. i.e. a fluxcage-graphic or teleporter graphic, is
splitted in seperate parts that needs different code. And then - my code is pretty different to CSBwin.
And for the mouse:
For DM2 I used Allegro 5, which is able to run different threads, so interrupts can be emulated somehow by that.
In the end (and for truecolor expansion even here), I decided to throw out most of the HMI-driver (PC-version),
and replace it with something like a client/server-interface. Data exchange works here with queues that send click rectangles, eventcode and mousecursor-graphic-informations. In fact this works now, but I have to say, that I don't
spend much time into testing. Maybe that all works just for a few minutes... and then - I have no idea how to
convert that to the Win-API. What I want to say is: that's surely all not an easy task.
However, I maybe have the one or other hint when such a project would be set up - but won't do it on my own.
The more fascinating it is, how Rasmus could port all to 3D-environment in a short time.
- cowsmanaut
- Moo Master
- Posts: 4378
- Joined: Fri Jun 30, 2000 12:53 am
- Location: canada
Re: CSB potential update
Not a clone Bit. This is just an update to the currently available CSBwin code to allow it to work on modern machines. Correcting DPI and aspect ratio, fixing lag issues that prevented it from working on my surface device for touch. Also aligning and scaling the view to fit the window. In addition to this, some clean up of the code, removing the inline assembly so that it can be compiled as 32 or 64 bit. I think he's finished it all already.. just need to do final testing.
- Paul Stevens
- CSBwin Guru
- Posts: 4319
- Joined: Sun Apr 08, 2001 6:00 pm
- Location: Madison, Wisconsin, USA
Re: CSB potential update
The latest versions of CSBwin should not have any inlinecowsmanaut wrote:removing the inline assembly
assembly. If it does, I would like to know about it. Certainly
the linux version does not because it runs equally well on
am x86 machine and an ARM machine.
- cowsmanaut
- Moo Master
- Posts: 4378
- Joined: Fri Jun 30, 2000 12:53 am
- Location: canada
Re: CSB potential update
Hmm, seems he went to the downloads on DMweb.free.fr .. the latest there was not the latest you've got on your page(we didn't know).. he has the latest now though.. Thanks for pointing that out.
Re: CSB potential update
I know.
About 64-bit-code: I still never tried it, but I assume it's possible to restrict pointer sizes to 4 bytes, else a lot of original structures run in troubles.
- cowsmanaut
- Moo Master
- Posts: 4378
- Joined: Fri Jun 30, 2000 12:53 am
- Location: canada
Re: CSB potential update
Some information and questions from the person doing the updates:
Out of curiosity, is there a reason it's not on GitHub? That's probably the best way to share and manage future changes with the world.
The changes I made locally:
1. Mark the app as high DPI aware in the manifest so it's not blurry on anything above 100% screen scaling
2. Make WM_MOUSEMOVE fallthrough to WM_TIMER so that moving the cursor is smooth
3. Instead of the hardcoded scaling sizes, use StretchBlt to scale to the window size (using 'touch from inside' style to preserve the aspect ratio).
4. Default to 4x3 aspect ratio, as this is how it originally looked (with an option to revert to the 8x5 current ratio)
5. Use Direct2D to do the scaling, as StretchBlt doesn't perform well on a 4K screen at all.
The changes are pretty simple, but make it feel a lot nicer. The fullscreen mode could be made into a toggle at runtime, but fullscreen on a large display looks really bad.
Some questions:
Is there any harm in calling UIM_TIMER at 60hz or higher? If there isn't, it might be better to change from WM_TIMER messages & a GetMessage message pump to a PeekMessage loop that is throttled by vsync.
There's some things I'm not sure are intended. Like using PostQuitMessage to exit on any error, as PostQuitMessage doesn't exit an app until there are no window messages pending. Might be safer to DestroyWindow here instead. I also had to disable CheckAllocated as it seems to be relying on internal behavior of the C allocator. (#ifdef WIN98... haha)
What's the oldest OS and compiler the current code is meant to run on?
Out of curiosity, is there a reason it's not on GitHub? That's probably the best way to share and manage future changes with the world.
The changes I made locally:
1. Mark the app as high DPI aware in the manifest so it's not blurry on anything above 100% screen scaling
2. Make WM_MOUSEMOVE fallthrough to WM_TIMER so that moving the cursor is smooth
3. Instead of the hardcoded scaling sizes, use StretchBlt to scale to the window size (using 'touch from inside' style to preserve the aspect ratio).
4. Default to 4x3 aspect ratio, as this is how it originally looked (with an option to revert to the 8x5 current ratio)
5. Use Direct2D to do the scaling, as StretchBlt doesn't perform well on a 4K screen at all.
The changes are pretty simple, but make it feel a lot nicer. The fullscreen mode could be made into a toggle at runtime, but fullscreen on a large display looks really bad.
Some questions:
Is there any harm in calling UIM_TIMER at 60hz or higher? If there isn't, it might be better to change from WM_TIMER messages & a GetMessage message pump to a PeekMessage loop that is throttled by vsync.
There's some things I'm not sure are intended. Like using PostQuitMessage to exit on any error, as PostQuitMessage doesn't exit an app until there are no window messages pending. Might be safer to DestroyWindow here instead. I also had to disable CheckAllocated as it seems to be relying on internal behavior of the C allocator. (#ifdef WIN98... haha)
What's the oldest OS and compiler the current code is meant to run on?
- Paul Stevens
- CSBwin Guru
- Posts: 4319
- Joined: Sun Apr 08, 2001 6:00 pm
- Location: Madison, Wisconsin, USA
Re: CSB potential update
I am anxious to adopt any of those changes that fit
well into the original. I appreciate the labor you have
put into this effort.
One of my tests that I think you should try:
Each of my Chaos Strikes Back and Dungeon Master
releases comes with a 'playfile.log' that plays a complete
game. They should work with your changes. I think you
should try them.
You had three questions:
still work.
than I. Actually, undoubtedly.
on earlier versions but I have not tested it. When I compile
on my Windoze 10 machine I find problems running it on XP.
well into the original. I appreciate the labor you have
put into this effort.
One of my tests that I think you should try:
Each of my Chaos Strikes Back and Dungeon Master
releases comes with a 'playfile.log' that plays a complete
game. They should work with your changes. I think you
should try them.
You had three questions:
I have no idea. Try it and see if the tests mentioned aboveIs there any harm in calling UIM_TIMER at 60hz or higher
still work.
No question. So no answer. You probably know more about thisMight be safer to DestroyWindow here instead
than I. Actually, undoubtedly.
I compile and test it on an XP machine. I hope it will runWhat's the oldest OS and compiler the current code is meant to run on
on earlier versions but I have not tested it. When I compile
on my Windoze 10 machine I find problems running it on XP.
- Paul Stevens
- CSBwin Guru
- Posts: 4319
- Joined: Sun Apr 08, 2001 6:00 pm
- Location: Madison, Wisconsin, USA
Re: CSB potential update
I'm not interested in managing future changes. ThisOut of curiosity, is there a reason it's not on GitHub? That's probably the best way to share and manage future changes with the world.
project is pretty much a wrap. I do not foresee making
any but minor detail modifications. I would be happy to
attempt to incorporate your suggestions. With great care.
But I will do it myself. I don't want anyone else fiddling
with the editor/engine that has my name on it. On the
other hand, I would be very happy to present your version
of the game alongside mine with text such as "Upgraded
version by xxx and yyy". I did this with the macintosh
conversion and the original Linux conversion. I took no
responsibility for those releases. I think Christophe, too,
would be willing to host your work. On the other hand,
you are perfectly free to present your version as your own.
I will not be offended. I have had my day of recognition.
- cowsmanaut
- Moo Master
- Posts: 4378
- Joined: Fri Jun 30, 2000 12:53 am
- Location: canada
Re: CSB potential update
The Reply:
I tested it with the playfile.log and it played through to winning the game, so all seems to work. Though that took longer than expected due to having to figure out that only 7zip is able to unzip the archive.
The Direct2D changes require Windows 7 or higher, so that's probably not what you want. It was the easiest way I saw to use hardware acceleration to draw the screen.
For anyone curious it does not work on 64-bit, it'll compile fine and run but dies right away as it does 'i32<->pointer' conversions.
I gave Cowsmanaut the binary, he can share it if anyone else wants to see how it behaves. Would you mind if *I* put the source up on Github?
I tested it with the playfile.log and it played through to winning the game, so all seems to work. Though that took longer than expected due to having to figure out that only 7zip is able to unzip the archive.
The Direct2D changes require Windows 7 or higher, so that's probably not what you want. It was the easiest way I saw to use hardware acceleration to draw the screen.
For anyone curious it does not work on 64-bit, it'll compile fine and run but dies right away as it does 'i32<->pointer' conversions.
I gave Cowsmanaut the binary, he can share it if anyone else wants to see how it behaves. Would you mind if *I* put the source up on Github?
- Paul Stevens
- CSBwin Guru
- Posts: 4319
- Joined: Sun Apr 08, 2001 6:00 pm
- Location: Madison, Wisconsin, USA
Re: CSB potential update
Not at all. Do with it what you wish. Sell it if youWould you mind if *I* put the source up on Github?
can find a way to make a dollar. After all, I stole
it from the original.
- cowsmanaut
- Moo Master
- Posts: 4378
- Joined: Fri Jun 30, 2000 12:53 am
- Location: canada
- Paul Stevens
- CSBwin Guru
- Posts: 4319
- Joined: Sun Apr 08, 2001 6:00 pm
- Location: Madison, Wisconsin, USA
Re: CSB potential update
You're welcome and thanks for asking.
For reasons beyond my understanding, I would
probably have felt differently if you had not asked.
Will robots ever be *THAT* complicated?
For reasons beyond my understanding, I would
probably have felt differently if you had not asked.
Will robots ever be *THAT* complicated?
- cowsmanaut
- Moo Master
- Posts: 4378
- Joined: Fri Jun 30, 2000 12:53 am
- Location: canada
Re: CSB potential update
So I don't have the code yet.. he's been distracted by other things. I do however have the updated exe for CSBwin if anyone wants to try it. I've tested it on my surface 3 pro, and my desktop.. seems stable enough, and in his tests it played all the way through.. so it should be good.
https://drive.google.com/file/d/0B0aV40 ... sp=sharing
let me know if you have any issues.. I can always try to use a .7z instead of a zip if it prevents you downloading it.
https://drive.google.com/file/d/0B0aV40 ... sp=sharing
let me know if you have any issues.. I can always try to use a .7z instead of a zip if it prevents you downloading it.
- ChristopheF
- Encyclopedist
- Posts: 1544
- Joined: Sun Oct 24, 1999 2:36 pm
- Location: France
- Contact:
Re: CSB potential update
In my test, the mouse cursor does not work at all in both the Utility and the Hint Oracle: I am unable to click anywhere in the menus, so I cannot make a new adventure.
Christophe - Dungeon Master Encyclopaedia
- cowsmanaut
- Moo Master
- Posts: 4378
- Joined: Fri Jun 30, 2000 12:53 am
- Location: canada
Re: CSB potential update
Thanks Christophe,
updated the above link with the new versions:
"It was something I fixed initially, but it didn't seem to break anything by not fixing it the second time (with the updated CSBWin code)
But now I see what it's for"
We hadn't tested the utility, so now it's been checked with the new version. If you can have a peek at let me know if this one works fine?
updated the above link with the new versions:
"It was something I fixed initially, but it didn't seem to break anything by not fixing it the second time (with the updated CSBWin code)
But now I see what it's for"
We hadn't tested the utility, so now it's been checked with the new version. If you can have a peek at let me know if this one works fine?
- cowsmanaut
- Moo Master
- Posts: 4378
- Joined: Fri Jun 30, 2000 12:53 am
- Location: canada
- ChristopheF
- Encyclopedist
- Posts: 1544
- Joined: Sun Oct 24, 1999 2:36 pm
- Location: France
- Contact:
Re: CSB potential update
It works fine with the updated version, thanks.
Christophe - Dungeon Master Encyclopaedia
- cowsmanaut
- Moo Master
- Posts: 4378
- Joined: Fri Jun 30, 2000 12:53 am
- Location: canada
Re: CSB potential update
He's looking for more suggestions and is interested in CSBWin allowing you to select the dungeon.dat and graphics.dat files at start so you don't need to mess with anything if you want to play DM, CSB, Conflux, etc. also wants to remove the RGB555/RGB565 code as true color is universal at this point.
So.. any suggestions? or requests of how they would like to see these implemented?
So.. any suggestions? or requests of how they would like to see these implemented?
- Paul Stevens
- CSBwin Guru
- Posts: 4319
- Joined: Sun Apr 08, 2001 6:00 pm
- Location: Madison, Wisconsin, USA
Re: CSB potential update
I have been rather proud of the fact that CSBwin
can be compiled and run on X86 Linux with either
SDL 1.2 or SDL 2.0 and can run very nicely on
the Raspberry Pi with ARM architecture. I even
supply binaries for popular systems.
Do you plan to retain this capability? Do you have
a release for these platforms? If not, I think
that it would be nice for your releases to point to
my CSBwin (or to the encyclopaedia page of clones)
for folks not using Windoze. It would
be a shame for such people to discover your updated
version and come to the conclusion that they were
out-of-luck.
can be compiled and run on X86 Linux with either
SDL 1.2 or SDL 2.0 and can run very nicely on
the Raspberry Pi with ARM architecture. I even
supply binaries for popular systems.
Do you plan to retain this capability? Do you have
a release for these platforms? If not, I think
that it would be nice for your releases to point to
my CSBwin (or to the encyclopaedia page of clones)
for folks not using Windoze. It would
be a shame for such people to discover your updated
version and come to the conclusion that they were
out-of-luck.
- cowsmanaut
- Moo Master
- Posts: 4378
- Joined: Fri Jun 30, 2000 12:53 am
- Location: canada
Re: CSB potential update
response:
"I didn't want to intentionally break portability, but without building all platforms these things inevitably happen. Pointing to your pages is a great idea either way. I can put whatever you want to say on there, or give you access to post yourself.
I'd already set the project web link to the CSBWin forum on dungeon-master.com."
"I didn't want to intentionally break portability, but without building all platforms these things inevitably happen. Pointing to your pages is a great idea either way. I can put whatever you want to say on there, or give you access to post yourself.
I'd already set the project web link to the CSBWin forum on dungeon-master.com."
- Paul Stevens
- CSBwin Guru
- Posts: 4319
- Joined: Sun Apr 08, 2001 6:00 pm
- Location: Madison, Wisconsin, USA
Re: CSB potential update
That makes me happy enough. Thanks.I'd already set the project web link to the CSBWin forum on dungeon-master.com."
Re: CSB potential update
Cowsmanaut, I successfully executed your version using Win 10, but it did not work for me on Win 7 (64b) nor Win XP (64b or 32b) (exe can't start).
I can't either compile the source from git, first complain with "d2d1_1.h" in stdafx.h. What is your compilation setup ?
I can't either compile the source from git, first complain with "d2d1_1.h" in stdafx.h. What is your compilation setup ?
- Paul Stevens
- CSBwin Guru
- Posts: 4319
- Joined: Sun Apr 08, 2001 6:00 pm
- Location: Madison, Wisconsin, USA
Re: CSB potential update
The executable from the link about eight responses above:
https://drive.google.com/file/d/0B0aV40 ... sp=sharing
Worked for me on Windoze 7-32bit. If nobody else chimes in,
I will try it later tonight on XP.
https://drive.google.com/file/d/0B0aV40 ... sp=sharing
Worked for me on Windoze 7-32bit. If nobody else chimes in,
I will try it later tonight on XP.
- cowsmanaut
- Moo Master
- Posts: 4378
- Joined: Fri Jun 30, 2000 12:53 am
- Location: canada
- Paul Stevens
- CSBwin Guru
- Posts: 4319
- Joined: Sun Apr 08, 2001 6:00 pm
- Location: Madison, Wisconsin, USA