Category Archives: Unity

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.

New Auto Fire Update – version 0.5.5!

Another update to Auto Fire has come down the pike! A lot has happened in the last couple of months, so it’s great to get a build out…  

Thanks to Itch.io for providing the app and the Butler tool so I can more easily post patches in the future.  It’s like Steam for the rest of us. ūüôā Checking out Perforce and my Trello, here are some things that went down:

  • Added an automap so you can see where the hell you’re going.  You can bring it up with the [Q] key.
  • Added a faction system.  Each sector has a generated gang that rules it, and a boss that controls each combat zone.  Defeating the boss clears the zone.
  • Boss arc now includes escalations that spur the bosses to taunt their forces and you with procedurally-generated shouts.
  • The quest system had some work done on it.  Now the player is automatically assigned a quest to take out bosses of places they conquer.
  • You can check out the current quests in the Character menu, by pressing [Tab]
  • Quest completion now has a dialog box and some information on the results.
  • The encounter dialog has a new layout, and it shouldn’t justify its text strangely anymore.
  • The Shotgun soldiers are much less deadly than they were.
  • Unity 2018.3 update, which should improve terrain performance a bit.
  • Some of the road decals had dreadful performance, so exterior spaces run a bit better now as a result.
  • Toying around with a little bit more of an intro on the title screen. 

Visuals:

  • I’m trying an outline shader on all gameplay objects to help them pop from the background.
  • Pulled up and adjusted the lighting to mellow some of the hard shadows that was creating visual noise.  Terrain  is a fair amount brighter now.
  • The garage looks a bit less out of place now.  Still work to consolidate the colors.
  • Difficulty now represented with bullets.
  • Time slows when you die.

Bugs fixed:

  • Armor sides weren’t appearing on the vehicle with the proper direction.
  • Multiple Line of Sight fixes.  You should not be able to be hit through obstructions now.  Fog uncovering on the map, the fire arc grid, and actual combat should all reliable return the same LOS results.
  • The player was able to exploit a bug that allowed them to use any side weapon against enemies in any direction.  Fixed.
  • Removed some visual stray VFX sprites on the scouts.
  • The (correct) car model appears again on the inventory and garage menus.
  • Exploding barrels had stopped harming things.  Fixed now.
  • Vehicle models now have manufacturer logo in info.

Check out version 0.5.5 here:

Download it from Itch.io!

Auto Fire Status Update – Oct 2018

Over the past several months I’ve been working through some significant issues to get Auto Fire up to snuff…¬† Good ol’ Jim¬†talked me into going to the Roguelike Celebration 2018 in San Francisco this weekend so I could start showing my game to people more widely.¬† Pretty exciting!¬† Also pretty nerve-wracking given all the other stuff going on this summer.

Unfortunately there were a ton of things about my game that still drove me crazy…¬† For example¬†I wasn’t able to save the state of maps between visits… which meant that the overworld in particular would regenerate every time you left a location.¬† I had to finally take the plunge and deal with that particular issue.

Man I hate two-years-ago me.¬† I did some real hack jobs to get that 7DRL challenge done, and I guess I wasn’t done paying off that technical debt. ūüėõ

Luckily I got all the proper stuff to function, save off map states and basically am ready for honest-to-god savegames (although I don’t do save/load just yet.)¬† I’ve also made a whole bunch of quality-of-life improvements based on early player feedback:

This slideshow requires JavaScript.

  • The camera is now behind the vehicle at all times.¬† This way the WASD weapon keys are always consistent and understandable, and you don’t have to envision tank controls.¬† I had always suspected this would be a problem, but I think I was so used to camera-always-north that I didn’t have any trouble playing.¬† The added benefit is that the game has a fairly unique look as compared to other Roguelikes now.
  • Improved feedback for speed.¬† This is always a work in progress.¬† The player needs to know when they are speeding or skidding.¬† Putting the camera at a shallow angle and adding speed lines is my current strategy.¬† I also shake the camera a bit, but that may just be too much.¬† We will see where things go as feedback comes in.
  • Recolored environment.¬† A good friend did a paintover of a screenshot of my city environment a while back and it helped me gravitate towards dark ground surfaces, light obstructions, and bright colored gameplay elements.¬† This wasn’t the case with deserts (because, y’know, desert), but I’ve been darkening things quite a bit and trying to get the colors to pop.¬† Still a work in progress.
  • Revised balance and loot drops.¬† This isn’t really finely balanced, but I did make the early-play experience quite a bit easier so that people that wanted to try out the build could get a good idea of what the game was about quickly.¬† I also brought down the size of the average “loot pinata” that existed when I was testing loot out.¬† I really still need to do a huge push towards making content, maybe after the RogueCel.
  • Revised location names.¬†¬†More on that next article!
  • New garages in the overworld and desert outposts.¬† I’m trying to make sure that the player has plenty of places to equip all the weapons and vehicle components I’m dropping.¬† That includes in hostile areas.¬† That will be a balancing act in the future.
  • UI improvements.¬† Again from feedback, I flash the weapon when you try to use it but can’t, and flash the grip meter if you are skidding and try to accelerate.
  • Music and sound improvements.¬†¬†I got some new weapon sounds and hooked them up.¬† The quality is steadily improving there.¬† On the music front, I went back to¬†Michael La Manna‘s excellent western apocalypse music… The quality is really high and fits the feel of the game really well.

My next step is to get the game out onto itch.io so that more people can play.  That will be sooner than you think!

Filling in the Desert

It’s funny how I spent all this time to create a prop distribution system, created tiles and various features to randomize and space out various tiles but never have the time to really find good models to populate the map with… ¬† so sometimes I play on a fairly empty map.

I spent the morning digging up some reasonably non-terrible assets to build tiles out of, and the results are luckily pretty good:

The problem is that whenever I’m doing visual stuff I’m both happy because things look better, but I feel guilty that I’m not working on function… ¬†Back to work!

Fog of Overworld

Auto Fire is continuing to look better these days. ¬† I got rid of the object-based fogging and returned to the old-school concept of putting a 2D plane between the camera and the world. ¬†You’d think it would look obvious but with a little fancy math I can scale and position the plane so that users are (more or less) none the wiser. ¬†I was able to add some perlin noise and give the fog two colors (defined per map) that makes everything smoother and more pro.

I put more effort into the overworld as you can see above.  Those roads are generated now, as well, followed by a smoothing step that places the correct road tiles in the correct locations. There are still a few specific intersections that I neglected to create tiles for (mostly diagonals to other diagonals) but the overworld is now guaranteed passable and locations have roads between them.   The roads make the overworld far more simple to navigate and find out-of-the-way locations.

I still have to finish off some of the world connections and then optimize the hell out of the world generation (currently coming in at 15 seconds) but it should be pretty quick and easy to trim all the low-hanging fruit (I don’t cache the passibility of each tile yet when calculating paths for example). ¬†Always more to do…

 

 

 

Garages and Fog Nerdery

Dang, I guess it’s been a few weeks and mostly I’ve been working on more of the inventory system. ¬†I managed to get the Garage working fully and now they appear on the map as places you can load out your gear, repair and refuel. ¬†

Working on infrastructure for this long gets a bit taxing, so I wanted to switch over to something more visual for a palette cleanser… ¬†so I chose to noodle around with Fog of War (not the most fun thing, but better than weeks of UI noodling).

Nerd Alert inbound!

Image result for hazard tape

My Fog of War (that is, how I represent areas of the map you haven’t explored and/or can’t see) is currently implemented tile-by-tile. ¬†I implemented it by creating a custom shader that fades out the individual tile models based on a fade value I feed each one. ¬†This has a few drawbacks:

  • The edges are hard and look a bit amateur as a result.
  • The fade currently goes to black, which is fine for dungeons but not appropriate for all my above-ground venues.
    • (Large areas of black also look a bit “cheap” on 3D games, although that’s my own personal bias. ¬†2D Roguelikes somehow look just fine with the very same thing, however!)
  • I can only fade per-mesh, so in order to support height-mapped terrain meshes, I’d have to write some wacky shader to handle it.
  • I have to put a custom material on every model, and write a shader for any weirdo material tricks that a specific mesh wants to use.

I did some experiments with non-black fade colors, which didn’t add a ton of complexity to the shader but still emphasized hard edges. ¬†Also, I had to turn off screen space ambient occlusion (SSAO) to make it fade to the pure color, which is something I use for my terrain features to “pop” a bit more. ¬†Not a huge loss, but it only reminds me about how my technique is impacting my rendering and asset management.

In the end, I’d like a fairly “soft” (and in my opinion, more pro-tier) representation of Fog of War. ¬†For most 2D Roguelikes, the common technique is to place a huge planar texture between the camera and the world and draw areas of black and transparency over it to obscure undiscovered areas. ¬†I had steered clear of this technique because my terrain is 3D and my camera is a perspective projection with a viewing angle of about 35 degrees… ¬†this causes the Fog plane to parallax (obscure different areas based on the viewing angle)…

However, this can¬†be solved with math… ¬†I can scale and offset the fog of war plane to match a fairly flat map, so I’m going to try it out. Granted, using a plane will fail if¬†the player ever drives up a hill (which is something I support, but only use in a few locations), but I think this technique should do well for all my current combat areas (not the adventure ones) for the short term. ¬†Will see if I can get it rigged up tomorrow morning before work. Wish me luck!

 

Auto Fire Status Update – May 2017

In case you’re new to Auto Fire, here’s an overview. ¬†If you are familiar with it, here’s a hint of what’s been happening over the past few months…

Overview

Auto Fire is a turn-based roguelike auto combat RPG set in the roads and cities of the shattered American west.  Enhance your vehicle, take on missions and build your name in a world where the only way to thrive is to drive.

Auto Fire is a deep, randomly-generated experience that combines the free-roaming adventure of games like Autoduel and FTL with the turn-based precision driving of games like Roadwar 2000 and the original Car Wars tabletop game.

An important part of the game is the player’s relationship with his or her car, and the ability to mount bigger and better weapons and equipment.

My Background

I’ve been a game developer for 24 years,¬†both as a programmer and a designer. ¬†In my past I have worked on titles like Heretic II, Jedi Outcast, X-Men Legends, and Dead Space 2 and 3. ¬†These days I do design exclusively for my day job, and I miss programming. ¬†I was also a big fan of the tabletop vehicle combat games of the 1980’s and want to create something worthy of that world.

Tools

I use Unity 5.6, Visual Studio, Adobe Photoshop.  Blender and Perforce when I get desperate.

Update

Over the past couple of months I’ve been reworking the weapons systems to allow for special attacks over time such as machinegun bursts¬†and oil slicks. ¬†An equipment system is in place that allows for secondary abilities to be mounted on the car such as radar sweeps and targeting computers. ¬†These systems are coming on line as well as a new inventory system.

A city map can now generate complex environments with special boss arenas and repair stations.  The starting enclave has now been enhanced with new assets.  New music, vehicles and effects have worked their way into the build as well.

Here’s an update of what it looks like.

7DRL 2017: Day 1

7DRL Challenge Day 1: Unfortunately GDC lay me flat on my back for five days straight through the weekend, so I’m getting a really late start on my challenge. I guess I’m be aiming for submission late Sunday to get as many hours logged as possible.

Today I was able to re-acquaint myself with the ugly-ass 7DRL 2016 codebase and temp sprites. <Shudder> All I had time for was to start working on road generation and take a step in the direction of transforming my combat movement into strafes, accelerations and so on. Still got lots of work to do. Still, fun to see things moving forward.