Comment

Comment by muhuk

Very cool series of articles.

My take-away, from the last part:

    The state represented by each search node doesn’t have to be limited to a position; 
    on the contrary, it can include an arbitrarly complex set of values. For example, 
    if turning 90 degrees takes the same time as walking from one square to the next, 
    the state of your character can be [position, heading]. Each node now represents 
    not only the position of the character, but also its heading; and the new edges 
    of the graph (implicit or explicit) reflect that.

    Going back to the original 5x5 grid, the starting position of the search now may 
    be [A, East]. The adjacent nodes are now [B, East] and [A, South] - if you want 
    to reach F, you need to correct your heading first, so the path would be 
    [A, East], [A, South], [F, South].

    First-person shooter? At least four dimensions: [X, Y, Z, Heading]. Maybe even
    [X, Y, Z, Heading, Health, Ammo].
parent muhuk 12 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton