Summonable Tokens and AI

I have a cool addition to the game: Summonable Tokens. I made a Necromancer token and cards, one of which is Summon Skeleton, it creates a token at one of the grave mounds that are placed around the map. The summoned skeleton token is a “Lesser Token” which doesn’t work like a regular token on your team in that it can’t “play cards”. No no, a Lesser Token only acts at the end of your turn and does a specific action each time. In the skeleton’s case, it’s “Shamble” which is a short distance melee attack.

Summoning lesser tokens can work for the player too, so I’m thinking of making a Beast Master character who can summon different animals which will be Lesser Tokens and have different behaviors such as a Wolf that Lunges, a Hawk can like… dive I guess or a boar can Charge (move in a direction until it hits something.

This morning I got the card action “InvokeLesserToken” working. As in, being able to play a card that forces your Lesser token(s) to do something. For example, the card Hunger Of The Dead: It causes a Lesser Token to do 3 Melee moves. The player doesn’t choose the Lesser Token’s target or aim it’s shot, it simply forces the token to do it’s own thing.

AI Play Evaluation Helper

Over the last 2 days I also implemented a new method on CardActions called SpecialAiEvaluation() which returns a float that the AI uses to evaluate a play. It adds or subtracts from the play’s score, which it turn makes the card more/less likely to be played by the AI. This is useful because sometimes the AI needs help deciding when a card is worth playing. Sometimes the card is just very powerful but hard for the AI to systematically understand why. For example Summon Skeleton; it gets another token on the field but the AI currently doesn’t evaluate that. It only ever looks at paths and targets’ properties. So the Summon Skeleton action’s SpecialAiEvaluation() simply returns a large number, in this case 300, which is a higher score than any standard evaluation the AI does itself ensuring the card is selected to be played.

This SpecialAiEvaluation is in contrast to how the AI in Hearthstone does it’s evaluation. During a talk at GDC years ago the original AI guy on the Hearthstone team said that one goal of his AI was to not use any special, helper methods of evaluating plays. This is great as it means the AI is advanced enough to understand the value of a card’s effects without having to explicitly be told.

While it is possible that I devise such a robust system for my project, it is likely unnecessary with the time/effort required not being worth it, at least not now. In the current form I can be highly specific about how a particular CardAction is evaluated. Later, if a particular action (like summoning a token) proves to be something that happens often the action’s special evaluation can be converted into a standard evaluation step. It’s easy to imagine that the general scoring of adding a new token to your team is usually a good thing, but it’s just not better than performing a game winning attack, or saving a higher value token with a heal.

Kick, Punch, Eat Meat Dev Log #2

So many big steps made, things are shaping up nicely. There are still lots of mechanics with uncertainties around them and a whole lot of UI/UX improvements needed. But I’m here to celebrate the victories over the last month.

A major help was a day spent brainstorming with a friend of mine, Kevin Zipper. We went to Gumbo in Brooklyn, a shared work space for a gaggle of game devs. While there we used a meeting room for a day and really hashed out some aspects of the game focused on enemy abilities and over-world movement mechanics. It turned out to be a very productive 6 hours of white boarding and fleshing out of ideas.

One of the big things we discussed was how to get the player’s deck to play a larger role in the other aspects of the game. The core idea is that “The Deck is your Character” but the game had become something where the deck was only used in combat. This didn’t sit right with me so we spent half the day exploring ways that the deck could effect the other aspects of the game such as movement and events.

See, one of the issues I've had is that I'm not creative in a bubble (nor am I entertaining when alone, hence why my writing is too bland). I need someone to form ideas with but this game has always been just me. This is a big part of the reason development has been so slow and why the game has taken on so many other forms over the years. One day I'll put together a post showing the many different forms of the game has taken.

Anyway, let’s get into some detail on what’s changed.

Proc-Gen Map

Using proc-gen for map biome placement. Big thanks to another pal, Brian McLendon, the proc-gen wiz, for doing this. He’s able to turn Perlin Noise into a Perlin Symphony (sorry, working on being funny). Specifically, the world now utilizes a seed to generate height maps then uses those to decide which biome to assign to a tile. Previously it was just randomly picking a biome per tile, this has made the maps much more comprehensible.

Event ScriptableObjects

The Game Event system got a major overhaul and now runs off ScriptableObjects rather than an XML doc. This means a nicer way to create and edit events while making the events more customizable. Also, I implemented Choice Requirements, so some choices can be locked off unless the character has a specific card, equipment or whatever (like the blue text choices in FTL).

Equipment ScriptableObjects

Equipment now also utilizes ScriptableObjects, mostly for assigning all the visual and text aspects of the item. The equipment’s effect is still dictated by a specific class for each item, in order to give them unique and powerful effects. One cool thing that equipment can do is add more cards to your deck while the item is equipped, very much like in Card Hunter. So expect to see equipment that has powerful passive effects balanced with adding some bogus cards to your deck. Oh and there is an equipment type called Mutations, but I’ll leave it at that for now.

Movement Phase

This is a big change that mostly came as a result of the big brainstorming session. The player’s deck now plays a role in player movement on the overworld. During the Move Phase, the player is dealt a few cards from their deck. They then get to choose a card to use as their movement card. The card chosen will determine how many spaces they can move and may also provide other effects either in or out of combat. For instance, perhaps during the Move Phase a player chooses to use the Bandage Item card. This card doesn’t provide many move points, but it does heal the player. Or maybe they use Simple Plan, providing a moderate amount of move points while also giving an extra card draw in combat if it’s encountered.

There are still some aspects of this new mechanic that may change as testing continues but it’s a major step towards having a game where “The Deck is your Character”

Side Note: The original idea was to have this movement phase be just like 1 round of combat, using the same UI. But upon implementing this I immediately didn't like it. Despair set in, but I went ahead with a different iteration which I really like and is now what is currently in the game.

Dual Purpose Cards

To go along with the Movement changes, cards have had to change too. Cards have to play 2 roles now, Combat and Movement, so can have distinct abilities in each context. When looking at the cards in your deck or when viewing cards being offered to you, you’ll see the card’s stats and effects for both phases, but when in the combat or movement phase you’ll only see the values and effects that relevant to that phase.

Enemy Controllers

Previously, enemies were entirely defined using ScriptableObjects and their attacks were reusable classes like “DamagePlayer” and “AddCardsToDiscard”. These classes were attached to the enemy’s ScriptableObject via an array, giving them a list of possible attacks from which they would choose 1 to use each turn. This was great for reusability but not great for customization nor did it allow for complex, multi-turn enemy behavior (like charging up an attack to use next turn).

But now that’s all changed and I’ve introduced the EnemyController. With this, enemies get a slew of new potential abilities. Charge-up attacks, fleeing from combat, explode on death and much more.

The Rest

There area also a whole bunch of more minor changes, bug fixes and some changes that aren’t too impressive to talk about but are big code architecture changes that allow for stuff that you’d expect in this type of strategy game. Like spawning new enemies into the current combat. Seems like something that should be easy, but it required a lot of refactoring to get the system able to spawn in enemies all willy-nilly.

Wolf Girl calling in more pups! Those red boxes on that cards are temporary!

So that’s the big stuff. The game is nearing “Feature Complete” and the next few weeks will be focusing on cleaning up the UI/UX mess that has arose from all the rapid prototyping. Looking forward to getting new art and animations from Butzbo soon.

Kick, Punch, Eat Meat Dev Log #1

It is my quest to complete Kick, Punch, Eat Meat and if fortune favors me, turn Robot Monkey Brain into a sustainable venture. Leave a comment if there is any other aspect of this game dev stuff that you are interested in keeping tabs on and I’ll include it in future logs.
Here is what has been happening over the past 4 weeks:

  • Implemented Equipment as playable cards
  • Conducted multiple play tests, gathered a lot of quality feedback (thank you, friends!)
  • Removed Equipment as playable cards
  • Implemented Equipment as items added into Slots on the character. They provide passive effects.
  • Changed the map to a Hex map
  • Implemented Line Of Sight on the map
  • Added Ruins to the map, locations which present the player with special Events
  • Implemented multiple outcomes to events with probabilities used for selecting the outcome of the player’s Choice
  • Recongigering of the Combat UI elements
  • Much balancing of existing Cards, Enemies and abilities
  • Many bug fixes and performance tweaks
  • Progression towards making Robot Monkey Brain into an LLC
  • Researched the Photon plugin for Unity (for future projects)
  • Addressed a performance issue with Instantiating too many cards every time the deck changes
  • Added a number of new Poison card mechanics
An early version of the map with Hexes and their various Biomes. Chests represent Ruins for now and Mountains block movement and line of sight.

Side Quest

Eat all the food in my house before buying new stuff. I’m allowed to buy food that’ll go with something I’ve got an am trying to use up. For example, I have a bunch of granola, so I’m allowed to buy yogurt to eat it with. At this point, I’m getting pretty low on food stuffs and these pickle, salt and coffee ground sandwiches aren’t the best.