Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement voxels collisions in Godot physics testbed #137

Closed
acs opened this issue Aug 14, 2020 · 14 comments
Closed

Implement voxels collisions in Godot physics testbed #137

acs opened this issue Aug 14, 2020 · 14 comments

Comments

@acs
Copy link
Contributor

acs commented Aug 14, 2020

Based on this effort:

godotengine/godot-demo-projects#473

Implement in this test bed a voxel collisions demo in Godot. The ideal engine is PhysX (used by Unreal, Unity and others) but it could be enough to do it with Bullet.

Pretty related to the effort in #122 and #125

@acs
Copy link
Contributor Author

acs commented Aug 14, 2020

The first step is to install godot engine and after that, to play with the demos at:

https://github.com/godotengine/godot-demo-projects/tree/master/3d/physics_tests

Probably it won't cover voxels but we can extend it to do it. Let's mature the idea.

1 similar comment
@acs
Copy link
Contributor Author

acs commented Aug 14, 2020

The first step is to install godot engine and after that, to play with the demos at:

https://github.com/godotengine/godot-demo-projects/tree/master/3d/physics_tests

Probably it won't cover voxels but we can extend it to do it. Let's mature the idea.

@acs
Copy link
Contributor Author

acs commented Aug 14, 2020

Ok, let's create our first Godot project following: https://docs.godotengine.org/en/stable/index.html

The demos are Godot projects also.

@acs
Copy link
Contributor Author

acs commented Aug 14, 2020

Let's download the Standard version of Godot from https://godotengine.org/download/linux for 64 bits.

Wow, the first time you start Godot you can download the demo projects, including the physics one and execute it.

Screenshot from 2020-08-14 19-22-02
Screenshot from 2020-08-14 19-22-08
Screenshot from 2020-08-14 19-22-17
Screenshot from 2020-08-14 19-23-36
Screenshot from 2020-08-14 19-24-54
Screenshot from 2020-08-14 19-25-15

godot-physics-demo

@acs
Copy link
Contributor Author

acs commented Aug 15, 2020

In order to create a binary for linux, I need to install the export templates. With them , it seems you can export your Godot projects to Linux, Windows, Web, Android ... cool! But you need to download a 440 MB template.

Screenshot from 2020-08-15 12-34-17

For a Linux binary ... what will be the size for a minimal project? Probably the 40MB of Godot Engine (a bit less because the editor is not needed?) and the extra stuff implementing the project.

And the result is:

HelloWorld]$ du -sh HelloWorld-linux.x86_64
41M	HelloWorld-linux.x86_64

and if I execute it:

[HelloWorld]$ ./HelloWorld-linux.x86_64 
Godot Engine v3.2.2.stable.official - https://godotengine.org
OpenGL ES 3.0 Renderer: Mesa Intel(R) UHD Graphics 620 (KBL GT2)

and this is amazing:

Screenshot from 2020-08-15 12-45-36

Creating an executable for the game is so easy! And it is just a binary file ready to be executed with all included in it.

At this point I understand why some people are proposing Godot as a general purpose framework for creating multiplatform applications: https://medium.com/swlh/what-makes-godot-engine-great-for-advance-gui-applications-b1cfb941df3b

And probably it is the same for generating a Windows binary, an Android apk, a HTML5 app ... it is wonderful.

godot-export

@acs
Copy link
Contributor Author

acs commented Aug 15, 2020

Interesting Open Source game using latest Godot: https://github.com/EdmarDev/Wind-Up-Racer

@acs
Copy link
Contributor Author

acs commented Aug 16, 2020

Ok, I have completed the https://docs.godotengine.org/en/stable/getting_started/step_by_step/your_first_game.html and now I have a much clearer vision and knowledge about howto create games with Godot. It has been a really nice experience. And physics are used in this simple games. So it seems it is core for the development of any serious game with these engines (and probably from scratch also).

The next step is to learn a bit about 3D in Godot. My idea is that voxels are groups of 3D objects. The collision of groups is something tricky AFAIK reading, so let's focus in learning 3D in Godot, let's create two groups of two cubes, and let's collide them.

@acs
Copy link
Contributor Author

acs commented Aug 16, 2020

Godot 3D tutorial: https://docs.godotengine.org/en/stable/tutorials/3d/introduction_to_3d.html#spatial-node

Starting to learn with it!

This tutorial does not cover the basics pretty well. Let's find others:

https://www.reddit.com/r/godot/comments/an0iq5/godot_tutorials_list_of_video_and_written/

Godot and MagicaVoxel: https://www.reddit.com/r/godot/comments/9497gz/how_to_3d_voxels_to_pixel_art_with_viewports/

The 3D tutorials are not as complete as the 2D ones (https://godotforums.org/discussion/15767/request-beginner-3d-step-by-step-tutorial) and most of them are inside videos.

For example:

https://www.youtube.com/watch?v=VeCrE-ge8xM

Let's take a look to this eBook: https://godottutorials.pro/free-ebook-godot-game-development/ link

This tutorial seems to be a good reference: https://godottutorials.pro/fps-godot-tutorial/ (the same than the one included in the book).

And this article bout Godot tutorials for Beginners is also pretty interesting, pointing to 3D resources: https://conceptartempire.com/godot-tutorials/

@acs
Copy link
Contributor Author

acs commented Aug 16, 2020

I would focus in this youtube tutorial:

https://www.youtube.com/watch?v=VeCrE-ge8xM Godot 3.1: Creating a Simple 3D Game: Part 1 (Intro, Nodes & 3D Physics) #GodotEngine

@acs
Copy link
Contributor Author

acs commented Aug 16, 2020

https://github.com/acs/numbers_attack my first repo about godot. I don't know how far I will get with this educational game for practising number operations. But at least in my mind it is promising. In <1h I have modified the game from the Godot tutorial to adapt it to a new theme: eduactional.

@acs
Copy link
Contributor Author

acs commented Aug 17, 2020

Ok, let's focus in Godot in implementing physics collisions. Once we know how to do it, it is just doing it with voxels.

So let's do it step by step. Let's go with a simple scene with two objects that collide.

collision

https://github.com/acs/godot-samples/tree/master/HelloCollision

@acs
Copy link
Contributor Author

acs commented Aug 17, 2020

Ok, I am trying to understand the limits of the physics engine. For example, the final position for this rectangle is wrong according to my intuition. The final position of the rectangle should not be with the vertex up but totally over the ground.

rect_collision_unreal

Configuring "Gravity Scale" to 1.5 fixes the problem:

rect_collision_real

A lot to learn yet about the physics engines.

@acs
Copy link
Contributor Author

acs commented Aug 17, 2020

Let's read more about how physics work to understand it with more deep.

https://docs.godotengine.org/en/stable/tutorials/physics/index.html

@acs
Copy link
Contributor Author

acs commented Aug 24, 2020

Will be done in: Voxelers/3d#1

@acs acs closed this as completed Aug 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant