Markeen: probabilistic random Galaxy level generator

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.
User avatar
Fleexy
Tool Smith
Posts: 1432
Joined: Fri Dec 12, 2008 1:21
Location: Abiathar C&C

Markeen: probabilistic random Galaxy level generator

Post by Fleexy »

I mentioned that a while back, I tinkered with the idea of statistically creating Keen Galaxy levels. The result was Markeen.

It's not done by any stretch of the imagination, but it is kind of neat, so I figured I'd show my progress. It can create levels that are pretty messy, but usually show the structure of a sane level design. Only the foreground is processed, so the background and infoplane is up to you! If you use the levels as a starting point, make sure you check the tileinfo - it doesn't know anything about reasonable platform structure, only tile arrangements (which usually take you most of the way).

Download Markeen (alpha 8/23/2016)

[EDIT: For a new version, see the second page.]

It works by first creating a profile - the statistics on which tiles appear next to which other tiles - from provided levels then generating new levels from that profile. All operation is done on the command line. Place the EXE in a folder with FleexCore2 (FMod.dll). To create a profile, use the "profile" argument followed by the output filename, the profiling depth (I use 5), the source GAMEMAPS, the source MAPHEAD, and optionally the source MAPDICT. To generate new levels, use the "generate" argument followed by the profile filename, the number of levels to create, the output GAMEMAPS, and the output MAPHEAD. You can then open those output files in your level editor (Abiathar recommended, it comes with FMod.dll).

Happy leveling!
Last edited by Fleexy on Wed Aug 24, 2016 0:38, edited 1 time in total.
User avatar
Nisaba
Janitress
Posts: 1597
Joined: Fri Jan 01, 2016 23:34
Location: The Outpost
Contact:

Post by Nisaba »

Oh that's sweet.
I've followed your blog over there for quite some time, where you posted some development notes. I was and still am pretty exited which direction this thing might take. gonna give this a shot soon. This randomized level output might be a good starting point for getting some inspirations on how to design a future galaxy mod...
out now (link) : Image
User avatar
Levellass
S-Triazine
Posts: 5265
Joined: Tue Sep 23, 2008 6:40

Post by Levellass »

Wow.

Ok, there was one level it made that used part of the tileset right. The rest... Ooog.

Image


I'm guessing as the tileset is rather complex (Apart from the grey tiles) it has some trouble building a coherent profile. Will have to poke around and see just what's going on here.
What you really need, not what you think you ought to want.
User avatar
Fleexy
Tool Smith
Posts: 1432
Joined: Fri Dec 12, 2008 1:21
Location: Abiathar C&C

Post by Fleexy »

It does tend to have problems with very complex tilesets. I find that it works pretty well on the original Galaxy episodes (Dreams not so much) and Ceilick's Keen 7 and Keen 8. The profiling depth matters a lot; you'll get much better levels with a depth of 5 than with a depth of 1, though the generator isn't tested with very deep profiles, so you might get very boring levels (and massive profile files) if you go up to 12 or so. Also note that the profiler always ignores level 0 (to avoid contaminating levels with world map tiles). If your world map is a different level, you might want to delete it before feeding the maps into Markeen.
Gridlock
Vorticon Elite
Posts: 617
Joined: Thu Aug 12, 2010 2:20

Post by Gridlock »

Interesting. I haven't had time to play around with it yet, but I'm very curious what output for Keen 5 might look like. I suppose it'd be kind of fun to include a randomly generated level in The Alphamatic (with major tweaks of course), but I'm not sure how well it would work.

I hope you keep playing around with this. Random generation can't replace a real level designer, but it could certainly be a useful tool.
Image
Armageddon Begins Again. The Alphamatic has arrived.

Atroxian Realm: viewtopic.php?f=4&t=3536
The Alphamatic: viewtopic.php?f=4&t=4086
Keening_Product
Kuliwho?
Posts: 2167
Joined: Fri Jan 20, 2012 7:02
Location: Tied up in the Oracle Chamber's basement
Contact:

Post by Keening_Product »

We all know where this is heading: an open-world, procedurally generated Keen game. No Man's Sky didn't say anything about right year old kids ruling the galaxy.

This tool is neat, by the way.
Keening_Product was defeated before the game.

"Wise words. One day I may even understand what they mean." - Levellass
User avatar
Roobar
Vorticon Elite
Posts: 3267
Joined: Tue Jan 08, 2008 16:12
Contact:

Post by Roobar »

Cool! Post more screenshots please!
User avatar
Fleexy
Tool Smith
Posts: 1432
Joined: Fri Dec 12, 2008 1:21
Location: Abiathar C&C

Post by Fleexy »

Certainly! Here's an Imgur album of some. I also just published some more development notes.
Gridlock wrote:I suppose it'd be kind of fun to include a randomly generated level in The Alphamatic (with major tweaks of course), but I'm not sure how well it would work.

I hope you keep playing around with this. Random generation can't replace a real level designer, but it could certainly be a useful tool.
Heh, it would be pretty cool to see a Markeen-based level in a real production! It would indeed require a good deal of tweaking, considering the messes it tends to make in these early versions. (There's probably an idea for a leveling competition in here somewhere.) As for using Markeen as a level-building tool, that's a great idea. I did a test in which I blanked out some of a default level with the placeholder and ran Markeen on it. It successfully put in something reasonable in several cases. Along with the profile editing tools I added today (which could be GUI-ified in the Abiathar extension), this could conceivably become an intelligent leveling aid that's able to learn from its mistakes. Cyborg level design for the win?
User avatar
Nisaba
Janitress
Posts: 1597
Joined: Fri Jan 01, 2016 23:34
Location: The Outpost
Contact:

Post by Nisaba »

Fleexy wrote: it would be pretty cool to see a Markeen-based level in a real production! It would indeed require a good deal of tweaking, considering the messes it tends to make in these early versions. (There's probably an idea for a leveling competition in here somewhere.)
yauz, that sounds like fun. what about a community Levelpack based on the output of your tool (call it The Reconstruction of MarKeen). every competitor could receive one random map with the task to showcase her/his creativity and the ability to deal with this sort of haphazardness.

the output could be complexity hilarious and crazy but there is a good chance of having a neat PCKF project.
out now (link) : Image
User avatar
Levellass
S-Triazine
Posts: 5265
Joined: Tue Sep 23, 2008 6:40

Post by Levellass »

It's agreed then, I shall nag at LL to allow a Markeen level. You say the profile depth goes up to 12? Interesting. I found that deleting incomplete levels has helped the level design a bit.
What you really need, not what you think you ought to want.
User avatar
Fleexy
Tool Smith
Posts: 1432
Joined: Fri Dec 12, 2008 1:21
Location: Abiathar C&C

Post by Fleexy »

There isn't actually a hard-and-fast limit on the profile depth, but you'll get horrible slowness and massive files as you increase it. Once I determine a better tile scoring algorithm, deeper profiles would always create better levels. Today, I made the profiler a little smarter - it now chops up the levels into their visible regions (divided by the bars in the infoplane) before profiling. Here are more pictures and here's a new blog article.

Would people be interested in a Markeen-based level design competition? I'd like to get it performing a little better in terms of quality before releasing another version, but I'll try to gauge interest now. (The seed feature was developed exactly for this possibility.)
User avatar
Levellass
S-Triazine
Posts: 5265
Joined: Tue Sep 23, 2008 6:40

Post by Levellass »

Could be interesting, if I can find the time.

What's with all the pink tiles?
What you really need, not what you think you ought to want.
User avatar
Fleexy
Tool Smith
Posts: 1432
Joined: Fri Dec 12, 2008 1:21
Location: Abiathar C&C

Post by Fleexy »

When Markeen finds a spot where it can't place any tile (because nothing is compatible with all of the immediately adjacent already-placed tiles), it places FA17h ("fail"), which is far beyond the end of the tileset. Abiathar renders unknown foreground tiles as hex with a pink background, kind of like how unknown infoplane values are in white and unknown background values are in yellow. Other editors may render them differently, not render them at all, or crash altogether.

If I can implement a smarter fill order, these contradictions/failures should be dramatically reduced.
Ceilick
The Dude
Posts: 1670
Joined: Mon Sep 22, 2008 20:10
Location: Seattle

Post by Ceilick »

This is pretty cool! I could definitely see creating some levels with the loose templates that Markeen creates. From what little I've seen, it's particularly useful for a cave, building, or any other interior location. I actually really like the point placement too; sometimes it's hard to place point items in a way that doesn't feel organized or symmetrical in some way.
User avatar
KeenRush
Android Dummy
Posts: 2560
Joined: Sat Oct 27, 2007 20:57
Location: KEEN1.EXE
Contact:

Post by KeenRush »

Very fascinating! I've wanted to see something like this. Haven't tried it but went through all the blog posts; it's scary how alien some levels look, and also how almost-playable some are. Definitely an interesting tool in a leveller's arsenal.

By the way, would be neat to see how it'd do with Keen 3. Would it make better and less buggy levels than the official ones? :D
My newest mod - Commander Keen: Sunset: viewtopic.php?t=8568 | codename H.Y.E.N.A.
Post Reply