PDA

View Full Version : LDATA\DKWNDXX.DAT files



Themperror
September 18th, 2018, 16:22
Hello,

I'm currently recreating Dungeon Keeper from scratch ( https://github.com/Themperror/Dungeon-Keeper-Remake ) and I have nearly every file loaded so far, intro is playing well, I got the creature sprites and nearly everything I need.
Now I'm almost finished with the main menu, however I lack the border from the level select screen.

Chances are very high that this is the DKWND00.dat inside the ldata folder, however the structure of this file is completely unknown to me, nor do any sources (or KeeperFX) even mention the file. Rendering DKWND17.RAW which comes with the game however results in a proper border. Though I'd honestly rather load the "real" files since they do have differing data among them.

I was wondering if anyone has (or can find) some info about these files as how they're build up.

So far it seems the files start with a bunch of 4-byte offsets, though it seems unlikely they're for the same file, and these seem the same for every other DKWND file. after so many bytes the structure changes completely. I've tried rendering it out using an offset and the sprites logic with the bytes including the number of alpha pixels, but this results in nonsense.

Can anyone light any info on these files?

Themperror
September 19th, 2018, 14:09
I have figured out the format myself.

Seems the offsets it starts with all point to a single line of pixels, that line of pixels is then encoded in the following way:
The first 4 bytes tell how many opaque pixels will follow, then every byte following those 4 are individual indices that refer to the palette file from DKMAPXX.PAL, then follows 4 bytes which tells the amount of transparent pixels that come after this (these have no indices as they are completely transparent). Repeat until you reach the next offset in the table.

The resolution of the resulting file will be 960x720

Code: https://github.com/Themperror/Dungeon-Keeper-Remake/blob/master/src/game/ThempObject2D.cpp#L164

https://gyazo.com/9fd0d5066be2d0028d59fde227aada0d (scrolling speed is a bit low but I'll fix that later)

dkdd
September 19th, 2018, 14:15
Good stuff :)

Check this (if you don't know it yet): http://www.yoda.arachsys.com/dk/index.html

Themperror
September 19th, 2018, 16:44
Yep I know about it, however its lacking quite some files, also a bunch of links don't work anymore which potentially had some neat info.

I've got most of the assets of the game implented now, currently doing the level select screen and starting to load in the actual levels.

dkdd
September 20th, 2018, 11:27
How will you handle the level geometry? Will you model some terrain models or will you generate them?

Themperror
September 20th, 2018, 15:37
I do everything directly from the official files, I intend to only have a single .exe which you paste into the game folder.

So I will load the level geometry from the actual files.

dkdd
September 20th, 2018, 16:34
So the terrain tiles are stored as actual meshes in some file?

YourMaster
September 21st, 2018, 11:21
You already figured it out, but you could have found some useful documentation on this here:
https://github.com/dkfans/keeperfx/blob/master/keeperfx/docs/creating_campaigns.txt

Good luck on your project.

Themperror
September 23rd, 2018, 11:40
Haven't found the actual meshes yet, will need to do some more searching but I believe they're generated instead of loaded as a file.
Terrain is stored as several files that work together, some describing a tile, some subtiles, a tile is made out of 9 smaller blocks and potentially going up 8 blocks (for each subtile)

dkdd
September 27th, 2018, 09:07
Any progress? :D

Themperror
September 27th, 2018, 12:59
I'm not gonna make this my blog haha, but yes
I'll show some screenshots:
https://imgur.com/a/WIjeqvF

The entire intro sequence works, video and audio plays, main menu is assembled, level selection screen works, and I'm now working on getting level one loaded in and creating all the tiles and stuff

dkdd
September 27th, 2018, 19:59
Great! Keep up the good work.

dkdd
October 12th, 2018, 13:06
So, what's new?

Themperror
October 16th, 2018, 11:40
https://gyazo.com/af6e9137664d1302a8e956948259fd50

https://gyazo.com/475d59357d921b487989c97757e71563


Still working on it, Pathfinding is gonna be the next task, then I can get some creatures in.

dkdd
October 22nd, 2018, 09:32
Great progress!

So soon we'll have a playable version :D

Themperror
October 24th, 2018, 16:28
Pathfinding is in, quickly added the ability to mark tiles..
https://gyazo.com/8bf9111e242e2351b8dfe61f0da20555

Imps will be the first creatures to come soon

dkdd
October 25th, 2018, 23:01
Excellent. Will you be using some AI lib or will you write your own?

Themperror
November 2nd, 2018, 10:46
I'm writing my own, I did use Micropather for pathfinding though (couldn't be bothered to write a A* thing)

Also to add in, if anyone wants to test my current build (and see how far I am)
I recently been tweaking the imp tasks stuff a bit and a lot is still on dev-speeds rather than real speeds in order to test things:
https://drive.google.com/file/d/18SQBSiMic773_efGKi3eD7kBEsnKV7zf/view?usp=sharing
Just place this .exe in your Dungeon Keeper folder (it does not change ANY files) and you can run it.

YourMaster
November 2nd, 2018, 11:55
Crashes to desktop for me. After the first splash screen. Nothing interesting in the log file.

Themperror
November 2nd, 2018, 12:18
Neat... "after" the first splash screen? so you did get to see something?, Also can you send the log output and tell me your system specs (OS, CPU/GPU) ? (And the game version? GOG, raw ISO? Gold/Non Gold?)

YourMaster
November 2nd, 2018, 15:16
To answer your questions I ran the game again to get a fresh log, and for whatever reason now it does start. Earlier I tried 3 times and every time I crashed back, indeed after the first splash screen, so before the movie starts to play. So nevermind I guess.

Themperror
November 5th, 2018, 13:33
that is very weird and definitely should not happen.. the fact that it's failing to run before the movie might indicate its something to do with sound, I'm currently working on that bit so hoping it fixes itself.

dkdd
November 13th, 2018, 08:27
Any progress?

YourMaster
November 13th, 2018, 08:55
You can see the progress for yourself by clicking here: https://github.com/Themperror/Dungeon-Keeper-Remake/commits/master

Themperror
November 13th, 2018, 10:34
I don't keep it as updates as I should though haha, I use Perforce as my main, github is mostly for public access.

Themperror
November 14th, 2018, 13:00
Thought I'd add in some things I have been working on:

https://gyazo.com/fc612558c39289f01447079401983a7f
https://gyazo.com/6d6866421e96f2922c8f306313b4a866
https://gyazo.com/aefebbb79d6613a9e9c2be67f5a84ade

Imp's tasks are a bit more stable now, still not entirely original behaviour but that'll come..
I've read in the creature.txt file for all the game settings and been applying a few of those, like mining takes time now (should take the same amount as the actual game) except for fortifying walls which is using a wrong value atm but again that'll be fixed..

I'm also gonna start on building some actual rooms soon, and after that creatures!