May 6, 2016 By: David Tse
Pre-Alpha 5 is finally out! You can download it now if you’ve pre-ordered
. It has a lot of issues with the biggest problem being that it has terrible performance. Because of that I decided to only release it as an opt in beta on steam. So if you want to play you need to opt-in. It has some serious problems that I know about, but I’m sure it has many more that I don’t so if you find ANY issues or have feedback/suggestions please let me know.
Normally I would do a detailed changelist of every little thing that’s changed since the last update, but it’s been so long that it’s impossible for me to remember everything and even if I could it would fill multiple pages of this blog. So here is a high level list of stuff that’s changed since Pre-Alpha 4.
- City Generation
- Neighborhood Generation
- Road Generation
- House Generation
- World streaming of all the generated data
- New world shift system. Old system shifted you one chunk at a time so it was possible to outrun the shifting. New system shifts you back to the origin no matter how far you’ve traveled so it’s impossible to break it.
- New and improved terrain system that has faster streaming, better world shifting, higher detail, further view distance, better performance, and less hitching while streaming.
- New view distance is about 100,000 meters while in Pre-Alpha 4 it was like 12,000 meters
- New depth buffer to handle huge view distances without z fighting
- Custom asset pipeline with custom binary formats and automatic baking tool. This significantly improves loading times. They went from 121 seconds in Pre-Alpha 4 to 5.2 seconds in Pre-Alpha 5.
- Basic LOD system to speed up house rendering
- So many improvements and fixes that I don’t remember
How to opt into the beta.
Ok so for those of you who have been following the development lately already know most of this stuff was in the new build so now I’m gonna talk about what I’ve been working on since the last blog post update.
So since the last update I’ve made some serious progress on the house generation and spent a little time cleaning stuff up and fixing things for the initial release.
The first thing I did was make it so there is a door connecting every single room in the house so there are no rooms that are inaccessible. This is done by going through all the wall voxels and making a list of connecting rooms. Then if the wall is large enough we try to make a door between them. This system still need some improvements mainly making it so doors and windows don’t spawn too close to the edge of walls.
This system is also used to place windows going outside. We just treat the outside voxels as one room and if we want to make a connection between a room and the outside we can also place windows with the doors.
Screenshot of the outside of a new house with some dead zombies and floating flashlight.
Mesh Placement and Fitting
So now that we have voxel sized holes in between rooms the next step is to add in the window and door meshes. Placing them is easy enough, but after that we have to get the actual wall mesh to squeeze in to conform perfectly to the mesh.
There is not much to talk about how this was done. It’s just a matter of tweaking the mesh generation to increase and decrease the voxel sizes to fit the window/door meshes.
Screenshot of the inside with new materials and mesh placement.
After the doors and windows were In I also added a trimming mesh that lines the floor. That was relatively straight forward too. Just extend a base trim mesh along all the wall voxels on the sides that touch the inside. So now all the walls have trimming lining them. I also did a flat trimming mesh on the edges of the roof. This will be replaced with a more detailed mesh in the future.
So once the door mesh was in the game I needed to give it a physics constraint connecting the hinges to the door frame. This way to can open it with the new interaction system or shooting it with a gun. This was surprisingly annoying to implement and get working with random house rotation. Those PhysX joints just don’t make any sense sometimes.
Also speaking of the interaction system, I implemented one. Not much more to talk about that so it doesn’t deserve its own section, but you can press E on doors to open them now. This system will be used for picking up loot and interacting with other stuff in the world.
Another screenshot of the inside of a house.
I also have the rest of the house physics which is just about giving the mesh to PhysX. I still don’t know if it’s more efficient to make it out of box shapes or if PhysX triangle meshes are just as fast if they have the same number of tris. So if any of you know about this please let me know. The windows don’t have any physics and don’t react to being shot by anything, which sucks but it’s not my priority right now.
Content Integration Pipeline Improvements
This was a larger time sink than I expected, but this will make getting new content into the game significantly easier. I mentioned in the changelist that I started using new binary asset formats for everything in the game to improve load times. To go with this I just implemented an auto asset builder that scans all the files and compiles everything that’s changed.
So this means I can change a texture or something, hit a button and then see the changes compiled and in-game. This will make adding assets to the game much easier and faster. I also completely restructured the content folder which took way too much time, but you can admire my work by looking in the files after you download the game.
Screenshot of the inside with parallax corrected cube maps, not in the current build but will be in the future.
The main reason this took too much time is the links to all these assets in the game were broken and I had to go and fix them. I have an idea for a new system that will load all the assets into a large asset database then if we want to load a texture or something in-game you just specify the asset name like Door_001 instead of a long ass file path. This will mean asset links only break when the actual asset name changes and I can move the folders around all I want. Will add a tiny amount of overhead to the loading, but it’s worth it.
I also did a simple material baker that searches all the files in a directory and if it fines files that make up a full material like “BaseColor”, “Normals”, “Roughness” it will gather them all up best it can and bake them into a custom binary material file. This alone will really speed up asset integration.
On top of all that I also did a ton of small fixes and improvements to get the release out. It’s exciting to see you guys playing the game again and I can’t wait to start pushing out more updates. My focus right now is getting the performance to an acceptable level then completely focus on adding loot and the inventory system which is where stuff really starts to get crazy.
Again if you have ANY issues or suggestions/feedback please go post in the forums. I can’t wait to see you guy’s in-game!