for people using godot 4.1.1 the code changes needed are: (2:37) export is now @export (5:06) use a PackedVector3Array() instead of PoolVector3Array(). The same goes for the other similar ones, just replace each array with the equivalent packed version.
@thinkamake29487 ай бұрын
For the PoolIntArray it would be changed to "index_array := PackedInt32Array()" If you use PackedInt64Array() it just won't render, but its likely based on your machine so if 32 doesn't work for you then 64 probably will
@marko76102 ай бұрын
And the Spatial class extended in Planet is a Node3D in godot 4
@thinkamake29487 ай бұрын
Worked Great with Godot 4.2.1! just make the following changes: @export instead of export PackedVector3Array() instead of PoolVector3Array() PackedInt32Array() instead of PoolIntArray()
@Muttyfut Жыл бұрын
For the latest versions the "export var normal:Vector3" at 2:45 needs to be "@export var normal:Vector3"
@mcarthuralford48723 жыл бұрын
I just started working on something similar yesterday. What a convenient time to upload! Very cool.
@flaringk2 жыл бұрын
Dude this is amazing! And it actually is possible to automatically generate normals if you generate a mesh using a surface tool, which literally has a “generate_normals” function once you add each vertex
@jRsqILVOY3 ай бұрын
One issue I hit is that if you have a very big planet, the forced camera distance culling will always cull (e.g. when the centre of the mesh is over 10 million metres away). AFAIK there is no way to disable it completely either and it seems the max distance you can set is around 10 million units (probably due to it being float32 too).
@Ombarus3 ай бұрын
Do not think of it as Meters but 1 Unit in Godot = 1 000Km if you want to get a sense of scale. This simple method won't allow you to walk on it though. If you want to be able to walk on it you will have to consider LOD (Level Of Detail), culling and many other problems related to Floating point precision errors.
@jRsqILVOY3 ай бұрын
Yeah exactly, that doesn't work if you use the physics system, since it is only accurate to around 0.01 - 0.001 units or so IIRC. I think the only option is to scale down the planet as you move "away" - so like the camera is tricked with the distance remaining constant but the object getting smaller.
@xoxogamewolf758510 ай бұрын
I really wanted to follow his tutorial but unity was getting real bad so I'm glad I can do it in Godot now!
@karelissomoved15052 жыл бұрын
Oh great video. I always like when someone port unity stuff to godot 13:30 the last for loop can be omitted easily
@user-rf2ui6nz5d2 жыл бұрын
Godot is very suitable for making games with high-freedom and randomness
@_mickmccarthy3 жыл бұрын
Nice work! Hope you continue the series!
@financeonyt36644 ай бұрын
Did anyone fix the seam that is created from the normals not being oriented properly between faces?
@alex1972 жыл бұрын
This is actually awesome. Thank you for making this!
@thanatosor4 ай бұрын
Great, now i can sculpt 😂
@shanefoster53055 ай бұрын
I'm working in GODOT 4.2.1 and if class_name PlanetMeshFace is giving you trouble, just save it and reopen it. It sometimes has trouble loading the class_name.
@vinnieyang54223 жыл бұрын
Could you please make a tutorial on creating large scale (real world scale) planets with LOD that players can move around on? I'd be curious to see how you handle floating point origins! :)
@Darkest-Kn1ght2 жыл бұрын
This right here! The project I'm working on I'd like to be able to use the entire Earth as a game setting! Of course, the terrain would remain the same, but the time setting is far into the future after the planet was made almost uninhabitable! I would love to find out how to create a realistic Earth with real world locations and be able to fill it with a game. I don't even need to see the world from space!!
@allenmitchell3039 Жыл бұрын
@@Darkest-Kn1ght Google maps has awesome 3rd party software that copies road, buildings, i copied my whole city Adelaide Australia into unity and unreal
@Darkest-Kn1ght Жыл бұрын
@@allenmitchell3039 Yup, I realize they do, as well as many other free software, but what I'd like to do would be more along the lines of kzbin.info/aero/PLFt_AvWsXl0dT82XMtKATYPcVIhpu2fh6 without the ability to see it from the air unless I implement some type of flight into the game. A city here and there is all good and all, but the game I am hoping to create would be opened up one region at a time, and eventually, the entire planet would be populated within the game, just without the cities that inhabit it currently, instead, replacing them with barren ghost cities.
@zayman405 ай бұрын
For some reason I'm not even getting the square when I run the scene
@MrZakrencony3 жыл бұрын
exactly what I needed, amazing timing, can't wait to see more episodes! will the planets also have collision generated for them?
@Ombarus3 жыл бұрын
I'm not planning to talk about it since they won't have any LOD so they're more made to be seen from far away. But you could just assign the array mesh to a collision node.
@Seraph1208 ай бұрын
Amazing! Thank You
@darthvader021910 ай бұрын
Is there a way to generate a single mesh that represents a sphere?
@Ombarus10 ай бұрын
If you can find the formula to generate the triangles sure. You can also just generate all 6 faces in one mesh. The idea of generating it in separate mesh is that it (kind of) open the way to having LODs (Level Of Details). You could image that one face would be generated with a higher resolution than the other. You could further break down each faces into more meshes to get finer LODs.
@joaopedrosilva37963 жыл бұрын
Excellent work!
@SandSeppel2 жыл бұрын
How can I shade this flat so you can clearly see the faces?
@DArK-xj8lr3 жыл бұрын
That's genius
@FemtoTheGodHand2 жыл бұрын
Thank you Ombarus, it works very well and it's very instructive. I'm trying to add a dynamic chunk loading system and I can load each face in a thread, but I wonder how I can subdivide them even more, for example the Up face in four chunks, Down face in four chunks...etc ? My goal is to generate huge planet with a maximum of details.
@Ombarus2 жыл бұрын
I'm not planning to tackle stuff like LOD systems and collisions. This is more intended to be something like a backdrop in a bigger scene. Though part of the idea in splitting the faces in separate mesh and having a resolution control would be so you could have different resolution for each faces or perhaps even cut the faces in even more meshes. But then you need to figure out how to stitch the corners between the different resolutions. There are some other tutorials out there about this though.
@user-ut4hj7kc1t9 ай бұрын
Why there is no games with it still?
@jeremiahdobes70082 жыл бұрын
Hey there! This is super helpful! I'm actually utilizing this to make a sort of gameboard planet, and I was wondering if it's possible to set a 2d texture to each of the generated squares on the faces?
@tsvetomiriliev58044 ай бұрын
7:14 what do you mean by "true" triangle?
@Ombarus4 ай бұрын
pronunciation is hard. I was trying to say "TWO triangles". Meaning two triangles are used to make one quad.
@tsvetomiriliev58044 ай бұрын
@@Ombarus Thank you.
@aroyart94913 жыл бұрын
Thanks, I have tried to port it may self but failed.
@pvini07BR Жыл бұрын
great tutorial, i wonder if you're still answering the comments, because i want to know how to generate UVs for the sphere, because i want to apply earth texture to the sphere and the texture doesn't properly appears.
@Ombarus Жыл бұрын
It's a bit tricky because you'll need to figure out a way to handle the projection (projecting on a sphere is pretty challenging). But if you can map a position on the sphere to a UV coordinate on your map texture it should be doable. I believe Sebastian Lague has a later video series where he discusses this, you might be able to adapt it to Godot.
@HypeLozerInc3 жыл бұрын
This is awesome
@absolutelinus85522 жыл бұрын
this is a bit too advanced for me, but I'll come back to this at another point
@KumsalObuz3 жыл бұрын
Nice!
@oblatornexus57582 жыл бұрын
I just made a similar script, but did it with the ArrayMesh within the MeshInstance, no need for multiple MeshInstances. Currently the script is not so pretty, just me 'bashing it with a hammer until it worked'. It was the UVs part that really annoyed me for the longest time.
@Ombarus2 жыл бұрын
The idea is that this could be the basis for a Level of Detail system (LOD). Each MeshInstance could be subdivided a different number of time. That said you would need to implement something to "stitch" the different LODs together to avoid seams.
@Cornell_2 жыл бұрын
Awesome Vid mate, but I tried to follow your thing, and I feel like I have everything like you but I can't get the Cube the render into view when I play the scene, it's just not showing up... very weird
@Ombarus2 жыл бұрын
Put a breakpoint and make sure the code is being called.
@Cornell_2 жыл бұрын
@@Ombarus Did that, the compiler spits out 6 errors, for each side, saying " _mesh.add_surface_from_arrays(Mesh.PRIMITIVE_TRIANGLES, arrays)" "E 0:00:01.465 mesh_add_surface_from_arrays: Invalid array format for surface." So I guess the format is messed up somewhere, but I can't find where I messed up in the code spend 2 hours yesterday looking for it xD
@jaydenduncan5747 Жыл бұрын
@@Cornell_ Hey I found you a fix! Resize the uv and normal array to be the same length as the vertex array!
@coolmanthecool6035 ай бұрын
I dont like how you did that, but cool tutorial.
@ComplexProgrammer9 ай бұрын
good tutorial but I don't like the fact that every once and a while you speed up the clip because it makes it really hard to keep up
Жыл бұрын
Now I just need to translate all of this across to C# 😭
@williamhutchins47910 ай бұрын
Don't some programs let you translate? Or is that only translation to C#?
@user-ut4hj7kc1t9 ай бұрын
I completely lost on 10th minute... -_-
@huoqu6059 Жыл бұрын
Outdated
@adamboussif8035 Жыл бұрын
Can someone explain why do we set the vector AxisA to have coordinates (localUp.y,localUp.z,localUp.x) ? if we calculate the dot product of Axis A and the normal then it is xy+yz+zx where (x is the localUp.x, and y ,z respectively