Sign-up for Email Updates:

Help Survive Development:

Development Blog
June 25, 2015 By: David Tse

This week I started working on proper scale for roads and a bunch of other less cool stuff. I spent time improving the editor, Atlas, and porting it to Mac so the new artist could preview his work in-engine. This week I'm also going to try something a little new. I'm not sure exactly how its going to work out or what you guys think about it, but I could really use your support.



Patreon

I'm officially launching a Patreon Campaign to improve the game and help speed up development! Patreon is a service where you can contribute X amount of dollars per month to support someone or something, in this came me and the development of Survive! You can check it out here: https://www.patreon.com/survive

I think I do a good job of explaining the reasons for the campaign on the actual patreon page so you should go read that, but here is the jist of it: I have enough money to support development for a long time, but if you contribute to the patreon I can spend more money on new assets for the game and get to the steam launch much faster.

There will be no exclusive rewards or content for this patreon so you don't have to worry about missing out. It's just a way for you guys to further support development and help me out. If you already have the game and can spare a few dollars to make the game better for all of us please head over to the patreon and take a look. Now onto this week's development news!

Atlas

Like I mentioned before I spent most of my time this week with atlas, the entity editor for Survive. There is not a ton of news here, I just got the model and material loading/preview working enough for the new artists to check out his work.

Initial Test
Screenshot of Atlas previewing a model and material!

These improvements were actually a small part of my work this week, but this artist for some unfathomable reason uses a mac. So I spent a good amount of time porting Titan Engine and Atlas to Mac. Theoretically this should be easy because all libraries are multi-platform, but its still a HUGE pain in the ass.

Less fun stuff

I figured since I was recompiling 3rd party libraries for mac I might as well dive straight into it and do a bunch of maintenance stuff I've been meaning to do for a long time. The first thing on the list was upgrading to visual studio 2013. It's not a huge change, but comes with faster compile times and is really easy to do while doing the next change.

One big bottleneck when working on world generation algorithms is memory. When I'm testing new stuff and trying to get all these cities, roads, and buildings to generate correctly memory is a real pain in the ass. I just don't want to have to worry about optimizing memory while working on rapidly changing algorithms. So I decided to switch the game exclusively to using 64-bit binaries.

This change does mean you need a 64-bit operating system and OS to run the game now, but the fraction of people who don't meet those requirements and can run the game already are minuscule. With a standard 32-bit binary the game is limited to only 4GB of memory regardless of how much a computer has. Like I said before this is really annoying when developing the game and it limits players who have more RAM than that. Hugh from Unknown Worlds wrote a really good article on their switch to 64-bit that will give you some more insight: http://unknownworlds.com/subnautica/64-bit-not-64-bit/

Initial Test
Screenshot of city roads with better scale, but still way to big. The roads are slightly shifted to the right because of a bug.

On top of all that I decided to just go even further into the rabbit hole and reformat my computer and reinstall windows. I usually do this every couple of years to keep my computer fresh and it had already been a few years since the last time. I also decided to go with the Windows 10 preview build instead of sticking with Windows 8.1 because i'm impatient and stupid.

While reinstalling windows it was also the perfect opportunity to setup my two 250GB SSDs in RAID 0! RAID 0 combines two drives so to windows they look like one single drive. This is really great for read/write performance and it gives me double the space on my C drive something I was constantly running out of. This read/write performance is also helps to improve compile times. I didn't do this before because it's also more risky. With this setup if one drive fails you lose everything. To "fix" this issue I just setup my external 4TB drive to do daily backups.



So this week I spent a lot of time doing a bunch of stupid house keeping shit. I also didn't finish the mac build just yet so expect some more work on that next week. Other than that the maintenance stuff is mostly finished and I can start working on proper scale city generation with all 32GB of my RAM soon! Don't forget to go check out the Patreon and consider further supporting Survive, I would really really appreciate it!

June 19, 2015 By: David Tse

This week I worked on classifying all the roads into city blocks, figuring out which blocks have the highest population and using the border roads to fill each block with basic grid like neighborhood layouts.

This weekly update is also going to be a little different and is all going to be in a video showing the city generation so check it out!

City Generation!

So like I said in the video this next week I'm going to integrate the cities with the high level interstates and then move back into the actual game world loading and rendering these new roads. Once everything is in the world I'm going to see all the problems with the road generation and most likely have to go back and tweak it to make them work, but we will cross that bridge when we come to it.

As for the progress of the game as a whole its going really well. These roads were a huge milestone and the long awaited Pre-Alpha 5 is getting much much closer to release. That's it for this week and don't forget if you want daily news on what's going on with development you can go follow me on Twitter!

June 13, 2015 By: David Tse

This week was about refining and tweaking the local constraints and global goals so they create the road networks I want or at the very least are acceptable for now. I also started a little on actual city roads that connect large city blocks. The roads need more work and variation, but are a decent start so far. I also made some changes to how all this generation stuff is going to work.



New design

Last week I mentioned that the city connecting roads try to follow population maps that were generated using the old high level highways and city locations. This week I decided that was stupid. So I'm going back to using those actual roads, but then delete the parts that are close to the actual cities. Then the road growth takes over generating the city roads using new population maps created with perlin noise masked by city locations. This way we get all cities connected and each city can handle connecting these interstates.

Road growth refinements

A lot of this has to do with the probes that keep roads from being too close to each other. There were a number of bugs with the circle line segment intersection function that had to be fixed. These fixes alone greatly improved the road placement. Once those core bugs were fixed I redid the way the probes decide which way to turn when encountering a road segment. By getting the normal of the hit segment and projecting it out from the new segment we are rotating all segments in the direction of least resistance. Another important improvement in road placement.

Initial Test
Current best city highways, smaller city roads will be filled into the blocks created by these roads. The green is the population map so spots with lot of green are cties. I made the cities really really huge so I could generate them faster for testing. This screen is showing 4-5 cities really zoomed in. So imagine the old high level roads I showed before and at each intersection point there will be one of these cities.

I added a second probe to the tip of new segments along with the one already in front of the tip so roads that are growing at the same time in parallel will also try to avoid each other. This was generally the only case were roads could end up being really close together so this fix means that roads should NEVER be too close to each other.

This week I also extended the probe system to the environmental awareness. Now in the local constraints each prospective road segment will sample a number of uniformly distributed points inside a specific radius. If some of these samples are in water or are on a mountain it will rotate to avoid it using the same system as road avoidance probes. This is more robust than the old system that just did one sample in front of the segment meaning roads more closely follow the coasts and mountains.

Initial Test
Example showing how the roads would be generated WITHOUT these probes. You can see how the roads look terrible because they are all jumbled together.

I mentioned last week that roads would try to reach water so they could follow the coast instead of hitting it and bouncing in another direction. This week I actually implemented that. So if the environmental probe hits water or some other impassible obstacle it gets marked and it will only try to seek the water or other obstacle it hit. Otherwise roads just try and follow population and maintain a certain shape. So now when a road encounters water it will aggressively seek it out while also avoiding it, creating perfect coastal highways. This system needs a little more tweaking of min max values and angles, but it's working ok for now.

Initial Test
Showing off ocean locking roads with all other constraints turned off.

City generation

I did some of the base groundwork for city gen which is actually the stuff I mentioned earlier. For city generation to work right the roads need these local constraints so roads don't get to close to each other or water. I also started on the algorithm that finds these large city blocks and fills them with neighborhoods, but it's not finished so I'll show that next week.



I didn't have time to make a video of the world generation this week, but there should be a cool one showing the real time growth next week. I think I will only need one more week of working on the road generation before it will be good enough to start loading and placing houses on them in game. If you want to see the advancement of road growth and city generation as it happens you can follow me on Twitter for daily updates!

June 4, 2015 By: David Tse

This week I worked on a new road growth system that uses the old road/city system as population maps. This system takes a few source roads usually at city locations and grows them according to a set of rules in two general categories called global goals and local constraints.

The idea of this core system is based on a paper by Parish & Mueller titled “Procedural modelling of cities”. While the core idea of local constraints and global goals is based on the paper, it's somewhat vague on some of the rules they use so I have been writing most of these rules from scratch. As always if you want more frequent updates you can follow me on twitter were I'm posting what I accomplish every day.



Road Growth - Global Goals

Every new road is always trying to find centers of population. This is the core of what they try to do with their existence. Road segments shoot a series of Rays in possible new directions searching for this population while also constantly evaluating the elevation in the area picking directions that will result in the least amount of elevation change and most population. This least elevation change priority results in roads that try to stay as flat as possible making the inevitable terrain smoothing under buildings and roads easier.

Initial Test
Early test of growth system with only a few source roads. Not all cities are connected, but you get the idea.

In addition to the population and least elevation change the roads will look for water in its nearby area so when their quest for population takes them near the ocean they actively try to stay along the coasts the way highways are like to do. Because they prioritize water once they get close to it they constantly try to create roads in the ocean, when these are rotated and fixed by the local constraints they end up closely bordering the coast. More on local constraints later.

Population Map
Source population map that roads follow. Generated using the old roads and city locations you saw in the screenshots last week. You can also notice there are some initial test roads following some of the population lines.

One of the most important aspects of the global goals is deciding when and how to split off a new road segment. The primary factor when deciding when there should be a split is if there is population. If there is a large amount of population in an area the probability of splitting a new road goes up dramatically so road growth for these highways generally happens naturally. When a road reaches a city where the population is generally much higher more highways will spawn and connect to other cities.

There are other factors based on type of city being generated (New York block layout, Paris circular layout, ect.) when creating city roads, but when creating these large highways connecting cities there is no concept of a "city shape". City roads will be done in a second pass using the highways as input.

Road Growth - Local Constraints

Once the global goals think that they have a good new segment they add it to a pending list. Before that segment can be added to the world it has to go through a number of tests called local constraints. These are to make sure roads don't go where they are not allowed to go. These constraints will do everything they possibly can to move and rotate around the proposed segments until they can legally fit in the world. If it tries a certain number of times and can't find a valid solution or a way to connect it to existing roads it just deletes it.

Example High Level Road Network
Another screenshot of road growth with more cites connected using different parameters. Ocean avoidance is turned off and there are no anti-parallel local constraints meaning roads get way to close. The split rate is also a little too high here creating a few too many roads for high level highways

The primary local constraint is dealing with all the existing roads already in the world. When a new segment is being checked first we see if there is another road or an existing intersection within a certain radius from the new segment's road end. If it finds something it will try to snap to that point. There is also a basic intersection test so if it overlaps another segment it will be trimmed down to create a new intersection.

The final other road based constraint is to test a circle at the tip of the road and not allow roads to be too close together and maintain a certain parallel distance between roads by rotating them. If it can't maintain the separation or correctly connect to the other roads it's dead.

Example High Level Road Network
This is a screenshot of these chunks with really large dimensions so you can see them clearly. In reality they are a 100th that size if not smaller.

To do these road to road intersections in any sort of reasonable time every road must be added to a grid of world chunks. The best thing about the regular gird of chunks is that to do intersections I just get the indices for the chunk this road is in and do intersections with the roads in that chunk. This lookup is insanely fast so the dimensions of these chunks can be very very small making these intersections really really fast.

Rainbow Grid
Screenshot from when I was testing a minimum distance allowed before a new split could occur and 100% split rate otherwise. This creates a cool looking grid, but the point is to show the ocean avoidance. Notice how the roads generally follow the coast. It's not perfect because of the chaos and huge number of tiny roads, but you can get the idea.

If a segment survives the perils of road constraints then it has to go through the landscape constraints. We don't want roads climbing up really steep elevations, going into water, or riding on top of mountains. So every segment samples the underlying terrain height data and checks its elevation to see what type of land its on and the change from its previous spot. If it encounters something it doesn't like it will try its hardest to rotate away. It it can't do it after so long it's killed. Like I mentioned before this coupled with the desire to move into the water will result in highways naturally traveling along the coast which you can see in the above screenshot.



There will be many more rules added to these global goals and local constraints to make the roads and cities very robust. This system is easily extensible and I'm really happy with it. It also has the really awesome added benefit of being able to watch these roads grow in real time. When you create a new world in game you will be able to watch the world slowly create itself! I'll probably do a video showing the growth in real time pretty soon because it's so damn cool!

Next week I'll be using this growth system and the highways grown to branch off the smaller city roads based on the population maps. If you have any questions or want any more information on how all this works just let me know and don't forget you can follow me on Twitter if you want daily updates and screenshots about what I'm working on!

May 28, 2015 By: David Tse

This week was all about city and neighborhood layout generation. This weekly update will be a little smaller than last week because I spent a lot of my time designing and iterating on the generation algorithms. If you didn’t see the update last week, I’m posing quick development updates every day so you should go follow me on twitter!



City Generation

Most of the work this week was on the generation system itself so I can iterate very quickly on the actual generation algorithms. The first thing I did was rewrite a bunch of the debug rendering stuff so I can zoom in and move around the map. This is vital when working on cities because I can’t work on city layouts when viewing the map at planetary scale.

Once the camera movement stuff was working I started on city generation, but needed to make some optimizations before I could keep going. The first was memory because I was adding so many roads to the world and I was just running out of space. This part was fairly simple because I was generally playing fast and loose with memory since it all happens offline.

Road Networks
Shows generated world with only the interstates connecting big major cities. Simple v1 grid based connections at the moment will be more variation in future.

After memory usage was low enough to handle the huge amounts of roads being created I moved to performance. Generally I don’t care how fast offline stuff happens because you will only run it when creating a new game world. As long as it’s in some reasonable time then there is no need worry too much about it. That being said there are times when performance optimizations need to happen on offline stuff.

This is needed usually because I need to test the generation algorithms and if it takes too long to do the generation every single iteration would take that much longer to test. So this week I spent a good amount of time making the base generation faster and offloading some of it so I can only rerun the parts of the generation I care about. Meaning I can generate the terrain height and highways once and then use that data to test city generation algorithms.

Road Networks
Same generated world just zoomed into one of the continents. Smaller cities will be spread out in between these large cities later.

Most of my time was spent on this systemic stuff that will make the actual generation stuff much easier. I did get some work done on the layout algorithms themselves, but they are in a rough state and are nothing to show off just yet. In the next weekly update or possibly sooner I’ll have some cool screenshots to show off the first iteration of the city/neighborhood layouts.



Like I said before this has been a smaller update because most of my work was on planning the algorithms and systemic behind the scenes stuff. Next week should be much more glamorous. You can start to expect these updates to happen on Thursdays, the slight delay in this week's update was so we could get on schedule. As always let me know if you have any questions and you can go follow me on Twitter for daily updates on the development of Survive!

Previous Page