Treasure Eaters and Shikadi Masters

Here, you can get help with anything or just chat about the original Commander Keen games.
User avatar
Quillax
Vorticon Elite
Posts: 554
Joined: Sat Mar 14, 2015 14:41
Location: Quillax Ship
Contact:

Treasure Eaters and Shikadi Masters

Post by Quillax »

[Split from Keen 4 Least Favorite Level? -Fleex]
StupidBunny wrote: Fri Nov 12, 2021 13:22
Toomuchsparetime wrote: Tue Nov 09, 2021 1:07 This isn't a strike against the level itself but I think those smirking treasure-eaters should've been in at least another couple of levels. They have a GREAT design and their loot-pilfering is a rare mechanic in platformers (at least platformers of the time AFAIK).
The teleporting enemies (treasure eater and Shikadi Master) both got shafted I think. I mean I guess it's reasonable that the Shikadi Masters only appear on the final map, but I always felt that, for how terrifying and threatening they could have been, the one or two on the QED weren't enough to really enough to demonstrate the full power of their quantum electric wizardry, and I always found them a bit too easy to slip past in the one or two locations that they actually teleported to. I feel they could've flourished in a more open environment like the Neutrino Burst Injector, although that level may already have too many electric things trying to kill me. But here I go talking about Keen 5 again...

Actually as an aside, does anybody know how the teleporting for the treasure eaters and Masters actually work? I've always wondered about this, and whether it's completely random or whether there's designated teleport spawns somewhere. Especially since I've only ever seen either character spawn in a handful of the same spots (and never seen a treasure eater spawn over a pit of tar for example, however hilarious that would be).
Yeah, last time I played the QED on Normal, the lone Shikadi Master was hardly a threat. It only confronted me like once, in the room where you get the green gem, and I slipped past him very easily.

KeenWiki explains how the Treasure Eater's teleporting works:
Treasure eaters will only take another hop if they see four consecutive tiles to their immediate right or left that are top blocking. If they cannot make another hop twice, then they will teleport to the next piece of Candy. They will search for candy and lifewater, and if it has all been collected, then they will disappear. They always select the first piece of candy that they see in the sprite list, (which is generally the top-left most piece of candy remaining).
I couldn't find any info on how the Shikadi Master's teleporting works, though.
Last edited by Quillax on Mon Nov 15, 2021 19:52, edited 2 times in total.
Quillax Ship - Where you can download all of my cool, keen mods and super-marvelous fangames!
User avatar
Nisaba
Janitress
Posts: 1597
Joined: Fri Jan 01, 2016 23:34
Location: The Outpost
Contact:

Re: Keen 4 Least Favorite Level?

Post by Nisaba »

StupidBunny wrote: Fri Nov 12, 2021 13:22 Actually as an aside, does anybody know how the teleporting for the treasure eaters and Masters actually work? I've always wondered about this, and whether it's completely random or whether there's designated teleport spawns somewhere. Especially since I've only ever seen either character spawn in a handful of the same spots (and never seen a treasure eater spawn over a pit of tar for example, however hilarious that would be).
like Quillax already mentioned, we actually do know a bit about the Treasure Eater's rather complex behavior.
The main feature of Treasure Eater is their ability to detect and steal items. To do so they will hop back and forth, jumping to reach any items above themselves. They will turn when they bump into walls and will teleport when they can do nothing else. Treasure Eater have a built in 'randomizer' that makes their teleporting slightly unpredictable; if this value is zero then the Treasure Eater will always go to the most desirable item (sprite type 4) when teleporting. By default it has only a 50% chance of doing so. (And a 25% chance of going after the 2nd most desirable, 12.5% chance of the 3rd most and so on.) By default the Treasure Eater ceases to exist if there are no target sprites in the level for it to move to.
It is thus possible to predict the path of all Treasure Eaters in a level. They will start where they are placed, 'eating' all target sprites in their area, then teleport to the top leftmost target sprite. With careful placement of target sprites it is possible to lead Treasure Eater through a level.

for a better overview I marked all sprite type 4 items in the image down below:
Image

As a result this is one strange thing that could happen:
Image
out now (link) : Image
User avatar
StupidBunny
format c:
Posts: 2155
Joined: Fri Nov 02, 2007 19:19
Location: The Centre of the Moon
Contact:

Re: Keen 4 Least Favorite Level?

Post by StupidBunny »

That’s amazing :eek Thanks for the explanation, it totally makes sense their movements would be driven by a hierarchy of item importance…wild too that they can be effectively exorcised out of existence this way. Quite an elaborate behavior for an enemy that’s barely in the game…

As to the Shikadi Master, I wonder if anyone is privy to that information (where is Levellass these days? I bet she’d know.) I would love to try making a Keen 5 level with some Masters in it to see if I could guess what they’re doing and why…
Image
User avatar
Pandakeen
Vortininja
Posts: 160
Joined: Tue Aug 03, 2021 9:54
Location: pckf,
Contact:

Re: Keen 4 Least Favorite Level?

Post by Pandakeen »

I never knew about this! :O
Lower IQ than 314
Vortininja
Posts: 85
Joined: Wed Mar 04, 2020 3:13

Re: Keen 4 Least Favorite Level?

Post by Lower IQ than 314 »

StupidBunny wrote: Fri Nov 12, 2021 17:16 As to the Shikadi Master, I wonder if anyone is privy to that information (where is Levellass these days? I bet she’d know.)
I'm pretty sure Gridlock's your man. Just look at how much more intelligently he used them in The Alphamatic than they were used in the source material. That, and he's already designed a teleporting NPC of his own with the Krile Ghosts in Atroxian Realm.

Ceilick also designed the Squiddlies in Keys of Krodacia, which were Treasure Eaters but underwater, so there's that.
Gridlock
Vorticon Elite
Posts: 617
Joined: Thu Aug 12, 2010 2:20

Re: Keen 4 Least Favorite Level?

Post by Gridlock »

I've never looked at the code for these enemies, so I couldn't give an exact technical answer for how they work, just what I've observed from using them.

The Krile Ghosts in AR were based on the idea of having Treasure Eaters attack Arachnuts. Once lemm reworked the game into the new engine, the code for those probably changed significantly from the original Treasure Eater implementation. IIRC, the behavior is that the Krile Ghosts target the first active Axosis (Arachnut) in the scene, based on y position from top to bottom in the level. Once Keen pogoes the stunned Axosis, the Krile Ghost targets the next Axosis positionally.

I don't understand the exact rules governing the Shikadi Master, but they don't use teleport points. I believe they do some kind of tile property check to determine sufficiently tall empty regions where they can teleport. I'm not exactly sure how rules for teleport distance work, though. I think they may be restricted to teleporting within a certain radius of their current position. For example, in the DLC level "Command Sector" of The Alphamatic (https://keenwiki.shikadi.net/i/7/71/The ... ic_L14.png), the final "survival chamber" in the bottom right has a Shikadi Master, and it usually stays within that chamber. That said, I think I've maybe seen exceptions where the Shikadi Master does teleport far away, so I'm not sure.

I do think the programming for them is a bit cheap. A Shikadi Master may randomly teleport above the player, and that can be an unavoidable death. I found the Shikadi Master generally to be a difficult and inflexible enemy to use when designing levels.

One other thing to note is that the Shikadi Master, like most other enemies, gets deactivated when it is more than a few tiles offscreen. So, it can teleport offscreen and then stop updating until the player gets close enough to wake it up again. They'd probably be even more unnerving if they were always actively updating.
Image
Armageddon Begins Again. The Alphamatic has arrived.

Atroxian Realm: viewtopic.php?f=4&t=3536
The Alphamatic: viewtopic.php?f=4&t=4086
User avatar
Multimania
Vortininja
Posts: 84
Joined: Sat Nov 10, 2007 8:10
Location: Hiding in a small, cramped corner of the BwB megarocket.
Contact:

Re: Keen 4 Least Favorite Level?

Post by Multimania »

The Shikadi Master basically picks a random spot near Keen. It then has a few checks to make sure the place it's selected is suitable.

If we look at the CK5_MasterTele() function in Omnispeak (which is called T_MasterTPort() in the original game and K1n9_Duk3's reconstruction), you can see what happens:

The Shikadi Master will look for a location 10 times — if it can't find a suitable one, it'll stay where it is.

To pick a location, it gets a random location in a 32×32 tile box around Keen (so, up to 16 tiles in each direction). It determines that the location is invalid if any of the following are true:
  • The location is outside the level.
  • The master is now stuck in a wall.
  • The master is (even partially) behind a foreground tile, (e.g., in a secret area).
There's no rule to keep them near their previous position: in theory, they could move to the other side of the map. Of course, since (like most sprites) they're only active when they're near Keen, and they teleport to a position close to Keen, they're very likely to not move too far.
User avatar
Quillax
Vorticon Elite
Posts: 554
Joined: Sat Mar 14, 2015 14:41
Location: Quillax Ship
Contact:

Treasure Eaters and Shikadi Masters

Post by Quillax »

Wow, this is all really interesting! I wasn't expecting this much technical info!

I remember when I designed the Flooded Fort level in The Sunnylands, I made sure the items in the secret areas weren't sprites so the Treasure Eaters wouldn't go after them. Looking back, though, I kind of wish I put in more point sprites. At least half of the points in that level are tiles, since I was afraid that I would hit the memory limit if I put in too much sprites. Also, since it's a linear level that goes somewhat-clockwise, you won't see the Treasure Eaters in the middle of the level unless you went to the end and then backtracked.

Right now, I think a great level that would utilize the Treasure Eaters would be a huge, non-linear level with a lot of exploration, like Chasm of Chills. Switches for bridges and platforms would create some backtracking -- but not too much -- so that Treasure Eaters may come back to get some points you've missed. In the bottom of the level, there would be a secret area filled with lots of points that the Treasure Eaters will take if you don't get there fast enough. Maybe in order to get to that area, you would need a gem, which could also be taken by a Treasure Eater if you're too slow.

Another idea I had for a potentially good utilization of Treasure Eaters would be a series of tunnels. In each tunnel there's at least one Treasure Eater and a bunch of points. Each tunnel would go from left to right, and end with a door that takes you to a hallway below. This left-to-right, top-to-bottom structure would mean the Treasure Eaters will look as if they're racing against you, assuming you weren't quick enough to shoot them.

I really like the map Nisaba made -- that should be uploaded to KeenWiki!

About the Shikadi Masters, I thought they couldn't hurt you if they were in the air? I remember that's how it was in the Keen 5 mod Battle of the Brains. It would be interesting to play with a patch that makes the Shikadi Masters always active no matter how far away they are from you. It'd probably make the QED level more exciting, but it might make it frustrating instead if they constantly appeared in tight hallways.
Last edited by Quillax on Mon Nov 15, 2021 19:47, edited 1 time in total.
Quillax Ship - Where you can download all of my cool, keen mods and super-marvelous fangames!
User avatar
StupidBunny
format c:
Posts: 2155
Joined: Fri Nov 02, 2007 19:19
Location: The Centre of the Moon
Contact:

Re: Treasure Eaters and Shikadi Masters

Post by StupidBunny »

Thanks for making a separate thread about this. The teleporty bois need some love.

Thanks Gridlock and Multimania for shedding some light on the Shikadi Masters and how they do their thing. I have to say making them inactive at distance massively neuters the potential threat they offer, as well as the terror they ought to cause. I’d love a mod or patch that lets them dog you around the level, and realize their full evil potential. I think based on what Multimania said they wouldn’t get to you in a corridor, since they wouldn’t have room to spawn in and drop. A good Shikadi Master-oriented might feature above mentioned patch plus a number of open areas with some tight alcoves, rooms, corridors, etc where the Master can’t go…so in any open room you face the threat of them popping in. Would be pretty cool…

And yes, they don’t hurt while dropping :)
Image
User avatar
Quillax
Vorticon Elite
Posts: 554
Joined: Sat Mar 14, 2015 14:41
Location: Quillax Ship
Contact:

Re: Treasure Eaters and Shikadi Masters

Post by Quillax »

If I understand Multimania's post correctly, the Shikadi Master gets its teleporting location by looking at the area around Keen, randomly selects one of the tiles there, and checks to see if the chosen tile is valid. I looked at extracted sprites of the Shikadi Master, and its hitbox is taller than 32 pixels. This means it would be impossible for a Shikadi Master to appear in a corridor that's exactly 2 tiles tall -- just tall enough for Keen to get through. Also, the hitbox seems to be about 16 pixels wide, so it could appear in a vertical shaft, although the chances of the Shikadi Master choosing a tile within that shaft would be slim. If the shaft is 1 tile wide, though, the Shikadi Master wouldn't teleport to there since there would be partially covering foreground tiles there (right side walls). I wonder if the Shikadi Master doesn't like one-way up tiles, as in it won't choose any tile that makes it touch a one-way up tile.

I like your Shikadi Master-oriented level idea, StupidBunny! I could see poles being used to get up and down through corridors and to go in and out of them, since the Shikadi Master won't appear with a pole covered by foreground tiles. In fact, poles could be added to some open areas to give the player a little defense from the Shikadi Master, since it can't hurt them in the air. I'd use such poles sparingly, though, so the open areas don't lose their tension. There could also be a few stationary Goplats exclusive to Easy and Normal. (Yes, it looks like you can have a Shikadi Master in Easy!)
Quillax Ship - Where you can download all of my cool, keen mods and super-marvelous fangames!
Ceilick
The Dude
Posts: 1670
Joined: Mon Sep 22, 2008 20:10
Location: Seattle

Re: Treasure Eaters and Shikadi Masters

Post by Ceilick »

Thought I'd comment since I've also worked with both creatures:

Working with their teleporting was kind of an exercise in frustration and one in which ultimately I chose to give up trying to design levels around.

I think in Battle of the Brains the Master/Overlord worked out best in the bottom section of the Krodacian Overlabs; lots of open space for the Master/Overlord to just follow Keen around. This was designed by Tulip and I'm not sure if it was intentionally designed around the creature. I designed both the Elevator Access Station and Defense Hall M, and the locations in those level where the creature teleported were, to my memory, circumstantial to the design.

In Return to the Shadowlands, the Treasure Eater appears in a few levels, with a slight tweak to it's behavior so that it would teleport to the next closest candy and would not longer steal key gems. I spent the most time experimenting with them in the Whispering Woods, a long horizontal level, wanting a situation where they would keep showing up as the player progressed. The problem I found was that they are WAY too slow moving and that unless the player has zero ammo or there is a physical barrier isolating them, they're presence in the level was often grabbing some points, maybe getting a second jump in for more points, and then dying. I felt I'd have to sacrifice large areas of level design just to create unique platforming situations to preserve the Treasure Eater's life, forcing the player to be unable to reach it before having the opportunity to teleport. This would have come at the expense of my existing vision for the level. So I created a few sprite based point locations where I would have liked the creature to teleport to, but never tested the viability because I didn't expect the creatures to live to get there.

So, as far as design philosophy for these creatures goes:

The Shikadi Master thrives in large open spaces without walls or floors between it and Keen. This, however, kind of defeats the purpose of teleportation except for its surprise factor. A series of tall, open spaces/rooms in which Keen is never quite able to get out of the Master's detection range would also work. I imagine a 2x2 grid of rooms in close proximity so that the Master can follow Keen into each one.

For the treasure eater it's the opposite. Small rooms or platform surfaces give it the greatest presence and opportunity to teleport elsewhere, and more so when it's a closed off section of the map that'll take Keen a moment to reach. The manner in which the Treasure Eater seeks the top leftmost target item REALLY restricts level design, I think, and gives the impression that the creature was always intended for one specific level only and why it was never included elsewhere (although that begs the question why they didn't just program it differently/better in the first place).
User avatar
55Aavenue
Vortininja
Posts: 116
Joined: Tue Apr 03, 2018 4:35
Location: Straight Outta Dosbox

Re: Treasure Eaters and Shikadi Masters

Post by 55Aavenue »

Interesting discussion! I wish this thread was up when I was designing levels using the Shikadi Masters. Much of this never occurred to me, I should have researched their behavior more, I was confused why sometimes they would teleport seemingly randomly, sometime were too predictable and sometimes not teleport at all depending on where I would put them.

Time to be self critical and see what I can learn from this. I went back and looked at my level Management Sphere from Armageddon App, which has 2 Shikadi Masters on Hard (and I think maybe normal too? Can't remember) with this thread in mind. I think I have placed the first Shikadi Master fairly well (see Shikadi Master A in the pic below). However, the other one, Shikadi Master B, may be the worst placed Shikadi Master in any mod/levelpack of all time!!

The first one (A) works good because he is in an open area with high ceilings, he can transport to the different platforms and he can shoot the propane tanks in the area causing them to explode causing extra chaos. But its an open enough area you aren't trapped, and you can go in the offices for refuge if need be and he can't follow you, which I know now, is because of the low ceilings. This also makes it so he won't (at least he usually doesn't) follow around for most of the rest of the level since the way out of that area to the bottom part of the level is too small again, which is good because the rest of the level is hard enough and I think that would have been annoying.

Now Shikadi Master B just sits in that top left office and 99% of the time will not teleport. When testing this level I had to make the ceiling above him hollow so you could jump over him to get the keycard or the level would have been impossible on most plays. Now I should have just deleted him, I'm sure his presence there has frustrated many people and I don't think he adds anything. For some reason, at the time of play testing the level I remember realizing he wasn't really working out there but I refused to delete him because it was the biggest office of the level and I was like "this is the big boss manager's office, there has to be a Shikadi Master in here!" Apparently, the hierarchy structure of the Omegamatic and who got the biggest offices became more important to me in that moment than level design :lol

Image
User avatar
proYorp
Vorticon Elite
Posts: 472
Joined: Fri Mar 03, 2017 1:56
Location: Orbit
Contact:

Re: Treasure Eaters and Shikadi Masters

Post by proYorp »

Quillax wrote: Sat Nov 13, 2021 8:23 the Keen 4 Least Favorite Level topic is currently having a very interesting topic about the Treasure Eaters and Shikadi Masters. It didn't have much to do with the original topic, however, so in respect of proYorp, I thought it'd be nice to make a new topic for it.
Oh lol. Thanks for the consideration. To be honest I don't mind when threads go a little off-topic. (It seems like a natural course of progression for conversation to flow, and in a casual friendly forum like this it's fitting. It feels more human that way....)

Though in this case there's a lot of posts on the new topic so it probably does deserve a new thread to stay organized. I was wondering if the thread would end up getting split off into two, but that seems to usually be done by a moderator moving the original posts and I don't know if any admins on here have time to mess with that. (To be honest it feels a bit awkward having duplicate posts. That creates the possibility that the conversation could end up running in two desynchronised threads at the same time.)

Er... is it possible to merge the original posts from the levels thread into this thread somehow?
"Friendly. Very friendly. Too friendly." Image
User avatar
Fleexy
Tool Smith
Posts: 1432
Joined: Fri Dec 12, 2008 1:21
Location: Abiathar C&C

Re: Treasure Eaters and Shikadi Masters

Post by Fleexy »

proYorp wrote: Mon Nov 15, 2021 3:57 Er... is it possible to merge the original posts from the levels thread into this thread somehow?
Done, though this thread's ID changed due to a bit of an oops on my part.
User avatar
StupidBunny
format c:
Posts: 2155
Joined: Fri Nov 02, 2007 19:19
Location: The Centre of the Moon
Contact:

Re: Treasure Eaters and Shikadi Masters

Post by StupidBunny »

@Ceilick The Treasure Eater behavior, elaborate as it is, is also pretty hacky and definitely feels overly specialized--I wonder if it really was designed specifically for one level (and the item placement, accordingly, tailored for the weird behavior of the smirky boi)? I feel like they could've come up with a less clumsy implementation if they'd really wanted to.

@55Aavenue I agree, Shikadi Master A is placed brilliantly there. I think the main power of the teleportation, especially without any kind of "always active" patch, is the Master's ability to move between walls/floors, and in this case the bugger has the ability to follow you almost from top to bottom of the level if you're not careful. As for B...well I'm very familiar with the impetus to make storylike design elements fit like this, even where they might lead to some questionable design choices :p Also this map looks cool and I'd love to try it.

Also I've never made a Galaxy level and should, someday
Image
Post Reply