Voxelers / 3d

3D in Voxelers
Apache License 2.0
9 stars 1 forks source link

Change the map (layout) of the game #49

Closed acs closed 2 years ago

acs commented 2 years ago

Ok, let's start with this one. The KinematicBody (KB) if it has a CollisionShape, will collide with other shapes. And if we use the move_and_slide call, the KB will slide over the surfaces. With a cool effect. Let's explore it.

And in Godot4 it seems worlds can be created better than before. Maybe a justification to use it:

https://twitter.com/devinthewater/status/1526673201866194945

acs commented 2 years ago

Ok, let's start adding some obstacles to the current world to see if the player, mobs and bullets collide with them.

acs commented 2 years ago

For some reason, the mobs don't collide with the obstacle. I need to research the reason.

world1

acs commented 2 years ago

Ok, time to finish with this task in order to close the work for the workshop that will be delivered on 23rd June at 18:30 in Vigo.

Let's compare the movement and collision shapes of player and mob to understand why the mobs does not collide with the mountain in the world and fix it.

Ok, problem found. They mobs where not colliding with the sphere because the collision shapes of the mob and the sphere where in different Layer/Mask. The fix is to add the collision sphere layer/mask also to the one in the mobs.

mobs-world

acs commented 2 years ago

We can improve the world adding a texture (water for example), or use a shader to add grass. Let's change just the color of the world adding a new material and changing the Albelo color:

world-green

acs commented 2 years ago

Ok, lest' modify the world with a basic texture of grass.

Just added better a kind of marble texture.

Screenshot from 2022-06-02 07-53-32

And my idea is to play a with with a shader material to show howto generate materials using shaders over the mesh. Let's see.

acs commented 2 years ago

About the use cases of using a Shader Material: https://docs.godotengine.org/en/stable/tutorials/shaders/shader_materials.html

acs commented 2 years ago

This approach of creating materials using shaders is the same one used in Material Maker https://github.com/Voxelers/3d/issues/47#issuecomment-1126716897 And in fact, the Visual Shader Material editor is pretty close to what Material Maker does. Probably, Material Maker is powerful than the Visual Shader in Godot. But the Godot editor probably is more versatile and you can modify it from VSCode.

acs commented 2 years ago

Nice tutorial howto use Visual Shader for Materials for creating a dissolve effect: https://www.youtube.com/watch?v=sf_Dc4ew3eM

I am thinking in applying a dissolve material in mobs once they are destroyed. And to compare it with using an animation in the player.

I have created the Visual Shader and it is really powerful! If you know what you want to do, implementing it visually is really easy.

acs commented 2 years ago

Ok, I have added the dissolve effect to the mountain once the game ends:

world-end-dissolve

acs commented 2 years ago

Time to close this ticket!