WaterCraft

Discussion in 'WIP and Development Status' started by Faelsel, May 25, 2012.

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

    Faelsel

    WaterCraft, the beginning of a big plugin.
    Actual version 1.5, Started to work on 26-May-2012

    ----------------------------------------------------------------------------------------------------------------
    For several days/weeks/months/years playing minecraft i was bored to see water... infinite water sources, water everywhere... only yesterday i started to solve this problem with a Bukkit server plugin instead of a clientmod to fix this water...
    There was already a plugin doing this (look at RealFluids, or FiniteWaterMod), but i dont see it anywhere so i started to write on my own.

    My dream is a minecraft world where player should build, dig, eat and drink, and every one of these are hard to do.

    Plugin development is in really beginning, any good word is appreciated
    [​IMG]

    Completed:
    - Ovveride Minecraft flow behaviour
    - Waterflow

    Work in progress:
    - New calculation system, to improve perfomances and reduce errors.
    - Video showing features.
    - Removing a bug on vertical flow, where flow stops.
    - Removing a bug on world generation, where server crashes.
    - Rain refill lakes/oceans/playerbuilded containers
    - Sun drain water


    ToDo:
    - Water mills refueling furnaces? Or charging redstones?
    - Pumps?
    - More and more optimizations
    - Change WaterCraft to a more comprensive PhysicsCraft... to fix blocks placing gravity, redstone energy behaviour?

    Release date:
    All up to users interest, no interest means longer time development, donation means faster time development.
    Maybe on June 2012.


    Feel free to donate if you want to see a better version...
    https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=VB4SH2EQJULHC
     
  2. Offline

    mindless728

    Well, considering I did some work on a project like this quite a while ago thought I would mention some ideas/problems you may encounter
    • Don't even try to calculate fluids that are outside of the loaded chunk area as this will be too much to process. In fact I would only do the calculations with in a 9x9 chunk square centered on a player
    • Make oceans/large lakes have infinite about of water (ie sources), as the calculations get really out of hand when you allow them to be drained
    • You are going to have to constantly update the block data by sending either chunk data to players or block changes to players. This is due to a client not allowing only partially filled water blocks to stay rendered (ie without a full block it looks like it goes away)
    • Get the basics working first before adding features, and program it to easily allow extensions to be added in as that will make it easier to add changes in the future
    This is what I accomplished roughly 6 months ago (last change I made to it). I stopped as I ran out of time to work on the project and it was literally a giant pain in the ass to get decent performance out of the system while also keeping the fluid calculations running.

    http://forums.bukkit.org/threads/realfluids.5345/
     
  3. Offline

    Faelsel

    I've did something against oceans/lakes... but still working with containers... something like, bypass phisic calcs on WATER with max pressure, water with lower pressure is calculated...

    For example actually if I place 1 Water bucket on an ocean in about 30 seconds phiscs calcs ends and water will divide in a range from where placed...
    ok oceans cant be totally plane in this way, like lakes, filled by waves, but i think, where is the problem? maybe i will try to raise the max pressure to plane them all... i don know now xD

    I've passed last 2 days to fix calculations, now all works good, but in world generation make thousands errors.... =(

    [​IMG]

    I've to say.. there are still some errors... but i think i will fix in next days

    Done the first.
    The second im working at to make more realistic, where in an ocean with not more than 60 processes (about 6k calcs/second)... where i saw limit on about 6000-16000 processes before server crash
    The third solved
    I agree with you
     
  4. Offline

    mindless728

    What I did to solve an issue I had during world generation, where the server would just lag out and no one could connect for a very long time, is to completely disable the (ie cancel) the org.bukkit.event.block.BlockFromToEvent events as they cause some issues when generating the world

    good luck on the water pressure aspect of it, I didn't think of a good way to model it so it was both fast and fairly accurate (enough so for a block based game)

    I can't remember the calculations/second I was getting, but it was quite a few, on the other hand anything to do with large bodies of water (being emptied) was a lot of calculations that slowed down the overall system immensely
     
  5. Offline

    AmoebaMan

    I tried something similar a while back, but never really took it anywhere. However, I have been working on and off on a structural physics plugin. Perhaps a collaboration is in order?
     
  6. Offline

    mindless728

    I would be up for this when I can commit some code/ideas
     
  7. Offline

    Faelsel

    Im making a restucturation of physics.. because more time im asking "how to know when a physic calculation is done in a block?" so im placing some informations about blocks, in order to save infromations...

    WaterCraft i made in last version make calculation good, not so long and so much and divide all of them in 16 seconds about so the server is not outnumbered by calculations...
    but some times when a physic event starts in an ocean the calculation spreads and sometimes are recursive (imagine heart fibrillation... ok the metaphore isnt good ... im studying medicine -.-)...
    "Recursive", when a calculation happen in the block exactly calculation has been ended... so the cycle restart... thats i mean.. heart fibrillation have the same beginning XD

    So for avoid physic fibrillations, I'm making a more "refrattary period" after a block-physic-event... and in order to save server's speed I preffer to occupy 20% more RAM for Chunk Loaded instead to have processes spikes on CPU (after a physic event).

    Any collaboration is well accepted, the time i finish the basic informations so is simpler to collaborate using some basilar, and shared classes :)
     
  8. Offline

    AmoebaMan

    I've been having the exact same issue. All the calculations for determining if a block should break or fall work fine, and they're not long enough to lag the server. The issue is figuring out how to spread the calculations so that they reach all the blocks they need to.

    For instance, I'm having the problem that when a stack of stone drops onto a dirt block, it doesn't break the dirt. The issue is that I'm calculating load by using a recursive straight-up trace, and when the blocks are in midair there are spaces that disrupt this.

    And as a collaboration goes, I was more thinking about working separately and compiling our work to make a "Realism Suite" plugin. I think something like that would be very badass.
     
  9. Offline

    mindless728

    Solution to this, if you have multiple blocks that are falling that are connected, you need to drop them as a group. Before starting the fall you need to calculate which blocks are going to be part of the fall, calculate a inverse height map for the bottom of the group, then drop the group taking into consideration the inverse height map to see what part hits first. Just a thought.
     
  10. Offline

    AmoebaMan

    That's actually a good idea, but there's one problem - blocks' physics are calculated using on-the-spot values, and have little awareness beyond the 6 block bordering them. This means that if I have one block floating in mid-air and another on top of it, the block on top won't know it's supposed to fall initially, because as far as it's concerned it's being supported by the block under it. It's not until the block under it updates and falls that a subsequent update will make the second block realize that it has to fall.

    Practically, this is the same reason that sand and gravel fall this way in vanilla Minecraft.
     
  11. Offline

    mindless728

    Like I said, it is something you would have to calculate and make happen at the same time (same tick). It would cause more strain on the ticks/s than jut letting it happen normally. This is where the fun of modifying the physics to make it more realistic happen, not being able to use ANY of the default calculations.
     
  12. Offline

    AmoebaMan

    I'm actually to the point where I might just make this a client-side mod. It's getting that frustrating to deal with the restrictions of Bukkit.
     
  13. Offline

    mindless728

    That's half of the fun btw, on another note, not a lot of servers would use it since it would require the client side mod as well (I will never make my users have a client side mod)
     
  14. Offline

    AmoebaMan

    That's why I originally wanted to make it a Bukkit plugin. Irritation abounding.
     
  15. Offline

    Faelsel

    Agreed ....
    but why duplicate memory usage (bacuse i think you need to save location informations, world, and physics informations) when with a 4 byte more (an integer for example for only physics info you need) for block is possible to have same results?

    I continue to working :)
    Last days i was unable to stay on PC...

    ehhh summer-time XDXD
     
  16. Offline

    AmoebaMan

    Actually I don't save physics information for blocks. All the calculations are handled real-time. The only memory I actually use is a List<Block> that keeps track of blocks that are falling. The calculations aren't long enough to justify caching them.

    And in any event, there wouldn't be any interference in terms of the blocks that we would be storing data for. Correct me if I'm wrong, but my impression is that yours deals solely with fluids, and mine has nothing to do with them whatsoever.
     
  17. Offline

    AmoebaMan

    Bumpity, any progress made?
     
  18. Offline

    Faelsel

    Yes i return to work on water later, is crazy like hell to make a non mod minecraft to work like i want XD

    I made a more comprensive physic-craft next step is the water ... again...
    I didnt found this thread and i've opened a new one :(

    sorry Bukkit-forum im really sad on duplicating threads :(
     
  19. Offline

    Byamarro

    Upgrading water buckets could be cool too.
    They reall works in unrealistic way.
     
Thread Status:
Not open for further replies.

Share This Page