Dismiss Notice
Wynncraft, the Minecraft MMORPG. Play it now on your Minecraft client at (IP): play.wynncraft.com. No mods required! Click here for more info...
Dismiss Notice
Have some great ideas for Wynncraft? Join the official CT (content team) and help us make quests, builds, cinematics and much more!

World Between-server Time Synchronization

Discussion in 'General Suggestions' started by Stefan Deleanu, Jan 10, 2018.

?

Should this idea be implemented?

  1. Yes. I think this idea is beneficial to the server

    50.0%
  2. No. I think this idea is not beneficial to the server

    50.0%
Thread Status:
Not open for further replies.
  1. Stefan Deleanu

    Stefan Deleanu Travelled Adventurer

    Messages:
    10
    Likes Received:
    8
    Trophy Points:
    10
    Minecraft:
    The time between the game servers is currently not synchronized, which leads to people switching servers in order to quickly get soul points back. Not only is this a way to abuse the system, but is also cosmetically unpleasing.
    This issue can simply be fixed by synchronizing servers on the restart. The way I thought of synchronizing the server should have a minimal impact on performance, as it is only issued when necessary.

    What I thought was actually using the actual in-real-life time to do it. This way, we get a very well synchronized server, with a variation that doesn't exceed a few in-game seconds.

    1. Using UMT (Universal Time) as a common ground between all servers
    We first need to find something that is already synchronized between the wynncraft servers. The simplest thing is the real-life time, which is already syncronized around millions of devices.

    The following is a java method that gives us the current time and date in milliseconds.
    Code:
    System.currentTimeMillis()

    2. Transform the real-life time to Minecraft time.
    The first thing we need to do is to examine how the time works in Minecraft. The following observations were simply done by using /time set:
    • The start of the day is at 0
    • The end of the day is at 24000.
    According to the Minecraft wiki, a Minecraft day takes 20 minutes, which means 1200 seconds. Dividing 24000 to 1200 equals 20. This many ticks pass in a second. This means that a tick passes every 50 milliseconds.

    This means that in order to get the Minecraft time synchronized, we need to get the remainder when dividing by 1200000 (1 minecraft day in milliseconds). It will loop back each time a day completes. Now we simply divide it by 50 and so we get the exact tick we need to set time to.

    3. Implementation
    Implementing it is quite simple and efficient. Simply set the time to this value every time you restart the server, and optionally every 10 minutes.

    This is the code that I used to test my algorithm:
    Code:
    package me.stefandeleanu.time;
    import org.bukkit.Bukkit;
    import org.bukkit.command.Command;
    import org.bukkit.command.CommandSender;
    import org.bukkit.entity.Player;
    import org.bukkit.plugin.java.JavaPlugin;
    
    public final class main extends JavaPlugin {
        @Override
        public void onEnable() {
            System.out.println("Syncronising Time!");
            long timemc = System.currentTimeMillis()%1200000/50;
            Bukkit.getWorlds().get(0).setTime(timemc);
        
        }
     
        @Override
        public void onDisable() {
        }
     
        @Override
        public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
            if (cmd.getName().equalsIgnoreCase("timesync")) {
                long timemc = System.currentTimeMillis()%1200000/50;
                Bukkit.getWorlds().get(0).setTime(timemc);
                sender.sendMessage("Servers were properly syncronised. " + String.valueOf(timemc));
            
                return true;
            }
            return false;
        }
    }
    

    4.Video
    What better way to prove the idea than to show it in action?



    5.FAQ

    No, it won't. The code i just posted is a very simple code that does simple math that even you can do. It will only run on restart, or once 5 minutes, wich is not going to lag the server. You can compare the performance drop to 2 more mobs (not bosses) added in the game. Allmost 0 performance inpact.
    Definetly not. The server will only syncronise the time when the server starts. It will keep syncronised with the game time from then on. It could also be made so the command is ran every 10 minutes or so, wich would be even better.
    The only case quests would bug out is in case there are quests that change the time of the day globally (you can also change it per player, by sending a fake packet to the player telling him the time is different. If there is a quest that changes that, this is the way it probabbly does it, in order not to disturb other players). If there was that kind of a quest, you would probabbly see the server changing time every 5 minutes or so, wich is not true.
    What we do here is use a very simple math problem to transform the real-life GMT (Greenwich time) into minecraft time. Because GMT is shared between all servers, it means the minecraft time will also be shared.
    I have worked at several minecraft servers, helping with system administration and optimisation. I still work at a 2000 player server, where i still improve on my knowledge
     
    Last edited: Jan 11, 2018
  2. captainganon

    captainganon God of k | Derpalope VIP+

    Messages:
    11,320
    Likes Received:
    33,309
    Trophy Points:
    229
    Minecraft:
    If you're willing to spend 20 minutes going back and forth between servers instead of just waiting then that's really not a big issue. There's not much of a point in forcing players to stop playing because of a lack of SP, so if people want to grind soul points then that's not much of a problem.
     
  3. Stefan Deleanu

    Stefan Deleanu Travelled Adventurer

    Messages:
    10
    Likes Received:
    8
    Trophy Points:
    10
    Minecraft:
    Yes, you're right, but it's still unintended and also cosmetically unpleasing.
     
    coolname2034 likes this.
  4. captainganon

    captainganon God of k | Derpalope VIP+

    Messages:
    11,320
    Likes Received:
    33,309
    Trophy Points:
    229
    Minecraft:
    it's literally impossible to see more than one sky at a time how could this ever be cosmetically unpleasing, unless you yourself are constantly switching between worlds for some reason hmm
     
    Gogeta likes this.
  5. (Meric)

    (Meric) No longer edgy

    Messages:
    3,194
    Likes Received:
    2,753
    Trophy Points:
    149
    Guild:
    Minecraft:
    Its a simple thing that makes all the worlds time the same
    I mean its useless but nice
     
    dargonlrod and coolname2034 like this.
  6. captainganon

    captainganon God of k | Derpalope VIP+

    Messages:
    11,320
    Likes Received:
    33,309
    Trophy Points:
    229
    Minecraft:
    i mean i don't really have any issues with the actual idea, just sort of the reasoning

    maybe it's just my mindset that not all glitches need to be fixed, especially ones that aren't game-breaking or create negative experiences

    like what would mario 64 be without glitches
     
    coolname2034 and Dr Zed like this.
  7. (Meric)

    (Meric) No longer edgy

    Messages:
    3,194
    Likes Received:
    2,753
    Trophy Points:
    149
    Guild:
    Minecraft:
    Something that no longer appears on AGDQ
    I mean the fix seems pretty simple though,
    Its not a really hard thing to fix considering Jpresent is here who's jesus
     
    coolname2034 and Dr Zed like this.
  8. OGK

    OGK The Grader CHAMPION

    Messages:
    1,115
    Likes Received:
    716
    Trophy Points:
    117
    Minecraft:
    I have one problem/question

    If the worlds are linked in time, wouldn't they also be linked in Restarts? If so, that would be annoying and generally unpleasing as restarts take awhile to do. And if that happens, the lobbies would lag (due to the amount of players and what is going on) and I am sure there isn't enough room in those lobbies.
     
  9. Stefan Deleanu

    Stefan Deleanu Travelled Adventurer

    Messages:
    10
    Likes Received:
    8
    Trophy Points:
    10
    Minecraft:
    No, this doesn't affect when the servers restart

    This is simply using the global time (greenwich time) which is common for everybody in order to set the day every restart. This
     
  10. OGK

    OGK The Grader CHAMPION

    Messages:
    1,115
    Likes Received:
    716
    Trophy Points:
    117
    Minecraft:
    This seems a bit unnecessary though. Yes it is more appealing, however it doesn't seem really worth it. I'll give it a .5 Support I guess though. Also nice with adding the coding.
     
  11. Stefan Deleanu

    Stefan Deleanu Travelled Adventurer

    Messages:
    10
    Likes Received:
    8
    Trophy Points:
    10
    Minecraft:
    It fixes a small bug and also looks better, without being overly complicated or hard. It's simply translating real-life time in minecraft time via a simple equation.
     
  12. OGK

    OGK The Grader CHAMPION

    Messages:
    1,115
    Likes Received:
    716
    Trophy Points:
    117
    Minecraft:
    I... don't think this is a bug at all... Plus to a non-coder... this is a bit of work. But meh.
     
  13. Stefan Deleanu

    Stefan Deleanu Travelled Adventurer

    Messages:
    10
    Likes Received:
    8
    Trophy Points:
    10
    Minecraft:
    Not really. This is a very simple plugin in the developer community.

    A small plugin has over 300 lines, and a minigame has over 3000.
    Wynncraft could even be >20000 lines long.
     
  14. DiamondWarrior59

    DiamondWarrior59 Tryhard Shopkeeper

    Messages:
    301
    Likes Received:
    75
    Trophy Points:
    60
    Minecraft:
    Maybe add a poll? It’s usually a somewhat better gage of how good your suggestion is then the like number.
     
  15. ElegantDeath

    ElegantDeath Who needs a title anyways HERO

    Messages:
    2,219
    Likes Received:
    2,853
    Trophy Points:
    186
    Guild:
    Minecraft:
    if I recall correctly, there are some quests (could've been revamped) that require it to be a certain time of day for you to go somewhere, so this could screw some players over due to scheduling constraints
     
  16. yellowscreen

    yellowscreen Certified Lurker

    Messages:
    2,512
    Likes Received:
    3,602
    Trophy Points:
    209
    Minecraft:
    Hey, you should add a poll to the thread, to see if people want this. You can do this very quickly and easily. In my opinion, this doesn’t cause any problems, and will make obtaining soulpoints easier. If only there was a way i could show it easily....
    Edit: wait this is your first suggestion? HOWIS IT SO DETAILED? Well this is rare
     
  17. aws404

    aws404 Wynn CMD VIP+

    Messages:
    296
    Likes Received:
    621
    Trophy Points:
    91
    Minecraft:
    Its a small things and I think ot would be nice. I'm just not sure whether its worth the extra restart / startup time for servers.
     
  18. Casparof

    Casparof mythic counter: 2 HERO

    Messages:
    1,257
    Likes Received:
    402
    Trophy Points:
    69
    Minecraft:
    you need day/night time for some quest
    if all workds got the same time player have tonwait and if you only have 5 min
    you fucked lel

    so bad idea sorryidk why you want thia
     
  19. Stefan Deleanu

    Stefan Deleanu Travelled Adventurer

    Messages:
    10
    Likes Received:
    8
    Trophy Points:
    10
    Minecraft:
    Yes, but still. This is the idea of the time quests, to be finished fast. Even if it is easier to play by changing the servers, i don't think it is intended.
     
  20. The_Pl4nte

    The_Pl4nte Travelled Adventurer

    Messages:
    56
    Likes Received:
    19
    Trophy Points:
    13
    I think it isn't a good idea.
    I don't care of what time is it in the other worlds it's useless and it will make wynncraft more laggy for the europeans
     
Thread Status:
Not open for further replies.