Rev up your engines and venture into the unknown with Drive Beyond Horizons: Prologue! Conquer dynamic landscapes, customize your ride, and unearth hidden treasures. Your introduction to our horizons starts now !
Hi Pilots!
In this first article, we'll delve into Open World Management.
As we approach the launch of the Alpha of Drive Beyond Horizons, we're excited to kick off this series of publications dedicated to our development journey.
[h2]Overview:[/h2]
Creating an infinite terrain poses several challenges that we need to tackle in the best way possible. No object can be "baked" as generation is entirely procedural, and it must be done within milliseconds without disrupting game performance. Let's dive in!
[img]{STEAM_CLAN_IMAGE}/44924970/aa027119d34435026d3752958da9ca6bf5bb120f.png[/img]
[h2]Terrain Meshing:[/h2]
For the terrain, we've opted for the "clipmap" technique as it allows for quick mesh creation and automatic LOD (Level of Detail) management.
For ease of programming, this clipmap is shared between the CPU and the GPU, unlike traditional clipmaps that reside solely on the GPU.
[img]{STEAM_CLAN_IMAGE}/44924970/72a71ef620fef0e2095e7a81da52d71f54b55267.gif[/img]
As you can see, the level of detail is automatically updated based on the camera position, saving GPU resources. It can also be adjusted in the options to display maximum quality or, conversely, to achieve better in-game performance!
[img]{STEAM_CLAN_IMAGE}/44924970/e8de74198c3bbf103d8bc0819f79839937228c92.gif[/img]
[h2]Terrain Texturing:[/h2]
When the player moves too far from the initial terrain position, textures are recalculated on the GPU. We've chosen not to use virtual textures, opting instead for a texture cascading system where textures are more detailed near the player than at the horizon. This allows us to update mountains and road elevations in real-time.
[img]{STEAM_CLAN_IMAGE}/44924970/9cb5e1c0f664253203d433aa258a8c382cb12cf0.gif[/img]
[h2]Collision Handling:[/h2]
Collision is handled through previously created height textures. The data is processed on the GPU side and sent to the CPU only for the desired portion, ensuring that the processing is fast enough to run within a frame. This calculation is done for every object requiring collision on the terrain.
[img]{STEAM_CLAN_IMAGE}/44924970/3931deba47c1cb73a0840de5ae0c4a5437ffae0a.gif[/img]
[h2]Vegetation:[/h2]
The most delicate management is vegetation because there are thousands of objects to instantiate in just a few frames. We take advantage of the relatively slow speed of the car to pre-generate the future foliage that the player will encounter. Meanwhile, we organize the foliage in the collision grid to make collision creation more efficient.
[img]{STEAM_CLAN_IMAGE}/44924970/70a01107f4867491feb11443c4f941f6d21a1029.gif[/img]
[h2]Conclusion:[/h2]
The terrain is at the heart of the game, and we've put a lot of care into its creation. We've successfully overcome the various challenges encountered so that you can drive beyond the horizons!
[img]{STEAM_CLAN_IMAGE}/44924970/6037a62baa70f7635b83e12244c75eefd4a55cd1.png[/img]