zombiecalypse / Game-Design-Project

1 stars 0 forks source link

Path finding #20

Open zombiecalypse opened 11 years ago

zombiecalypse commented 11 years ago

We need to find a path finding algorithm, that operates on our potentially continuous map

Blue-Robot commented 11 years ago

The path finding needs to be implemented in the movers trait. But how can the trait access the mask? Which is needed for the path finding for obvious reasons.

zombiecalypse commented 11 years ago

parent.blocked? should do the job I think

Blue-Robot commented 11 years ago

I mean like, the whole map

zombiecalypse commented 11 years ago

Yeah, what else would it do? Oo => parent.blocked? x,y, uses Level#blocked?, which uses Map#blocked?

Blue-Robot commented 11 years ago

Ok, I will build my own map then. Why is it parent.blocked? x,y and not just blocked? x,y?

zombiecalypse commented 11 years ago

huh? what did you have in mind, that you need to build a new map for that?

parent gives the game state in which the object was created - every movable thing should have a Level there. There is no reason, why you shouldn't implement

def blocked x,y
  parent.blocked? x,y
end
Blue-Robot commented 11 years ago

Yep, I had a confusion about parent and super. Anyway, there is already a method

def blocked? x,y
  self.instance_exec(x,y, &blocked_block) if blocked_block
end

Is that not doing the same?

zombiecalypse commented 11 years ago

Ah, yes, I remember! That one is for the case that the guy is not only blocked by the surroundings, but also e.g. by other units. Do you think, the path finding should take that into account?

Blue-Robot commented 11 years ago

It works now but really slowly, like 20 secs per enemy.... but it feels longer

zombiecalypse commented 11 years ago

fitting: my tilemaps are really slow for big levels too ;) On Jan 9, 2013 3:52 PM, "Blue-Robot" notifications@github.com wrote:

It works now but really slowly, like 20 secs.... but it feels longer

— Reply to this email directly or view it on GitHubhttps://github.com/zombiecalypse/Game-Design-Project/issues/20#issuecomment-12047353.

Blue-Robot commented 11 years ago

I guess we'll talk tomorrow about optimization

Blue-Robot commented 11 years ago

I developed a three point program to optimize this:

Blue-Robot commented 11 years ago

So far