• Check out the results of the Techtree Contest #19!
  • Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!

Detecting Hills between 2 points

Status
Not open for further replies.
Level 9
Joined
Dec 21, 2006
Messages
490
hi is there any cpu friendly way to detect a hill between 2 points?

for now i do a for each "real" between 5 and distance between 2 points.

if point with offset angle distance = point 1 + "real" > ground height ...


but these are alot of points being checked and for different cases....

any way to do this different?
 
i'll check every point between point 1 and point 2 (point with polar offset +3 ). if the checked points height is higher than (let's say all hills are higher than 20) 20 it saves that point.

@Dr what exactly do you mean with checking the squares? how would this look like?

@blue i don't get it
 
Well, each tile in the game is made up of 4 points. Infact, each triangle of the terrain is made up of 3 points. Thus all you need to do is work out where these are and check if the line collides with the triangle (vector mathimatics).

This will optimize your search to be 100% accurate for a line at the least cost (only searches collision with tiles it passes over).
 
Status
Not open for further replies.
Back
Top