Category Archives: Game Development

Auto Fire v0.5.12: The Spruceining(tm)

I’ve been laying the foundation for a trailer over the last couple weeks, so most of my progress in Auto Fire has come in the form of cleanup, although there are a few gameplay tweaks, mainly to make that early experience a bit better. On the upside, there are less-soldier-y gang members, a cleaned up HUD, some new lighting and vehicle trails, check it out.

AutoFire

Starting next week, I’ll be able to work on Auto Fire full-time for a while, so prepare for some meaty updates.  The goals are to significantly improve the player movement, reveal more options when driving, and fleshing out systems that have only been teased, like a more alive overworld.

See you on the road!

Changes

  • General
    • Upgraded to Unity 2019.1, which seems to have gained a little performance.
  • UI
    • Cleaned up UI
    • The equipment quotes in the info popup are now aligned correctly
    • Revised weapon icons
    • Revised window frames, etc.
    • Removed the skid meter behind the car, since it didn’t look great.
    • The player can turn the skid meter on or off in the options screen
    • Remove random encounter dialogues until they are ready.
  • Visuals
    • Revised the road decals to make for softer edges
    • “Soldiers” are now desert warriors
    • Foot gangers now use the proper pose to match the weapon they are wielding.
    • Added headlights to the player car when in a ruined city
    • Lowered overall brightness of the city map, so that the light sources could stand out.
    • Increased the light brightness for streetlights and barrels and fire.
    • Revised the trails from the taillights of vehicles entirely.  They use a new system that makes them very smooth.
    • Improved the detection of offroad when a vehicle is driving, for visuals and gameplay ramifications
  • Audio
    • Gangers now use battle cries rather than military radio transmissions when they spot the player
    • Vehicles now rev their engine instead of honk when the spot the player
  • Balance
    • Improved the visibility of enemy cars (they were very short)
    • Increased the range of junkthrowers since they were still kind of frustrating to use.
    • Adjusted population cap to accommodate new fuel dumps and watchtowers.
    • Fuel dumps are now guarded by flamer gangers

Way too many changes at once

Oh man oh man it’s been far too long since I’ve published an update to Auto Fire. That’s a terrible thing I don’t want to happen very often, but I started to put in the quest updates and it made sense to get a number of additional features up to snuff in support of it.  

Worse yet, I sat on a hojillion changes in my source control before I checked everything in. I think it was like a month. Work was making me a little crazy, but that’s ridiculously bad form. On the upside, this update brings about a bunch of changes in a big sweep. 

My primary goal for this update was to add more exploration and stages to the boss fights and quests. For this I needed to support better quest state reporting, and make new emplacements to fight against to draw the boss out. Then I realized that the whole system fell apart when you left the area, so I had to improve how quests were maintained when you leave an area. Then I realized I wasn’t really saving data the way I should and basically had to improve the saves to be near-ready for cross-session saves (hopefully soon). Then I realized that spawning emplacements in random locations was really ugly and made them hard to find, so I added a content socketing system for bosses, emplacements, loot and hazards so that their placement could be more deliberate and hand-crafted.

Along the way I cleaned up the UI, added dynamic music, fixed some lingering physics problems (which caused invisible soldiers when the ragdolled out of the world, as well as making some tiles near rotated large objects to be un-enterable. I even stripped out some of the anti-aliasing that was making the game look muddy.

Quests

  • Entering a map occupied by a boss now requires the player to progress through the map and take out a number of strategic structures in order to coax the boss to face you.
    • Outpost maps are defended by armored watchtowers.
    • Ruined cities require you to take out fuel dumps.
  • The quest title is shown when entering and area, and updates are shown as the player achieves objectives.
  • The mini quest display is cleaned up and should update properly.
  • Quests are properly resumed when the player returns to a location.
  • Reviewing your quests that are in maps other than the current one is handled better.

Music

  • Added some post-apocalyptic music and a couple stingers.  Adjusted existing stingers.
  • Added dynamic music tracks for city and outpost tactical maps.
  • Dynamic music now escalates as the player takes out more emplacements and the enemy spawns get more intense, up until the boss is unleashed and the boss music is played.
  • Added boss-specific music, and adjust the intensity based on how close the boss is.

Visuals

  • Adjusted the anti-aliasing so the game isn’t blurry.  Temporal anti-aliasing can cause a smearing effect might work for realistic titles but ain’t great for games with precise information to dole out.

Combat/Systems

  • Added sustained fire bonuses that improve player accuracy after multiple attacks.
  • Painting an enemy with the radar will improve player accuracy against them.
  • Improved some targeting response elements by indicating which entities are people, cars, emplacements, etc.
  • Emplacements such as watchtowers have new aggro and play distinct spotted sounds.
  • Extended the aggro duration of enemies and made sure they don’t lose interest in the player while still in sight.

 Balance

  • Junkthrowers do 50% more damage. They were supposed to be scrub-tier weapons but they were just sooooo bad.
  • The Stallion now has a bolt rifle mounted front and two junkthrowers (one per side).  Its combat capability was depressingly terrible.
  • Mines have a lower cooldown again.
  • Significantly more cash is dropped from loot crates and enemies.  Killing a boss and getting $4 was definitely sub-awesome.
  • Zones have fewer garages.

Map Generation

  • Quest emplacements like watchtowers and fuel dumps are placed in sockets that are part of map generation.  Thus their placement is more crafted.
  • Loot crates and barrels also have specific hand-crafted sockets for various map generation tiles, for a less haphazard placement.  
    • Crates are off the beaten path, sometimes in nooks or dead-ends, but generally in a place somewhat thought out.
    • Barrels are placed in clusters around road hazards, fuel stations and large wrecks.
  • Loot and barrels now have a tunable target number placed per map.  Before it was a much wilder range of possibilities.

Progression

  • Population, quest progression and entity placement is now saved when exiting and returning to a map.
  • Entities, enemies, sites and pickups now save their state (when marked to do so) when leaving and returning.
    • This is not quite all the way to full savegames, but we’re very close.

UI

  • Improved the display of enemy misses somewhat.  Shots go wide and misses are pretty clear.
  • Cleaned up the “chrome” UI window borders.  They were originally photoshopped from actual chrome dashboards but that didn’t scale as well as I’d like.  Buttons have their own appearance now.
  • Improved some bugs with weapon targeting and the widgets over target vehicles.
  • Can now display entities as singular or plural for quest readouts.
  • Boss and targeting popup displays are now cleaner and, well, less terrible.

Bugs

  • Fixed the handling of rotating large objects… This means that there should no longer be any invisible barriers.
  • Improved some poorly-handled persistent effects such as oil jets and skids…  These are now handled with greater safety and more robustness.
  • Enemies no longer can get in a state of attacking inanimate objects or themselves.

Auto Fire v0.5.10: Quality of Life

Welp… another week, another build update.  I’m sure I’m a bit too excited about having a real honest-to-god key configuration screen, but I’ll take the little victories. Hooray for Rewired!

Some bug fixes in UI are coming in also, but more important is the fact that options screens hold settings that persist across sessions.  Yay quality of life!

Finally, the vehicle selection popup at the start gives you more information so you can pick a car that matches your playstyle.

Don’t worry, I’ll be back to the shooty-shooty kind of update next time. In the meantime you can go get v0.5.10 on Itch right here.

Progress both Practical and Pretty

There has been a solid amount of progress on Auto Fire in the last month, though not everything has been visible.

Conditions

There’s a condition system now, where entities can be stunned, set on fire, made to skid, be blind, etc, and that will last a fixed number of turns before automatically removing themselves. Nothing super fancy, but it allowed me to do stuff like cause a vehicle to spin out when it hits an oil slick.

It also allowed me to give the player’s radar more functionality, because it now “paints” targets within a specific radius for a set amount of time. Ideally the player should be able to build up sustained fire on a single opponent, or race through a group (at high speed to avoid being shot) and hit everyone with a radar ping before swinging around and taking advantage of the higher hit rate (and eventually critical hits spurred by this).

There is a new icon system above vehicles to show their current conditions, which hopefully will teach players more about the advantages of speed and choosing targets.

Weapons!

I did a bit of work on weapon resolution to clean up some weirdness, as well as allow for effective area effects over various volumes. I can have weapons with blast radius at impact, cone effects, lines, and more. This gave me some vastly improved versions of scatterguns, flamers, and so on.

Scattergun

I also switched over my missiles to LeanTween (a great Unity package that’s freeeee, although the Editor that goes with is worth throwing a few bucks at) so that I could use more sophisticated arcs (splines, eases, etc) for the projectile travel. This gave me some great drunk missiles and so on.

A heavy rocket, follwed by a mini-missile salvo.

City Flow

A somewhat smaller bit of work but vastly important was looking into problems I was starting to see in my city layout.

A couple of years ago I put multiple months into a city generation method that took pre-crafted blocks and spliced them together, street-to-street, with props and so on. It worked pretty well… However, lately the cities seemed to have wayyyy too many skinny alleyways and dead-ends, even though I remember putting a fair amount of effort into reducing these.

Worse yet, I’d started to see some passability issues and unplayable maps, which I know I did checks for. Ugh. I love dusty Mad Max wastes, but the cities are just as important a part of the game and they weren’t fun.

I spent some time trying to re-learn what the hell the 2016 version of me had made. For a little bit I thought 2016 me was a bit of an idiot… but it turns out he was somewhat clever. It was 2018 me who introduced a number of bugs that caused loops to no longer form… that guy was a jerk. Specifically I had some code that overlaid roads over previously populated obstructions to create extra loops, and those no longer overlaid properly. In addition, my passability checks were not properly busting holes through the buildings and obstructions when needed.

I added a bit more two-lane roads and discouraged alleys from forming very often. In addition, I added some new block types to my definition that had fewer buildings, so some extra open spaces could be formed. I can pretty much make an infinite number of city block components, so I’ll keep adding ones that give some more driving freedom.

Battling some Ace Panthers in Old Custerton.

Onward

Anyway, I hope to have a new version out this weekend, it’s been too long. Wish me luck!

Noodling the Numbers

Been working on creating some better combat mechanics and options for Auto Fire lately. One of the factors I was working on was tangibly having hit chance be affected by tactical choices such as “painting” a target with radar for more accuracy, or on the other side moving faster to avoid getting hit. I got those systems in but it didn’t really seem to matter.

I had to seriously think of how I’m dealing with accuracy, range and speed. My initial version of the combat system in Auto Fire was inspired by the system in Diablo II. It used this sort of calculation:

Chance =200% * AttackRating /

(AttackRating + DefenseRating)

Consider AttackRating to include things like gunnery skill, weapon accuracy, and other targeting bonuses. DefenseRating in contrast is stuff like range, target speed, and target size.

Multiplying the value by 200% gives the player 100% hit chance whenever the Attack Rating is more than 50% the Defense Rating… So in the average case the player is guaranteed a hit. This was the system I used in X-Men Legends, and it feels pretty good in an action game where you are directly controlling your character and only want to have misses when your opponent clearly outclasses you.

The problem with this method is that the chance to hit tapers off because it never reaches zero… Thus, I was finding that there’s only a small sweet spot where hit bonuses mattered between 100% chance and maybe 60% chance.

If you like numbers, here are the results of that sort of calculation.

I made some changes and pushed the system more towards a classic “opposed totals” method more akin to D&D or most pen and paper games.

Chance = (base + AttackRating – DefenseRating) * 10%

It’s not original, but what it did was make each bonus you earn through improved targeting, or sustained fire (or penalty from moving fast) has a pretty chunky impact on the hit result.

Here’s that table if you’re feeling nerdy.

I do put a minimum hit chance of 10% just so it’s not worthless to attack, and I’m not sure what increasing the miss chance is going to do to the feel of the game.

I have a mechanic where excess above 100% is used as a critical chance (That is, 130% chance is an automatic hit with a 30% crit chance). I might consider doing the same on the bttom so a “miss” is a glancing blow that still does a little damage, progressing to a real miss based on the percentage. (For example, -30% is a 30% chance of a real miss and a 70% chance of a glancing blow).

I’m wrapping that back into weaponry definitions and looping back around to where I can try the new system in the wild. From there we’ll see what happens.

Auto Fire v0.5.08 – Controls! Citadels! Courier Missions!

I’ve had a pretty busy last month (and some weather drama), but luckily I did get some meaty things done on Auto Fire.

Controls

Many people have lamented that it is difficult to control Auto Fire because the “forward” key also accelerates. Responding to feedback, the new controls are thus: If you press forward, your speed is capped at 40 MPH (that is, 2 actions per second). This way you can manage most maneuvers without crashing into everything around you (previously a popular activity in urban areas).

Speed is still king however, especially out in the badlands! A separate Boost key is used to accelerate beyond 40, up to your vehicle maximum.

Citadels

A citadel is a civilized city where you can take a break, get repairs, and buy/sell items. Eventually different citadels will have their own specific functions, depending on which corporation owns it.

The cool thing is that you can now load up courier missions at a loading dock, giving you a non-combat way to earn more cash.

Cool Stuff

Gaw’bless Unity. It took like a half hour to put ragdolls on the soldiers.

I’ve also got some transition improvements, added new features in the overworld and improved the entrance/exit of areas.

We now save out fog of war between maps. (Whew that was annoying).

Quests work better! They’re improving all the time… but in this case I needed to create a quest on the fly when the player had to deliver cargo. This way I can use all the quest features like lists of rewards, player tracking, unique generated descriptions, and hooking into triggers such as arriving at a destination and showing quest markers.

Lame Stuff

Some significant bugs were also dealt with… I had previously been very diligent about properly and safely deleting entities, so that I wasn’t deleting them from a list I was parsing through. Unfortunately I wasn’t doing so when adding entities to the list. Thus C# was complaining at me nonstop, and it was nice to deal with that.

I also had a few remaining Entity pointers that I was saving across frames, which was not safe. I had changed everything over to a unique token method of tracking entities, but I had missed a few things previously. Again, good to get that out of the way and run some stress tests!

Snowmageddon and ‘splosions

Seattle was pretty well snowed in for the last 4-ish days, so I was hoping for a long weekend to work on the game (between back-breaking bouts of shoveling). Welp. I got it, but did I end up with a ton of progress? Well, I got some new points of interest in on the maps, improved the roads, threw exploding cars based on attack angle and its velocity and some other fun things…

Unfortunately, I ended up battling stale pointers and strange issues for most of the time. Ugh. A more robust system that doesn’t poop out exceptions every blue moon is good, but I am sooooooo ready to get back to the fun stuff.

But on the upside, I was able to cap off the weekend fixes with a stress test… 🙂

Tiles, tiles and Tools

I was just thinking about the challenges of generating a city map for Auto Fire and realized that I’ve accomplished a whole lot and haven’t really discussed it in a long while.

City layout workspace

Really early on in development I created some tools to generate block templates that get placed during map generation. This allows me to work with actual crafted sections of map (with variant buildings and other things that can be adjusted after the template is laid down). It’s more or less a requirement for cities since the classic “cave-style” procgen or even dungeon layout techniques don’t work as well as I’d like.

I create template patch objects that have a bunch of data attached to them such as exit points (for cities) as well as a variety of variable bits like spots for random decor and building styles (depending on the generation profile I’m using).

The block data that I save out actually even supports 9-slice scaling, so I can declare borders to be of a fixed size, but the center to be a repeating tile section that can be any size. It’s really useful in some situations like when I want a long crafted section of wall, or a large 4-lane boulevard on a city map.

For cities, however, I actually work mostly in blocks that are 4×4 in size, with street connectors that are 1, 2 or 4-lanes in size. If I want to make a larger block such as 4×8 or 12×16 I can do that as well. Getting the whole system to rotate blocks properly was probably the hardest part (you can see in the build right now that I have a few multi-tile objects that don’t yet collide properly… my work is never done).

I’ve got several workspace maps that I use to create these blocks of content (desert outpost, city, overworld, etc), and it’s a scalable system that could support a whole ton of layouts. When I say “damn I gotta work on content”, making 10x the tile variations and cities with specific flavors are ways that I could take advantage of the systems I’ve created.

Anyway, this approach isn’t particularly new but it works great for my needs… It deserves a more crunchy article dedicated to it, but it’ll have to go on the to-do list for sometime in the future. For now, hope the peek at the approach was a little interesting.