[REQ] Spreading Creep

Discussion in 'Archived: Plugin Requests' started by Sbirematqui, Apr 23, 2011.

  1. Offline

    SamV522

    Oh wow, more than once every 5 minutes? That's pretty slow :( What do you mean on player near? near the player?
     
  2. Offline

    valdark

    Exactly is it run based on being near the player or anywhere in loaded chunks? What is the defined area where growth will occur?
     
  3. Offline

    SamV522

    It grows anywhere thats not itself or air, that way it grows across land, it runs wherever the block is placed.

    Source: https://github.com/SamV522/gitCreep

    The majority of the code is in CrpBlockListener.java keeping in mind I'm new to the bukkit API, is there a better way to do this?
     
  4. Offline

    valdark

    I'm not fluent in the coding aspect but from what I can tell you have set the creep to grow indefinitely. What is the limitation? If you don't limit the growth either by requiring the presence of the player for growth to occur or by some other means then you will be using an exponentially increasing amount of RAM. Even with iGrow set to within 100 blocks of the player you get issues.

    Have you taken a look at iGrow's code? You might be better off just updating the timer string there. Again I don't have the coding knowledge to update it myself but I have a basic understanding of the principles.
     
  5. Offline

    SamV522

    Yeah, I looked at iGrow, thats where I got this new method from. I've got it partially working now. For anyone that wants to know - instead of using schedules, which overload the server almost instantly, I'm using threads, which so far, seem to work seemlessly. only catch is how I'm going to delete them behind the creep.
     
  6. Offline

    mindless728

    if you only have one schedule running and a list of creep blocks then limit the time of the plugin to say 5ms, then you shouldn't get overloaded messages (i do the same kind of thing inside of RealFluids for fluid flow behavior)
     
  7. Offline

    valdark

    But he is updating the creep constantly. Wouldn't that become an issue? The amount of updating will increase exponentially. 1 creep becomes 2 which each become 2 more... unless you are only running this in a limited zone it would cause issues wouldn't it?
     
  8. Offline

    mindless728

    but if the object is to grow slow over time, it would run fine for a while, not to mention you could implement a time limit of being active so after a time the old creep blocks no longer spread

    keep in mind his would do the same thing with Timers as they start eating resources a lot as well (probably more than the list of creep blocks that expands)
     
  9. Offline

    SamV522

    I tried doing that and the server got overloaded with just the one creep block, but it works with the new threading method, I just need to adjust the way it grows, both in-game, and code-wise.
    At the moment, it starts a new thread/timer/event each time it "grows" that grows the next lot of block, but I haven't found an efficient way of interrupting the thread once the block is inactive, maybe I'll make it grow all possible directions and if it can't grow anywhere, then interrupt the thread. I'll commit the new code after I get home and make the said changes.
     
  10. Offline

    mindless728

    IDK how you managed to make one creep block overload the server when in my RealFluids plugin i manage to handle tens of thousands of flow events which require a good amount of calculation without overloading the server, and i managed to have several hundred thousand creep blocks without overloading the server in my test code
     
  11. Offline

    valdark

    But wouldn't you then have to run a check every time you broke a creep block in order to re-activate those now inert blocks? Otherwise creep would stop growing if you pruned its outer edges. Again I am not fluent in java but somehow the logic seems flawed.
     
  12. Offline

    mindless728

    checking for every block broken isn't hard, all of the permission plugins do it, and so does RealFluids, its not that hard on the server in terms of computing, and that is every block not just a subset
     
  13. Offline

    SamV522

    I'm really not sure how I did either
    Yes, but as mindless728 said, it's really not that complicated, especially because there is an event that is fired when a block is removed, then I'll just check for some adjacent blocks, if/when I implement Mixcoatl's suggestion, I'll be able to check if the block is from an actual Creep source, and in the case that it is, I'll just start it up as a Creep source again.

    Also, I've revised the growing pattern a bit, and I figure, I'll setup a max creep source config variable, and then after the number of creep sources reaches that variable, I'll get it to chose x (max creep sources /number of grow iterations required) random creep blocks, and start those up as Creep sources, this way, it grows in a pseudo random pattern, which would add some extra effect! What do you guys think?
     
  14. Offline

    valdark

    I like the last suggestion. I get why you are using this method when you factor in the random change. What blocks will be replaced with this? Also are you going to require non air/creeper block attached or will this cause mountains of creep? I think my hesitancy stemmed from not understanding how complex your formula would be. I think the code that was crashing a server was most likely lacking these limitations and running rampant as I mentioned. But I'm a noob on the required code so forgive my ignorance. will you be offering an open config similar to iGrow?
     
  15. Offline

    SamV522

    No blocks get replaced other than air, as requested in the original post, I may setup a configuration setting in the future to add "consumable" blocks
    Yes, that way creep will grow all the way across land and "smother" buildings/constructions, otherwise it will indeed end up in mountains of creep (Not nice D: )
    To conclude, using the old schedule method it would place one block, and then it would be overloaded, it never placed more than one block. There won't be a need for a config similar to iGrow, the only configuration settings so far are BlockID, the Id for the creep block, Time, for the time between creeps and possibly a string of all the block id's creep can replace in future.
     
  16. Offline

    valdark

    Thanks for the feedback.
     
  17. Offline

    GodlyMiller

    This looks awesome & hoping you get to the lava bucket in furnace plugin for me :)
     
  18. Offline

    Dominic

    Ha! This seems awesome! It's like the creep from Starcraft that the zerg has! Love it!
     
  19. Offline

    marinating

    I'm working on this as well (interesting problem) and I also have the issue of server overloading after 4 or 5 creeps. In a couple of days, if someone hasn't figured it out, I'll keep working on mine.
     
  20. Offline

    SamV522

    @marinating - I've got mine working, it's just the growing pattern I need to work on, we should collaborate?
     
  21. Offline

    rockxz2135

    when i saw this i imediately thought of "creeper world" but then i had a second thought "well this will probly just be a noob asking to import blocks or a new mob but"
    but then i read this and this would be fun omg i love the idea so how about adding a config file to set the amount of blocks per minute and the type of block because this would destroy my nether nice idea better than the noob questions like add ligt sabers and stupid things that u cant do
     
  22. Offline

    Sbirematqui

    Huh, i'am still here. [torch]
     
  23. Offline

    marinating

    Sure thing. Is the link you posted above the most updated version of your code? I'll poke around a bit and see what I can do.
     
  24. Offline

    Iaconic

    you should be able to define the maximum number of blocks for each creep so that you can place one and it will only cover say 30 blocks, also what if there was an original creep block say fire/or something surrounded by netherack and if you destroy the mother block u destroy the hive? it could be sort of a game to ;)
     
  25. Offline

    SamV522

    I've updated it slightly and I've got it to creep but it's only really placing one source at a time, rather than growing outwards like it's meant to, I'll see if I can push the next lot of code sometime shortly. I think the problem is somewhere in CreepSource.java in startGrow(Block) function.

    Update:
    Alright, I've figured git out, you can find the source in the repo. That's at a working stage, but it only grows in one direction, perhaps we need to merge our growing functions.

    That's the idea, once we get it working we'll release it so you all have something to play with then we'll try and get that added in as a future feature.

    Currently, the block grows outwards from a source block in all available directions, and you can define which block to use in the config file, as well as the time it takes for a source block to grow.
     
  26. Offline

    Sbirematqui

    Krm... What's up ? :)
     
  27. Offline

    marinating

    I'm currently working on a combat plugin, but once it's done I'll hop back over to this.
     
  28. Offline

    SamV522

    @marinating - if you could get your code on Git I'll try and merge as much as I can to get this working. It'd speed up our development time also.
    @Sbirematqui - We're working on your Creep plugin, it's almost done, we just have to fix a bug :)
     
  29. Offline

    valdark

    [​IMG]

    Made a wall 1x20x15 of netherrack... then set iGrow to work for a couple of days while I tweaked the settings. I can see why you'd prefer a growing pattern for this one.
     
  30. Offline

    marinating

    I have no idea how to put my code up on Github. I also deleted a lot of my work out of frustration (lol) because I couldn't figure out why the list of active creep blocks kept rewriting itself for no apparent reason. I'll just take a look at your code and see where it could be improved on a bit.
     

Share This Page