skwin work in progress

Chat about "The Legend of Skullkeep", the true sequel to the original Dungeon Master.
This forum may contain spoilers.
Forum rules
Please read the Forum rules and policies before posting.
Post Reply
kentaro-k.21
Artisan
Posts: 178
Joined: Wed Dec 17, 2003 1:39 am
Location: Osaka, Japan
Contact:

skwin work in progress

Post by kentaro-k.21 »

it is work in Progress A dm2 port, will work on modern windows operating System.
it had started Since jan 2006. in those days i worked With dosbox. dosbox has effective debugging Or analyzing feature for guest dos program.
i activated it with visual studio, and extended the dosbox suitable for Reverseengineering. the intention is explodeing the Disassembled source code.
i started at game save code for first interpretation. because i have no Intension to port dm2 those days just i'm interesting how about Sksave file format. `2'
kentaro-k.21
Artisan
Posts: 178
Joined: Wed Dec 17, 2003 1:39 am
Location: Osaka, Japan
Contact:

Post by kentaro-k.21 »

this is the best progress about my porting work. it'll be in very very early stage (still have many problems).
it contains test dungeon, and modified DM2 graphics data file partially translated in English language (others are still japanese).
the ported package does not contain swoosh, title and ending. they don't appear on specific timing you expect. just fire and ibmio are ported, and compiled into one executable windows program.
some i/o peripherals like video, sound, timer, keyboard and mouse are simulated on windows devices, or implemented temporarily about MFC build ver. the video is implemented in user32 and GDI. fullscreen is not available for now. timer thing is completely faked, however it seems it works well. keyboard and mouse inputs are provided by windows user32. you can select one of sound technology way no, windows media, direct sound and openal as sound output method. you need openal installed on your pc if you select open al for sound output. find it at http://www.openal.org/
the save and load features will contain errors in their work result. plz avoid to use.
you may encounter clear errors while trial play , which should be fixed. most problems may be pended even if you report it because i won't understand how to repair it. i won't recognize most part of ported codes (i understand the actual working about some of c runtime, memory management, video bit bliting, graphics&dungeon&sksave file data io, dungeon database manipulating codes, etc). e.g. i don't have good resolution to repair if a creature persistently move around you instead of getting you. it'll take so much patience and effort to find out the issue code. maybe it is constructive to show how to repair it if possible, and i'll prepare the minimal method to help proceeding it in near future.
this will work on windows 2000/xp or later. i don't test it on various environments yet.

http://kkdf2.sakura.ne.jp/dmfiles/DM2_S ... s.Rev.9.7z (src+bin+FTL's copyrighted dats, 2.09MB)
& type 2 for pass.

EDIT: Link updated on Dec 2, 2010.
Last edited by kentaro-k.21 on Thu Dec 02, 2010 5:49 am, edited 2 times in total.
User avatar
Adamo
Italodance spammer
Posts: 1534
Joined: Fri Apr 22, 2005 11:59 am
Location: Poland
Contact:

Post by Adamo »

hello Kentaro!
I checked your kkdf2.sakura.ne.jp/dmfiles/DM2_SKSAVE_Converters.Rev.5.rar
Is it a DM2 windows partially converted game? Or your own creation?

However, I`ve got som questions.
In DM2 the "wallsets engine" is rebuilt (more developed) than in DM/CSB. The DM2 engine displays the wallsets in "4-step distance" way, instead of the "3-step distance way" in previous parts. Do you know, how DM2 program displays the wallsets, especially comparing to first part?
There`s also a "double step" movement, wchich I think no one likes (the original step-by-step movement was much better).

I know there are a lot of changes in the wallset displaying engine.
I`m just curious if it would be possible to rebuild DM/CSB (eg. CSBwin) wallset engine so there was also one more step to display, like it is in DM2? Of course without additional animations, double-step movement etc. I know it would require a lot of other changes like displaying monsters, wall and floor decorations and projectiles in 4th step distance, changing the existing perspective system, rebuilding existing wallsets, etc, etc, etc, but my question is only theoretical.
Spoiler
(\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/)
Spoiler
(@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@)
Spoiler
(>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<)
kentaro-k.21
Artisan
Posts: 178
Joined: Wed Dec 17, 2003 1:39 am
Location: Osaka, Japan
Contact:

Post by kentaro-k.21 »

hi Adamo.
thanks for trying !
I checked your kkdf2.sakura.ne.jp/dmfiles/DM2_SKSAVE_Converters.Rev.5.rar
Is it a DM2 windows partially converted game? Or your own creation?
it is a partially converted game.
In DM2 the "wallsets engine" is rebuilt (more developed) than in DM/CSB. The DM2 engine displays the wallsets in "4-step distance" way, instead of the "3-step distance way" in previous parts. Do you know, how DM2 program displays the wallsets, especially comparing to first part?
hmm. difficult. anyway i don't understand both engine well. correct me if something is wrong.

i found following figure at Paul's documentation site. CSBwin may use following stone cells style. (P is your viewpoint).

Code: Select all

--------------------------
| 0  | 4  | 6  | 5  | 1  |
|    |    |    |    |    |
--------------------------
| 2  | 7  | 9  | 8  | 3  |
|    |    |    |    |    |
--------------------------
| 10 | 12 | 14 | 13 | 11 |
|    |    |    |    |    |
--------------------------
     | 15 | 17 | 16 |
     |    |    |    |
     ----------------
     | 18 | 20 | 19 |
     |    | P  |    |
     ----------------
each cell will be represented in structure SUMMARIZEROOMDATA. the following code is brought from CSBwin. it also includes CSBwin specific extended feature thing. important thing is roomType, rn2 and decorations variables. roomType contains cell type one of wall, floor, door, stair, teleporter, pitfall, false wall, and unknown. rn2 is record link associated with the cell. it may point first one of database record (door, teleporter, text, actuator, creature, weapon, cloth, scroll, potion, chests, misc items, 11, 12, 13, missile and cloud). decorations are indices of wall and floor ornates.

Code: Select all

struct SUMMARIZEROOMDATA
{
  i32 x, y, relativeCellNumber;
  i32 skinNumber;
  ROOMTYPE roomType;
  i32 championPortraitOrdinal;
  GRAPHICROOMTYPE graphicRoomType;
  RN  rn2;
  i32 decorations[3]; //right, front, left
  RN text[3]; //right, front, left
};
a DM2(skwin) uses following stone cells style. (0 is your viewpoint).

Code: Select all

//   |--|--|--|--|--|--|--|
// 4 |21|19|17|16|18|20|22|
//   |--|--|--|--|--|--|--|
// 3 |  |14|12|11|13|15|  |
//   |--|--|--|--|--|--|--|
// 2 |  | 9| 7| 6| 8|10|  |
//   |--|--|--|--|--|--|--|
// 1 |  |  | 4| 3| 5|  |  |
//   |--|--|--|--|--|--|--|
// 0 |  |  | 1| 0| 2|  |  |
//   |--|--|--|--|--|--|--|
each cell will have following structure skxxx6 brought from skwin source. this will contain minimal summary data found in CSBwin. roomType will be presented as w0, rn2 -> w4 and decorations -> w6.

Code: Select all

struct skxxx6 { // 16 bytes
	U16 w0;							// @0 // tiletype
	U16 w2;							// @2 // tileval?
	U16 w4;							// @4 // tile record
	U16 w6[4];						// @6 // ornate index in GDAT
	U16 w14;						// @14
	DMEncyclopaedia::ObjectID id4() const { return w4; }
};
and some points:
(1) it seemss CSBwin considers about "4-step distance" way.
(2) both CSBwin and a DM2 have summary room data. they would share basic primitive information. they will be incompatible about advanced parts like drawing creature or something.
re`s also a "double step" movement, wchich I think no one likes (the original step-by-step movement was much better).
i tried it. and i noticed that it is difficult to remove it completely. but i can still restrict it in halfway.
I`m just curious if it would be possible to rebuild DM/CSB (eg. CSBwin) wallset engine so there was also one more step to display, like it is in DM2?
probably it'll become incompatible clone compared to original CSBwin if it is possible...
Tom Hatfield
Ee Master
Posts: 688
Joined: Mon May 07, 2001 7:00 pm
Location: Indiana, USA
Contact:

Post by Tom Hatfield »

Adamo wrote:There`s also a "double step" movement, wchich I think no one likes
I like it.
kentaro-k.21
Artisan
Posts: 178
Joined: Wed Dec 17, 2003 1:39 am
Location: Osaka, Japan
Contact:

Post by kentaro-k.21 »

the source code will be avail soon.

it can be compiled and debugged in some freely avail development tools.
u++ the ide screenshot link
visual c++ 2005 express scsho link
User avatar
Paul Stevens
CSBwin Guru
Posts: 4318
Joined: Sun Apr 08, 2001 6:00 pm
Location: Madison, Wisconsin, USA

Post by Paul Stevens »

visual c++ 2005 express
Line 59,910? Wow! Modular it ain't. :wink:
kentaro-k.21
Artisan
Posts: 178
Joined: Wed Dec 17, 2003 1:39 am
Location: Osaka, Japan
Contact:

Post by kentaro-k.21 »

here is current working source code. it includes:
* converted c++ source code files.
* project file for Ultimate++ 2007.1, also minimal tutorial to setup build environment.
* project file for visual studio 2005.

kkdf2.sakura.ne.jp/dmfiles/DM2_SKSAVE_Converters.Rev.6.src.rar

this is not all i can supply. i'll publish more contents useful to understanding this clone's origin well.
kentaro-k.21
Artisan
Posts: 178
Joined: Wed Dec 17, 2003 1:39 am
Location: Osaka, Japan
Contact:

Post by kentaro-k.21 »

hi.
here is a next release of skwin.
some problem are fixed. it is getting a little bit playable than prior release.
there are still problems. they are identified by WIP tag found in below changes.
if you are good kind to test skwin and found any bugs not listed below, please report it.

Rev.7 @20070722
* minor problems fixed release.
* fix: fix wrong wall rendering.
* fix: sometimes floor renders wrong.
* fix: eliminate :P icon on wall rendering.
* fix: in the inventory player name won't be rendered.
* fix: creature won't do half step moving.
* fix: flying missile disappears from screen if it is in some tile position N or E.
* fix: item cannot be picked up.
* fix: you throw, and hit wall, then it drops at wrong position.
* fix: throw item goes wrong side.
* fix: missile explosion won't appear.
* fix: sleep device causes assertion on activation.
* fix: minion map hides objects on certain player dir.
* fix: get unstable after minion is released.
* fix: every door's button is invisible and non-pushable.
* fix: you acquire eye of time other than torch when you take wall touch.
* fix: the wall window frame disappears.
* fix: the wall window curtain won't wave.
* fix: even floating creature can fall down the pit.
* fix: every creature acts as pit ghost.
* fix: the boulder is always rotatable but movable.
* fix: the table duplicates itself when it is moved by player.
* fix: the table drops someone's remain instead of plank when it is broken.
* fix: the key vanishes when you insert it to key hole.
* fix: sun crest holder vanishes when you hang it up at wall.
* fix: get halted if you see room's window.
* fix: you stand at wrong direction when you enter map boundary.
* fix: the screen messed up when it begins rain.
* fix: spell cast fails so much more than expected times.
* fix: door decoration causes assertion when you see it.
* fix: teleporter ignores direction settings.
* fix: cross scene actuator causes assertion when you see it.
* imp: extra option to disable player's half step moving.
* fix: the cursor hides permanently when you eat something.
* fix: shop panel is broken and exhibits non merchandice items.
* imp: port startup program anim.
* fix: the outside looks wrong when it begins to rain.
* WIP: clan key won't be accepted at castle entrance.
* WIP: error causes when anyone throws something into map exit tile.
* WIP: the map exit becomes invisible wall, where it should be solid wall.
* WIP: spectre acts like porter minion.
* WIP: game load won't work correctly.
* WIP: game save won't work correctly.
* WIP: creature's rendering order is irregular against its depth position.
* WIP: assertion causes when you defeat a creature.
* WIP: static creatures are moving around.
* WIP: tornedo throws a door object as a missile. it should be bolt but door.
* WIP: missile explosion looks wrong positon.

this archive contains files for playing on windows environment. the source code release'll be in near future. thanks

kkdf2.sakura.ne.jp/dmfiles/DM2_SKSAVE_Converters.Rev.7.rar
keyword is 2.
User avatar
Paul Stevens
CSBwin Guru
Posts: 4318
Joined: Sun Apr 08, 2001 6:00 pm
Location: Madison, Wisconsin, USA

Post by Paul Stevens »

Oh, my! I am very impressed.
User avatar
ChristopheF
Encyclopedist
Posts: 1537
Joined: Sun Oct 24, 1999 2:36 pm
Location: France
Contact:

Post by ChristopheF »

I am very impressed.
That's what I said for csbwin. I also say it for skwin!
kentaro-k.21
Artisan
Posts: 178
Joined: Wed Dec 17, 2003 1:39 am
Location: Osaka, Japan
Contact:

Post by kentaro-k.21 »

thanks!

i got the great help from both CSBwin source code, and technical documents (Dungeon, Data files sections) in DM Encyclopedia. i thank you for their helpful resources. credits are scribbled in source code :D

i'll spend times to do minor bug fixes. it would be good dictionary to write "capture" about technical contents (e.g. damage calculation) if it can be almost pure clone. currently it is unpure due to indefinite mis-conversions. because the porting work is in progress by mainly handwork, with specific tools for saving time. then i'll cost much time to explore and reveal the internal structure of DM2 engine, also write the documentation.
therefore remodeling of engine (like new features found in CSBwin and not found in original DM of atari version?) may be so much delayed, if anyone is willing to wait for it...
kentaro-k.21
Artisan
Posts: 178
Joined: Wed Dec 17, 2003 1:39 am
Location: Osaka, Japan
Contact:

Post by kentaro-k.21 »

hi.
here is minor update of skwin.

it is still TEST version. you can't expect usual result like playing retail DM2.

yesterday, my point was that fix outstanding problems which are easy to find. however it may be better that the game is more playable, even if visual or minor problems are still there.

CHANGES:

Rev.8 @20071231
* fix: fireplace won't be lit.
* fix: gc won't collect recyclable items.
* fix: game load won't work correctly.
* fix: clan key won't be accepted at castle entrance.
* fix: creature generator called wrong procedure.
* fix: error causes when anyone throws something into map exit tile.
* fix: the map exit becomes invisible wall, where it should be solid wall.
* fix: missile explosion looks wrong positon.
* fix: flying magic missle looks wrong passing/coming pattern.
* fix: tornedo throws a door object as a missile. it should be bolt but door.
* fix: static creatures are moving around.
* fix: right side of door frame is imbalance.
* fix: 3d sound buffer's position is incorrect. it's at a little bit right position.
* WIP: table move operation selects incorrect destination against cursor location.
* WIP: creature's rendering order is irregular against its depth position.
* WIP: assertion causes when you defeat a creature.
* WIP: game save won't work correctly.
* WIP: light level is always bright.
* WIP: switch for brighter gamma correction.
* WIP: creature sometimes disappears on specific 5x5 pos while moving back or forward.
* WIP: spectre acts like porter minion.
* WIP: porter minion won't carry.

kkdf2.sakura.ne.jp/dmfiles/DM2_SKSAVE_Converters.Rev.8.rar
keyword is 2.

contents:
- modified graphics.dat for partial English language translation
- dungeon.dat
- A Win32 executable
- src (for VS.NET 2005, U++)
- src build tutorial for U++ 2007.1
- changes
User avatar
Sphenx
On Master
Posts: 566
Joined: Sun Sep 09, 2001 11:23 am
Contact:

Re: skwin work in progress

Post by Sphenx »

I wonder if Kentaro updated further this project ? It is a(nother) great job Kentaro did !

I took it back and made a (partial) successful debug build (compiling with an old MS VC++ 6)
Now I could do some tracing to understand more about DM2 engine. I'm interested about creatures AI and items definition so that I may generate custom DM2 graphics.dat.
User avatar
Rasmus
Ee Master
Posts: 714
Joined: Fri May 08, 2009 1:44 am
Location: Sweden
Contact:

Re: skwin work in progress

Post by Rasmus »

Wait a minute, what is this? Is it a "playable" version of DM2 with sourcecode??
User avatar
Bit
Arch Master
Posts: 1064
Joined: Mon Mar 03, 2008 10:53 am
Location: Nuts trees

Re: skwin work in progress

Post by Bit »

The source is from one of the 16-bit-PC-versions, very close to a disassembling. Also, it seems to be 16-color-graphics, dos4gw-version has really better graphics. And then all messages appear in japanese.
But we will try to summon Kentaro, probably he can help much in the new project - at least he may know where the real sk-code begins - with all that driver- and dos4gw-stuff that's still hidden in the fog. And he's surely very experienced in assembler-things.
His source is probably very worthful for further analysis. Sphenx goes deeper into it, but he also reports some problems.
Checking Kentaro's homepage, we found that he just updated an article about actuators the weekend.
So - half of the summon spell already worked ;)
User avatar
Rasmus
Ee Master
Posts: 714
Joined: Fri May 08, 2009 1:44 am
Location: Sweden
Contact:

Re: skwin work in progress

Post by Rasmus »

Oh well, just looked at the sourcecode and got a a headace :(
A guess this is a job for bit ;)
kentaro-k.21
Artisan
Posts: 178
Joined: Wed Dec 17, 2003 1:39 am
Location: Osaka, Japan
Contact:

Re: skwin work in progress

Post by kentaro-k.21 »

Hi.

@Bit
Sphenx told me about you! you are trying to port DM2.
Bit wrote:The source is from one of the 16-bit-PC-versions, very close to a disassembling. Also, it seems to be 16-color-graphics, dos4gw-version has really better graphics. And then all messages appear in japanese.
Yep, it is based on IBM PS/V version (http://dmweb.free.fr/?q=node/861), one of 16bit PC version.

Also graphics are 16 colors. It's right!

About Japanese messages, there's a chance to change the language by editing graphics.dat.
But we will try to summon Kentaro, probably he can help much in the new project - at least he may know where the real sk-code begins - with all that driver- and dos4gw-stuff that's still hidden in the fog. And he's surely very experienced in assembler-things.
Ahh, sorry.

I don't know any about dos4gw (and also 32bits protected mode programming).

However DM2 PC version and dos4gw seem to work with recent DOSBox.
DOSBox is open source, and it will be helpful to disassemble DM2 PC codes.
His source is probably very worthful for further analysis. Sphenx goes deeper into it, but he also reports some problems.
I have learned a lot of DMEngine's knowledge from CSBwin source code ported by Paul Stevens.
It greatly helps for my porting work.
at least he may know where the real sk-code begins
Sorry, I have no clue about it.

But I'll be able to help you.

I'm curious to know how to get disassemble code from SKULL.exe.
How would you think about it.

In my case, I mutated DOSBox to "realtime disassembled code writer", because I have no clue about disassembler tools.

Thanks
User avatar
Bit
Arch Master
Posts: 1064
Joined: Mon Mar 03, 2008 10:53 am
Location: Nuts trees

Re: skwin work in progress

Post by Bit »

Ha - the spell worked! Fine to have you here again!!!
Just the night Sphenx sent me a PM that he managed to get your things to work, and is able now to modify the things he wanted.
I will soon prepare a package for you that represents the current state.

edit - technical things removed

Let's hope that no one disturbs on sunday, then I can prepare a source and the tools for you if you want.
I can imagine pretty good how much work you did put into that - would be a shame if we do that new project without you.
Ha - I really love the people here :)
Last edited by Bit on Sat Oct 16, 2010 6:54 am, edited 1 time in total.
kentaro-k.21
Artisan
Posts: 178
Joined: Wed Dec 17, 2003 1:39 am
Location: Osaka, Japan
Contact:

Re: skwin work in progress

Post by kentaro-k.21 »

Hi, Bit.

Ok, I'll help your DM2 porting partially.
I'll study the DM2 PC code (SKULL.exe) from disassembling so that I can help you at some parts.

Thanks.
User avatar
Sphenx
On Master
Posts: 566
Joined: Sun Sep 09, 2001 11:23 am
Contact:

Re: skwin work in progress

Post by Sphenx »

Hello all

Just wanted to say Kentaro progressed well on SKWin and it is now more playable (but still not complete).
I have compiled special versions (containing sources) here http://dmbuilder.sphenxmusics.fr/skwin/skwinspx.zip (~5MiB) with superheroes and some modifications (also in dungeon map for testing stuff). Beware, the modified version is super fast!
Anyway, it is real fun to dig into the code and try new stuff :)

Another chance to try a japanese version of DM2 :)
User avatar
Rasmus
Ee Master
Posts: 714
Joined: Fri May 08, 2009 1:44 am
Location: Sweden
Contact:

Re: skwin work in progress

Post by Rasmus »

Looking good Sphenx :)
User avatar
zoom
Grand Master
Posts: 1819
Joined: Tue Sep 23, 2003 1:27 am
Location: far away but close enough

Re: skwin work in progress

Post by zoom »

also taken a look. great! Some things going wrong with stairs, but I do not know if that is intentional/ not avoidable/ ok with you atm..
Thank you for this, kentaro-k.21 and Sphenx looking forward!

Beware, the modified version is super fast!
However, the game runs very slow for me! Too slow to play it properly. Maybe to do with staircase graphics-glitch?

Have only limited time , will try out to set or switch something off later in the menue.. maybe it is just the wrong file ;)
-->my computer should be able to run it "without problem".
User avatar
money
On Master
Posts: 574
Joined: Tue Apr 29, 2008 4:45 pm
Location: Newcastle

Re: skwin work in progress

Post by money »

ran incredibly slow for me too - normally (RTC) it runs too fast on my pc!

(win 7(64), 6GB ram, Quad 2.4ghz)
User avatar
zoom
Grand Master
Posts: 1819
Joined: Tue Sep 23, 2003 1:27 am
Location: far away but close enough

Re: skwin work in progress

Post by zoom »

the fast one runs fast indeed! opened up one savegame it seems(I´m no japanese-reader) and the party just died a sudden, but nevertheless ugly poison cloud death by "drutan".
User avatar
Sphenx
On Master
Posts: 566
Joined: Sun Sep 09, 2001 11:23 am
Contact:

Re: skwin work in progress

Post by Sphenx »

Some things going wrong with stairs
Yes, it is wrong. Probably some mistakes during code translation.
However, the game runs very slow for me! Too slow to play it properly
ran incredibly slow for me too
The 'normal' versions are compiled with long tick cycle and are therefore somewhat slow. Please use SKWin.Mod.Release instead.
To test, you can resume with the save game 'blood key'; you will be in Dru Tan's cave; just fall in one pit and try to escape the flame orb.
Post Reply

Return to “Dungeon Master II: The Legend of Skullkeep (DM2)”