Sunday, January 6, 2019

Ludum Dare 43

I realized I never made a post about my participation in Ludum Dare 43 where I finished my newest project, Slime Venture!

The theme for the latest Ludum Dare was "Sacrifices must be made" and what better thing to sacrifice than your own body or the bodies of similar creatures? I decided early on to stick with my theme of 2d platformers as I have become very familiar with the systems involved and I new I could get a functional prototype done quickly. I didn't dedicate the whole weekend to the compo so I wasn't willing to tackle something entirely new.

Credit to my wife for suggesting slimes, which were a great choice as I didn't have to put much effort into assets. Simple colored cubes while not much to look at were fully functional and believable. The bright colors also made it easy to differentiate the slimes from each other and the background.

JMonkeyEngine is of course my go to 3d engine with Java as the primary language. I decided midway through the project to also incorporate Groovy script to supplement Java and give me an easy way to test features without needing to compile. This also taught me that when Netbeans' Gradle plugin compiles a project with a sub-project containing your assets, those assets are copied and stored in a separate folder. After an hour of head scratching I figured this out and made a simple work around to access files directly for testing only.

I used dyn4j for the physics and collisions. Integrating the physics into JME is easy and consistent.

Zay-ES was used to take advantage of an entity-component system. While I don't feel as strongly about ECS as I used to (At one point I couldn't fathom making a game without one) I do still feel they are very useful and when implemented correctly greatly speed up prototyping. The art is in finding a balance between to many and to few components for any given situation and really fleshing out your systems on paper. Remember, your systems ultimately drive what components you make and not the other way around!

Lemur UI is my favorite GUI system for JME. It lacks some features but is so easy to work with that I rarely run into an issue I can't resolve.

The game loop is very simple: Every level has a spawn point that sets the player's avatar to a slime with a given size and color. Every level needs to specify a trigger to activate level end. The only trigger I used for the Jam was a simple detection zone that would detect the player entities id if the player was inside the zone. There was no visual editor for levels and they are all described via groovy script calling java functions to build the various set pieces.

Slimes all have a size (1-5) and a color (blue or green in the prototype). Slimes who are a larger size will consume slimes of a smaller size. This is true for slimes of the same color, so beware you can still be eaten by "friendly" looking slimes! If you consume a slime that is your color and smaller than you, you grow 1 size. If you consume a slime that is a different color and 1 size smaller than you, you shrink 1 size. Smaller slimes move faster and jump higher than big slimes. Most levels features obstacles that were to small for large slimes to pass through, so you would need to shrink yourself enough to squeeze through. Other levels would require you to eat slimes in a certain order to be the correct size to finish the level.

All in all this Ludum Dare was tons of fun. I didn't dedicate my entire weekend, and altogether probably spent 12 hours working on this project. By setting the scope very small and dedicating more time to interacting with my wife and kid I had a much easier time focusing on programming when I did sit down to work.