Giter Club home page Giter Club logo

Comments (9)

yythlj avatar yythlj commented on May 27, 2024 1

if this game engine never test with a multiplayer mode or multi room mode.

When you offer multiple rooms for players to use, you generally run multiple Godot processes, each hosting their own server. Hosting multiple rooms in the same process makes parallel resource usage harder (if not impossible), so it's not recommended.

Container orchestration solutions like Kubernetes can be handy for this at a large scale (though at a smaller scale, they can be overkill).

Thank you for your help! The method is effective. After testing, splitting each world3d into an independent process can effectively improve the FPS. However, the memory consumption has also increased significantly.

Based on the tests, with the multi-process approach, seven rooms already used up 88% of my memory (32G). While in the single-process multi-room scenario, with 20-50 rooms, the memory usage did not see a significant increase and was maintained around 20% of (32G). Is there a compromise approach?

from godot.

Calinou avatar Calinou commented on May 27, 2024

if this game engine never test with a multiplayer mode or multi room mode.

When you offer multiple rooms for players to use, you generally run multiple Godot processes, each hosting their own server. Hosting multiple rooms in the same process makes parallel resource usage harder (if not impossible), so it's not recommended.

Container orchestration solutions like Kubernetes can be handy for this at a large scale (though at a smaller scale, they can be overkill).

from godot.

yythlj avatar yythlj commented on May 27, 2024

The purpose of sharing different world3d processes is to ensure that the server can unify monitor the progress of different rooms. While they are completely independent world3d, so there is no need to share or compete for content. I think the best way is that Godot provides a parameter that allows me to set the interval at which different windows trigger the process and physicsprocess, and they do not need to compete for high efficiency running with each other.

from godot.

yythlj avatar yythlj commented on May 27, 2024

I'm still unable to resolve the second issue mentioned - when the character moves and collides with walls, with 10 rooms and 10 characters in each room for a total of 100 characters, as long as there are continuous collisions with walls, the fps will remain below 10. However, if I remove the call to move_and_slide, the fps returns to normal (only leaving the animations and attack detection etc).

I think the performance issue in 3d is definitely caused by severe bugs in the move_and_slide method.

At least collisions should be cached and not repeatedly calculated when a character moves to an area that has already been passed through before to avoid duplicate collisions.

Especially in some irregular scenes, like terrains created by the heterrain plugin, it would be more severe. Entering corners of walls alone would cause fps to drop below 10 (recovering if move_and_slide is not called).

this test with godot4.3.dev6

@Calinou

from godot.

yythlj avatar yythlj commented on May 27, 2024

https://github.com/Gamepro5/Custom_CharacterBody3D_Movement_System
This approach seems to improve performance

from godot.

Zireael07 avatar Zireael07 commented on May 27, 2024

@yythlj Are the colliders made of cubes or are they more complex? How did you create them?

from godot.

yythlj avatar yythlj commented on May 27, 2024

@Zireael07
@Calinou
no they just is the normal box shape and run on the headless mode.

I sincerely apologize, this was my mistake. I ran 10 rooms with 10 players each in a same process and use different world3d.

When I changed it to run each room in its own process, with 20 processes total, the FPS increased to 60. The only downside is the memory usage increased.

However, this does greatly bother me, because there are many scenes that contain static objects that never change (such as platforms, floors, etc.). But due to needing to run in multiple processes, the memory consumption is quite large.
Having static objects like floors and platforms duplicated across each process does waste memory, since they never change or need to be simulated independently.

In networked multiplayer games, it is very common for the Godot server to need to run multiple identical instances of the same scene, as is the case here.

thanks

from godot.

yythlj avatar yythlj commented on May 27, 2024

the answer is never create multi window on the server, use different process instead

from godot.

yythlj avatar yythlj commented on May 27, 2024

um...memory use too much.the 20 process only start up 5
(32G windows)

if in the same process,the memory just a llite when 10 room

from godot.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.