January 31st 2021 by SDGNelson
Anecdotes from the past month of gamedev.
Four weeks into 2021, and four Friday updates for Unturned. It feels like we are back in 2016! Most of this month's work was not particularly exciting, but here are the highlights:
For the next map coming soon seamless teleporters have been added. These maintain your relative position between the entrance and exit, so non-Euclidean spaces can be faked e.g. "it's bigger on the inside!"
I brought the automatic item icon measurements from 4 back to 3, which then highlighted a lot of flaws with the approach. This converted the renderer world space bounds into camera space to find the center and dimensions, but inflates the bounds when rotated. Fortunately most items have axis-aligned cameras.
Since each item, object, vehicle, etc used to be in a separate asset bundle there are a stupid number of duplicate files. I added a tool to hash all assets in the Unity project to find these duplicates, and started work on consolidating them in order of severity. There is a lot to do, but hopefully this will save a nice bit of memory.
Since my main goal for Unturned this year (described in the previous blog post) is to rewrite the netcode, I figured best to get started early. I have been rebuilding the bottom layer for next Friday: converting game data (e.g. position, rotation) to and from the network buffers.
Back when writing Unturned's netcode the first time around https://gafferongames.com/ was a great resource, and now he has even more useful posts. In particular this bottom layer rewrite drew heavily from his Serialization Strategies and Reading and Writing Packets posts.
It is funny to see bandits and drones shooting each other in 4, albeit without any form of tactics or strategy. Most of my time was spent on 3, but I did fix a variety of bugs and began the foundations for perception. Some of the core senses I have decided on:
- Smell / "tracking". This will leave a trail of points behind the character, and certain AI can follow the trail. Could be interesting for a zombie type, or wild animals, and certain items could disable the trail.
- Hearing / sight. Obvious, not much to say.
- Motion. This was prototyped with the drones (can only see moving targets), and could be interesting as a distance factor for bandits.
- Light. At night time sight threshold is influenced by point and spot lights.
So far I have been experimenting with keeping the AI dumb about "what" they perceived, but I am not sure how far this can go. For example, rather than the bandit knowing they are shooting at a player and stopping when dead, they are just shooting at "the best available hostile target location" which happens to stop being hostile once it dies.
Back in November I took Richard Lico's Space Switching Course and have been putting together a Blender tool for a similar workflow. It seems to be working fairly well so far, and if I get the time to put together an Unturned example I will share the tool.
Similarly animation related, I have been experimenting with procedural animation to fully merge the first and third person animations. This would bring a lot of benefits like lights and shadows perfectly matching between perspectives. Again hoping to have something to show next month.
Promised features for the custom weather system needed by the next-next map are long overdue, so that will take first priority. Built-in rain and snow ought to be converted to custom weather as well.
Not an exciting feature, but I intend to add an in-menu implementation of the Stockpile (rather than opening the web browser) to hopefully bolster the game's sales.
Hopefully wrapping up the next 4.0 update with basic AI combat... At that point it will have been almost 3 months since the last preview update.