{"id":23363998,"url":"https://github.com/decipher2k/clientside-predictor-for-godot","last_synced_at":"2025-04-07T22:21:22.848Z","repository":{"id":169962197,"uuid":"442363876","full_name":"decipher2k/Clientside-Predictor-for-Godot","owner":"decipher2k","description":"Character synchronization using clientside prediction for Godot 3D network games.","archived":false,"fork":false,"pushed_at":"2023-01-26T03:05:54.000Z","size":70,"stargazers_count":11,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-13T23:39:46.335Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"GDScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/decipher2k.png","metadata":{"files":{"readme":"README.txt","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-12-28T05:54:38.000Z","updated_at":"2023-11-19T19:39:40.000Z","dependencies_parsed_at":null,"dependency_job_id":"1f602a9d-d89e-4400-bb17-398314659dc7","html_url":"https://github.com/decipher2k/Clientside-Predictor-for-Godot","commit_stats":null,"previous_names":["decipher2k/clientside-predictor-for-godot"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/decipher2k%2FClientside-Predictor-for-Godot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/decipher2k%2FClientside-Predictor-for-Godot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/decipher2k%2FClientside-Predictor-for-Godot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/decipher2k%2FClientside-Predictor-for-Godot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/decipher2k","download_url":"https://codeload.github.com/decipher2k/Clientside-Predictor-for-Godot/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247737787,"owners_count":20987735,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-21T13:12:50.206Z","updated_at":"2025-04-07T22:21:22.831Z","avatar_url":"https://github.com/decipher2k.png","language":"GDScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"Clientside Predictor\nCharacter synchronization using clientside prediction for Godot 3D network games.\n\nThis asset allows you to implement clientside prediction with just a few lines of code per entity.\n\nDo youn need an 3D artist or a gamedev? In that case, please send a mail to dennis.heine@gmx.de\n\n\n=================================\n\n\nUsage (all functions have to be called from the server):\nplayerId has to be the string representation of the unique network id.\n\n\tvar target:Vector3=Vector3(100.0,0.0,100.0)\n\tvar lockRotation:Vector3=Vector3(0.0,1.0,1.0)\n\tget_parent().find_node(\"DummySpawner\",true,false).remote_spawn_dummy(0.4,str(playerId),Vector3(0,0,0),Quat(0.0,0.0,0.0,0.0),\"\",\"DummyCollection\",lockRotation)\t\n\tget_parent().get_root().get_node(\"ClientsidePredictionSpawner\").initBegin(\"Player\",\"DummyCollection\", 30.0,target,\"Camera\",5.0,false,false)\n\tget_parent().find_node(\"ClientsidePrediction\",true,false).initBegin(\"Player\",\"DummyCollection\", 30.0,target,\"Camera\",5.0,false,false)\n\t\nEach entity (for example each player entity, each bullet entity etc - not their instances!) has to have its own ClientsidePrediction node (you will have to rename it in order to use more than one entity.)\nTo modify the avatar the user sees, the corresponding node should be attached to the node called \"Dummy\".\nThat node should be positioned outside the walkable terrain, as it could cause unwanted collissions.\n\n===================================\n\nDummy states to implement into state machine: (!!! Untested !!! Please write GitHub issue in case of failure)\nThese have to be called from the client. Only states of nodes with client's ID can be changed, and the\nstates will be replicated over the network.\n\nvar dummyNode:ClientsidePredictionDummy=get_tree().find_node(\"DummyCollection\").get_node(nodeID)\n\nPlay sound: \tdummyNode.play_sound(\"res://sound.ogg\", nodeID, \"DummyCollection\", \"\u003cSoundNodeName\u003e\")\nPlay animation:\tdummyNode.playAnimation(nodeID, \"\u003cAnimationPlayerName\u003e\",\"SomeCoolAnimation\", animationNodeId,true):\t\nSet mesh:\tdummyNode.set_mesh(var \"res://mesh\",nodeID, \"DummyCollection\", \"\u003cMeshNodeName\u003e\"):\nSet speed_\tdummyNode.set_speed(0.4, nodeID, \"DummyCollection\"):\n\n\n=================================\n\nNode Structure:\n\n===Client===\n-root\n--\"Player\" (type: KinematicBody) - has to have the player controller script attached\n  (name can be changed for more entities)\n--\"ClientsidePrediction\" (type: Spatial) ClientsidePrediction.gd\n  (name can be changed for more entities)\n----\"DummyFunctions\" (type: Spatial) \n     (feature not yet implemented)\n----\"\"DummyCollection\" (type: Spatial)\n------\"Dummy\" (type: KinematicBody) ClientsidePredictionDummy.gd\n--------\"MeshInstance\" (type: MeshInstance)\n--------\"CollissionShape\" (type: CollissionShape)\n\n===Server===\n-root\n--\"Player\" (type: KinematicBody)\n  (name can be changed for more entities)\n--\"DummySpawner\" (type: Spatial) DummySpawner.gd\n--\"ClientsidePredictionSpawner\" (Type: Spatial) ClientsidePredictionSpawner.gd\n--\"ClientsidePrediction\" (type: Spatial) ClientsidePrediction.gd\n   (name can be changed for more entities)\n----\"DummyFunctions\" (type: Spatial) \n     (feature not yet implemented)\n----\"DummyCollection\" (type: Spatial) \n    (name can be changed for more entities)\n------\"Dummy\" (type: KinematicBody) ClientsidePredictionDummy.gd\n--------\"MeshInstance\" (type: MeshInstance)\n--------\"CollissionShape\" (type: CollissionShape)\n\n\n=================================\n\nUpdate:\nv0.2: -Seperated client scene from server scene.\n       The server scene now has got to have a DummySpawner.gd node attached.   \n      -Added demo scenes. (You will have to add an own connection handling part, which calls the DummySpawner, though.\n      \t\t\t\tThe player controller for the \"Player\" node also has to be implemented, it is not included.)\nv0.2.1 -added some sanity checks\nv0.2.2 -parametrized ClientsidePrediction.tscn name in DummySpawner \nv0.3   -moved spawning of ClientsidePrediction.gd to server, making it being called by ClientsidePredictionSpawner\nv0.5   -addes states\nv0.5   -added more sanity checks\nv0.6   -added demo scenes\nv0.6.1 -removed buffer overflow in animations\n\n=================================\n\n#==== DummySpawner.gd====\n#\tNote: \tThis script should be attached to a seperate node on the server only.\n#----func remote_spawn_dummy(var idNode:String, var pos:Vector3, var rota:Quat,var _AnimationTreeName,  var _collectionName):----\n#\tidNode: Unique ID of the character instance per player\n#\tpos:\t\t\t\tStart position\n#\trota:\t\t\t\tStart rotation\n#\t_AnimationTreeName:\tName of the AnimationTree (can be \"\" when not using Animation Trees\n#\t_collectionName:\tName of the node with the ClientsidePrediction.tscn\n\t\n\n\n#==== ClientsidePrediction.gd====\n(Attached to the main node of the clientside prediction, most likely labled ClientsidePrediction)\n#\tNote: \tThis script should be attached to the _collectionNode.\n#\n#\t\t\tThe dummy node has got to have the script ClientsidePredictionDummy.gd attached,\n#\t\t\tand it has to be a child node of the _collectionNode.\n#\t\t\tTo spawn an instance of a character, call the dummy node's spawn_dummy function from the server\n#\t\t\tThe rotational node should be the node from which to get the rotation, for example the Camera node\t\t\n#\t\n#----func initBegin(var _speed:float, var _characterNode, var _collectionNode,  var _tickrate, _targetPosition, var _rotator, var _clamping,_useKeyFrames,_useTarget):\n#\t_speed: \t\tspeed of interpolation\n#\t_characterNode: node that should be interpolated\n#\t_collectionNode:node to that holds the character list\n#\t_tickrate: \t\trate at that the position is being updated (milliseconds)\n#\t_target: \t\ttarget position when using direct position instead of character sync\n#\t_rotation:\t\ttarget rotation when using direct position instead of character sync\n#\t_clamping:\t\tdistance from extrapolated position to current position at which to snap\n#\t_useKeyFrames:\t\tshould root motion be applied when animating?\n#\t_useTarget:\t\tuse fixed target instead of character synchronization\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdecipher2k%2Fclientside-predictor-for-godot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdecipher2k%2Fclientside-predictor-for-godot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdecipher2k%2Fclientside-predictor-for-godot/lists"}