DEV Community

Masashi
Masashi

Posted on

Langjam Gamejam

Day 1

There's only 6 days left. I had a ton of things to look after for the past few days so I completely missed the date.Infact, I started working on a fresh compiler for my language graveyard garden.

Suicmez, the Language

Suicmez underwent PDD (panic driven development). In the past month, I've done two speedruns of implementing languages from scratch. Both of them were in Rust, so naturally, I decided to use it for this thing as well. All that practice came in handy as I slapped together a lexer and a parser in about two hours.

However, I realised that things were way more challenging than I assumed them to be.

Performance

For ANY game (apart from tic-tac-toe or "guess the number"), I couldn't just have a bloated DSL that hogs 2GB of RAM and gives you 2FPS on flappy bird. The past two speedruns were treewalked (though one of the languages got a JIT
after the speedrun was over).

Suicmez had a few options:

  • Bytecode VM
  • JIT using Cranelift
  • Compiling to C

But that wasn't all.
I needed a typechecker. A robust one.
One without good enough inference would mean I'd have to spend time worrying about type annotations where I shouldn't have to. An overly complex one would mean that I'd finish the typechecker by next Christmas.

Then there was the runtime, the builtins, FFI support, etc.
And THEN ONLY, could I start working on a game.

Hopium

All of this was nearly impossible to do alone. So I set out on a search for a nice teammate.
Luckily, Nishi decided to join. I was overjoyed.

What We Did

We discussed the plans for the game and specifically, the compiler, and how it interacts with stuff. Nishi originally thought of using Milsko, his graphics library, but we'd have to do a ton of math stuff on our own if we wanted to use it for a game.
So we settled on Raylib.

Nishi primarily divided the work (for the game) into three sections:

  • Rendering
  • Collisions
  • Networking

And then, he started working on a networking library for the game, libfishsoup.


Day 2

The Best Team Ever

Shortly after, Wildered and El1i0r joined.

El1i0r was probably the most fluent in PLTDI theory stuff. So he helped us with some language design choices and helped me correct some of the sucky decisions I had made.

Wildered created a generational (pun intended) GC specifically for our use case. He also worked on the codegen part.

Now, we had set goals for the lang and the game.

The reason we chose not to use a bytecode VM was: performance.
The reason we chose not to use a JIT VM was: too complex.

A C backend was the Goldilocks solution to our problem.


Days 3-4-5

We decided to make a multiplayer FPS game. A 3D one. Last one standing wins.

These days went by in a haste, Wildered's GC was working perfectly. I started working on Suicmez's standard library.
We were utilizing ODE and Raylib. At some point, we did regret not choosing an engine but, we were already too deep in the rabbit hole.

Near day 5, I realized how big of a mistake we had made. Suicmez was way too abstract and high level to have nice C interop so me and Wildered spent a night adding low level features.

Here's how our language looks

Bitwise ops

Fixed arrays

Enums


Days 6 and 7

Our target was to get things done by Day 6, but because of shader errors. Things rolled on to Day 7.

The terrain was just a green blob.
Luckily, we managed to fix it and, things went well.

So in the last 15 or so hours, we deployed the game on Nishi's VPS.

And with that, our work, was done. All that was left was to submit it.
We had a lot of fun throughout this game jam and ended it with a playtesting session (We all suck at the game).

Top comments (0)