Per World Arenas

Discussion in 'Plugin Development' started by ResultStatic, Feb 8, 2015.

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

    ResultStatic

    so it was recommended to me that i upgrade my arena system in my plugin to a system that uses a world for each arena. currently each arena is copy and pasted like 20 times and each of the arena settings are set in a file which is super tedious and inefficient. the way i think would be the most efficient would be to have a world folder for each arena then i could keep loading new instances of the world from the same world folder and inject it into the worlds list for each arena i needed. i would have to make sure that no blocks are changed or saved since it throws the multiple access error. any suggestions on what i should do? its for a very big project and i need a good solution. i could basically override all chunk saving methods since it doesnt need to save at all on the real server
     
    Last edited: Feb 8, 2015
  2. Offline

    Zombie_Striker

    First, you are unclear as to what you currently have and what you want. Having multiple worlds would not be efficient and instead would use up more memory. Try one world for arenas and just have space between them and just call those regions instead of different worlds(e.g. Arena1 goes from x.0 z.0 to x.50 z.50 and Arena2 from x.100 z.100 to x.150 z.150).
     
  3. Offline

    ResultStatic

    @Zombie_Striker thats how its currently coded but i dont think it would use more memory since the world is unloaded when its not needed anymore.
     
  4. Offline

    Zombie_Striker

    So your plugin would load and then unload the worlds? Reloading worlds takes up a lot of memory and will create lag spikes. If the world is large enough or if your players have a bad connection, it could make them time-out. Stick to how you currently have it and work off of that.

    Do you mind showing me what you currently have?
     
  5. Offline

    ResultStatic

    @Zombie_Striker no this is a private plugin. and there is tons of classes where arenas are handled.
     
  6. Offline

    Konato_K

    @Zombie_Striker This depends on how the single-world arenas are handled, if you paste new arenas every time you need a new one you will cause more lag than just loading a world, however, it's truth that using worlds use more memory.
     
  7. Offline

    ResultStatic

    @Konato_K there is 20 or so pre pasted arenas.
     
  8. Offline

    Zombie_Striker

    @Konato_K Creating a new arena each time does create more lag then adding a new world, but if he has multiple pre-made arenas put into one world and just make sure that no blocks change, then it would be more efficient to use one world.
     
  9. Offline

    Konato_K

    @Zombie_Striker Ah, I was thinking on pasting arenas all the time, in the case they are all premade then it's way better to use a single world.
     
  10. Offline

    UaVxChallenge

    You could always just use BlockSending and have one arena and every arena that isn't the same just make everyone invisible and send them the blocks that were there originally there. A lot harder to code and more tedious to work but once you get it working it will reduce lag like 300%. Since there is only one arena.Plus all the blocks only show up client side and not server side which will save server space. This also depends on the mini game I don't have any idea on what you are using it for.
     
  11. Offline

    ResultStatic

    @UaVxChallenge no that isnt possible because we have abilities that spawn mobs, particles, blocks etc, that people use in the arena.
     
Thread Status:
Not open for further replies.

Share This Page