Zylann / godot_voxel

Voxel module for Godot Engine
MIT License
2.63k stars 247 forks source link

Question about voxels and world generation #267

Closed TrayserCassa closed 1 year ago

TrayserCassa commented 3 years ago

Hey, first of all really nice work on all your tools and plugins :)

I am trying to build a small cube world clone, because I like the art of this game. Since it is my first game I struggle a little bit with the start. I have some small questions where I can move on and maybe a small hint which class/nodes I should use:

  1. For a own rpg world I would use the VoxelTerrain and build like houses or trees on it and use the stream to save my world. Is this a good or bad idea?
  2. I want to go to a higher voxel and bump the player up, like on stairs. I used the VoxelBoxMover, but I think this is not possible. I try for 2 days to change meshes in the terrain to maybe change the collision, or add a kinetic body and add collision (But why the collisions are not working on a kinetic body? For a new Game Developer it is kind of strange, that collisions not working like this).

I am currently thinking, this is not so easy as I though from my beginning :/ Or I am just too stupid for game development and need to do more 3D tutorials :/ ?

best wishes from germany Traysercassa

Zylann commented 3 years ago

For a own rpg world I would use the VoxelTerrain and build like houses or trees on it and use the stream to save my world. Is this a good or bad idea?

Sounds ok? For CubeWorld or Minecraft-like terrain you can use VoxelTerrain with blocky voxels, although that workflow still needs to be documented better. There are quick start steps here: https://voxel-tools.readthedocs.io/en/latest/quick_start/#blocky-heightmap-terrain-using-voxelterrain

I want to go to a higher voxel and bump the player up, like on stairs. I used the VoxelBoxMover, but I think this is not possible. I try for 2 days to change meshes in the terrain to maybe change the collision, or add a kinetic body and add collision (But why the collisions are not working on a kinetic body? For a new Game Developer it is kind of strange, that collisions not working like this).

I'm a bit confused with what you are trying to do here. If you mean to go up stairs without having to jump, like actual stairs blocks in Minecraft, this is something you have to code yourself at the moment, there is nothing ready-made in this module to achieve this. You may have to investigate an approach that works for your game (and tbh I haven't thought of a way to do it myself). All the module provides is either collision through meshes (with Godot collision engine), or simplified cubic collisions with VoxelBoxMover.

Note: if it is your first game and you are still learning Godot, this module is going to be quite complex for you. Or even making full open-world RPG. Getting more familiar with Godot and scripting on simpler projects will help.

TrayserCassa commented 3 years ago

first thank you for your quick response 👍 I have done the examples on the godot website and it was really good. And also your minecraft example works really well. Since I am developing infrastructure for 5 years now, I was thinking it can't be so tough. But oh boy.. This is really different from what I program at work and free time. But gdquest and your documentation gets me really exited to stick with godot :)

the stairs: I scaled down the terrain and if I am walking to a higher block it should feel like the player is running over stairs like in minecraft. This is where I am struggling currently, because I know two approaches and don't know which one is correct or smarter to do.

  1. Change collisions from the terrain (Maybe I am wrong, but I didn't see any collisions in the terrain)
  2. use the VoxelboxMover and do it by myself (I try this one for now and check the performance)

To learn more about godot, I do some tutorials in gdquest or youtube and after that I play with the VoxelTerrain/BoxMover and do some research (like this stair movement). To get a bit more motivation I designed the ui which works currently really well and then try the hard stuff, like stairs.

You answered me and this shows that you care about small guys like me. This is what I needed to hype my motivation :) So thanks :) If you want, I can post here my results if I get something to work.