DevBlog #005: NPC Root Motion

September 9th, 2016

Root Motion and Wolf NPC

Alexander
The pathfinding system is implemented and ready to navigate some NPCs around the world. The movement itself is a combination of rootmotion and steering behaviors. After calculating the desired direction a movement controller sets the corresponding values for angle and speed of the animator. This way the NPCs move very natural and smooth and don’t slide over the ground as much as before. However, many animations on the server are a big impact on performance so we have to optimize a lot. Therefore I started to implement a level of detail system for the AI which disables some components of agents which are not in close proximity to players. It reduces their update calls on the server and simplifies the motion and AI itself for example. As a first prototype we have a new wolf NPC which uses the new pathfinding system, rootmotion and lod-system.

More dirt

Sebastian
We added some more dirt to abandoned places.

Housing/Building

Gavin
This week I started my work on an exciting new feature which feels really great working on after all the performance optimizations of the past weeks. The performance currently still isn’t optimal, but the next step needs to be done by another member of the team. The feature I’m working on is our housing / building system which I planned the last weeks. In order to speed up the development we are using uConstruct which can be bought in the asset store of Unity3D. Even though a lot of the work is already done I guess the entire system will occupy me at least for one to two month till it’s in the state I planned. I started with using the system to make it possible to place campfires or other objects into the world. Before campfires would always be placed some meters in front of the player which was bad because the player had no real control of its position. If the player wanted to, it would have even been possible to place them inside other objects. The great thing about the new system is that it isn’t only working for campfires but for every object we want to mark as a “placeable” which comes in pretty handy for future integrations like a workbench. You can see the current implementation in the following video. After everything was up to snuff I started thinking about how I could roll out incremental builds of our housing system. I ended up splitting it into three distinct phases:
  • Phase 1: Integrate the building part locally (this is more for internal testing)
  • Phase 2: Integrate network-side without the blueprint editor.
  • Phase 3: Integrate the dedicated blueprint editor.
In order for you to make any sense out of the list I have to explain how I / we planned the housing system. We always disliked the looks of the buildings in other games but really enjoyed the creative freedom you have as a player. We came up with the idea to integrate an editor that gives the players the possibility to plan and share their house before actually building it in the world. Besides allowing for better resource management the editor would also check certain conditions before the building can be placed into the actual world in order to only allow buildings that for example have a door or a roof. Once the player finished a “blueprint” he can start building the house by gathering resources and craft the necessary parts. This is similar to other survival games but has the benefit that the player won’t lose any resources because he realized that he placed something wrong. Of course the whole system is highly experimental and we might change it in the future if we realize that it isn’t fun or doesn’t work correctly. In the video below you can take a look at phase 1. It’s still in a very rough state and no one will be able to see the buildings you place. Furthermore a lot of components for it are missing which will make the houses look far better and distinctive than in the current version you see in the video. I hope you can see what I mean by the end of the next week.