Keen 1 Randomiser

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
User avatar
Multimania
Grunt
Posts: 30
Joined: Sat Nov 10, 2007 8:10
Location: Hiding in a small, cramped corner of the BwB megarocket.
Contact:

Keen 1 Randomiser

Post by Multimania »

It's been 30 years :birthday since Keen 1 came out, so most of us have worked out where all of those pesky spaceship parts are hiding on Mars. So to shake things up a bit, here's the Keen 1 Randomiser: a program which shuffles various items, levels, etc. in Keen 1 around. Hopefully this'll give people a chance to spend some more time exploring levels that normally get skipped, and cursing how difficult it is to find the Pogo Stick now!

Homepage: https://davidgow.net/keen/randomiser.html
Download (v1.0c): https://davidgow.net/files/rndkeen1c.zip
Source Code: https://github.com/sulix/randkeen

To use it, just download it (Keen 1 is included), and run RNDKEEN1.BAT. You'll get a slightly different game every time:
  • Level entrances are shuffled: you have no idea what level you're about to play.
  • The spaceship parts (and pogo stick) could now be in any level.
  • Lollies (point items) are shuffled within a level.
  • A couple of other minor cosmetic differences.
  • Don't worry, the Yorp statues will give you some useful hints about where things are.
If you want to play the same randomised game again (or have a race on the same version), you can use the /SEED <seed> command line parameter to play a particular numbered seed. (You can check which seed you're playing from the status screen: it replaces the "EXTRA KEEN AT" screen.)

There's some more info in the README file and on the website. Note that it's compiled with DJGPP, so will need at least a 386 to run. (DOSBox works fine, too.)

Please give it a go, and hopefully see Keen 1 in a whole new light (i.e., without the Pogo for half the time, and never having enough ammo! :crazy )

Edit: Updated the link to version 1.0a: see this follow-up post.
Edit 2/3: Updated the link to version 1.0b, then 1.0c: see this follow-up post.
Last edited by Multimania on Tue Dec 22, 2020 13:01, edited 3 times in total.

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

Re: Keen 1 Randomiser

Post by Roobar »

That's interesting! I begun right with the secret level, but without ammo or pogo. I was not able to beat the first level that way though.

User avatar
Nisaba
Vorticon Elite
Posts: 1224
Joined: Fri Jan 01, 2016 23:34
Location: The Outpost
Contact:

Re: Keen 1 Randomiser

Post by Nisaba »

yeah!
a Marooned on Mars radomiser! I love that idea. Can we use this mechanic for other Vorticon games and mods as well?

but Roobar is right. We need some mechanic to make sure that you can access the Pogo right away. other than that this is a really neat idea. this might rules out every levelpack we have seen so far
"We have come to conquer you all and bring you lots of candy!" | about me | my current project: play Keen mods on a GameBoy |

User avatar
Quillax
Vortininja
Posts: 219
Joined: Sat Mar 14, 2015 14:41
Contact:

Re: Keen 1 Randomiser

Post by Quillax »

Oh wow, this sounds really cool! I'll have to try it out someday! I like how the website looks!

Roobar, what area were you having trouble with? From what I looked in the map, it seems that all of Secret City can be accessed without the pogo (and ammo if you lure some of the Yorps and Gargs away cleverly).
Quillax Ship - Where you can download all of my cool, keen mods and super-marvelous fangames!

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

Re: Keen 1 Randomiser

Post by NY00123 »

That's been unexpected! On the other hand, it feels appropriate for Keen 1's 30th anniversary.

I gave this a couple of tries. It first used seed 2079. As in the case of Roobar, I started right in the secret level. I couldn't progress much further from the starting point, due to the lack of ammo and a garg on the (only) way forward.

My second attempt, this time with seed 1952, was more successful. It was indeed different to spot instances of re-positioned creatures, mostly the vorticons. I even spotted recolored bricks in Capital City.

One thing I couldn't reliably do, was reaching the secret level teleporter. Reason is that there was a garg, rather than a tank robot. Maybe the chances the garg won't reach Keen for enough time aren't exactly zero, although they're probably still low.

The last level I visited was where the Second Ice Shrine is usually located i.e., to the right of the usual location of the Vorticon Commander's Castle. It was a different Shrine level, and as things turned out, it had the last part required for the ship (IIRC it was a joystick).

Thus, I technically completed all levels, except for where the Secret City and the Vorticon Commander's Castle are usually located.

Let's see if this will bring an inspiration in the future.

User avatar
Multimania
Grunt
Posts: 30
Joined: Sat Nov 10, 2007 8:10
Location: Hiding in a small, cramped corner of the BwB megarocket.
Contact:

Re: Keen 1 Randomiser

Post by Multimania »

Glad people have found it interesting. I was largely inspired by the A Link to the Past Randomizer, which shuffles the contents of the various chests in the game. Keen is somewhat less complicated, fortunately, though I'm sure there's a lot more you could do.

I've uploaded a new version (v1.0a) of the randomiser, which adds some options to make it a bit easier. I still think it should be possible to play through a lot of the game without the pogo, but it's certainly a bit more fun to get it sooner. To wit, there are a few different options to choose from:
  • /NOENEMYSHUFFLE — disable the randomising of enemy locations. This should make the in-level teleporter and similar easier to access.
  • /STARTPOGO — always start with the Pogo Stick.
  • /STARTAMMO n — start with n ammo.
  • /EXTRAPOGO n — hide [n] extra Pogo Sticks throughout the game. (They'll still be at the end of levels, though.)
These can be combined. Note that they might change what seed is what: so for the seeds to mean the same thing, you need to use the same options.

Personally, I'm finding that adding between 6 and 12 /EXTRAPOGOs gets me a Pogo Stick earlier, but not instantly, and combined with /STARTAMMO 15 early enemies aren't much of a problem. There are still a couple of things (like the secret level teleporter) that /NOENEMYSHUFFLE is needed to make possible. I'd be curious to see what — if any — of those options are most fun for people.

Of course, if it's too hard, you can just run again with a different seed until you find one you like. Ideally, all seeds would be possible, though, so a future version will have to find other ways around the problems.

As for running it against other Vorticons games / mods: it should be possible to get it to work, but there are a lot of hardcoded tile numbers for things. The real problem is that Keen 2 & 3 don't have the ship parts, and moving the mangling machine or the tantalus rays around is both harder and less fun to play. I'm sure it wouldn't be too hard to get it to work with Keen 1 mods which don't use tileinfo, though.

User avatar
Nisaba
Vorticon Elite
Posts: 1224
Joined: Fri Jan 01, 2016 23:34
Location: The Outpost
Contact:

Re: Keen 1 Randomiser

Post by Nisaba »

immediate tool support.
that's awesome! thanks so much for the update
"We have come to conquer you all and bring you lots of candy!" | about me | my current project: play Keen mods on a GameBoy |

User avatar
KeenRush
Android Dummy
Posts: 2557
Joined: Sat Oct 27, 2007 20:57
Location: KEEN1.EXE
Contact:

Re: Keen 1 Randomiser

Post by KeenRush »

It's a nice idea -- I've seen these for some more popular old games like Mario 64 but never thought that Keen could have one as well.

It feels kind of strange to open a level and suddenly not find the one you've known to be there for about 30 years... :dopekeen Or seeing the color of something being different than you were quite sure it was...

One improvement which might be fairly easy to do would be hard-coded random placements for keycards. Here's how I would do it (the simplest way I can think right now): For every keycard color assign a value not used by another tile (such as 650, 651 etc -- although I'm too lazy to check those specific ones aren't unused, but near the end of tileset there are many). Then, for every original level (manually): Replace a card tile with the tile assigned to it. Then move around randomly and place that same tile (like 650) around the level in logical places -- ie, areas accessible with the same cards than the card one is replacing, so that the card can be accessed even if it's in a different place; for instance, for a yellow key that needs to be collected before a red key, place the yellow tile indicators only in areas that can be accessed without that other key. And of course so that the key isn't placed above a row of fire tiles in a way that it's impossible to get it. And so on. Then modify the randomizer program to scan the level, list all tiles of 650, replace one of them with yellow key card and all the other instances with the blank background tile, and do the same for the other color keys. Now the created levels should have semi-random positions for cards. Since most of the background tiles are gray, there are many many potential locations for cards. I think something like this should be done, would be cool!
Edit: I realized that of course in this case one could just use the original card tiles as card indicators, no need to use unused tiles, simply place many card tiles of the same color and make the program replace all but one of them with the blank tiles.
My newest mod - Commander Keen: Sunset: viewtopic.php?t=8568 | codename H.Y.E.N.A.

User avatar
TheBigV
Grunt
Posts: 24
Joined: Mon Oct 21, 2019 13:43
Location: LXTerminal

Re: Keen 1 Randomiser

Post by TheBigV »

I'd like to report an issue. When you die on a level that originally had a ship part, you will lose the ship part that level used to have even if that ship part is now on different level. That can make a game unwinnable if the player isn't careful.

I suggest you could either make it add a patch to not remove the ship parts (since it's hard to die after getting them anyways), or make it add a patch to correct which levels take which parts.

Also, I tried seed 314 and it was unwinnable because it started on a level that required a pogo. (Note that I did this before the 1.0a update came out.)

User avatar
Multimania
Grunt
Posts: 30
Joined: Sat Nov 10, 2007 8:10
Location: Hiding in a small, cramped corner of the BwB megarocket.
Contact:

Re: Keen 1 Randomiser

Post by Multimania »

KeenRush wrote:
Tue Dec 15, 2020 10:09
One improvement which might be fairly easy to do would be hard-coded random placements for keycards. Here's how I would do it (the simplest way I can think right now): For every keycard color assign a value not used by another tile (such as 650, 651 etc -- although I'm too lazy to check those specific ones aren't unused, but near the end of tileset there are many). Then, for every original level (manually): Replace a card tile with the tile assigned to it. Then move around randomly and place that same tile (like 650) around the level in logical places -- ie, areas accessible with the same cards than the card one is replacing, so that the card can be accessed even if it's in a different place; for instance, for a yellow key that needs to be collected before a red key, place the yellow tile indicators only in areas that can be accessed without that other key. And of course so that the key isn't placed above a row of fire tiles in a way that it's impossible to get it. And so on. Then modify the randomizer program to scan the level, list all tiles of 650, replace one of them with yellow key card and all the other instances with the blank background tile, and do the same for the other color keys. Now the created levels should have semi-random positions for cards. Since most of the background tiles are gray, there are many many potential locations for cards. I think something like this should be done, would be cool!
I had an idea for doing something like this, but was going to hardcode rectangles of "okay positions" and randomise all items (points, keys, etc) within the same area. I like your idea much better though: it's simpler and more flexible, and probably will create cooler-looking results. I'll have to experiment with it a bit.
TheBigV wrote:
Tue Dec 15, 2020 22:01
I'd like to report an issue. When you die on a level that originally had a ship part, you will lose the ship part that level used to have even if that ship part is now on different level. That can make a game unwinnable if the player isn't careful.

I suggest you could either make it add a patch to not remove the ship parts (since it's hard to die after getting them anyways), or make it add a patch to correct which levels take which parts.
Okay, so version 1.0c is now out, which fixes the first issue (as well as a couple of other bugs). The ship part is now removed only if Keen dies in the correct level. (This was actually slightly trickier than it should have been, because it's technically possible for there to be multiple ship parts in the same level.)
TheBigV wrote:
Tue Dec 15, 2020 22:01
Also, I tried seed 314 and it was unwinnable because it started on a level that required a pogo. (Note that I did this before the 1.0a update came out.)
Darn — I'd naïvely assumed that all levels except 16 were completable without a Pogo (and that has a Pogo in it, so should be fine.) But no matter how many times I tried, that jump in the right-hand side of level 15 eluded me. Maybe that's something to fix in the level (by shrinking the fire, or giving more headroom for the jump), or maybe it's worth reworking the randomiser to avoid putting that level before the Pogo is accessible. I suspect the former would be more fun — it _looks_ like that level should be completable without the Pogo, but it is less of a "pure randomiser" if I fiddle with the levels too much.


Anyway, the changes for v1.0b are basically all bugfixes:
  • Spaceship parts are no longer lost if Keen dies in the level they were originally found in.
  • Yorp statue messages about level locations are no-longer backwards.
  • The RNDKEEN1.BAT file now uses MS-DOS line endings, so will work on real MS-DOS machines. (DOSBox handled the UNIX newlines fine.)
  • The in-game random number generator is now seeded with a value derived from the randomiser seed. (This means that enemy behaviour, et al, is technically deterministic with the same seed now, but probably won't cause any player-visible changes.)
v1.0c fixes another bug in the spaceship part removal.

You can download it here:
https://davidgow.net/files/rndkeen1c.zip

Edit: Replaced 1.0b with 1.0c. You can still download v1.0b here if you like bugs for some reason.

Post Reply