Comments (16)
Also mods/admins.
from apollo.
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.
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.
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.
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.
@Major- you planning on doing this? cause I was gonna start tonight
from apollo.
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.
Will have a framework of this done in a min, want to see what you think
from apollo.
Progress?
Ping @garyttierney @Major- @lare96
from apollo.
@ryleykimmel hadn't done any more than a PoC. Will push a branch on my fork.
from apollo.
@ryleykimmel I never had a chance to test mine, and it was kinda messy iirc
from apollo.
Right now I don't want this in master as it's basically unnecessary and also (see my comment above)
from apollo.
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.
- 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.
This can probably be worked on now as region updating has been completed.
from apollo.
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)
- Port the Ruby Herblore plugin to Kotlin HOT 3
- Improve lookup algorithm in areas plugin HOT 2
- Expand the "Introduction to apollo plugins" documentation
- Improve plugin documentation HOT 2
- Investigate if runtime plugin reloading during development is feasible
- Plugin API ergonomics HOT 8
- Door plugin lacks support for gates, curtains, etc HOT 4
- Command to get another player's position HOT 2
- Command to teleport to another player
- Add magic plugin for kotlin HOT 2
- Add support for providing configuration to player persistence implementations HOT 1
- Fix message releasing (netty 4) HOT 7
- Update from Java 8 to Java 11
- Slack link not working HOT 1
- Update README.md file HOT 3
- [Tracking] OSRS support HOT 2
- Support loading and analyzing existing gamepacks HOT 2
- Redundant abstract modifier in SynchronizationBlock HOT 1
- Get bytes when no transformation reads bytes reversed
- TODO comments
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from apollo.