September 6th 2022

OLC Code Jam 2022

5-9 minutes

This year, I participated in the OLC Code Jam. It isn't the first time I've done so, but it is the first time I'm writing about it here.

The theme of this year's jam was "Weather".

What is the OLC Code Jam?

It's is a yearly game/programming jam.

Hosted on itch.io by javidx9 for the One Lone Coder community.

Every year, the theme of each jam is veiled in secrecy. A mystery, up until about a day before the jam is set to begin. It is usually revealed during a brief livestream broadcasted by Javid, or a video upload on his channel.

Fracture

I've previously participated in OLC Code Jams, however I only ended up submitting an entry once.

I submitted Fracture for the jam in 2019.

It was a little experimental project that I ran on an early version of my game engine. I ended up using it as an opportunity to add some new features that I still use for my personal projects to this day.

There were some clear problems with the project though.

From a gameplay perspective, it was very unfocused. At the time, I had all sorts of ideas that were visually interesting, but when it came to game mechanics, everything was rather quiet.

I was going for a cold post-apocalyptic vibe. A world in which time was falling apart and tearing up the universe.

For context, the theme of that year's jam was "Destruction". Fracture involved very few actual destructive concepts. It really only existed in the narrative.

The Great Wave Machine

In 2020, I also took a lot of liberties with the theme. This time it was "The Great Machine".

Once again, I also was having a hard time coming up with anything interesting from a gameplay perspective. So I ended up with a wave simulator...

Originally, I wanted you to be able to sail across the water with a boat. You would pick up adrift packages and that was about it.

As the jam progressed, I just lost interest in most of those ideas and instead forced the debug camera to always follow the water surface. It would be pushed around a bit by the waves, and a timer would count down to zero until you drowned.

Clearly a very engaging project. I only ended up uploading the video, and never submitted the project to the jam itself.

I skipped over 2021, I can't exactly recall why but I think I had other plans the week that the jam was running.

Pour Honor


Image of Pour Honor's intro sequence

This year was quite different.

I've been spending a fair amount of time on Lofty Lagoon, and recently improved how I design and plan game mechanics. It's no golden goose, but I feel it has been helping me focus this year. It's also very useful for when you want to quickly put something together within a few days.

After the theme for this year's jam was announced, I quickly grabbed my notebook and sat down to put some thoughts to paper. Almost straight away I had an idea I liked.

It was simple, had an interesting premise, and actually involved some gameplay!

Image of the game's first draft on paper

You're a weatherman! You're supposed to predict the weather, and if you get it wrong. Both society and the universe will take turns making your life miserable. However, if you get it right, life will bring you good things!

On paper, I separated the game into several distinct screens. In my mind, they also directly represented game states. This made it quite easy to break down tasks, as unfinished states could just be skipped over during development.

enum GameState
{
    Title = 0, // Title card that waits for user input. (Press Enter to begin)
    Intro, // Intro that is played after the title card. (skip using Spacebar)

    Observe, // Stare out the window and try to dicern what the weather will be.
    Predict, // Submit predictions to the computer.
    Presentation, // Your predictions are presented on the television.
    Reality, // Were you indeed correct?
    Consequences, // The senate will decide your fate.

    Lose, // You're fired, your reputation is in the dumps.
    Win, // You're the greatest weatherman that has ever existed, good on you buddy!

    Maximum
} State = Title;

Here you can see what enum GameState looks like. It remained pretty much unchanged for the entire duration of the jam.

I think we've scared away all the non-programmers at this point. Here's a snippet of the code for the intro as well.

struct IntroCard
{
    float Duration = 3.0f;
    std::string Asset;
    std::string Text;

    olc::Sprite* Sprite = nullptr;
};

std::vector<IntroCard> Cards = {
    {4.0f,  "slide1",   "The life of a weatherman."},
    {5.0f,  "slide2",   "The life of a weatherman...\nIs filled with worry."},
    {2.0f,  "slide1",   "Developing a keen weather sense."},
    {4.0f,  "slide1",   "Developing a keen weather sense..\nIs paramount."},
    {2.0f,  "slide1",   "Wake up.."},
    {4.0f,  "slide1",   "Wake up..\nIt's time to gaze."},
    {4.0f,  "clouds",   "Watch the clouds."},
    {4.0f,  "computer", "Then press Enter\nto submit your prediction."},
    {2.0f,  "slide1",   "Take your time."},
    {4.0f,  "slide1",   "Take your time..\nBut not too much time."},
    {0.2f,  "slide1",   "Your "},
    {0.75f, "slide1",   "Your reputation"},
    {0.25f, "slide1",   "Your reputation is"},
    {0.25f, "slide1",   "Your reputation is at"},
    {4.0f,  "slide1",   "Your reputation is at stake."}
};

All the intro state code does is look up how long the intro state has been active after which it then switches to the next "card".

const auto CardDeltaTime = TimeSinceStateChange() - CardStartTime;
const auto WantsSkip = ( CardIndex > 0 && GetKey( olc::ENTER ).bReleased ) || GetKey( olc::SPACE ).bReleased;
if( WantsSkip || CardDeltaTime > Card.Duration )
{
    CardIndex++;
    CardStartTime = TimeSinceStateChange();
}

You can find the full implementation on GitHub.

Anyway, I think I've babbled enough about this project. It was fun participating in the OLC Code Jam again, and it felt great to be able to actually put together something that actually feels like a game.

I'll leave you with a quick playthrough of the game.

Link: Play Pour Honor on Itch.io

I hope you have a great day!