Hello Sanctuary seekers!
I’m going to try to post more frequent updates about the game so this will be the first of many regular dev logs where I’ll tell you all about what I’m up to in the game and I’ll maybe go into a little bit of detail about how I’m doing things.
I’ve tried to split it into sections.
World
Since my last update I’ve been working hard adding a lot more detail to the huge world in which the game is based and I’ve changed the way the world is streamed in and out.
Here’s a before and after.
Before the changes to the world.
After the changes.
I previously intended to split the terrain into several different chunks, Have each of these chunks in a different scene and use Unitys SceneManager.LoadLevelAsync class to load parts of the world only around the players position.
This would allow for virtually unlimited play areas.
It works great.
Really well….
Until you add trees and grass……
There is a bug in Unity which refreshes all grass details and trees whenever you load another piece of terrain which led to some huge lag spikes.
If the game loaded more than one chunk of terrain the game stutters to a halt.
I’m still using the same principal to only load the terrain nearer to the player but this time, most of the terrain is enabled as the player gets near rather than loaded from another scene.
This is a far faster method of streaming the world and has no lag whatsoever.
Models.
I’ve been working hard learning to use Blender to create and where necessary rig models.
Since the last update I’ve created and rigged the players FPS arms.
The next step in completing them is to animate them.
Game systems
Inventory
I’ve created a basic inventory and item system for After Sanctuary.
It’s a grid based drag and drop style inventory and allows for some item types to be stackable.
The inventory is currently serialised in the json format
Json is great because it’s very easy to create, read and edit the files it produces and I like the name/value setup it provides.
I just need to encrypt the files before the game is released.
Footsteps
The player now has foot step sounds again.
The sound produced depends on the surface the player is stood on.
I’ve made a nice little editor script to assign different sounds to different textures
In the game I raycast down from two transforms (the left and right feet positions) and play the correct sound for the surface.
AI
I’ve started creating a basic navigation system for our NPC friends (and enemies) to wander our huge play environment.
This is a challenge in itself.
Unitys built in navmesh is limited and does not lend itself to huge play areas.
I’ve had a play around with the Astar path finding project which is exellent but doesn’t really work too well on a large environment.
My current solution is based on OpenPath which is open source.
Instead of trying to generate one huge grid graph or lots of small ones, Each NPC has their own smaller graph which moves with them as they travel around the world.
NPC’s destinations are often off their grid so a new path is calculated every so often to keep the NPC moving towards their goal.
That’s all for now, if anyone has any questions or comments please feel free to reach out to me on Facebook
I’ll leave you with a few screen shots.
Until next time,
Stay safe.
Paul.
2 comments