I would take a look on how minecraft was made, using threads to deal with those objects.
IceIceBergy
Posts
-
-
Just adding something I notice when debuging, its not the change_scene_to_packed itself that deletes the variables, its something that its executed after it runs in background, I guess its schedulle some startup procedure in another thread.
-
I tried that... Afther the change_scene_to_packed, every var set or object in the scene is deleted...
This is the code I tried:
scene.add_player( isMe , playerName , nodeId )
var pack: PackedScene = PackedScene.new()
pack.pack(scene)
get_tree().change_scene_to_packed( pack )in the new scene Node :
...
var playersToCreate: Array[String]
...
func add_player( activePlayer:bool , pName:String , pId:int
playersToCreate.append( str(int(activePlayer)) +","+ pName +","+ str(pId) )After the change_scene_to_packed, it executes again the var playersToCreate: Array[String] and resets the values, it may be a bug, but it prevents anyone to send any data to a new scene...
-
I am not sure I was clear, so, this is my point :
scene.add_player( isMe , playerName , nodeId ) ->>> this do nothing ... I need this to do something.
-
@altria Thanks for replying, I am just trying to send some info to the new scene. Unfurtunally change_scene_to_packed also reset anything the scene have so it also dont work, I also cant see a diference of using pack or not... It may be a bug but I dont know.
Anyway, the only way I could find to send info to a new scene so far ( not using singletons ... ), was to completly change the way the engine works and use a top allways active root node ( same way other node engines works ... ). -
I feel its an old problem of godot : https://github.com/godotengine/godot-proposals/issues/1513
I need to send information for a scene to indicate spawner locations , ammount , etc :
var p:PackedScene = load( "res://Scenes/scene.tscn" ) var scene = p.instantiate() scene.add_player( isMe , playerName , nodeId ) get_tree().change_scene_to_packed(p)
The func add_player is called, but when the scene loads it overwide any data in the scene and delete the information.
I saw everywhere, I mean, everybody using singletons to make this works, sorry, singleton is not a solution for me, is there a way to send information to the scene or this is just one more problem godot have and if I want to use it I need to use singletons ??? -
I didnt switch from Unit from Godot, I started directly with Godot a few months a go, the reasons I despise Unit are 2 :
- Dot.net dependence and not integrated code editor ( because of this dot.net ) : for me its a very very big limitation, and this is the one reason why I dont use c# in godot also.
- UnitHub BS : I tried a few times to use Unit, but I was unable to make it works in linux with out unithub, and unithub is a big no for me.
Adding to that, I tried Unreal as well, it works very very well, I had no problems setting it up, compiling etc, very good performance, but I guess I still prefere coding...
-
Unfurtunally godot dont have a good physic system for cars...
There is a guy that is building a new one using gdscript : https://www.youtube.com/watch?v=6hEL66P1WQw
In general, if you need very realistic physics, you will need to build something similar, and its quite complicated. -
Thanks for the reply. But I am not looking for a external server solution...
Thats insane that godot has nothing to provide in the network area, that itself explains why its not growing... -
Hi, I am looking for more complete examples for multiplayer integrations.
Before I ask, I tried the new godot4 ENetMultiplayerPeer solution, it really sucks, and dont work for me.
I found the solution of TCPServer + WebSocketPeer more relaible and interesting, but I could not find good examples, anyone have something to share about it ?
How to do simulation with many entities?
Set start parameter to PackedScene.
Set start parameter to PackedScene.
Set start parameter to PackedScene.
Set start parameter to PackedScene.
Set start parameter to PackedScene.
What are your reasons switching from Unity to Godot?
How can I add 3D Realistic Car physics in my game
Tips for multiplayer ?
Tips for multiplayer ?