Project N5 Progress Update: 2024-03-24

» The Arena Update


A new update so soon‽ Yes! I have things to share that I'm really excited about!

What did I actually do?

Today, while I was standing in the shower, I set out a goal for myself: implement the arena mechanic. This was actually a goal that I had set out for myself to complete months ago, and my ultimate goal was to have it done by April. A few weeks ago, I thought to myself that I had postponed it too much, and that I wouldn't be able to get it done by April anymore – especially concerning the lacking motivation I had back then.

So, did I actually get done what I had set out to do? Also yes! I worked on my game (with breaks in-between, even one I used to bake a small cake) for a whole 10 hours today, and I actually worked out a decent, modular arena challenge system.

The Finished Product

The Good

The New Enemy, Suzanne Cylinder

Suzanne cylinder (called "test_monkey" in the game) is the first enemy that has movement code implemented, able to follow the player once close enough and attack once the player gets too close. Without gravity holding Suzanne cylinder to the ground, though, the situation gets spooky quickly.

Initial movement tests were quite funny, because look_at() adjusts rotation on both the y axis (left-right rotation) as well as the x-axis (up-down rotation), which meant that the enemy kept looking up when the player was at a higher elevation than it.

send help

Developing Arena Challenges

To expand on the last point: I'm actually quite proud of the solution I implemented for creating arena challenges. The way this works right now is that the arena terminal contains a dictionary which stores all arena challenges, including any information that needs to be associated with them: round and enemy count and types, rewards, etc.

All that information looks a little like this:

const arena_challenges = {
    1099: {
        "reward": 7382,
        "rounds": [
            {
                "type": "regular",
                "spawner_count": 3,
                "enemies": [
                    ENEMY_MONKEY,
                    ENEMY_MONKEY,
                    ENEMY_MONKEY,
                    ...
                ],
            },
            ...
        ],
    },
}

1099 is the unique ID by which the challenge is identified; this can later be used to save which challenges the player has already successfully completed. The ID is also used to fetch strings, such as the title of the challenge, and later the description and perhaps other useful information that could be displayed to the player in the arena terminal GUI.

reward is the money count that is rewarded after completing a challenge; the option to receive items could be implemented later. A reward for completions after the first one should also be added later, so that the player doesn't receive an insane amount of money for completing the same challenge over and over again!

rounds is an array that contains round objects which store the type of round – which is currently unused, but could be used later for boss rounds –, the spawner_count, defining how many of the current total of 8 spawners should be used for spawning enemies, and of course, enemies, which defines what types of enemies and how many should be spawned in the given round. enemies are defined simply by entering the string paths to their scene file (here, ENEMY_MONKEY is a constant string pointing to the enemy's enemy.tscn file).

This system is actually super easy to use; by defining a spawner_count and enemies, the arena script can figure out how many enemies should be spawned per spawner in order to balance out the spread of enemies. Spawners are picked at random, and enemies are shuffled before being spawned, so that the order entered in the challenge definition doesn't produce same results every time.

A challenge ends once all rounds have been cleared; a round ends once all enemies in a given round have been defeated.

The Bad

Verdict

Very happy with my progress today – I got so much done. This was my most productive day in a very long time.

The great thing is that, now that there's an arena challenge, and with it, a constantly spawning stream of enemies attacking the player, the game actually has a proper gameplay loop, in some way! In other words – there's actually something to do now!!

I think that's pretty neat.