Search

Search found 6 matches

by regic
25 Oct 2013, 11:58
Forum: Engine
Topic: Pathing algorithms
Replies: 30
Views: 6113

Re: Pathing algorithms

Edit: where I wrote unit I really meant the UnitDef of the given unit. I only store UnitDefs in the sorted list. Ah I realized I'm stupid. I just have to store an integer number per each tile, lets call it n . n means the unit with position smaller then n in the list (sorted by maxSlope property, in...
by regic
24 Oct 2013, 16:35
Forum: Engine
Topic: Pathing algorithms
Replies: 30
Views: 6113

Re: Pathing algorithms

I think I should clarify my idea a little in order you can effectively reflect on it. I do not plan to cache routes, only passable tiles, so checks against terrain and obstacles don't have to be made on-the-fly. (I'm not even sure if that's not how the pfs works right now, I'm still learning your co...
by regic
24 Oct 2013, 16:16
Forum: Engine
Topic: Pathing algorithms
Replies: 30
Views: 6113

Re: Pathing algorithms

Furthermore the passability function is not simply binary, units *change speed* going up- or downhill or through water by a variable amount (depending on MoveDef parameters) which influences the definition of "shortest path". Yes, I realized that, but atm I only want to know if this littl...
by regic
24 Oct 2013, 16:06
Forum: Engine
Topic: Pathing algorithms
Replies: 30
Views: 6113

Re: Pathing algorithms

Thank you for the answer! Even if you could do this it would be a *bad* idea to restrict unit movement to the least-tolerant case given the wide range of tolerance values (practically from flat ground to all-terrain) in the majority of Spring games. What I suggest doesn't change the rules of movemen...
by regic
24 Oct 2013, 12:06
Forum: Engine
Topic: Pathing algorithms
Replies: 30
Views: 6113

Re: Pathing algorithms

I think I figured it out... The "terrain check" is done with the GetPosSpeedMod function, if it returns 0, then the square is not passable. This gives me an idea: The only difference between unit's check against terrain is the max slope a unit can pass. This means you can sort the units by...
by regic
23 Oct 2013, 13:47
Forum: Engine
Topic: Pathing algorithms
Replies: 30
Views: 6113

Re: Pathing algorithms

Where is the function that checks the UnitDef against the terrain to know if a given square is passable? I see only the checks against obstacles (in CMoveMath)

Go to advanced search