NIFE Updates Shatterloop Game Projects Shatterloop Updates
Other Projects Blog    


P-IV. Combat Notes

Posted 6 Months ago by Xhin

Moving anything related to the combat megaproject here for safe keeping.

Page 1
  • Combat Update (covers 5 posts of notes)
  • Mass simplification / re-integration
  • Dungeon Combat

    Page 2

  • Terrain-dependent Hand weapons

  • There are 8 Replies

    Spawns / Nests Basic Stuff

    The first thing I definitely want to upgrade is the spawning system, which is quite annoying at the moment and makes scout animals slightly more useless.

    Nests are fixtures that are scattered around the world that enemies spawn from. Like water colors, their generation is mathematical to cut down on rendering issues. They should be somewhat less predictable however. Using Zones might also make sense, or otherwise going through that existing endpoint. Nests will never be too close to the origin (got to give new players some time to work with the game before they hit combat), but they're not super far away either.

    If you're within a screen and a half (31 tiles) of a Nest, enemies will start spawning from it. Depending on their behavior, they might start appearing on screen on one of the edges as you get closer. If you're two and a half screens (52 tiles) away from a nest and no enemies are on screen, they'll despawn. Multiple nests can have this happen with them simultaneously.

    When enemies spawn, they can appear at any direction from the nest. The first time a spawning happens, floor tiles will get built two square radiuses from the nest so that enemies can actually pathfind to the player. This won't be perfect in more crazy terrain layouts but it should help. This shouldn't happen for flying enemy nests (they can fly over solids) or caves (they break through solids), or dungeons (they're already surrounded by floors).

    Enemies that get too far from their nest will start moving back towards it to help these systems move along. I'm not sure what the range is here yet.

    Spawning timing

  • Each nest has a "capacity" -- the maximum amount of enemies that it can have on screen at once.

  • Each nest also has a "spawn rate" -- the speed at which new enemies are created from the nest.

  • Lastly, each nest has a "final amount". Enemies will respawn when killed below capacity until the final amount has been reached.

    These properties are inherent in the enemy that spawns from that nest and can thus influence enemy difficulty and make learning patterns more valuable.

    Nests will almost always spawn a single enemy type, which again improves the learning factor and also improves materials acquisition. However occasionally you'll run across a "melange nest" that will spawn several different types of enemy. The nest properties of these melange nests will be fully randomized but somewhere in between the properties here.

    Both regular nests and melange nests can be found with Scout animals, and you can also see whether they're regular nests or melange nests accordingly.

    Nest Distribution

    The nest-spawning algorithm only determines that a Nest spawns there. The natural terrain surrounding the nest determines which enemy type spawns there, and this terrain system is identical to the same one that determines trapping locations.

    You can therefore use Scout animals to figure out which kind of enemy is going to spawn somewhere, provided you know the correct terrain patterns. This fits in quite well to the learning core mechanic, the terrain use mechanic, and also makes Scout animals more useful.

    Nest spawning is tied to the Tetrad you're currently on, so you can have a Nest spawn several kinds of enemies depending on which Tetrad you're actually on when the spawn event activates. To make this easier it'll probably make sense to change nest distribution based on the tetrad.

    There are a couple of random handcrafted things here that give enemies variations on their usual behavior:

  • Nests surrounded by 5 or more water tiles will get a water movement upgrade (hydrophobic --> paddling --> swimming --> aquatic).

  • Nests surrounded by 5 or more solid tiles will get a solid movement upgrade (grounded --> climbing --> flying --> soaring)

  • Nests fully surrounded by water tiles will increase water movement by 2, while nests fully surrounded by solid tiles will increase that title by 2.

  • Nests fully surrounded by floor tiles will downgrade water or solid movement capabilities.

    These upgrades alter the enemy's movements but also change its name (Ex -- Flying Shortpig) and thus will give different materials from its corpse.

  • 6 Months ago
    Sky's the limit

    Enemy movement changes

  • Enemy movement patterns should be largely handcrafted rather than random. I might randomize the handcrafting of it, but they're far far too random right now and not really that interesting because of it.

  • The v0 pathfinding system that's in use with NPCs will get ported over to enemies so they can find their way around.

    Enemies have water and solid movement classes that look like this:

  • Hydrophobic/Grounded -- Can't move on water or solid (those count as "barrier" tiles)
  • Paddling/Climbing -- Moves more slowly on water or solids
  • Swimming/Flying -- Moves at a normal speed over water or solids.
  • Aquatic/Soaring -- Moves twice as fast on water or solids. Moves slowly on floor tiles.

    Enemy naming changes

    The natural movement classes can determine the name-clade of the enemy that spawns there, to improve overall game feel:

  • Aquatic -- non-fish non-mammal aquatic creatures (starfish, eels, etc)
  • Swimming -- non-fish aquatic creatures (whales, beavers, etc)

  • Soaring -- Mythological flying creatures such as dragons or rocs
  • Flying -- non-mythological flying creatures (birds, bats, pterosaurs, etc).

    Paddling/Climbing/Hydrophobic/Grounded are a much wider variety of animal types, like lizards, pigs, etc.

  • 6 Months ago
    Sky's the limit

    Engagement Changes

    I've made some changes here to improve both the tactical systems and also to make enemies more interesting.

    There are three game states associated with enemies:

  • Out of Engagement. This means you're not currently fighting any enemies. Turns proceed as they currently do -- enemies can move at the start of your next turn (depending on their speed of course). So your movement and their movement essentially moves at the same time and you can be more tactical.

  • Offensive turn -- Time slows down and you can do various things (like move or attack) to fill up your "turn meter". Enemies won't move during this period of time, making it easier to do tactical stuff.

  • Defensive turn -- Time runs in real-time at a reasonable pace. You can still do things offensively or defensively, but it's harder since the enemies are moving in real-time.

    Getting into (and out of) engagements

  • Generally speaking, when you attack an enemy or they attack you, this starts an engagement. If you attack them, the engagement starts on your turn, whereas if they attack you, the engagement starts on their turn. Thus, both stealth and aggression are valuable strategies.

  • Enemies have an "Awareness" property that's basically a range, a type of cardinality, and some bonuses/detractments based on different types of terrain. If you hit them with something (such as a ranged or magic weapon) outside of their awareness, you can deal them damage without starting an engagement. They do still take a turn after you, but you can use this to avoid nasty defensive turn encounters with difficult enemies.

  • On your combat menu, there's a button that lets you attempt to flee from an engagement. If successful, this ends the engagement but doesn't despawn the enemies (that's dependent on another set of conditions). Fleeing only works if you're more than 4 tiles away from every single enemy.

  • Engagements stop when no enemies are on screen -- whether they've moved off it or you've killed them.

    Offensive turn details

  • You can attack. Weapons have been heavily simplified and are highly tactical. Attacking increases your turn meter by some amount as dictated by the weapon's properties.

  • You can use magical attacks. These increase your turn meter as dictated by the jewelry, and are generally pretty terrible without upgrades.

  • You can move. Movement increases your turn meter by a standardized amount, though there are improvements you can make here.

  • Moving past an enemy or into an enemy can count as using an Offhand attack, which consumes the turn meter accordingly.

  • You can use combos -- these are attacks which are unlocked by hand/offhand/movement combinations and are unique to the hand/offhands you have equipped. Combos don't increase your turn meter, and can in fact actually decrease it, do useful attacks, or have other effects.

  • You can equip new weapons. This takes a good bit of your turn meter to do.


    You have two slots for equipment. Weapon classes are either Hand or Offhand, which determine how you use them:

  • Your "Hand" slot is the weapon you use with your mouse. You'll see a kind of preview for these kinds of attacks like you do now. These tend to be more specialized attacks.

  • Your "Offhand" slot is the weapon you use while moving into enemies, away from enemies, or side-swiping enemies. These tend to be more basic attacks or defensive/movement attacks.

    Hand Weapons (mouse)

  • Sword -- These affect all enemies in an arc around you.

  • Spear -- These hit an enemy up to two spaces away from you and can also affect enemies on that line afterwards.

  • Clawarm -- These weapons are thrown into an enemy and then moves will either pull them towards you or you towards them, dealing them damage accordingly.

  • Flail -- These weapons are thrown into the ground, and then either pull them towards you or you towards them, damaging anything in the path of that.

    Offhand weapons (movement)

  • Dagger -- Probably the easiest to understand -- you just walk into an enemy to stab them. No knockback, so you can do it over and over.

  • Axe -- If you're on a diagonal from the enemy and you make it so you're horizontally or vertically adjacent to them, it'll deal them damage. This can be done with two enemies at once.

  • Shield -- Knocks an enemy backwards 1-2 tiles by walking into them. If there's a solid in their knockback range, it deals them a massive amount of damage.

  • Acrobat Gauntlet -- Allows you to jump over an enemy (or line of enemies potentially) by walking into them. This deals them damage accordingly.

  • Grapple Glove -- Touching an enemy will grab them and throw them onto the other side of you, possibly with some knockback in that direction. Deals damage as well.

  • 6 Months ago
    Sky's the limit

    Weapon Crafting

    Instead of crafting any particular weapon individually, you instead can craft a "Hand Weapon" or an "Offhand" weapon, with the materials you use determining which kind of weapon you get.

    Hand weapons are crafted from a Handle and a Blade. The Blade dictates the type of weapon and damage, while the Handle dictates its range (or equivalent).

    Offhand weapons are crafted from a Handle and an Aegis. The Aegis dictates the type of weapon and damage (if any), while the Handle dictates its range (or equivalent).

    Other properties of weapons (such as stun chance) are split fairly between the two ingredients.

  • Handles can be crafted from Fiber, Hide, Wool, or Bark.

  • Blades/Aegises can be crafted from Rocks, Bones, and Scales.


    Similar to the fishing rod, a Crossbow is a key item. Once crafted, it takes up no room and you can then use your Archery menu (which might be a submenu of a "Ranged" menu that includes magical attacks).

    Bows can be upgraded in a similar way to fishing rods -- allowing you to shoot multiple arrows at once or in multiple directions at once, upgrading base arrow properties, etc. Upgrade modules are probably items, which makes them viable loot.

    Bow attacks are based on the arrow. Unlike other weapons, you can select the arrow you want to use directly from the archery menu without first equipping it. This helps you see things more clearly, as arrow properties can be somewhat complex.

    Arrows are crafted from a Fletching and a Shaft. Fletchings can be crafted from Leaves or Feathers. Shafts can be crafted from Branches, Bones, or Metal.

    Arrows have a wide variety of properties.

  • Cardinality (O/D/B) -- arrows can be shot either orthogonally, diagonally, or both.

  • Range (3-10) -- a base range for floor and water tiles. Arrows will usually stop when they hit solid tiles.

  • Damage -- The amount of damage the arrow deals.

  • Height (0-5) -- arrows with a better height can be shot over solids, with the amount dictating the amount of solids they can pass through.

  • Secondary damage percent (20-80%) -- A percentage of the damage dealt by secondary effects. If there aren't any, this is ignored.

  • Secondary effect duration (1-4) -- The number of turns secondary effects take where possible. If there aren't any, this is ignored.

    Special Arrows

    Provided you've unlocked the Special Arrows module, you can create special arrows by combining them with potion ingredients.

    The way this works is you pick a potion ingredient, which will have one of the special effects attached to it. You then can turn 3 arrows of any type into 3 special arrows, which gives them a prefix and some special ability:

  • Flexible -- Flexible arrows can target individual enemies along a line rather than just shooting the first one within the range. Useful for more precise shots.

  • Knockback (1-3) -- Enemies hit by these arrows will get knocked back some amount of spaces. If moved into a solid they'll take secondary damage.

  • Pierce (1-3) -- Hitting an enemy will also hit this number of enemies directly behind it (if there is one) for the same amount of damage.

  • Miasma percentage (20-80%) -- Miasma arrows will affect all adjacent enemies the secondary damage percent amount.

  • Stun percentage (20-80%) -- A percent chance of the enemy being stunned. If stunned, they will be stunned for the secondary effect duration.

  • Poison percentage (10-50%) -- A percent chance of the enemy being poisoned. If poisoned, they take secondary damage for secondary effect duration turns.

    Arrows can only have one special qualifier at once.

    Fletcher fixture

    A Fletcher is a fixture found in Bases or Shops that improves your arrows. Using it, you can improve any property up to the hard maximum (so like, 100% miasma percentage) on an arrow stack of any size.

    You need at least 4 arrows in order to use a Fletcher. Every time you upgrade a property, the stack loses 2 arrows. While you can create some ridiculously powerful arrows like this, it takes a lot of materials and you end up with very few arrows by the end of it.

  • 6 Months ago
    Sky's the limit

    Enemy region differences

  • Enemies in caves are reptilian, rock-based, shadow-based or metallic.

  • Enemies in dungeons are metallic or elemental (based on the element of the dungeon). Those in melange dungeons can be any element.

  • Enemies don't spawn in the quantum or entropic planes. There's way too much going on in those already.

  • Enemies probably won't spawn in planes either. It depends on what the purposes of planes actually are. If they spawn in them, they'll be elemental and you'll potentially get damage boosts for having attacking-element weapons.

    Misc Combat stuff

  • You can attack Nests. If you kill them, enemies won't spawn anymore. However, attacking a nest makes all enemies very aggressive.

  • I'm going to rewrite my entity rendering code -- it's in a pretty bad state right now. There will be a general rendering function here that's called by map.render() but isn't a direct part of it so that enemies will be able to move around outside of a turn structure and the whole thing will be a lot faster.

  • I'd also like to add a rudimentary physics engine where knocking back an enemy would knock back adjacent enemies in a domino way. This would solve some issues and would also generally look/feel better.

  • 6 Months ago
    Sky's the limit

    Mass Simplification / Re-integration

  • Combat needs Magic Attacks reintegration, since those were removed -- weapon attacks need to potentially arc out to other enemies, etc.

  • Can probably drop armor completely. There's not a lot of point in it -- combat is about avoiding attacks, soaking up damage, or being really crafty with potions/magic. It would instead make sense to have some kind of "buildable hearts" that upgrades your health if you source the materials for it -- one recipe per dimension. Things like lava or void damage are better relegated to potions, and keeping you from having permanent upgrades means you'll use potions and magic systems more and focus on making better ones.

  • Combat is too complicated. Instead of having three states that are always available, it might make sense to have a "trance" ability that lets you do complicated tactical things. Certain events can also trigger enemy sentience (could maybe be dungeon-exclusive -- lore makes sense! Void is also a good location for this.), where they move in real time. I also need to integrate magic attacks back in, and maybe scrap the combo system so only attacks (and attack types) are important. It should maybe also be easier to equip different types of weapons.

  • 6 Months ago
    Sky's the limit

    Dungeon Combat

    To fit in with the new systems (and the lore!) better, combat in dungeons works a bit differently:

  • Enemies will come in from portals in the background (contrasted colors from it maybe). These don't despawn, can move in real-time and can absolutely swarm you if you don't deal with them. Their combat is probably a bit different too since they don't use the nests mechanic. What's interesting about their spawns though is that getting a full spawn is turn-based, but once you do they move in real-time. So you can still plan tactically.

  • Enemies are straight robots/automatons and can be extracted for metal or maybe some other special dungeon material.

    This one's definitely going to require the combat update.

    I've also given some thought to having bosses -- both Hadurah and Tangle in several capacities as you move through the story. These would be a blend between traditional combat and the real-time stuff. Nothing too terribly complicated to set up, but a neat addition to the story part of the game.

  • 6 Months ago
    Sky's the limit

    Terrain-dependent hand weapons

    Should make battles way more interesting:

  • hammers -- reverberate through solids up to its range.

  • trident -- if you hit a water tile, hits any enemy on a water tile within its range.

  • winch -- pull single solid tiles towards you, dealing damage.

  • spring shoes -- push off from a solid wall to deal damage to anything in range.

  • spike shoes (offhand) -- go from a solid tile to a floor tile with an enemy on it to deal it damage.

    Should be able to generalize anything here and in the combat post for more interesting possibilities.

    I know I need to reintegrate magic attacks (with "splashback") as well.

  • 6 Months ago
    Sky's the limit

    Reply to: P-IV. Combat Notes