I wanted to ask for information on the method used to have the Daggerfall world and to an extent its interior spaces continuously load the world with seemingly no slowdown or load screens, my understanding is this uses a technique known as level streaming combined with the pre-seeded generated world, so my questions relate to the following:
What are some good resources for implementing level streaming?
My understanding is that things like cities/towns use predefined maps and pull from those based on the seed, how is this information stored?
If a fresh seed was used to generate a world using the same method for daggerfall's, would the world need to be preloaded or could it do it on the fly?
World Continuous Loading/Level Streaming
- pango
- Posts: 3443
- Joined: Wed Jul 18, 2018 6:14 pm
- Location: France
- Contact:
Re: World Continuous Loading/Level Streaming
Hi arax,
First off, while Daggerfall world is procedurally generated, is was procedurally generated before release, and the generated (and probably hand tweaked?) world was stored in game assets, most likely because generation would have been too slow or too memory hungry to run on players' computers at the time.
So Daggerfall Unity never has to deal with world generation, with the exception of details of terrain, that are added on the fly by terrain generators (either the embedded one, or mods).
About level streaming, only wilderness is streamed; dungeons and other interiors are loaded at once. Level streaming principle is simple, the land is split in square "zones" of 800x800m, and the game draws several zones at any given time: the one the player is currently on, then at least one ring of zones around that (possibly more, depending on "Terrain Distance" setting). So as the player moves around, some zones are loaded in front, while others are discarded in the back.
The most fancy thing Daggerfall Unity does is use Unity3D "jobs" to compute zones' terrain shape in parallel using all processors available.
It also uses a "floating origin" to keep the coordinates 0,0,0 not too far away from the player for floating point accuracy reasons (coordinates far from the origin have lower precision). That requires translating the whole scene in the opposite direction to compensate for the origin change.
If you're interested in the way Daggerfall Unity implements it StreamingWorld.cs is probably a good start?
First off, while Daggerfall world is procedurally generated, is was procedurally generated before release, and the generated (and probably hand tweaked?) world was stored in game assets, most likely because generation would have been too slow or too memory hungry to run on players' computers at the time.
So Daggerfall Unity never has to deal with world generation, with the exception of details of terrain, that are added on the fly by terrain generators (either the embedded one, or mods).
About level streaming, only wilderness is streamed; dungeons and other interiors are loaded at once. Level streaming principle is simple, the land is split in square "zones" of 800x800m, and the game draws several zones at any given time: the one the player is currently on, then at least one ring of zones around that (possibly more, depending on "Terrain Distance" setting). So as the player moves around, some zones are loaded in front, while others are discarded in the back.
The most fancy thing Daggerfall Unity does is use Unity3D "jobs" to compute zones' terrain shape in parallel using all processors available.
It also uses a "floating origin" to keep the coordinates 0,0,0 not too far away from the player for floating point accuracy reasons (coordinates far from the origin have lower precision). That requires translating the whole scene in the opposite direction to compensate for the origin change.
If you're interested in the way Daggerfall Unity implements it StreamingWorld.cs is probably a good start?
Mastodon: @pango@fosstodon.org
When a measure becomes a target, it ceases to be a good measure.
-- Charles Goodhart
When a measure becomes a target, it ceases to be a good measure.
-- Charles Goodhart
- pango
- Posts: 3443
- Joined: Wed Jul 18, 2018 6:14 pm
- Location: France
- Contact:
Re: World Continuous Loading/Level Streaming
By the way, Interkarma is talking about this in the devlog of his new game
Mastodon: @pango@fosstodon.org
When a measure becomes a target, it ceases to be a good measure.
-- Charles Goodhart
When a measure becomes a target, it ceases to be a good measure.
-- Charles Goodhart