This is an Elvarg issue in the networking, I can't remember the fix.
|
So I've noticed quite strange behaviour on my fork of Elvarg 3.2 (Economy version)
(Not sure if its elvarg or TCP specific). I've pretty limited networking knowledge so I thought i'd post here and see if any of you guys had came across this before or know how to prevent it
So basically, if I leave my PC in sleep/locked or leave the window minimized for a long period of time, and then reopen it, it seems like all of the processing from the time the game screen was closed happens in a "catch up" fashion. I.e. npcs/player movements seem to fly around to catch up to the current state.
I guess if someone knows what this is or why its happening, how do we stop it (and force a Loading, please wait... message instead). Really appreciate any help or advice and will give credits on the project for your contribution
The source code (in case you need to see it or want to reproduce the issue) is here: GitHub - RSPSApp/elvarg-rsps
TIA - Tobias
2fa74ee41d48a54fcc426df1a033eeb4.gif
This is an Elvarg issue in the networking, I can't remember the fix.
it's because Elvarg uses ScheduledExecutorService and the way it works is it will call ALL the runnable from when it slept to when it woke back up, while(true) { Thread.sleep(600); } won't
^ What Spooky said. I'd recommend converting it to run on a traditional game engine thread instead of a scheduled executor.
Thanks for that - is that the reccommended way to process the game loop or is there a more common, sophisticated way of doing it?
Thanks for the reply Oak! We've been working on your base for a little over a year now, I think we're making pretty good progress with combat, pathing and general stability. If you had/have any ideas for where you wanted Elvarg to go please do let me know so I can keep with the general direction. Aim is to keep this thing open source and make an extremely good base for 317.
Will raise an issue re. the scheduled executor now
Does this mean that Runite bases also have this issue because. The game thread of Runite "ProcessWorker.java" also uses a ScheduledExecutorService.
Does this mean that Runite bases also have this issue because. The game thread of Runite "ProcessWorker.java" also uses a ScheduledExecutorService.
Code:public static final ProcessWorker worker = newWorker("server-worker", 600L, Thread.NORM_PRIORITY + 1);
PS I can't edit my post, however Runite and my base of Elvarg use "scheduleAtFixedRate" I believe that fixes the issue OP has?
@kippie, I can't seem to quote your post for some reason - but our fork of Elvarg also uses sheduleAtFixedRate so this is not the fix unfortunately.
executorService.scheduleAtFixedRate(this, 0, GameConstants.GAME_ENGINE_PROCESSING_CYCLE_RATE,
TimeUnit.MILLISECONDS);
I don't think that is the issue, I looked into many bases which do not have this issue at all. They all use ScheduledExecutorService as game thread.
I can't remember the fix, I hired someone to redo the elvarg network. Which fixed this issue along with many others.
Of I find it I'll update this post.
« Previous Thread | Next Thread » |
Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |