this post was submitted on 19 Jan 2024
29 points (100.0% liked)

Godot

5642 readers
240 users here now

Welcome to the programming.dev Godot community!

This is a place where you can discuss about anything relating to the Godot game engine. Feel free to ask questions, post tutorials, show off your godot game, etc.

Make sure to follow the Godot CoC while chatting

We have a matrix room that can be used for chatting with other members of the community here

Links

Other Communities

Rules

We have a four strike system in this community where you get warned the first time you break a rule, then given a week ban, then given a year ban, then a permanent ban. Certain actions may bypass this and go straight to permanent ban if severe enough and done with malicious intent

Wormhole

[email protected]

Credits

founded 1 year ago
MODERATORS
 

My previous post on figuring out a terrain implementation is here: https://lemmy.world/post/8540418

Terrain Project ^codeberg^

Player Controller used is also available ^codeberg^

I was quite upset for a long while that I could not figure out how to optimize my terrain systems. This I have now figured out.

What I am working on is three different processed terrain components:

  • Topology Data (TPD) # 3D Positions of where each terrain point/node should be
  • Texture Data (TXD) # Which texture each terrain point uses
  • Special Data (SPD) # Special data for specific terrain points

I have finished rendering a multimesh of the topology data and it runs smoothly on my rather old computer just as I need for all my games.

The problem of mapping a collision system to the multimesh was something that I did not like attempting to solve on my previous tests from last year. I have found a solution. I misunderstood what was causing the lag and assumed collisionshapes could cause as much fps drop as meshinstances.

This system is built to load in separate parts.

  • Generate terrain if necessary
  • Chunk terrain data
  • Render multimesh
  • Instance collisionshapes for individual terrain points

My next step is either of the following:

  • Connect vertex points for smooth terrain
  • Create python script (or godot software) for heightmap editing and creation
  • Figure out generation of single texture image to blanket over multimesh

I do intend to make this terrain destructible. I decided some at least four months ago that I would only render the terrain if an update signal was pushed either from a multiplayer server or the client side.

I will create a terrain editor for the engine sometime but that is not on the main plan. Height map conversion to TPD format will come first. Caves and underground are completely possible as well of course with the most recent commit.

This development will give me a huge step forward in all of my projects as many of them require this sort of terrain system. Also I was too lazy to figure out that one terrain plugin I suppose.

top 2 comments
sorted by: hot top controversial new old
[โ€“] [email protected] 4 points 7 months ago* (last edited 7 months ago)

UPDATES

For this new chunking, each chunk gets a spatial for each of its terrain texture multimeshes. It is also functioning properly now. It simply counts up to the amount of necessary chunk_size points then starts a new chunk.

A chunking system that is actually good | better chunks 2b091f189e

Each texture now has its own multimesh | terrain is now textured + generate texturedata d03de637eb

Quickly set the size of each terrain node/point | cleanup and point size 2bff7a7cde

[โ€“] [email protected] 3 points 7 months ago

If you need help implementing this into your game, send me a message or email. I'll see what I can do without a guarantee.