Keen Dreams - Unofficial Tech Demo

Here is where to post about the latest Commander Keen fangame or modification you've finished, a new website you've made, or another Keen-related creation.
Post Reply
NY00123
Vorticon Elite
Posts: 426
Joined: Sun Sep 06, 2009 19:36

Keen Dreams - Unofficial Tech Demo

Post by NY00123 » Sat Jan 24, 2015 21:52

LATE POST EDIT (Dec 24th, 2016): Edited download link since Dropbox' "Public" folder is expected to become private by March 2017. In fact, there was interestingly a typo of mine, where the ZIP file was originally named ckdreams-20140124.zip, while it should've been ckdreams-20150124.zip. This also applied to an internal folder name inside the ZIP. So I edited the folder name and then re-uploaded the (modified) ZIP file.

Hi all,

It's probably a good idea I won't use too much words. Basically, in terms of gameplay it's just Keen Dreams, but a component of the executable known as the ID Engine has been replaced with the code from the Catacomb 3-D sources released on June of 2014 (which is also known to be, more-or-less, the same as the ID Engine from Keen 4-6). The most noticeable change is probably the control panel / menus.

Note that while the game code and data are generally based on version 1.20 of Keen Dreams, this is not the general role. For instance, the title screen is loaded from the tileset and map 20 (as in v1.00 and all CGA releases), rather than an external KDREAMS.CMP file with LZHUF-compressed contents.

If any of you has a question, maybe it's already answered in the bundled FAQ.TXT file or another text file.

https://www.dropbox.com/s/d41sdy6orsecr ... 4.zip?dl=0
Last edited by NY00123 on Sat Dec 24, 2016 8:50, edited 2 times in total.

User avatar
Roobar
Vorticon Elite
Posts: 2642
Joined: Tue Jan 08, 2008 16:12

Post by Roobar » Sat Jan 24, 2015 22:20

Well, with a little modification it could look exactly the same as Keen 4-6.

Btw flower pong :)

User avatar
troublesomekeen
Vorticon Elite
Posts: 1091
Joined: Fri Feb 03, 2012 8:01
Location: Three-Tooth Lake
Contact:

Post by troublesomekeen » Sat Jan 24, 2015 22:54

Wowee! That's very cool. Thanks! :eek
Image
Commander Keen in... Canteloupe Quest!

User avatar
szemi
Vorticon Elite
Posts: 1472
Joined: Sun Jan 11, 2009 15:19
Location: Hungary
Contact:

Post by szemi » Sun Jan 25, 2015 0:00

YOU ARE A GIANT GENIUS!
Yeah, piece of cake!

User avatar
lemm
Blorb
Posts: 681
Joined: Fri Jul 03, 2009 10:18
Location: canada lol

Post by lemm » Sun Jan 25, 2015 3:29

I wish more keen creations came with a CRAP folder.

Also thanks for making this. In combination with the Omnispeak effort, it should be easy enough to now produce a reasonable facsimile of a Keen:Galaxy Game!

NY00123
Vorticon Elite
Posts: 426
Joined: Sun Sep 06, 2009 19:36

Post by NY00123 » Mon Jan 26, 2015 23:06

Thanks to all of you for the support, and to anybody who's taken a look!

As hinted by wiivn and lemm, it shouldn't be a lot of resource and code replacements before things come closer to Keen 4-6, although I guess it won't be Keen Dreams as we know it; On the other hand this can help ones simply get stuff which is not far from the original 4-6, and that's also a thing.

I guess I can write/type here some more. To begin with, I've forgotten to mention that the control panel / menu background screen is not exactly created from scratch; Rather, it's based on an animation that eventually got cut from the original game. It may currently be found here: http://www.shikadi.net/keenwiki/Keen_Dr ... ded_ending

As to the work on this mod again, well, it's basically a combination of the "game code" from Keen Dreams with the "ID Engine" from Catacomb 3-D. As ones may find in the "SRCDIFFS" subdirectory from the archive above, there aren't a lot of modifications done to the combined codebase (note that resource definition files like GRAPHCKD.H are excluded from the diffs).

On the other hand, I think most of the time was spent on preparing the resources, given that the various modding tools were never made for anything like this Tech Demo (notes with more technical details can also be found in the same archive).

There were still a few difficulties when it comes to coding, too (not just resource related). One good example is what appeared to be a combination of different problems with the smooth scrolling. At times it was just a single number to correct (e.g., definition of SCREENWIDTH), but a change to the game code was required for proper scrolling. As an upgrade from Keen Dreams, Keen 4-6 maps can have custom scroll blocks, giving the illusion that each such map is split into smaller sub-maps. In addition, a scroll block is technically added for each of the whole map's borders in 4-6. Due to some differences from the ID Engine as originally coded for Keen Dreams, though, there were some scrolling bugs near the borders while creating the Tech Demo (one could see the other side of the map, at least when it comes to horizontal scrolling). To solve this, the inputs to RF_Scroll have to be clamped to the range -255..255. This was found out by looking at the NETKEEN/Omnispeak sources.

These small differences don't change the fact there is a lot of a common found in the Keen Dreams and Keen 4-6 codebases. In fact, while Keen Dreams is unofficially known as "Keen 3.5", it may be more accurate, not just technically but also in terms of original release dates, to call it e.g., "Keen 3.8" or so (Keen Dreams was originally finalized on July of 1991, while an early demo version of Keen 4 was made ready on October of the same year). In more details, a lot of the ID Engine function names, variables and more haven't really changed, at least not in a way that matters in the game code. Even the different control panels / menus are invoked with US_ControlPanel in both revisions of the ID Engine. (On a side note, the Wolfenstein 3D / Spear of Destiny codebase, which contains an even later revision of the ID Engine with seemingly more significant modifications, also has a US_ControlPanel function, although it's technically located in WL_MENU.C.)

Even if one doesn't know anything about coding, there are enough hints for the similarities: The similar Keen sprites/animations, physics, scrolling and general feeling, the tilted perspective (although that's less of an engine feature), common cheat codes (including the cheat code dialogs) and probably more. Truly, the help section / controls / story sections may remind of similar sections from Keen 1-3 in a few ways, but I suppose there aren't a lot of such similarities in comparison to 4-6.

User avatar
Levellass
S-Triazine
Posts: 5187
Joined: Tue Sep 23, 2008 6:40

Post by Levellass » Thu Jan 29, 2015 4:22

Interesting, interesting. So; would it be possible to move across a Dreams mod to this executable?
What you really need, not what you think you ought to want.

User avatar
lemm
Blorb
Posts: 681
Joined: Fri Jul 03, 2009 10:18
Location: canada lol

Post by lemm » Thu Jan 29, 2015 6:55

@Lass: It should save considerable development time by programming your behaviours in C code rather than assembly patching. This benefit should increase with the increasing sophistication of a mod. And yes, you should be able to take the resources that you have in the works for your Keen Dreams and make a branch off of NY's project.

@ NY: Is this a finished release, or were you planning on adding more Galaxy features into this creation?

User avatar
Commander Spleen
Lord of the Foobs
Posts: 2306
Joined: Wed Oct 31, 2007 22:54
Location: Border Village
Contact:

Post by Commander Spleen » Thu Jan 29, 2015 13:00

Impressive work. The intro is particularly nice. There's a lot of potential here, though I plan to watch from the comfort of Keen 1 land to see what others create from this.

NY00123
Vorticon Elite
Posts: 426
Joined: Sun Sep 06, 2009 19:36

Post by NY00123 » Thu Jan 29, 2015 21:39

Thanks again for your comments!

To lemm and others: Maybe there'll be a few really-minor updates here and there, but otherwise it's going to stay as-is: The original Keen Dreams game with Cat3D/Keen4-6's ID Engine.

To Levellass: I guess you're interested in patching? In such a case you should probably pick a specific EXE and work with that, although given it's been constructed using publicly available sources (and not just for that reason), it may be better to go the way of source-modding (although I know it isn't the same).
While possibly a bit risky, if you open the project file with e.g., the Borland C++ 2.0 IDE in order to build the sources (not before you run static\make.bat for generation of OBJ files containing static data like EGAHEAD), you can optionally tell the linker to generate a .MAP file. If it's not already enabled, look for linker options in the IDE menu(s). Assuming there are enough details, such a .MAP file should have a list of symbols with names based on original variable and function names, along with their locations in the EXE (in seg:off format). Note that static variables/functions may be absent, probably because each of these is referenced just in a single object file.

User avatar
Levellass
S-Triazine
Posts: 5187
Joined: Tue Sep 23, 2008 6:40

Post by Levellass » Fri Jan 30, 2015 6:27

NY00123 wrote: To Levellass: I guess you're interested in patching? In such a case you should probably pick a specific EXE and work with that, although given it's been constructed using publicly available sources (and not just for that reason), it may be better to go the way of source-modding (although I know it isn't the same).
Whelp, source modding may be the way to go. I'm thinking working off a decompressed EXE would be the idea. If I can copy everything across it might prevent that wretched memory bug.
What you really need, not what you think you ought to want.

NY00123
Vorticon Elite
Posts: 426
Joined: Sun Sep 06, 2009 19:36

Post by NY00123 » Fri Jan 30, 2015 8:17

Levellass wrote:Whelp, source modding may be the way to go. I'm thinking working off a decompressed EXE would be the idea. If I can copy everything across it might prevent that wretched memory bug.
Are you referring to the "out of memory" kind of problem(s) you've recently been having with some under-development Keen Dreams mod? Already tried downloading and building the original Keen Dreams sources, with a few modifications that may help resolve this (other than replacing the whole ID Engine)?

User avatar
Levellass
S-Triazine
Posts: 5187
Joined: Tue Sep 23, 2008 6:40

Post by Levellass » Fri Jan 30, 2015 9:20

Yeah, and it seems to be some sort of memory leak problem. I lack the smarts to know just what but the game doesn't like having tiles from the top AND the bottom of the tileset in the map level.
What you really need, not what you think you ought to want.

NY00123
Vorticon Elite
Posts: 426
Joined: Sun Sep 06, 2009 19:36

Post by NY00123 » Fri Jan 30, 2015 10:20

Levellass wrote:Yeah, and it seems to be some sort of memory leak problem. I lack the smarts to know just what but the game doesn't like having tiles from the top AND the bottom of the tileset in the map level.
Afraid I don't know much, although debugging with Borland C++ (or maybe using a source port?) may be able to do the job.

Oh yeah, here's one note of warning I've forgotten to mention, which still applies: As already said, there aren't that many modifications to the Keen Dreams "game code" (i.e., kd_ files). In particular, if any of these has code leading to memory problems on its own, there are chances it's still there even with this Tech Demo. If, however, there was actually such a problem in a file like ID_RF or ID_CA only, then it may be resolved, but again there's no guarantee.

User avatar
Levellass
S-Triazine
Posts: 5187
Joined: Tue Sep 23, 2008 6:40

Post by Levellass » Sat Jan 31, 2015 22:41

Well that depends, it appears to be a problem with how the game clears things from cache; sometimes instead of setting all the appropriate 'cache this tile' flags to 0 large chunks are skipped. This causes the game to think it has to cache more than it should. As such if this uses Keen 4-6 memory management we should be sailing home.
What you really need, not what you think you ought to want.

Post Reply