Minigame arena instances

Discussion in 'Plugin Development' started by adam753, Sep 18, 2014.

Thread Status:
Not open for further replies.
  1. Offline

    adam753

    I'm making a private plugin for a minigame server. The game takes place in a preset arena which is copied from a template. Since there can be a lot of matches running at once, I can't just have one arena in a set location, I would need a scalable way of creating arenas on the fly.

    The problem I have is that I can't imagine a way of creating an arena that wouldn't hang the server for several seconds. The main problem is loading potentially-new chunks - when a player teleports to an entirely new area, it will generate over 400 new chunks, which takes a long time. I could put in a warning for the server owner that they should pre-load the world, but this still isn't infinitely scalable and also requires extra effort from the user, which isn't my style. I've tried use schedulers to load the arena and surrounding chunks in parts, but with a big arena this can take upwards of 60 seconds.

    Is there some way of loading empty chunks and skipping the chunk generation part which creates so much lag? Or is there any other way of doing this?
     
  2. Offline

    blablubbabc

    You can provide a custom chunk generator which creates empty chunks. Though that doesn't change the fact that copying large arenas is a heavy task, even more if you do this multiple times and on the fly while the server is used by players.

    So personally I would provide the admin the tools to easily copy an arena to a certain location. That way he can easily set up the amount of arenas he needs to handle his amount of players, once. Afterwards your plugins doesn't need to create and remove those arenas on the fly but just use what the admin has setup.
     
  3. Offline

    adam753

    blablubbabc
    Actually, copying a lot of blocks seems doable compared to the time taken by chunk generation. If I were to make a generator that does nothing, would it cut out that time? And if so, how do I do it?
     
  4. Offline

    AronTheGamer

    Making a Chunk Generator that generates the arenas would save some time.

    IMO you should just use MCEdit, create 20 arenas and just keep it on that. I cant imagina a single server would need many more if the arenas are that big
     
  5. Offline

    xTrollxDudex

    Hard way (not recommended): Async chunk loading
    Easy way: spread out chunk loading
     
Thread Status:
Not open for further replies.

Share This Page