chewbranca.com

Documentation
Login

This is archived from chewbranca.github.io. Old metadata:

I'm very excited to be diving into the 2018 Lisp Game Jam! My plan is to make a Diablo-esque pvp deathmatch game! I stumbled upon the awesome open source Flare Game that is a single player action RPG inspired by Diablo. What really intrigued me about the game is all of the artwork.

I haven't had great luck finding open source isometric game art, especially with a variety of characters and animations, so when I found all of the open source artwork in Flare Game, I started dancing and getting ideas for this game. The Flare Game repo itself that I linked to above is actually just the game assets, containing the artwork, animation definitions, maps, map tiles, sounds, etc, and the engine is in the Flare Engine repo. This is perfect for me, because I'm rolling my own engine on top of Love 2D using Lua, so I just need the art assets.

I've built a library around the Flare Game assets, called LFG, short for Lua Flare Game. The idea with this library is to take care of parsing the various animation definitions and making usable characters out of the sprite sheets.

What does that actually mean? Well, let's take a look. A sprite sheet is a series of animation frames combined into a single image that you then load in your game engine to render. So for instance, I've taken a sprite sheet from Flare Game like this minotaur sprite sheet:

Minotaur Sprite Sheet

and using LFG I've turned it into animations like:

Minotaur Animation

and that's based on Flare Game's animation definition for the Minotaur Animation which looks like:

#image=

render_size=128,128
render_offset=64,96

[stance]
position=0
frames=8
duration=1600ms
type=looped

[run]
position=8
frames=8
duration=533ms
type=looped

[swing]
position=16
frames=8
duration=1066ms
type=play_once
...

Those animation definition files give you the information to know what frames correspond to a particular animation, and then the 8 rows of the sprite sheet correspond to the 8 cardinal directions. So to make an animation, you figure out which cardinal direction the player is facing, select the appropriate row, and then select the appropriate sprite tiles for the desired animation. Then you divide the animation duration by the number of frames in the animation, and you play each frame for that long to animate the character.

The idea of the LFG library is to provide a simple library interface around these Flare Game assets, so you can do things like local minotaur = lfg.get_character("Minotaur") and have the full set of animations at your disposal. The LFG library also takes care of player controls, movement, circling strafing, and it has rudimentary projectiles and collision detection in place. I'm in the process of adding networking support to it as well. In general, LFG's goal is to make it easy to build Love 2D games using the wonderful assets from Flare Game.

Lisp Game Jam 2018

So how does this all fit together for the Lisp Game Jam? Well, like I said, I'm going to build a Diabo-esque pvp deathmatch game using the Flare Game assets! This is the first video game I've ever made, so I've been having a blast diving in and researching how to build games and how game engines work and game networking and all that fun stuff. It's been a bit tortuous not being able to actually start on the game itself until today, but it took a chunk of work to get LFG to where it provides higher level abstractions around the Flare Game assets so you can just grab the different characters and use them in your game. A handful of the Flare Game character mobs are currently supported, for instance:

Random Mobs

"But I thought you said this is a Lisp game jam? Lua ain't a Lisp." Correct! That's where the awesome Fennel Lang comes in! Fennel is a lightweight Lisp that compiles down to Lua code with minimal overhead. So my plan for the game jam is to make a new Love 2D based game that is written in Fennel, and uses LFG to provide the characters and game world! The entire point of this game is for pvp deathmatch, so getting networking in place quickly is a priority for today. I'm going to focus on LAN only game play, because low latency internet based gaming is serious undertaking. Maybe in version 2 :D

My plan is to post updates to this blog as development progresses so folks can see it come together. Happy hacking!