1. Updated Resource Submission Rules: All model & skin resource submissions must now include an in-game screenshot. This is to help speed up the moderation process and to show how the model and/or texture looks like from the in-game camera.
    Dismiss Notice
  2. DID YOU KNOW - That you can unlock new rank icons by posting on the forums or winning contests? Click here to customize your rank or read our User Rank Policy to see a list of ranks that you can unlock. Have you won a contest and still haven't received your rank award? Then please contact the administration.
    Dismiss Notice
  3. From the gates of hell, the 5th Special Effect Contest Results have emerged.
    Dismiss Notice
  4. Rubbed the right way, the genie is out of its lamp! The 12th Concept Art Contest Results have been announced.
    Dismiss Notice
  5. Race against the odds and Reforge, Don't Refund. The 14th Techtree Contest has begun!
    Dismiss Notice
  6. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
Do you have good ideas for new contests? If so, please open new threads in the Contest Submission sub-forum to discuss them.
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

Resources That Have Yet To Be Coded

Discussion in 'JASS Resources' started by Nestharus, Aug 6, 2013.

  1. Almia

    Almia

    Joined:
    Apr 24, 2012
    Messages:
    4,843
    Resources:
    35
    Spells:
    30
    Tutorials:
    4
    JASS:
    1
    Resources:
    35
    but not in a binary distribution ;)

    I have already tested this and it doesn't work just like how other bonuses works
     
  2. Wietlol

    Wietlol

    Joined:
    Aug 1, 2013
    Messages:
    4,640
    Resources:
    3
    Spells:
    3
    Resources:
    3
    You can do it the same way how health and mana are done.
    Adding 1000, 100, 10 or 1 depending on how much you need.
    So if you want to increase by 1350, you do +1000 +100 +100 +100 +10 +10 +10 +10 +10.
    You can make binaries out of those instead of powers of 10 to increase efficiency but it is the easiest way of doing it.
     
  3. Xonok

    Xonok

    Joined:
    Mar 27, 2012
    Messages:
    3,042
    Resources:
    8
    Spells:
    3
    Tutorials:
    5
    Resources:
    8
    Except that you can't. Sight Range doesn't stack.
     
  4. Almia

    Almia

    Joined:
    Apr 24, 2012
    Messages:
    4,843
    Resources:
    35
    Spells:
    30
    Tutorials:
    4
    JASS:
    1
    Resources:
    35
    I told you it doesn't work. How do you think binary distribution works?

    2 100 sight range won't stack
     
  5. Wietlol

    Wietlol

    Joined:
    Aug 1, 2013
    Messages:
    4,640
    Resources:
    3
    Spells:
    3
    Resources:
    3
    But when you remove it, it removes the bonus from lvl 1.
    When you add the ability with lvl 1 set to 0 sight range and lvl 2 set to -100 then you can add the ability, set it to lvl 2 then remove it and you have added 100 sight range.

    I told you it works, why cant you just believe me?
     
  6. Almia

    Almia

    Joined:
    Apr 24, 2012
    Messages:
    4,843
    Resources:
    35
    Spells:
    30
    Tutorials:
    4
    JASS:
    1
    Resources:
    35
    http://www.hiveworkshop.com/forums/lab-715/sight-range-260758/

    Spiral search can do it, right? even though not as fast as octrees/quadtrees can.

    also i think k-d tree can do it
     
    Last edited by a moderator: May 4, 2016
  7. Almia

    Almia

    Joined:
    Apr 24, 2012
    Messages:
    4,843
    Resources:
    35
    Spells:
    30
    Tutorials:
    4
    JASS:
    1
    Resources:
    35
    Okay, I think this should work for GetClosestTile :

    1) Use a Spiral Search approach to identify tiles. (I think it is OP-safe, and also works better on fixed radius)
    2) Use K-D tree. Get all of the points and then build a tree with it. (Not sure of OP-Safe)
    3) Use K-D tree. Iterate the points and insert them one by one. With each insert, balance the tree. (Not sure if op-safe as well)
    4) Use a Quadtree where each leaf node holds 4 tiles. Starting from the center of the map, subdivide the map. (Not sure if op-safe either)
    5) Use an Octree, just like Quadtree. Because it is 4 times larger than a quadtree, I think it is not safe as well.
    6) Binary Space Partition ( I need some info for this)

    Requirements:
    ZLibrary(each tile holds it's rawcode and it's depth?)
    TileDefinition or Tile module

    Needed information:
    How many tiles each variation of map has.(e.g. 32x32, 32x64, 32x96, etc.)
     
  8. Wietlol

    Wietlol

    Joined:
    Aug 1, 2013
    Messages:
    4,640
    Resources:
    3
    Spells:
    3
    Resources:
    3
    I think a spiral search is pretty simple to do.
    But how would a fixed radius be better on it?
     
  9. Almia

    Almia

    Joined:
    Apr 24, 2012
    Messages:
    4,843
    Resources:
    35
    Spells:
    30
    Tutorials:
    4
    JASS:
    1
    Resources:
    35
    I mean it works better with it.

    Get the axis-aligned bounding box of the radius, get the list of points, do a spiral search with the center of AABB until you go outside the AABB

    currently, Spiral Search is the best way to do with it. It is easy to write and implement. Not as fast as other methods do tho, but it is the simplest.
     
  10. IcemanBo

    IcemanBo

    Joined:
    Sep 6, 2013
    Messages:
    6,261
    Resources:
    22
    Maps:
    3
    Spells:
    11
    Template:
    1
    Tutorials:
    4
    JASS:
    3
    Resources:
    22
    Maybe a rectangle search is better.
    1) Go to the current tile edge
    2) Go in rect-shape, following the tile-edge, around your current tile, and compare the condition for each of the tiles next to your current position of the edge. (you must know how tile definition works for that)
    3) If the condition mets, you save the tile distance and tile id as variables. (backup variables)
    4) If the condition mets again, you compare distance to your backup value, to know if it's a closer tile, or not.
    5) If you finished the rectangular surrounding, nothing was found, you go 128 units further, and repeat.

    If you want Get N-ClostestTiles, then something like a list is better. But for only one tile it's probably not needed.
    I'm also not very sure how you come to usage of something like OctalTree of this. Mind to elaborate your thoughts?

    Also elaborating on this might be cool:
     
  11. Almia

    Almia

    Joined:
    Apr 24, 2012
    Messages:
    4,843
    Resources:
    35
    Spells:
    30
    Tutorials:
    4
    JASS:
    1
    Resources:
    35
    if we are talking about data structures + kNN search, I think K-D tree is the best.

    K-D tree is a tree of points, where each depth of the tree represents Axes.


    Binary Space Partition is a basis of K-D tree. you just keep on splitting the planes into 2. I think k-d tree is axis-aligned, BSP isn't
     
  12. IcemanBo

    IcemanBo

    Joined:
    Sep 6, 2013
    Messages:
    6,261
    Resources:
    22
    Maps:
    3
    Spells:
    11
    Template:
    1
    Tutorials:
    4
    JASS:
    3
    Resources:
    22
    Well, I would want to know why you think this is the best, and why you want to use it.
     
  13. Almia

    Almia

    Joined:
    Apr 24, 2012
    Messages:
    4,843
    Resources:
    35
    Spells:
    30
    Tutorials:
    4
    JASS:
    1
    Resources:
    35
  14. IcemanBo

    IcemanBo

    Joined:
    Sep 6, 2013
    Messages:
    6,261
    Resources:
    22
    Maps:
    3
    Spells:
    11
    Template:
    1
    Tutorials:
    4
    JASS:
    3
    Resources:
    22
    Could you explain me without just linking to wikipedia?
    I'm interested how you would use it exactly and why.
    Look at my example - for for getting one clostest tile, no data structure at all was needed.
    For getting a list of N clostets tiles, yes. But it has not to be a special type of tree imo. So I'm curious.
     
  15. Almia

    Almia

    Joined:
    Apr 24, 2012
    Messages:
    4,843
    Resources:
    35
    Spells:
    30
    Tutorials:
    4
    JASS:
    1
    Resources:
    35
    I haven't written any K-D trees (yet the tree ds itself) on any languages so Idk how it will work out :D
     

    Attached Files:

  16. Almia

    Almia

    Joined:
    Apr 24, 2012
    Messages:
    4,843
    Resources:
    35
    Spells:
    30
    Tutorials:
    4
    JASS:
    1
    Resources:
    35
    Okay back to the get closest tile

    I have found out that Spiral Search and IcemanBo's solution is still the best so far.

    because the current problems for QuadTree, Octree, K-D tree and BSP is the memory management.

    When dealing with QuadTrees, a 256*256 map will be required to generate 21845 quadtrees to hold all the tile data in the map. Octrees will take 21845^2 octrees. If we aren't going to use a Table for this, the QuadTree and Octree will fail.

    When dealing with K-D trees, it will be required to create a K-D tree per tile type(by tile type I mean their texture) and also for water depth and cliff.
    IT is good when dealing with get nearest water tile or cliff, but it is not good for holding tile data because it will be required to create a K-D tree per tile type and updating the K-D tree if a tile is modified will be harsh (because it needs to be balanced)

    BSP is just like K-D tree's case.

    [Back to the Starter]
    Coordinate Transformation
    - won't this be easy using a Matrix 2/3? or how about holding the spherical transformation.

    A*
    - What. Maybe someone should update Ammorth's code.
     
  17. Cokemonkey11

    Cokemonkey11

    Wurst Reviewer

    Joined:
    May 9, 2006
    Messages:
    3,237
    Resources:
    18
    Tools:
    1
    Maps:
    5
    Spells:
    3
    Tutorials:
    2
    JASS:
    7
    Resources:
    18
    It doesn't make sense to use an octtree (a data structure for 3D data) for terrain tiles (which are limited to the terrain heightmap, a 2D interface).
     
  18. Almia

    Almia

    Joined:
    Apr 24, 2012
    Messages:
    4,843
    Resources:
    35
    Spells:
    30
    Tutorials:
    4
    JASS:
    1
    Resources:
    35
    Yes it doesn't make sense, but what I am saying is that Octree can fulfill the job as well, even tho it is worse in Space complexity
     
  19. yki01

    yki01

    Joined:
    Jul 9, 2012
    Messages:
    36
    Resources:
    0
    Resources:
    0
    is there a freecodecamp.org or coursera.org for wc3 map modding languages? (anti-fascist peeps, please forgive me).
     
  20. Pinzu

    Pinzu

    Joined:
    Nov 30, 2007
    Messages:
    1,178
    Resources:
    3
    Spells:
    2
    Tutorials:
    1
    Resources:
    3
    Coding macht frei. You will enjoy your future freedom.

    Look at tutorials, jass section, other peoples code such as spells or simply convert GUI code to JASS. Finally produce stuff that people can review or post your code and ask for feedback.
     
    Last edited: Mar 29, 2019