Code Monkey home page Code Monkey logo

Comments (5)

DeckerMMIV avatar DeckerMMIV commented on July 26, 2024

Line 247? - Well, it is the for-loop which iterates through the number of "wheels touching ground", so when there are many wheels on active vehicles/equipment, there is a lot of network-events being sent from server to clients.

Try this - Comment out the lines 74 & 101:

74:    -- and self.isServer             -- Only on server
101:   --    g_server:broadcastEvent(WheelLanesEvent:new(cuttingAreasSend));
       ^^ 

Doing that will cause the script to not send any network-events from the server to clients.

Instead it will cause all clients (and the server) to locally calculate the 'wheels areas of destruction', but only if the wheel(s) hasGroundContact - which in FS2013 is a server-only variable, so it might not work correctly on clients.


Thinking out loud...

Another possibility could be to have the server not send the 'wheels areas', but instead just the vehicle-id and then let the clients locally calculate the 'wheels areas' (disregarding if they have ground contact or not.) - This would reduce the size of the network-event packages being sent, but still not the iterations required in the WheelLanesEvent.destroyFoliageLayers() method.

Even yet another method could be to 'even out' the required number of calls to setDensity...() over several rendering-frames, instead of just one. But this will probably be impossible to keep in sync.

Or figure out if there is a possibility to reduce the number of calls to GIANTS' game-engine's setDensity...() API methods, because of the mod's requirement of not destroying the grass fruit-type and the specialty with potato & sugarBeet.

from farmsim_mod_wheellanes.

Dzi4d3k avatar Dzi4d3k commented on July 26, 2024

Unfortunately commenting out line 74 & 101 indeed caused lack of wheel destroying effects on client side.
Other suggestions are out of my coding abilities, which are just basic.

from farmsim_mod_wheellanes.

DeckerMMIV avatar DeckerMMIV commented on July 26, 2024

@Dzi4d3k - Would it be possible for you to test my recent v0.8.0-BETA changes in multiplayer?

from farmsim_mod_wheellanes.

Dzi4d3k avatar Dzi4d3k commented on July 26, 2024

@DeckerMMIV
Of course, with pleasure. We will test it and I'll back with results.

from farmsim_mod_wheellanes.

Dzi4d3k avatar Dzi4d3k commented on July 26, 2024

Its been a while since last update, with quick thought I can say that there is a lot improve in performance. However because of summer time we didn't manage yet to do "massive lag test" what we calling to 5-6 people cutting, tedding, baling grass on one filed. On previous version it was a nightmare with 10-15 FPS.
I'll get back if I have update in mean time I have possibly another issue #2.

from farmsim_mod_wheellanes.

Related Issues (8)

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.