Dev Needed Large Req (IslandCraft)

Discussion in 'Archived: Plugin Requests' started by mikeyagoto, May 23, 2012.

  1. Offline

    gamerguy14

    If you want I can make a new type of chunk generator that generates entire islands at one time instead of one chunk at a time. So it would send a space of 8x8 chunks in which all 64 can be setup then it would save the chunks and generate them when told to.
     
  2. Offline

    mikeyagoto

    Defiantly 128, and random if you can :) i want them to look as natural as possible. Yes grid is what i was thinking at first!
    Ohh thats ok! thank you for all of your help!

    well sounds good, lol I dont understand most of what you guys are saying but im trying to keep up!

    Thanks all of you!

    Mikey
     
  3. Offline

    TeNNoX

    Hey man this sounds awesome! :D

    I would love to help and island can maybe move if players go sleeping or if nobody's on the server... other way: the move if nobody's on the island... like randomly...
    moving is not the problem.. i think problem is that players could be moved into walls or so.. but then just also move the players... it's definitely possible :D
     
  4. Offline

    j_selby

    gamerguy14
    I have already created a chunk generator that can generate islands as big as you want, and mine also does things on demand.
    Would you be able to work on the land protection component please?
    Moving the island may be a fesible idea as when I currently generate a island there is little to no lag, and moving it won't be that hard. (hopefully)
     
  5. Offline

    gamerguy14

    I will do the protection component. I will start it soon. Do you only want to do world generation, or do you want to do other stuff? Either is fine for me. Moving islands will be a little more intensive than generation. How do you think the moving should be done? I would load the island into a buffer and the replacement into a buffer and then load the buffer over. Then recursively move islands so that one is out of the way before the replacement is loaded. This will prevent people from being without an island temporarily and will allow islands to be moved without people changing it.
     
  6. Offline

    j_selby

    I will continue with the world generation, but if you want me to do something else I am happy to. Using buffers like that is a great idea and should work with my current island setup. I am just working on ore distribution now, and after that all I have to do is make the islands more lifelike, and maybe a code cleanup - so when I am done with that I am happy to help with something else.
     
  7. Offline

    korikisulda

    What about things like ladders, torches, signs, etc that need a supporting block though? you'll have to use up CPU time identifying these blocks and putting them to one side to put them into the destination last.
     
  8. Offline

    j_selby

    They do, but currently there is no supported blocks like that, however when I add the village (another thing to put on the list) then we will use up additional CPU time.
     
  9. Offline

    gamerguy14


    Each of those things takes up one block and can be identified. You only have to load the id of each block through for it to work. The only issue might be chests, and furnaces. You have to remember what is inside these.

    For villages, you should use a block populator. That way you can stick villages into natural terrain. I am also sure this is how Mojang does it too. I think they also use populators for lakes and caves.
     
  10. Offline

    j_selby


    Dealing with chests and furnaces etc could take up a small amount more CPU usage, but it shouldn't be that much of a problem.
    A block populator may work. Let me experiment with it.
     
  11. Offline

    mikeyagoto

    Ohh my! soo much is happening!


    Thank you for your help! It is greatly appreciated!

    Are you talking about when moving islands? Or during generation? Thank you for the help!

    gamerguy14

    Wow thank you for all your help!

    j_selby

    Wow again! That was fast! Things seem to be going well!

    Thank you all again!

    Mikey
     
  12. Offline

    korikisulda

    Both, potentially.
     
  13. Offline

    TeNNoX

    Just wanna mention that the bukkit API provides Threads..
    Also just take the Block object from the chest/furnace and set the location somewhere else ;)
     
  14. Offline

    mikeyagoto


    So that makes things easier? Haha i sure hipe so.

    Thanks for the help'

    Mikey
     
  15. Offline

    gamerguy14

    j_selby, mikeyagoto

    We need a uniform way of locating islands. I was thinking of numbering the islands on a cartesian plane just as the blocks are but numbering them with consecutive positive integers (0, 1, 2, 3) for x and z. This way each island can have its data loaded into a two dimensional array with its coordinates. We could also use negative coordinates and then adjust the array based on that which can easily be done, it can be done by finding the lowest coordinate there is, and subtracting every coordinate by that coordinate and adjusting array length for that.

    I also need to know what the space is between islands where it is international waters. 128 blocks would be ideal for coding but maybe not for the world itself. It is good for coding because a simple rounding algorithm can be made to find if something is part of an island using bitwise operators (see below). Knowing this space will also allow me to make an algorithm that converts locations to array indexes like I explained above.

    example of rounding algorithm:
    Code:
    /*
    * Say round is 237
    * 237 in binary is 0b11101101.
    * a right shift 7 (>>) shifts the whole thing to the right 7 bits:
    * it is now 0b00000001 or 1 in decimal.
    * shift it left seven now and you get:
    * 0b10000000 or 128 in decimal.
    * this tells us that 237 is before the next 128.
    * it rounds down to the nearest multiple of 128.
    */
    public int round(int round) {
        return (round >> 7) << 7;
    }
     
    /*
    * Another good one would be to take the result of the round and determine whether or not it is also a multiple of 256.
    * You know you have a multiple of 128 so dividing it by 256 will return a remainder of zero if it is divisible and 128 if it isn't.
    * This tells the difference between island and international waters.
    * Multiple of 256 is an island otherwise it is international waters.
    */
    public boolean isIsland(int round) {
        return (round(round) % 256) == 0;
    }
    I also know an algorithm to round a number to the nearest multiple of 128 that isn't a multiple of 256. All these algorithms work for any number that is an exponent of two.
     
  16. Offline

    j_selby

    gamerguy14
    I have kinda already setup a array for this - for example:
    123, 456 => Jselby
    435, 242 => null (public island)
    This array will get extended when needed.
    International waters can be defined as the entire world at first, and when the need arises, we could have a algorithm that will then get costal waters from that.
    For the distance between islands, 128 is a good starting point, but we can always change it if need be.

    Checking if a island is devisible by 256 would work to detect if a area is suitable for a island.
     
  17. Offline

    mikeyagoto

    Umm yes :) lol

    Ummm yes :)

    Ihave very little idea of what you guys are talking about... I trust you to make it work :) lol

    ohh and 128 sounds fine to me :)

    Thanks,

    Mikey
     
  18. Offline

    gamerguy14

    j_selby

    Maybe we should set a space of 128 between islands on generation then when an alliance is made, stick the moved island in one of the spaces of international waters which could help speed up the process of island moving.
     
  19. Offline

    j_selby

    gamerguy14
    That may work, but we will need to find out if all the international water is used up we need to move that island to that new friend, and also pull over all of his other firends over - this could create substantial lag.
     
  20. Offline

    mikeyagoto

    That's why I was thinking some kind of scheduler, so its only done one island as a time. And then theres never more than one island moving at a time. That should reduce lag quite a bit I think.

    Thanks mikey!

    Ps. Just a reminder there is going to be water around the island, and then international waters right?
     
  21. Offline

    j_selby

    mikeyagoto
    A scheduler would work, and if that schedule was executed while everyone was offline or afk that would work even better.
    Yes, coastal waters will transition into international waters.
     
  22. Offline

    mikeyagoto

    Well I was thinking if I have periodic restarts, could it be done like before each restart? like every 2 hours or so? I think that would solve all our problems.

    Thanks,

    Mikey
     
  23. Offline

    j_selby

    mikeyagoto
    If IslandCraft did the restarts, or was told about them then yes.
     
  24. Offline

    mikeyagoto

    Ok! I planned on having the restarts so you can make islandcraft do them if you want! lol, as long as it turns back on!

    Thanks,

    Mikey
     
  25. Offline

    j_selby

    You will need a wrapper for that, but if you create a batch script with something like this:
    Code:
    @echo off
    java -Xmx1024M -Xms1024M -jar craftbukkit.jar
    thisbatchfile
    But yeah. IslandCraft should be able to do the restarts.
     
  26. Offline

    mikeyagoto


    Awesome sounds good to me!

    Thanks,

    Mikey
     
  27. I like Islandcraft and Crafters of the Carribean.
     
  28. Offline

    mikeyagoto

    Haha thanks!

    I actually just thought of another, PirateIsland!

    Thanks,

    Mikey
     
  29. I'll post some more names if I can think of any more.
     
  30. Offline

    mikeyagoto

    Alright! Thanks a bunch!

    Mikey
     

Share This Page