1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Hey Guest, is it this your first time on the forums?

    Visit the Beginner's Box

    Introduce yourself, read some of the ins and outs of the community, access to useful links and information.

    Dismiss Notice

Looking for someone to optimize my quicksand

Discussion in 'Requests' started by Shadowblitz16, Jun 15, 2018.

  1. Shadowblitz16

    Shadowblitz16 Ballista Bolt Thrower

    Messages:
    158
    hey I made some quicksand and I was looking for someone to optimize it by combining the shape and sprite into a single blob like what tile do for optimization..

    for example if I have two bobs next to each other like this..
    Code:
    ------------------
    |       |        |
    |   A   |    B   |
    |       |        |
    ------------------
    
    this it would become this..

    Code:
    ------------------
    |                |
    |       A        |
    |                |
    ------------------
    
    here this is what it looks like so far however it crashes clients when spreading
    GIF2.gif
    and these are the files for anyone interested https://drive.google.com/open?id=1poidAEKndgA-hYHPbibY4SyfblduQudJ
     
  2. Asu

    Asu THD Team THD Team Forum Moderator

    Messages:
    1,580
    If you get a crash after that gif it might be because you're polling for something out of bounds, what's the error (or is it a plain crash)?
    What you could have (and might be doing already) is a 2D array of booleans with the same dimensions as the tilemap. To check whether a blob is inside quicksand, you can do that by checking the array at its world position converted to worldspace (could do some extra checking to cover its entire shape, not just one tile). Then you can use the new rendering functions, which should be fast if well implemented (as it's sort of the same technique as used by KAG to render tilemaps).
     
    blackjoker77777 likes this.
  3. GoldenGuy

    GoldenGuy Haxor Tester

    Messages:
    105
    I tested it. its not exactly a crash, the game just freezes, because you spawn too many quicksand. Its being creating on top of the other quicksand. Your check for it doesnt work properly.
     
  4. Shadowblitz16

    Shadowblitz16 Ballista Bolt Thrower

    Messages:
    158
    @Asu that sounds a little too advanced for me. I really don't even know where I would start.
    @GoldenGuy hmm I had a feeling that might be happening but I wasn't sure. do you have a idea of what it could be?
    --- Double Post Merged, Jun 23, 2018, Original Post Date: Jun 17, 2018 ---
    So does anybody know how to fix the overlapping of quicksand? I'm not quite sure what causes it.