Wednesday 15 August 2012

path generator video game algorithm -



path generator video game algorithm -

i'm working on game ios , i'm stuck on something.

the thought simple: have player must go forwards in order win points (and avoid yellowish bricks). here (on green) ideal path in order go forwards within rectangle (from bottom up).

i'm adding new row each time, each new row has allow player move forwards (it can move left, right , forward, no diagonal).

the thought have 'parasite' empty spots, user must think next move.`

so, question: how generate (for number of columns)

thanks.

c.c.

personally, tackle backward:

generate "right" path randomize remaining cells heuristic prevents generating "wrong" path.

the heuristic similar this:

let line 1 closest row, , line 10 furthest.

let path series of contiguous 0s.

if line 1 contains "right" path , lines 2 9 contains @ to the lowest degree 1 "wrong" path, have line 10 contain "right" path.

this heuristic might not perfect, it's thought off top of head.

algorithm game-engine graph-algorithm path-finding

No comments:

Post a Comment