OFFICIAL Tech Blog: Dynamic MP Grids

Discussion in 'Announcements' started by Nocturne, Feb 8, 2018.

  1. Nocturne

    Nocturne Friendly Tyrant Forum Staff Admin

    Joined:
    Apr 13, 2016
    Posts:
    6,217
    https://www.yoyogames.com/blog/459/dynamic-mp-grids

    [​IMG]

    https://www.yoyogames.com/blog/459/dynamic-mp-grids
     
    Andy, Nux, Galladhan and 4 others like this.
  2. GMWolf

    GMWolf aka fel666

    Joined:
    Jun 21, 2016
    Posts:
    3,160
    A great read for those looking for more from the MP grid functions!
    One issue you may run into is that when the path is drastically changed, the pos variable may refer to a point that is quite far away from the current location, and the AI may not be able to find its way to it. In that case one solution is to find the closest point on the path before continuing.
     
    Last edited: Feb 8, 2018
  3. Nocturne

    Nocturne Friendly Tyrant Forum Staff Admin

    Joined:
    Apr 13, 2016
    Posts:
    6,217
    There are a few issues like that with the system... Like when you place a block in the same position as the AI object, it'll get"stuck"... But the point is that after going through the article, you should be able to solve those issues yourself (we hope!)!

    :)
     
  4. Miradur

    Miradur Member

    Joined:
    Jan 16, 2018
    Posts:
    99
    Great tutorial and always nice to see how you can improve self.
    My wish for the next tutorial would be a deep-sort routine with tile layers :)
    (Maybe with collision and alpha for the player when he is behind the tiles).

    Miradur
     
  5. OrangeBit

    OrangeBit Member

    Joined:
    Jun 26, 2016
    Posts:
    12
    It gave me a YYZ file. Not supported with Studio 1.4?
     
  6. rIKmAN

    rIKmAN Member

    Joined:
    Sep 6, 2016
    Posts:
    3,502
    OrangeBit likes this.
  7. JackTurbo

    JackTurbo Member

    Joined:
    Oct 19, 2016
    Posts:
    732
    OrangeBit and rIKmAN like this.
  8. Smarty

    Smarty Member GMC Elder

    Joined:
    Jun 21, 2016
    Posts:
    53
    Nice write-up @Nocturne. I've experimented long time ago with the grid-based path finding and I think it's important to emphasize that the grid should be a miniature representation of the room. The smaller the grid the faster the pathfinding algorithms.

    Not related to the article, but I think the one lacking feature of pathfinding in GMS is that it is limited to just go and no-go areas. It is not possible to indicate areas that have a (speed) penalty to cross them. For example, asphalt terrain vs grassland terrain - pathfinding should preferably go for the fastest route between A and B, and opt for ' slower' terrain only if necessary. Grid values would be -1 for impassable terrain, and 0 to any value higher up to indicate the penalty.
     
    Last edited: Feb 10, 2018
    Nocturne likes this.
  9. GMWolf

    GMWolf aka fel666

    Joined:
    Jun 21, 2016
    Posts:
    3,160
    also, would be nice to have more than just a*. For a lot of games, its often useful to keep the annotated graph around.
    For instance, you can do Dijktras with the target as source, and end up with a single data structure that can easily be used to reach the source from any point on the graph. Very usefull for, lets say, a zombie game.
    You can do the opposite, compute all of the reachable nodes from a source. Very useful when for AI (Select the best reachable destination. Could even use to check that destination is not reachable by enemies, etc), or to show where the player can move to in a turn based game.
     
    Nocturne likes this.
  10. Andy

    Andy Member

    Joined:
    Jun 20, 2016
    Posts:
    143
    I have been playing with path-finding and MP grids, so this article is timely. :)
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice