This week has been getting everything up and running again after migrating everything to the SDK in preparation for ItemV2. We now have the game running with every piece of Hurtworld content loading from the SDK. We should soon be able to start throwing out ItemV2 experimental builds to a new steam branch. Initially in a very broken state, we are keen to get you guys in on the process as soon as possible.
We will be releasing an update with the Kanga included on Monday the 3rd. This will include a wipe of all official servers. At this point the wipe is optional and shouldn’t cause issues on community servers should they want to keep their savegame.
So the Kanga is now finished on my end. The pics below show some of the colour variation on the 5 Skins. I also designed the icon sets for the body kits, skins, wheels, engine and gearbox. This came out great and fits well with the other vehicles.
This brings me to my new shiny project, GUNS! This is something that I think a lot of kids have enjoyed drawing over the years including me (the big kid). I have been tasked with coming up with some new weapons. These guns will have to take into account the many attachments they will have while fitting into a few set character animations. It is very important that the detail be focused on areas that the player will see the most. The sight area, the left side of the gun and the silhouette when viewed from both third and first person must be interesting. I am designing the gun body first. From here I will design add on parts much like the vehicle system has a core chassis and then components can be added on or switched out. This should make for some very different looking guns, and I am already scheming up some beauties. 😀
OK so I am back from a couple of weeks off and straight on to more character gear! Initially I was exploring how to try and do hard surfaced armour type pieces in Marvelous Designer, but was unable to find any workflow that ended with a result I was happy with. So next item up was to be a bomber jacket, which will hopefully read quite different from some of the other clothing pieces. After this I will be moving on to some jackets with more of a combat feel. Adding a bunch of attachments like pouches and straps to try and break up the shape and give t shape and style that reads nicely.
Sketch over a Marvelous Designer base.
In game Bomber Jacket mesh.
Bomber Jacket sculpt.
Initial textures in unity.
It’s been a busy week, fixing up a lot of broken parts of the game as well as continuing with getting a macro outline of the map going.
Entity stats are coming together now in an ItemV2 architecture. We’ve got the basic stats working again, with effects, modifiers, all the good stuff. Players can get hungry, cold, hot, and take damage again. Now I’m looking at binary effects – things like hyperthermia, or irradiation, or broken legs. As with the old stat effects like health, binary effects were defined in scripts rather than as moddable objects. Now this has changed, and binary effects are coming across to a completely moddable, extensible way of doing things. There’s still a few places where responsibilities aren’t really clear, and the entity stats system will need a bit of a restructure later on I think to make the structure of it a bit neater and clearer, we are one more significant step closer to getting back to baseline with the ItemV2 branch.
I definitely want to do more with stats and binary effects with the ItemV2 redesign. We haven’t really pushed the limits at all of what this system can do. Items that give you temporary buffs, debuff weapons, potion-like items, diseases – all very cool things that we are wanting to play around with and try out!
The map tools have definitely matured. I’ve been playing around with workflows to mash the different terrain biomes together. Check out the screenshot above! This won’t be the layout of the map, but it’s a proof of concept for the tools. We can easily change the shape and location of these zones just by altering a single mask texture and regenerating. Hopefully this will make it both trivial for mod makers to make their own maps, and super fast and easy for us to iterate over map layouts and designs.
This week I’ve been working on the release candidate for the Kanga patch and we’re super close!
I managed to get through a few builds this week and the other guys have been helping me give them a good thrashing. After each test I end up with a list of bugs and change requests to work on and round and round we go until we are all happy.
Right now I think I’ve finally gotten rid of all the regression bugs we could find (although our players will no doubt find a few more) and what we’ve got left to do is some fine tuning (tweaking things like spawn rates, handling stats, crash parameters etc.) as well as getting the final crash animations sorted.
Speaking of balance, the Kanga fits into the vehicle line up as the fastest vehicle and also the most agile (it’s a complete mountain goat) but it won’t be the best outright for everything.
It can’t take any passengers so the Roach is a better choice when travelling with mates. The Kanga also leaves you very exposed making you a much easier target in pvp situations. Speaking of pvp, we imagine the Roach will still be the ‘weapon’ of choice here for the above reason plus the bigger hitbox makes it a lot easier to run your enemies down.
You also run the risk of crashing while on the Kanga which can give your opponents the window they need to easily kill you or even just quickly pinch your bike.
The Roach also comes with storage slots whereas the Kanga only gets storage through the Raider rear panel.
The Goat is now essentially an easier to obtain cross between the Kanga and Roach. It isn’t as volatile as the Kanga as it’s much harder to crash but at the same time it’s still an exposed riding position and it’s also slower than the other two vehicles although it is lighter, smaller and more agile than the Roach.
We’ve still got some tweaking and testing to do and still need to put the latest build through its paces but I’m hopeful of getting it signed off on this week.
Hurtworld Update #49
19 09, 2016
I have designed 5 new graphics for the fairings of the Kanga this week. They are all pretty varied and should be fun to customise. It is difficult to come up with different ideas that look significantly different and also look good on the bike at the same time. I designed 8-10 variations and they were all reasonable ideas, some just didn’t lend well to being placed on a bike. Only these 5 made the final cut. They are only skinned on the ‘Crow’ body kit currently.
I’ll proceed to enhance these a little more next week and get them onto the other body kits. After that the Kanga is ready to be passed to Tom to finish off his end of things on it too. This has come out nicely and after testing the actual ride that Tom has put together so well, this thing is going to be a favourite I think.
This week I’ve been working on getting the Kanga ready for release. We’ve now got all the kanga items up and running including all the variants and paint masks (although these still need to be applied to the Raider and Earwig variants), Diemensland has been updated with Kanga spawners and the loot tables have been updated to include the new Kanga items.
One of the hardest parts of developing the Kanga has been making the crash system safe so it never places you inside rocks or other peoples bases. After a lot of iteration we’ve settled on attaching an invisible capsule to the vehicle via a joint that can be broken by force, if broken then a crash is triggered. This allows you to bump into and drag across rocks and walls at slow speeds without crashing which is a whole lot less frustrating plus it doubles as excellent validation for the crash vehicle spawn location as we can replace the capsule with the crash vehicle. As well as watching for the joint to break we also check for any large changes in velocity over a small period of time and also test the pitch of the bike relative to the angle of the ground (if we just tested the pitch of the bike against the ‘up’ direction of the world then crashes would be thrown when riding upside down through a loop). Unfortunately early in the week I encountered a bug where If I crashed and the bike landed perfectly upside down I could then re-enter the bike which would instantly cause a crash and the crash vehicle would spawn in the rider position which would be under the ground at that instant meaning you could use this to glitch into rocks.
To fix this up I created a new type of vehicle entry that does some physics checks to make sure the rider has room to enter the vehicle, if this check fails the vehicle gets briefly put into a lift mode where it will try and turn itself upright, giving room to enter.
As well as this fix I’ve also discovered a reliable way to check if a point is inside a collider or not which I’ve added to the ownership stake validation, this should finally put an end to invulnerable rock bases even if players manage to glitch themselves into the rocks.
After reviewing the destruction changes we decided they still have a ways to go as we need to develop good ways to give feedback on the health of the vehicle and its attachments plus feedback on your actions to damage/repair them. In the interest of getting the Kanga update out sooner and not having to redo a lot of work as our whole item system gets overhauled we’ve decided to push the vehicle destruction changes back to itemv2.
I’ve put together our work in progress changelist so you can get an idea of what will be in the update
Crash system added
Bail crashes (crashing from exiting a high speed vehicle) added to all vehicles
Goat has had orientation crashes and rider capsule crashes and velocity delta crashes added.
Goat cannot be entered unless room for the rider is clear
Player weight is now added to vehicles on entry and more vehicle handling attributes are affected by weight.
Camera fixed so orientation is maintained on vehicle enter and exit
Ownership stakes can no longer be placed inside of rocks or other geometry.
Vehicle brake lights now brighten when braking
DynamicLOD system added for vehicles, LOD budget and High LOD bias can be set in the graphics options menu.
Vehicle scales fixed, removes physics rebaking step on spawn which will help considerably when loading many vehicles at once.
Goat texture resolution increased to match Roach.
The small 2m square foundation construction piece has had its volume scale corrected, making it take the correct amount of damage (was previously taking too much damage because volume scale was too small)
Fixed bug where the player’s position in the physics system was not being updated whilst in a vehicle.
Vehicle wheels now spin correctly in the air maintaining take-off RPM
Vehicle reversing is now much slower than accelerating forward.
Vehicle steering assist is now a twisting force rather than a pushing force
Using the reverse key to slow a vehicle down will no longer reverse its steering direction.
SDK update with all kanga and crash components added.
Not a tonne of pretty pictures from me this week. I’ve been putting the pieces back together after our significant project restructure, and the rabbit hole has taken me into bringing entity stats into ItemV2. The project restructure has felt a little like an open heart surgery. We’ve made the big cuts, and moved around the internal organs we needed to (note – do not do real surgery like this). Now we’re just stitching up everything and getting the heart beating again.
As I mentioned last week, I’ve been taking a look at the Biome and environmental effects system. As is the pattern, this has evolved into a refactor of a base underlying system, the entity stat system. We’ve talked about this a lot before, but as a refresher, this is the system that handles the interactions between all the different stats in the game, like health, nutrition, damage, speed, and more. It’s an incredibly complex system, that does a million different things. One of the fundamental parts of the system is the process of building an entity stats object, like for a player, which contains all stats that entity uses. We need to specify somewhere what all these data and relationships are. Previously, we did this in code, which was easy but not extensible. It wasn’t a thing that could be modded easily, or at all really. So I’ve been porting the entity stats building code over to a format that can be defined in the SDK. The challenge in this has been the huge complexity possible with entity stats, but it’s mostly been moving things around rather than having to come up with entirely new logic.
The map is also coming along. I now have the tools in place to start actually making macro builds of the map, which is a big step. Builds are on the horizon – when things aren’t so broken.
Continuing on from last week, I’ve been putting the structures in place so that our asset database can import and export asset manifests as needed. One requirement of this, is that we migrate all our content assets into the map SDK project so we have a clean separation of core logic and configuration. To make this possible, I had to migrate over 1000 code files stripping them of their dependencies on the core project.
Doing this manually would have taken me weeks… instead I utilized the AOT code generation framework I wrote a few weeks back and used it to dynamically rewrite almost all of our code in a form that can be used by the SDK. Long story short, this mostly involves reflectively finding all fields that Unity can serialize on an object, and emitting C# code so that the SDK can construct objects our main project can read, without all of the run time functionality included. We then mark all editor time scripts that need to be fully included and manually flag pieces of code not to be included using compile time #ifdefs.
This means we no longer need to doubly manage 2 code bases, and removes any overhead created by our expanding sdk.
As Cow_Trix described, we are now getting the heart beating again after the enormous restructure. Just to be clear, Cow_Trix and I are working in a different branch to the motorbike progress. The motorbike will be released before the work we are doing towards ItemV2.
Hurtworld Update #48
12 09, 2016
This week my SDK work has extended into reworking the biome, weather and skybox system (it’s really sort of one system, so the reworking encompasses all of it). I also kept fiddling with and making some biomes. Check out this WIP mountainous biome!
This refactor will enable users to specify custom biomes, weather systems and biome-influenced client effects in the SDK, something that was previously impossible.
The first thing that needed doing was rethinking the usability of the biome tools we have in place. While the ShigiTools biome tool was usable, it wasn’t super user friendly. While that will still be an option, we now have a MapMagic output that will work as well, and a biome painting tool in the editor.
Biomes have changed a bit in how they work. They are no longer concrete enumerations that are linked to a script that builds how they work. Now, their configuration is entirely serialized and configurable, everything from the color of the sun to the temperature to if you want it to blast a gazillion units of radiation every day at noon for an hour. A map will now have a ‘base biome’, which acts as a fallback for when there is no mapping for the cell a player is in.
We also upgraded Time of Day, the skybox plugin that we use for skybox rendering. There are some pretty nice features in it, like a cool atmospheric scattering effect, which might make the world look a bit prettier with minimal effort. Also, the latest Time of Day implements natively animated parameters. This means things like if you want the color of the sun to change throughout the day, this is now much more viable. Previously we had to implement this ourselves with this whole layer of abstraction, and now we don’t need to, which makes the whole system way cleaner and better. However, it did lead to an interesting performance issue.
One of the requirements for a skybox is interpolation. A cell can contain an arbitrary amount of biomes at different strengths. You need to interpolate, or tween, between the configurations. This was easy to do in the previous version of Time of Day, because all the configuration was structs or value types so we could do quick lerps without allocation. However, Time of Day implements animated colors via the UnityEngine’s Gradient class, which contains two arrays of the color keys and alpha keys, meaning it’s allocation city. I experimented with pooling these gradients, but it was kind of a rabbit hole. Just getting the alpha and color keys of a UnityEngine.Gradient allocates memory. So I took the interpolation back to the drawing board.
What I really needed, I thought, was the ability to apply a weighted normalized stack of skybox configurations to a weight. A weighted normalized stack in this context is just a mapping of biome to weight, which is a number between one and zero, where all the weights combined add up to 1. While before I was crunching this stack down into a final object – meaning I had to lerp UnityEngine.Gradients, meaning allocation – if I instead just stored the necessary information of the stack and processed it as I went, then I didn’t really need to store the result of the stack anywhere. This works great! We can interpolate between arbitrary amounts of biomes, it’s fast, and we’ve reduced memory allocations to zero.
A secondary problem is multi-cell biome interpolation, which is needed for the skybox. This is necessary when you move around between cells, and you want the interpolated states to smoothly blend. So if I’m in cell A, and it’s 50% biome 1 and 50% biome 2, and I move to cell B, which is 50% biome 2 and 50% biome 3, I want the skybox to smoothly transition between the two different states. As I move further out of cell A, biome 1 has to drop down to 0%, and biome 3 has to rise up to 50%, while biome 2 stays level. Luckily this is pretty much a solved problem – it’s called bilinear interpolation, and images do it all the time. We can get the four closest known points, which are the four closest biome cell centers, and figure out how much each one of these cells affect us depending on distance. You can see a rough visualisation of this below.
So, next up is working through all the structural changes Spencer is putting in, and trying to get everything combined into one point which I can then branch off again. Lot’s of things in the works!
I have allllllmost finished the base texture for the Kanga this week. I have to texture the wheels, which will be fairly quick, then I have to bake the Ambient Occlusion map and generate the Specular/PBR maps from the Albedo map. The time consuming part of the texturing is done though. I will probably spend Monday finishing off the base texture and then dive into making some sweet decal designs for the body areas. These will be yet another set of designs that are completely different from the Roach and the Goat. I have a couple of ideas already which I want to try out, so I can get stuck into it straight away.
This week I’ve been working on itemv2 again getting the mesh baking system integrated and working for players. I started out rewriting our static mesh attachment class which we are using for the majority of equippable items. My first pass at the class made too many assumptions like limiting attachment points to only 1 attachment and providing no method to bake static attachments together. If we’re going to be able to deliver on interesting randomly rolled loot we need a way to stitch different stocks, barrels, receivers, sights etc together and if we can bake them all together we can reduce draw calls to 1 per item rather than 1 per part (note: in practice many shaders need more than 1 pass and guns generally need to be separated into different animated parts, ie. the magazine needs to be separate from the receiver so they can be separated during reload but even without getting down to 1 call per item there are still savings to be made).
After getting statics working together I worked on an overhaul of the mesh attachment tools, used to convert mesh assets from Unity’s definition into ours. We’ve tried to make the tools as easy to use as possible, for skinned meshes as long as the mesh is bound to the same skeleton it will automatically transform the mesh into character space at the original reference pose meaning you can create assets from any reference pose as long as the skeleton is the same. For static meshes the tool automatically finds the attachment bone by recursively searching up the transform hierarchy from the mesh until it finds a matching reference from the skeleton definition, it then generates a transformation matrix to shift the verts so they are defined relative to the bone, allowing them to be placed directly on the bone, freeing up their current game object.
Both static and skinned meshes are generated by selecting a skeleton and a target character and hitting the generate button, the tool then walks down the hierarchy finding all static/skinned/both meshes and attempts to convert them all at once whilst logging feedback into the console. The workflow we envision is setting up a character within a Unity scene, positioning all the attachments correctly then selecting the root character gameobject and clicking the generate all attachments button. Then the mesh attachment assets generated can be assigned as item components inside the new item system.
Now the mesh baking system is properly integrated into the itemv2 branch, you can see it in action here putting together a few smg configurations together on the fly:
Work on the Kanga is still going and we tested a new build at the end of the week which has given me a new list of changes to address for this coming week. Mils is getting very close to finishing up all the textures so then we just need to sort the final crash animations + testing testing testing.
Nothing exciting this week as I’ve been working on backend and infrastructure stuff. For the first half of the week I’ve been tackling one of the last outstanding items on ItemV2 and integrating it with map creation, mod loading and our general architecture. This system manages the concept of referencing something that you may or may not have in your project.
The reason we need to do some lifting around this area is to make it so content creation in future wont be a nightmare of things pointing to eachother by names, names conflicting, the wrong assets being loaded and items having multiple versions running on the same server (like 2 wood log versions that don’t stack)
The main challenge here is we need to be able to select things in our mods (or default hurtworld packages) that are contained in something else. When a map selects that it wants to spawn a coal rock, it needs to select which networked prefab instance it is referring to. As the map doesn’t include a copy of the coal prefab, it needs to go find the correct one at runtime that may have been loaded as part of the default assets, or by another mod. There may even be a mod that overrides the default coal rock prefab that we want daemons land to spawn without having to change the map.
Another scenario is, someone creates a mod called “Awesome Resources 5.0” which contains all sorts of new metals, rocks and materials, including ways to obtain them. You would like to create a new weapon that is crafted out of Awesome Resources, but don’t actually have their source files to pick from inside Unity.
This is where the new HurtDB comes in, which allows you to pick any mod or default content pack and add its “Asset Manifest” into your project. What this does is extracts a list of all things inside a mod package that should be referncable like Items, construction prefabs, networked entities, vehicles, resource nodes, recipes, creatures etc, and adds a dummy copy of them to your local project.
This allows you to use the native unity editor to select references to objects that you didn’t create (that are backed by a 128 byte guid) that can be resolved once the mod loads in the game client.
This also solves a few nasty issues we have had on our radar around server owners wanting to load mods after a save game has been created, making it so every asset that is ever loaded from a mod, can be properly identified and versioned to ensure savegames never break because a mod created did something dumb.
The second half of the week was wasted punching on with git providers to find a place to put our 50gb of asset files. BitBucket let us get away with our git repo growing to a massive size on one repository, however when I tried to migrate most of the assets to the map sdk repo it cracked the sads saying 1gb was the maximum for a repository. Interesting considering our main repo is 38gb compressed.
After a lot of research, I discovered a new extension to git that game developers have been waiting for forever! Git LFS
Anyone who has developed games using git would know that it just doesn’t handle large binary files very well. The usual alternative is to run all large assets in a different system like Perforce. Since perforce is a horribly bloated piece of crap, we do our best to minimize its usage.
Fortunately in the last year or so, bitbucket and github teamed up to build Git-LFS, a solution to git handling large files well. If you are a dev and haven’t checked this out, do yourself a favor. Instead of storing the files inside git, it stores a SHA hash and deferes to a supported large file storage system. When you fetch from a remote, instead of downloading every version of that 50mb texture your artist has ever committed, you fetch only the revision you checkout into your working copy.
What I needed to do now was go through our entire repo history and remove all storage of large files and replace them with Git lfs links. If you ever need to shirk a git repo, this utility is an absolute life saver: BFG Git Repo Cleaner
BitBucket still doesn’t allow hosted repos larger than 2gb, so I tried to move over to a paid github account. I attempted the upload over the weekend and found that it took so long, the files had expired by the time the last one finished… We needed a better solution.
That’s where BitBucket Server saved the day. I grabbed an old machine, installed a fresh copy of windows, and deployed our own custom installation of BitBucket, all in a few hours. This allows us to continue to use their awesome infrastructure, but hosted on our premises and without size restrictions.
Good to go now, but 3 days wasted. Back to moving all our assets into the default package mod structure this week.