This week I have been finishing off ( hopefully ) tweaks to the main player and getting rid of any errors that have popped up. One of the main ones was obvious seams where the character had been split apart. Previously I had hand edited the normals anywhere the player mesh was split which would often get rid of anything visible, but was very time consuming and left us with a mesh that was fragile, with them sometimes resetting when moving between max and maya.
Now that the character has a normal map I had originally thought that that alone would take care of it, however this was not the case and still left seams of varying visibility depending on workflow/how it was baked.
In the end what ended up working was to make sure each separate piece was individually uv’d, then I would recombine all the pieces into a single mesh but not weld the verts along each join. I would then bake out the normal map using this as a target mesh with a generous amount of padding and convert the map to tangent space with Handplane. This seems to work fine.
I also went and finished the textures for the new hair/beard combos.
This week I’ve been having heaps of fun doing stuff like this:
The motorbike and the vehicle refactor are coming together well, I think I’ve found a good balance between realism and fun given the relatively limited control scheme (it’s hard to handle turning and leaning well without an analogue input like a thumbstick). I’ve put a early build together that we’re going to be testing internally and we’ve been talking about pushing out the vehicle changes before the itemv2 update so watch this space!
I’ve also been doing some more work in itemv2 working on the backend of our baking system pooling groups of datatypes used by meshes. This allows us to preallocate the memory the baking system is going to use rather than request it at runtime. When working with high level programming languages like C#, systems like this are essential for good performance as the garbage collector (named because it turns no longer used objects back into free memory) isn’t fast enough to work smoothly in real time and frequently leads to framerate spikes. If we preallocate all (or at least most) of the memory we need on start up and don’t release it we can massively reduce garbage collector use.
I’ve also developed a system for turning static meshes into basic skinned meshes by binding them 100% to one bone.
This should help modders out creating items like hats and masks easily, I used this horse mask from the asset store, bound to the head bone to test it out.
Hiya everyone. This week I optimised a lot of the city assets, and played with a new map-making tool.
One of the big challenges with the city, as we’ve mentioned before, is getting it to perform well. It’s a complex problem with some distinctions from optimising an open terrain like Diemensland. We get a lot more out of aggressively culling objects, and it’s much less noticeable due to the amount if culling we get from the buildings. We started of as you can see at around 30fps in most scenarios, and up to 3 million polys.
The first thing I did was write a tool to find the objects hogging up the render time – where were we spending these polys? Well, it turned out we were spending a lot on very small amounts of texels at a distance – that is, lots of polygons were making up very few pixels. I put on my 3D modelling hat and made some quick and dirty LODs for the worst offenders. Thanks to Mils’ modular design of the city, this meant I only had to make a few before we got some real dividends.
You can see a before/after performance comparison below.
I’ve also been playing around with Map Magic, a recently released procedural terrain composition tool. Hopefully we should be able to streamline our map making process using middleware tools like this in the future. As worthwhile as Shigi Tools was, and probably will be for some niche procedural generation, the more tools we can outsource, the faster we can make content. I’m working on reproducing some of the basic microstructure that we ended up with in Diemensland. Think the hills, rock placement, tree placement. These were all iterated over a lot to try and get a good feeling of scale and place. Reproducing this in an entirely procedural way will really allow us to lock in the micro and start playing around more easily with the macro. This has meant I’ve gotten to right some cool procedural heightmap generators – check out this custom warp generator I whipped up!
Hurtworld Update #42
01 08, 2016
This week and next, Spencer and Mils are away.
This week I’ve been helping out with itemV2, hooking up the skinned mesh baking work I’ve been doing. We’ve also been making a lot of changes to player rendering to support customization. The plan is to have players be able to pick a skin colour and a hair colour as well as hair and beard styles. We want to implement this as part of your characters default setup rather than through gear like how we currently handle it. When creating gear in the sdk you’ll add a skinned mesh attachment item component to the item which will allow you to select a mesh or group of meshes to be baked into the character model when the item is equipped. The component also allows you to mask out sections of the default player to remove them from the bake, this is handy if we want to do something like turn off the hair model when wearing a hat.
We’ve also been working on decoupling player rendering from player simulation and control and this has allowed me to write a player model viewer to help speed up our workflow. The model viewer gives an easy way to test visual item components, player default setups as well as skinned and static mesh attachments under the whole range of player animation without having to load up the entire game. This should help speed up item creation for modders as well once itemV2 makes its way into our SDK.
The motorbike is also coming along well, both Mils and Dazzler have been hard at work on content and now we have low poly models and rider animations complete. I’ve started bringing these into Unity and have split up the range of rider animations into the following blend tree.
This tree allows us to drive the animations through 5 variables:
Speed (blends between the stopped pose regular motion)
GroundedWeight (used to blend between air poses and grounded poses)
InputY (taken from up/down input, used to blend between forward and back poses in the air)
InputX (taken from left/right input, used to blend between left and right in both drifting and normal turning)
DriftWeight (represents drift amount, 0 being no drift and 1 being full drift. Used to blend between turning and drifting)
To give an idea of what the nodes represent, here’s what the ‘Air Fwd/Back’ node looks like running through its range in all its barhumping glory.
With all this in place I can start fine tuning the handling, making sure it all blends together nicely. I’ve only just started this process and need to smooth out the transitions but I think its coming together pretty well already
Hey folks! This week I’ve been planning out the new map that will be coming with ItemV2. The new map is going to be a big task. It will incorporate the amazing work that Mils has done creating an enormous library of city assets, as well as reflect some of the big gameplay and balance changes that are coming. We’ve been doing a lot of planning and talking through map ideas as abstracts, and now I’ve started actually building something to see if it works. While we loved Diemensland, we felt that it missed the mark on a couple of things. We didn’t really get a strong progression through biomes, there weren’t enough of them, and the main mechanism was temperature, which is something we want to move away from. Using temperature as the main “gating” mechanism throws in a whole lot of complications, as we also use temperature in a bunch of other stuff. It strongly limits how we are able to scale biome difficulty – for instance we can’t make a biome 100 times harder without increasing the temperature by 100, and this complicates stuff like putting in dynamic behaviors for entities at high temperatures. So, everything will just catch fire. This means we’ll probably move away from temperature as a gating mechanic for biomes.
Another change we’re entertaining is much more binary transitions between biomes, pretty much a line you step over. We think this will make balancing the biomes a bit easier, as we don’t really have to worry about the transition zones. As well as that, we felt the transition zones were generally ugly and limited how different we could make the biomes feel as we always had to consider the transition. We’ve also been thinking about player flow and forces a lot, and what we want the flow of players to be around the map. We’ve been considering a design with quite a different layout to where players begin in a middle hotspot, the city, and must get out as quickly as possible, grabbing some supplies to survive the day, and move out to one of several separate zones. These separate zones would have distinct, increasing difficulties and rewards as you progressed out, pushing players outwards. Also, as players reached the end of that progression (not necessarily establishing a base there, but having sufficient gear to travel there), they would then be able to return to the city to do high-tier farming runs. They would also be able to travel to different zones, to raid and pillage or to claim some other territory. As always, we’ll see how this layout works with a rough version first, before going forwards with a fully polished map, but it should be pretty cool and different!
Since last week I have mainly been working on tweaking the player character both in regards to proportion as well as making sure the in game mesh can separate in the correct way to line up with the new build system.
His mesh will now be split into : Finger Ends, Hand, Lower Arm, Upper Arm, Torso, Crotch, Upper Leg, Lower Leg, Feet, Neck, Head, Hair, Beard, and Eyes.
We noticed that the players neck appeared thin and and slightly elongated, which became more obvious when there was no beard or hair pieces loaded onto the player. Whilst fixing this I took the opportunity to fix other areas especially around the torso and pelvis. I also separated the default shorts off into their own map.
*Textures still need tweaking and proper spec maps applied.
Hurtworld Update #41
25 07, 2016
The dirt bike is coming along nicely. The low poly for the 3 wheel designs and one of the body kits are done. I decided to model all the wheels and the body kits at the same time to make sure I don’t go over our poly limit. One of the wheel sets (the one on the right) that most resembles a standard dirt bike tyre, stretched our poly budget a bit more than previously thought. I had to use mesh to get that nobbled tread silhouette which increases the poly’s significantly for that design. Once the 2 other low poly body kits are done I can check the combined polycounts of that tyre set with the other body kits to make sure we aren’t blowing out our poly budget.
I also made some updates to the raid drill which you have now probably been playing with. We split the machine into 3 parts to make it’s creation and use more interesting. I had to update some of the mesh, textures and icons for it.
I spent this week getting the Raid Drill out and fixing a few bugs that came up from that patch. That was a mostly smooth process, and now we’ll be looking at the feedback from you folks and metrics on the drill’s usage and uptake.
It’s always a balancing act when releasing a new gameplay mechanism, and it’s almost a statistical impossibility we’ll get it exactly right first time. The question then becomes – do you balance a new mechanism erring on the side of caution and maybe buff it later, or do you release a possibly overpowered mechanism and maybe nerf it later? Both tactics have advantages and disadvantages. If you err on the side of caution, and release a mechanism that may be under-powered or not viable, then you have less uptake on the mechanism and some players might be disappointed. If you go the other way, you will get good uptake as the mechanism dominates the meta, but it will be frustrating to be on the receiving end of it and a nerf will have to be quick, as damage is being done. Personally I prefer to err on the side of caution, simply because in the time it may take to re-balance and buff, generally, damage isn’t being done. You have the frustration of this new thing is useless!, but not this new thing is destroying the game!
My new main task, and what you’re going to be hearing about for the next few weeks, is making a new map to go hand-in-hand with the ItemV2 update. This map will integrate a lot of new assets, including the cities that Mils has been working on, as well as experimenting with some different layouts and structures. While Diemensland has been a great map that we’re proud of, Diemensland is just an aspect of Hurtworld. Part of this, which is what I’m doing right now, is looking at Diemensland and trying to learn some lessons from it. I’ve been pulling apart savegames and analysing them, seeing where people play, build their bases, hide their loot, and more. There haven’t been too many surprises, and we were glad to see that a lot of the design decisions we had made had had their intended effects on player behavior. You can see some of the aggregated maps below, showing where on the map certain objects are. So, the most populated part of the map is the transition between the Forest and the Starting Beach, which makes sense. You’ve got the Dome, Valley, and Fortress all in a small area, it’s resource rich, survivable and accessible. There are way too many workbenches.
It’s some interesting data that has given us a lot to think about when planning this next map. I’ve also been looking at the community maps that people have been playing and liking, to see what they’ve done with layout and flow.
Nothing overly exciting from me this week, just more clothes in the form of jeans and tshirt, trying to round out all the standard/base clothing items. Once all these standard issue type gear is done, I will jump onto things like jackets, footwear, and gear more in line with some of the concepts I had posted previously.
Next week I will post up a fully kitted out new character next to the current one to give everyone an idea of how different they look.
This week I’ve been refactoring the core of the vehicle system. I’ve been trying to simplify the code base making it easier for both ourselves and modders to work with. I’ve removed serialization from variables that were being overridden by equipment and environmental factors (eg. Throttle torques, traction modifiers, fuel efficiency etc.). Each component is smaller now and the separation of responsibilities is clearer which makes it easier to work on and maintain as well as making it easier to setup new vehicles.
For example here’s how the vehicle motor and controller classes look in the sdk when comparing versions.
I’ve also been able to squash some bugs and move some edge case handling back into the main general simulation. This will lead to more consistent handling with less seemingly random spinning out and flipping over.
I also found several cases where the forces we applied weren’t being affected by the vehicle’s weight, I’ve been rebalancing these so in the average case the handling should be roughly as before but with a particularly light or heavy vehicle (depending on equipment and passenger numbers) you should notice more nimble/sluggish handling respectively.
With these changes in place, this coming week I’m going to do some experiments with client side prediction to try and remove the input delay vehicles currently suffer from. No promises as it’s a tricky problem and for a persistent world style of game where death is potentially costly we think it’s a better experience to have a bit of input delay rather than have players rubber banding and teleporting all around the place.
I also spent a bit of time this week poking around our AI system and doing some research as that’s my next area of focus after vehicles. I’ve been looking into using the state machine / behaviour tree system Spencer has been using for item v2 which should mean it’ll be faster for us to create new content and also open up NPC modding.
Didn’t get as far as I wanted to with recoil this week, as the more I dug into the requirements for the recoil system it became clear that the entire camera system needed a rewrite. The reason for this was that the server had no knowledge of the clients camera positioning, and our camera logic was wildly inconsistent and spread all over the project.
As the rabbit hole deepens, like all other systems being touched on this journey, I decided to rebuild it with all the missing features we want to have soon:
Ability to look over your shoulder aka headlook
Just like the Arma engine, this feature is useful when sprinting and you want to look left and right without having to change direction. To do this I needed to introduce the concept of more than just an aim angle. I also needed to add the ability to restrict the camera movement rotation left and right depending on situation, which needs to be fed back into the input controls (mouse angle) on the client, but also enforced on the server
Look restrictions in first person in a vehicle
When in first person in a car, you shouldn’t be able to spin 360 degrees. We wan’t your facing direction to be properly animated soon, and if you have look freedom we can’t really come up with a decent pose in a lot of situations without looking like the exorcist. This meant using the view rotation restrictions mentioned above, but extending it to be able to be restricted dependent on parent rotation (the vehicle). There are also different situations for vehicle seats, like the tray seat on the Roach could have full rotational freedom (including legs), the passenger seats should be able to change aim direction while their legs are locked forward in the seat, and the driver should only be able to change his headlook direction while his aim is fixed forward. This made things pretty complicated, but I’m sure now we can handle just about any camera / look scenario including…..
Shooting from Vehicles
Probably the most requested feature we’ve had, something I’ve wanted to add forever also. There were a LOT of issues we needed to iron out to make this possible, but with the camera restriction, and concept of facing direction, aim direction and look direction cleanly separated I decided to have a crack at solving the other issues.
The biggest of which is the paradox of your own player on your screen being ahead of server time, shooting from inside a vehicle on your screen that is behind server time (as the server owns it), and reconciling the hit registration. Normally we only have to apply antilag on the object being hit by a gunshot (rewind your target on the server to the point they were at when you shot them, to determine if you actually hit them). But in this case, the server has no idea where you actually were when you fired the bullet, as by the time the server simulates the gunshot happening, you may be 20m further down the road.
To solve this I created a concept called parent simulate time, which when in a vehicle, your client sends to the server each tick some data indicating what time its parent was at when your machine simulated the tick. I then had to add a history buffer of vehicle positions on the server, so when simulating a player inside a vehicle firing a bullet, the server can rewind the vehicle position to where the client thought it was when it fired, and simulate the bullet from the exact same trajectory (before moving the vehicle back to where it was).
Parent simulate time also paves the way for awesome stuff like being able to walk around in the local space of a parent object! (Think moving platforms / standing on moving vehicles)
As I still have the equipment / camera system in pieces on the floor, shooting from vehicles isn’t up and running yet. However, all the roadblocks stopping us delivering it should now be removed. Fingers crossed it will make it for itemV2!
No Touch On Server
This is one of the most annoying bugs we have currently, is caused by our server side authentication system for interacting with objects like chests / machines. The server has a concept of touch, in that if you look at an object on the server and nothing is blocking your line of sight, you are added to a “touching list” that allows you to interact with the object. Without this, players could send packets saying they are interacting with your chests and remove items from them. Distance checks aren’t enough as they may be just over the other side of a wall.
This fails when the server doesn’t agree with what you are currently seeing, which happens a lot inside 1 level buildings in third person, as the server has no idea what you are actually looking at because it doesn’t run the full camera logic. Now it does, so the servers view of what you can touch should be 100% accurate. There was also a bug where the clients interaction view would be offset by the clientside interpolation smoothing which is purely for rending and shouldn’t affect simulation logic. This made a few scenarios where the server and client would disagree on what you touched, or even what you hit with a pick. This will also be fixed in ItemV2.