Salomonsson.se
Jul 31 2024

Banish and Polish

Been playing around with this project quite a bit this summer. Here are a few highlights!

Banish Ability

I implemented a new ability, Banish. It targets an entity and teleports it to a random part of the map that is out of the casters vision. This means you can send away dangerous opponents, but you can’t control where they’ll end up. Maybe just behind a pillar right next to you…

Also, since the code don’t deal with “players” or “enemies” or “monsters”, but entities, it means you can banish anything. Like a chest, yourself, or a door.

Demo of the Banish ability

Just to test it out, I created an enemy that would use the banish against you. Turned out too frustrating as it is potentially very deadly, and almost completely out of control, so needs tweaking.

Sequences re-write - C-style

The back bones of this game is how I can create and chain Sequences together. It was one of the very earliest features I implemented, but some aspects of the implementation has annoyed me for some time now:

  • Object oriented C++ with inheritance, not very nice to work with: lots of boiler plate and lots of copy-paste for every new sequence
  • Heavy use of new and delete, even though the rest of the game uses my own, custom memory arena allocator
  • Lots of copy-paste nonsense between header and cpp-files (even though I thought I managed to keep it fairly simple with a factory)

So I took the bold decision to do a full re-write. No more classes. No more new/delete.

Now we’re using old-school C-style structs, void * for custom data (yeah baby), and function pointers for custom execution. My project, my rules.

Turns out I could simplify things a lot. Better overview of existing sequence-implementation, and fixing a few bugs along the way.

Slot machine polish

One sequence that was very old, and very hacky was the slot machine implementation. While at it, I got to do a re-write, getting rid of some really crazy hax, and adding lots of polish to it too!

  • Each real slows down before stopping
  • As a reel stops, the result is highlighted by a quick white flash
  • Added a bit of shading to the “curves” of the reels
  • Reel can support other that plain damage numbers (implemented fire damage as a test)
Polish, the devil is in the details!

And here is a video of the new slot machine in motion.

Working on some other, really cool features too. But those’ll get their own post!

Happy ascii!

Apr 27 2024

Holes in the level, and ability hints

Been mostly playing with levels, but have two new things to show.

First, I added descriptions to each ability which is displayed when hovering in your inventory.

And secondly I added “holes” in the level. You can’t walk over a hole (unless you can fly), but you can see over it and ranged attacks work. If you can teleport, then you can also teleport straight to the exit.

That’s all for today.

Mar 31 2024

Asciibrain - Strategic Gameplay!

Sometimes it’s the small things that really stir things up. I decided to spend some time on making a static dungeon, and making it really fun. And the result was fantastic!

Step 1: Add a third character

Say hello to the Thief

Only two characters made the game hard. A turn would end too fast. So I quickly added the Thief. This new character has the following interesting characteristics:

  1. Weak! Low on hp and don’t hit very hard
  2. Has a much shorter walk range, BUT has 3 actions per turn (instead of 2) so the total movement is much greater
  3. Has a new default ability Sneak that makes enemies ignore him (or her?) for one round
  4. Also starts with the One more thing ability by default, which means she can make up to 4 potential actions!

Step 2: Players can act in any order

The Thief turned out fantastically, but turn order really limited everything. So I quickly re-wrote it to allow you to change to any player controlled character with actions left….

And wow! Now it’s a completly new game!

Where before it was just mindlessly “walk and attack”. Now you can start taking strategic decisions! A simple example:

  1. One of your characters is in deep trouble, cut off and surrounded by enemies and low on health.
  2. Switch to another character. Loot a nearby chest (chest will give every character a ability-card) and
  3. …pray it contains something that will save the day. Maybe your character got a sneak? Change back and apply it to yourself. You’ve just delayed your imminent doom one turn…

Here’s a short video showing heroes and abilities playing together…

Strategic gameplay 001

Step 3: Adjust health on doors

Another really small, but impactful change, was to lower the health of my doors to match the damage of a Fireball. Now, any door that gets collateral damage from a fireball will be removed and reveal the enemies behind it… now you need to be a bit more careful…

Doors will now burn up from collateral fireball damage

Step 4: Adjust health on chests too…

Even more critical! Chests also gets destroyed from Fireball damage! This might be even more critical!

How to handle it? Change to the Thief character, sneak in and grab the loot, get out of the way and have the Wizard fry the eneimes and the now empty chest…

Loot chest before it gets destroyed!