Friday, October 31, 2014

HDR, Bloom and Gameplay Footage

We're now using high-dynamic-range lighting and I added a bloom effect*. We've also added scenery in order to make the light and shadow make more visual sense. And I made a video showing it off.

Disclaimers: work in progress, and a lot of what you'll see and hear is placeholder. Also this is my first video and I'm not very good at it yet haha.


I like the way the firelight flickers and the way the shadows animate. I feel like the visuals are at a point where I can leave them alone for a while and go back to making the game fun. I stuck a post-it to the wall over my monitor:



Right now the game has a bunch of systems, and some interesting ideas, but it's not very fun. Playing is a bit of a chore. And that's why it's even more important to play every day.

From my recent sessions, the highest priority is improving the AI. That will also mean defining more interesting monsters and scenarios. Lots to do!

I may also take a short break to make another baby app and move to Texas.

* Yes, it's been done to death. Sue me, I think it looks good.

Thursday, October 23, 2014

Shadows!

I've been working hard on the graphics infrastructure for Legacy*, and I finally have something to show for it! Check out the shadows at the bases of the figures below:


Because of the way I'm calculating light and faking shadows**, shadows are relatively cheap for me, so we can have a lot of them.


Aside from the cool shadows themselves, you'll notice that light is now blocked by walls (those pits you see will actually contain obstructions some day, which is why I have them blocking light.

So now that we know how much light is hitting each tile, we can potentially attach mechanisms to that. I would probably need to find a way to make different light levels more distinct.

So this is a good start but I'm not happy with it. The light tends to either blow out or be too dim, and it's tough to get it balanced, so I might take a look at some HDR techniques to see if I can get better results that way. In Legacy we want to be able to show a fairly broad range of environments, from outdoor daytime to dark dungeons, so I think the HDR sidequest is justified.


*I forked libgdx to fix some bugs and have been looking into OpenGL core profiles.. a real learning experience.
**Ask me about it if you want the details, but I might talk your ear off.

Sunday, October 12, 2014

Mechanisms: Line of Sight, Fog of War

Here are some simple ones. I'm testing out a line-of-sight driven visibility system. It's fairly standard, we do a center-to-center and corner-to-center test for each pair of tiles to determine visibility.* In addition, walls adjacent to visible floors are always revealed. When terrain or units are no-longer visible, they are grayed (for terrain) or removed from view in the case of mobile units.

I'm not sure if this picture is terribly clear but I suspect I'll be doing some more work on line of sight feedback before it goes live :-)


I also wanted to mention that this mechanism isn't inevitable or final, I think there are some viable alternatives to it. For example Descent uses doors to gate monster reveals, but never hides units or terrain once revealed. True, as a board game it's more constrained, and having secret monster locations would be a pretty big opportunity for the overlord to cheat.

The other open question is if/how much we want light level to affect visibility of terrain and units. Is a stealth mechanic just too annoying? Or is it awesome? Only one way to find out I guess. My instinct is that in order for it to be good, we need to give excellent feedback to the player about how the stealth rules work, ideally to the level that when they are hovering over a movement destination, they can see whether or not they will become visible to any of the monsters that the party is aware of.

Oh yeah oh yeah - new XCOM has these "on reveal" triggers, where when you see an enemy for the first time, they hiss at you and then immediately activate and seek cover. Old XCOM had a mechanic that when you reveal a foe in the middle of a move, your move is halted and you have a chance to reconsider. Both are interesting. The great thing about movement in XCOM is that it always feels risky. Every move you take you risk triggering an overwatch or revealing too many enemies, who will then swarm you.

We may need to have some kind of "activate on reveal" for monsters just to keep the ai turn reasonable. And in the case of playing against a human overlord (a scenario I just can't drop no matter how I try!) There would need to be a mechanism to prevent him/her from gathering all the units from across the map in order to overwhelm the heroes.

So, next I still have to integrate line of sight into combat and targeting, and I might attempt to put in some kind of "cover" test while I'm at it, which would affect ranged attacks. After that I might try to figure out how doors work. That seems important.


*Mostly.. I'm reusing Wu's line algorithm here, which is an excellent approximation, but is not actually as strict as a pure "intersection of line and rectangle" test. I'm ok with that because our obstacles are visually pulled back from the tile boundaries, so it should make intuitive visual sense what you can see and what you can't.

Wednesday, October 8, 2014

Mechanics: Fireball, Flame Strike, and Fire Lash

Coming in hot. So to speak. This time it's all about the Mystics, and how they shape fire to their will. Mystics have a Charge mechanic that acts as a currency for their more powerful spells. Right now they start with 1 Charge and consume Heroism to gain an additional Charge. For now Fireball is the only spell that consumes Charge, the others are free, but all magic actions take 65 time units (out of a budget of 100), so you can only cast one per turn.
So, a warrior, a hunter, and mystic walk into a bar full of boars. A boar bar, if you will. I don't really know how the joke goes, like maybe the warrior asks the bartender for some bacon and all the boars look up from their drink, and then the hunter's all trying to calm everything down but spills beer on the mystic and then something about a fireball? I don't know whatever. But it ends with bacon.
Ok so first up, Flame Arrow. You target a nearby source of fire, which you consume to grant your ally a free attack with a bonus. The attack also lights a fire at the target. This effectively moves fire around the map.


Next, Fireball. This is currently the only mechanism the heroes have for creating fire, and it consumes Charge. It's intended to be the big flashy spell.

What's the damn punchline?
Next, we have another situational spell. Fire Lash targets a source of fire and another tile, and spreads fire over every tile on the line, also burning any units in the path. This is another way that Mystics can change the map.


All together, Mystics now brutally outclass these Boars. I might need to pull out some tougher enemies. But also this is all subject to balance, and in the game itself we might roll out these abilities one at a time over the course of the game.

Flame Arrow - active - target the closest source of fire and a ranged hero other than yourself. The hero makes a free ranged attack and also lights a fire at the target. The source fire is consumed.

Flame Weapon - active - target the closest source of fire and a melee hero other than yourself. The hero makes a free melee attack and also lights a fire at the target. The source fire is consumed.

Fire Lash - active - target a source of fire and another tile within close range of the source. Hit everything in a line with a magic attack and light the tiles on fire.

Fireball - active - consume one charge a 3x3 blast area within range. Hit every unit in the area with a fire attack, and light all the tiles on fire.

Charge - consumable - Mystics start with one Charge and can consume heroism to gain additional charge. Charge powers certain spells.

We're definitely making progress in terms of making terrain matter. I think the next big category of mechanics will have to be around sight. Line of sight, cover, light, and stealth. And for that all to make sense I'll likely have to do some work on mission visuals as well. For example, all these fires, they really should be light sources, and they really should cast shadows that dance across the floors. It's hard for me to express how much I'm looking forward to that work :-)

Tuesday, October 7, 2014

Mechanics: Heroic Death, Guard, Injury

Here's some more mechanics!

This crop is all about filling out the heroes' options and incentives. Injury is a form positive feedback that makes getting hurt extra bad. Heroic Death is a form of negative feedback that makes dying less bad. And guard allows you to take conditional actions on the enemy turn and mitigates the "bumpiness" of turn-based combat. So take Gawdion here. He's in a pretty bad spot, in between the boar and the fire. He's injured too, which means his attacks deal less damage. That might not even be relevant for much longer..


Yikes. But when he dies, the other two get +1 Heroism. (Heroism is explained here) So with that they are in a pretty good position, despite the loss of their brave comrade.


When one of your heroes dies, it is sad. But, a death also galvanizes the remaining heroes and gives them a better chance to finish the mission. Next, Ollile demonstrates Guard. If the boar comes within range, Ollile gets a free attack on it.


Now, as a farmer, Ollile's attack is not that great, and he relies on surround to bring down large foes. But Guard can be pretty powerful in the hands of a trained warrior.

Heroic Death - passive - when a hero dies, remaining heroes get +1 heroism.

Guard - active - heroes with a melee weapon can create a guard region around them. When an enemy enters that region, the hero gets to attack it. The guard goes away when used or at the start of your next turn.

Recently Injured - debuff - (Note that your health bar is divided into two segments, damage first counts against Stress, and once you're out of Stress, starts to count against Injury. Ordinary monsters don't have Stress, so they go straight to Injury. I need to make this distinction more clear in the UI.) Recent Injury negatively affects your attack rolls until it wears off. Recently Injured lasts for two of your turns, and stacks. If you take two attacks that injure you, its value will be two, and each time it is refreshed, the cooldown is reset to two turns. This stack and decay mechanic was pretty easy to implement with my new template aspects and effects.

Enraged - buff/debuff - some monsters have a variant on the Injury mechanic that strengthens their attack but weakens their defense when they are injured. So it makes them easier to finish off, but more dangerous. I basically got this for free when I implemented Recently Injured so there you go.

Mechanics are coming in hot and fast right now, I suddenly feel very productive. Funny how two weeks ago when I was tearing apart the ability system, I felt so down. That work is now paying dividends.

Friday, October 3, 2014

Mechanics: Debris and Fire

I've implemented debris and fire in order to make terrain more important. The map below spawns in with some fire. That's just for debug purposes but it gets the point across.


 When you're standing on debris, you can pick some up and throw it at an enemy in order to daze them.


Dazing takes away 25% of their time on their next turn, and can stack. In this way you can really reduce the enemy's effectiveness, but at the cost of your own actions.

Fire is more complicated. It deals damage when you enter it, and every turn you end in it (including enemy turns.) It decays after 2 turns unless it is on a Debris tile, in which case it sticks around indefinitely. Fire also counts towards surround, so backing your enemy against the fire is a great idea.

Along the way I made another round of improvements to the Effect-Action system. Fire uses the Attack/Defense mechanics to deal damage, which means that creatures could easily have resistance to fire. And since I can now trigger attacks when units move, I've done most of the work for an "Ambush" (see: Overwatch, Guard) mechanic as well.

Actions now resolve on a FIFO stack, which makes it easier to chain and combine them meaningfully. And each new trigger I add is easier and simpler, so I feel like I'm going in the right direction. Everything is feeling more flexible and uniform, and I'm able to keep all the mechanics in the data, not the code.

Next, I want to implement some abilities for the Mystic. This means AoE attacks (Fireball!), maybe a "Flame Weapon" ability which allows the mystic's ally to make a free (the mystic pays for it) attack with a flaming weapon, and a "Fire Lash" ability that allows the mystic to utilize existing Fire on the map. You may be detecting a theme.

Then.. Line of sight? Ambush? Stealth? Re-equipping? Doors? Light sources? Furniture?