Most Important Person - children fly faster when you throw them

screenshotem2018/em12em4/em2em30/em25.png

Game Idea

I am myself a member of GameDev Underground, a community of aspiring game developers. As a result, I experience my game jams in a community focused manner, hanging out in discord and watching community streams.

So it was Friday and I was watching one of those. When the theme dropped I was kind of glad, because it wasn't god-awful to work with. There are a lot of ways it can be interpreted. My first decent idea was a superhero theme. After all, a good superhero has to sacrifice himself at some point for the greater good. Then someone in the chat mentioned the trolley problem and I knew what I was gonna do :) The established consensus on the trolley problem is that you should sacrifice less people for more people. I personally despise that attitude of killing someone on their lucky day and I can't see sacrificing someone else as a commendable course of action. And there it is, my theme :)

And so I began work on a game about a superhero who heroically sacrifices other people.

Mechanics

The easiest way to adapt this was a platformer. I view platformers as the thing you make when you have no idea for a game, but its very versatile in what you can do with it.

I quickly made associations in my head between superhero -> monsters, superhero + sacrificing other people + monsters -> feeding peolpe to monsters -> throwing peolpe at monsters -> children fly faster etc. But I also needed an incentive to throw them. Which means the monsters had to follow you around. Which means I had to make a full platforming pathfinding algorithm. I was a bit of a pain.

For the algorithm I chose Godot's AStar, which worked pretty well. After getting my platforming mechanics down, I built a bunch of platforms to test the capabilities. Then I wrote an algorithm which constructed navigation grid based on the platform tilemap layout. The algorithm was pretty simple, as I was using tilemaps exclusively for the platforms.

  1. For every tile that is not passable (which means a platform piece is placed there):
    1. If the tile above is passable:
      1. If the tile to the left is not passable:
        1. If the tile above the tile to the left is passable:
          1. Add a connection between the tile above and the tile above the tile to the left. There. That's it for navigation information on continuos flat platforms.
      2. Otherwise, the tile to the left is passable. If the tile above the left is passable:
        1. For every tile within your horizontal jump range to the left (It was like 3 for me IIRC):
          1. For every tile NOT ABOVE the tile to the left in the column from the highest to the lowest:
            1. If the tile is not passable:
              1. Add a connection from the tile above (above the starting tile, ALWAYS) to the tile above this tile (you know its passable because of the break)
              2. If the tile is within jump reach (this will vary depending on horizontal distance, right)
                1. Make the connection bidirectional
              3. Break.
        2. For every tile within your horizontal jump range to the right:
          1. Basically repeat 1.1.2.1.1. with the with the change that the tile has to be UNDER, not NOT ABOVE. To avoid duplicates.

There. That's all the map information your AI needs to jump and drop from platforms. It's really satisfying to see it go :) The path following algorithm has its own quirks, but its pretty straightforward conceptually. I will upload my source files for completeness.

Throwing is very easy. Its just a normal projectile with gravity, right? You have 3 ammo types: children, adults and fatmen, and the all fly differently and take different amount of time to digest each: 1, 2, 4 seconds respectively. Throw in a proper flight path prediction and you're set.

Ammo restock is more interesting. Finite ammo would be depleted way too fast, so I had to make it infinite. Localized spawn points would work very well, but I was lazy so the people just rain from the sky. The willingly follow you around and if you don't have anyone in your hand they will come to you on their own. No need to pick them up, it happens automatically if they are close enough. There are level design problems with this but more on that later.

Monsters are about 70% slower than you. All AI characters have randomized speed for visual variety. The big problem with my platforming AI is that during a jump the AI has to be as fast as you are, because they need to be able to get wherever you can. This makes vertical sections surprisingly more tricky. I could probably just make them jump in slowmo, but that would look silly. Monsters will enter eating state on contact with any of your dudes. They will remain for an amount of time determined by innocent type and they will go back to normal. When they are hit with an innocent when they are eating, they will die. It's a very simple and effective concept.

Level Design

I didn't have a lot of time to like refine my levels or anything. I made a bunch of arenas to see how they would turn out with the platforming AI. It turns out that the 'go-anywhere-from-anywhere' style of arena is tricky in that the AI has no problem to surround you because its just so good at pathfinding. Using some sort of move restrictions gives player more tactical evasion options.

Having learnt my lesson, I implemented a simple checkpoint system. Its so much better with it.

All roofs have holes in them for the innocents, so that they may fall from the sky to you and drop down the rest of the way. Simple and effective, but it has one problem. I separate the arenas with doors. Doors respawn when you restart from checkpoint. Now thats problematic. If an innocent drops on the wrong side of the door, it will be stuck there forever, limiting your ammo. The solution to that could be localized arena spawn points, or replacing doors with one way passages (just a 4 tile drop). I've made one of those before the first arena and then I just forgot about them for the rest of the game. Oh well.

Art

screenshotem2018/em12em4/em2em33/em20.png

So I decided to just learn Inkscape now. I used it a little bit for some simple palceholder art like triangles with gradients, so I was a little familiar. I learned an awful lot more this LD though. The graphics are nice and crisp as a result :)

Because of the sacrifice theme I immediately though of Cthulhu, so I decided on a Cthulhu theme. The background is slightly animated. Not much else to see here.

Sound

I bought the RPG Game Dev Bundle lately and I decided I'd try it out this LD. All sounds and music come from the bundle, particularly from the pro sound collection. Its so great and versatile, its awesome! I'm super glad I bought it. Worth every penny.

There is one outstanding issue with the sound and that's the child sounds. When I found the child scream file in the bundle, I sank my face into my hands for good 10 minutes, contemplating whether I was going to use it, because I felt i was crossing a line. I decided to use it anyway because of limited reach of the game. Hopefully it won't bite me in the ass later.

Summary

I learned a lot of useful stuff this LD and hopefully I will see that reflected in my score :D I placed in the lower 25%, 20% and 15%, so If I don't change the tendency i will go negative during LD46

The game and source code are available at https://ldjam.com/events/ludum-dare/43/most-important-person Enjoy! I can play and rate some other games too.

screenshotem2018/em12em4/em2em35/em28.png

Merry Christmas everyone!