Coder Social home page Coder Social logo

Comments (16)

Major- avatar Major- commented on May 27, 2024

Also mods/admins.

from apollo.

lare96 avatar lare96 commented on May 27, 2024

Question about this, it seems to be using gathering the Players from the entire World rather than in the immediate region? Is this intentional?

    for (Player other : player.getWorld().getPlayerRepository()) {

(in PlayerSynchronizationTask, same thing applies to NpcSynchronizationTask)

from apollo.

Major- avatar Major- commented on May 27, 2024

Intentional in the sense that apollo has always done it like this, before the region system existed. Now it is present it leaves room for that optimisation.

from apollo.

lare96 avatar lare96 commented on May 27, 2024

I wasn't sure whether a PriorityQueue or a SortedSet would be faster so I made a benchmark (loosely) simulating their usages and ran it 5 times to see if results would be consistent

Warming up...
Completed warmup.

Took the PriorityQueue 12435ms for 2_000_000 iterations.
Took the SortedSet 11894ms for 2_000_000 iterations.

Took the PriorityQueue 13304ms for 2_000_000 iterations.
Took the SortedSet 12773ms for 2_000_000 iterations.

Took the PriorityQueue 13394ms for 2_000_000 iterations.
Took the SortedSet 12809ms for 2_000_000 iterations.

Took the PriorityQueue 14255ms for 2_000_000 iterations.
Took the SortedSet 13235ms for 2_000_000 iterations.

Took the PriorityQueue 15055ms for 2_000_000 iterations.
Took the SortedSet 13825ms for 2_000_000 iterations.

Not sure if I did the benchmark correctly or not, but the PriorityQueue seems to consistently take longer than the SortedSet, so I guess the set would be the best collection to use

from apollo.

Major- avatar Major- commented on May 27, 2024

I want to implement this, but first I want to change the player updating implementation to iterate over all players in nearby regions instead of all of the players. This is obviously going to be a performance cost, so limiting it to the players in view first is probably desirable.

from apollo.

lare96 avatar lare96 commented on May 27, 2024

@Major- you planning on doing this? cause I was gonna start tonight

from apollo.

Major- avatar Major- commented on May 27, 2024

first I want to change the player updating implementation to iterate over all players in nearby regions instead of all of the players.

from apollo.

lare96 avatar lare96 commented on May 27, 2024

Will have a framework of this done in a min, want to see what you think

from apollo.

rmcmk avatar rmcmk commented on May 27, 2024

Progress?

Ping @garyttierney @Major- @lare96

from apollo.

garyttierney avatar garyttierney commented on May 27, 2024

@ryleykimmel hadn't done any more than a PoC. Will push a branch on my fork.

from apollo.

lare96 avatar lare96 commented on May 27, 2024

@ryleykimmel I never had a chance to test mine, and it was kinda messy iirc

from apollo.

Major- avatar Major- commented on May 27, 2024

Right now I don't want this in master as it's basically unnecessary and also (see my comment above)

from apollo.

garyttierney avatar garyttierney commented on May 27, 2024

@Major-

My code only checks neighboring regions for players while prioritizing which ones are updated. However, unsure of the implementation details of how players should be prioritized.

from apollo.

Major- avatar Major- commented on May 27, 2024
  • Entities you're fighting
  • Entities you're interacting with
  • Admins
  • Mods
  • Friends
  • Everyone else, by distance (not sure if this one is too performance-heavy, or if we care enough)

from apollo.

rmcmk avatar rmcmk commented on May 27, 2024

This can probably be worked on now as region updating has been completed.

from apollo.

Major- avatar Major- commented on May 27, 2024

Someone is welcome to work on this if they really want to, but there are definitely more important things to work on (sort by high priority to see what). I'd also like comprehensive before/after benchmarks for this, because apollo's updating performance is top-notch and I don't want it to take too much of a hit.

from apollo.

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.