CULTIC Dev Log - Automap and More!
[p]Hello everyone![/p][p][/p][p]Since we're about two weeks post-launch, I wanted to get another dev log out and catch everyone up on where I'm at with everything CULTIC![/p][p]Overall, launch has still been going well, and I want to give a big thanks to everyone who has been posting valuable feedback and helping with troubleshooting tricky bugs! [/p][p]The next update is going to be an actual full patch, bringing CULTIC up to version 2.01. With this version, I'm going to be trying to tackle all of the current bugs that I can replicate, as well as tackle one of the two most commonly reported issues - navigation in Chapter Two's larger maps.[/p][p]You can read on below for more details on all of this, but the Automap is mostly finished already, with all maps for all levels complete, all objective markers that I wanted to add are completed, and things seem to be working! I need to make some readability adjustments to the map shader and do some testing, but I'm hoping this will be ready for the beta branch within the next week![/p][p][/p][h3]Automap[/h3][p]
[/p][p]Navigation has by far been the most common issue players have run into besides ammo/resources (which is trickier to tackle, I'll cover that further below), and unlike resource usage, navigation is not really meant to be part of the difficulty. I really didn't receive many issues from QA from navigation throughout playtesting, but that's the trouble with a small sample size! [/p][p]I burned some serious midnight oil over the last week and got a fully functioning Automap put together! With this map system, the map starts out hidden, with a somewhat large radius marked as "discovered" as you walk around, getting painted in a dark color, and then a smaller radius is marked as "explored" getting painted a lighter color, so players should more easily be able to track where they've been and what they can still go explore. [/p][p]Any locked doors you try to open will also be marked on your map, allowing for much easier recall of where you can return to to try out new keys you've acquired.[/p][p]The map can be freely tumbled/panned, and I've also got a separate mode where you can view the map from your current first-person perspective, making orientation a snap in more complex/vertically stacked areas.[/p][p][/p][h3]Key Features[/h3]
[/p][p]Well shoot, that's a ton of vertices. This is Fairgrounds, by the way. So while this was still a huge timesaver, it was clear that a lot of manual cleanup would be needed. Luckily, using a shortcut in Blender that lets you select all linked vertices meant that I could basically just select vertices that are on a known walkable area of the map, and then select everything that's connected to it, which wound up being another lifesaver! This made it really easy to quickly bulk-select big chunks of the walkable map while ignoring things like the tops of crates, rooftops, inaccessible terrain, etc. that are all technically walkable but still not areas that I want shown on the map.[/p][p][/p][p]
[/p][p]From there, it was just a lot of manual cleanup and reducing vertex counts by using degenerative dissolves to merge similar/clustered vertices, and then getting rid of loose vertices and islands. Lots and lots of manual cleanup, but I got it down to where most of these maps were only taking 30 minutes to an hour to finish, which isn't bad all things considered. Here's what Fairgrounds looked like after it was all cleaned up:[/p][p][/p][p]
[/p][h3]Painting the Path[/h3][p][/p][p]The next big task was figuring out how the heck I would handle revealing the map and showing where the player had been. Again, with the goal being avoiding tons of manual work. I figured it'd be easy enough to just "paint" the map as the player explored using vertex colors. Basically, a 3D model is just made up of a bunch of points, or vertices, that are connected together to make all of the polygons that make up the shape. In the above image, every intersection of every line is a vertex, and I can access the positions of those vertices, compare the position to the player's position, and if it's within a larger radius, I mark it as "revealed", and if it's within a close radius to the player, it's marked as "explored". Kind of like a Fog of War system but with two levels. [/p][p]The only issue with that was that some of these maps have a TON of vertices - 16-20K in some instances, and running 16,000+ vertex comparisons each frame was going to be a big hit towards performance, so I wound up writing this function as a C# "Job", meaning it could be taken off of the main thread and basically run in the background until it was finished, rather than the game waiting for it to be finished before continuing. In the end, it was only about a 0.2ms operation, which is spread out across several frames, so the performance impact was negligible.[/p][p]3D meshes can also store a color along with each vertex, so I made it so by default, each vertex in the map mesh is marked with a transparent black (RGB 0,0,0 with an Alpha value of 0). When you "reveal" a vertice by getting within ~25m of it, that color gets changed to a dark blue, and when you "explore" it by getting within 5m of it, it gets marked as light blue. Then those vertex colors are referenced by the shader I made for the map and used to properly render it.[/p][p]I also wanted to be sure that the map was readable even when the player was in an area with a lot of verticality to it - like when they were in a building with multiple floors. I added a feature to the shader that would dither out map geometry that was above the player and within a certain radius, so you can still see the player's location even when there's map geometry directly above you! [/p][p][/p][p]
[/p][p]I'm honestly really proud of how this turned out because I only very recently learned about shader building and how to work with nodes, so this is all brand new to me![/p][p]Since the map mesh is build from the levels' actual navmesh, the nice thing was that everything lines up 1:1, so when it comes to representing the player's location or placing map markers, I didn't need to do any scale or transform conversions, I can just use actual world positions for everything, which was a huge relief.[/p][p]It took about a week of work to get this far and get all of the meshes built. I want to make some more readability adjustments to the map so it's easier to view when there are a lot of vertical layers stacked up, but other than that, I've been super happy with how quickly it's come together and hope it helps players out![/p][p][/p][p]P.S. sometimes the navmeshes had little faces in them and this one was my favorite, as it perfectly encapsulates how I felt while cleaning up all these meshes:[/p][p]
[/p]
- [p]Dynamic map that reveals ground as you explore and marks nearby ground as "explored"[/p]
- [p]Map markers for some objectives to aid in finding key items[/p]
- [p]Map markers for previously visited locked doors[/p]
- [p]Multiple map modes to suit player's preferences:[/p]
- [p]Map + Markers[/p]
- [p]Map Only[/p]
- [p]Map Disabled[/p]
- [p]Tumble, pan, zoom, and height controls[/p]
- [p]A quick re-center hotkey to return to the player's position[/p]
- [p]A first-person map mode[/p]
- [p]A few map color palettes[/p]
- [p]Shotgun Ammo Box pickups were increased in value slightly from 12 > 14[/p]
- [p]Magnum Ammo Box pickups were increased in value slightly from 8 > 10[/p]
- [p]A significant amount of resources were added to Old Town to aid players in that fight[/p]
- [p]A significant amount of resources, including a mounted machinegun, were added to the Bunker boss arena[/p]
- [p]A few more molotovs were added to early game areas so players can experiment with them more[/p]
- [p]Penetration value of Sniper weapons was increased from 2 > 3, matching the Lever Action and Revolver[/p]
- [p]Magnum rounds will be added to the Bunker boss arena, as I realized there currently aren't any at all[/p]
- [p]A small sprinkling of Molotovs will be added throughout all of Chapter Two so they're not quite so scarce[/p]
- [p]Re-supply points after larger fights will be re-evaluated to see if they need souped up for players who run dry during those fights[/p]
- [p]All maps will be audited to try and identify significant gaps in resource availability - e.g. long periods of time where there are no pickups for a particular ammo type [/p]