godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
91.41k stars 21.26k forks source link

Procedural Generation for Android app #34000

Open MarvinKehl opened 4 years ago

MarvinKehl commented 4 years ago

@#Godot version: 3.1.1

OS/device including version: Linx Mint 19.2

Issue description: Collision mesh crashes the app on GLES2

Steps to reproduce: click the buttons in the minimal reporduction project.

Minimal reproduction project: https://we.tl/t-zesbP4RB7P

Hello, I have an issue with exporting my game to android. I create a procedural map with a noise texture and there is no issue on pc and android (GLES3), but if I change Godot to GLES2, my game crashes due to the collision mesh generation.

I made an minimal reproduction project, where I tried to recreate the problem for one quadratic tile. ou can click the buttons above to see the problem.

I also tried to create it with an CSGMesh, which wasnt successfull either.

Unfortunatly, the app crashes before an debug output, so I am not sure what exactly crashes.

Thanks for your help.

nathanfranke commented 4 years ago

You can consider using a height map collision shape to work around this... They work fine for me in GLES2 mobile.

MarvinKehl commented 4 years ago

Hmm, I don 't think this is the solution, because the game works without the get_convex_collision() function.

nathanfranke commented 4 years ago

Not a solution, just a workaround I was thinking Anyways can you see what happens if you export the CollisionShape using ResourceSaver and then use that instead and see if it still crashes? It would be important to narrow it down to that function.

BTW, You can also use get_trimesh_collision(). You said you're using a NoiseTexture? I don't think convex collision will work unless the noise texture is actually convex (unlikely)

MarvinKehl commented 4 years ago

I try to reate Tiles with surfacetool based on the y-value of the noise and then add collision to the tiles. As I dont know how the tiles will look like there is no fixed collision shape I could export.

But on all the other assets there is an collision sibling, which works fine.

I already tried get_trimesh_collision() with the same result. BecauseI apply the collision to an actual surface, it is not important, if OpenSimplexNoise is convex, I only need the position of the vertices.

KoBeWi commented 4 years ago

Can anyone still reproduce this bug in Godot 3.2.3 or any later release?

If yes, please ensure that an up-to-date Minimal Reproduction Project (MRP) is included in this report (a MRP is a zipped Godot project with the minimal elements necessary to reliably trigger the bug). You can upload ZIP files in an issue comment with a drag and drop. (the linked project is unavailable)