The Daily Click ::. Forums ::. Klik Coding Help ::. How do we make range detection in a RTS in TGF???
 

Post Reply  Post Oekaki 
 

Posted By Message

RPG Player 2003



Registered
  27/06/2003
Points
  248
8th July, 2003 at 16:40:04 -

I think this is the last problem I will run through in this development stage of the RTS. Well, I need the SIMPLEST FORMULA EVAR, so please NO SQRTS!!!

 
"I see", said the blind men to his deaf wife.

Beware of the grass, don't step on the dog!

Knudde (Shab)

Administrator
Crazy?

Registered
  31/01/2003
Points
  5125

Has Donated, Thank You!Clickzine StaffKlikCast StarVIP MemberGhostbuster!Dos Rules!I donated an open source project
9th July, 2003 at 01:37:55 -

object 1 X posistion + object 2 X Position divide by 2, do the dame thing with the Y coords, then add the result together, instant distance.

 
Craps, I'm an old man!

Daniel[Crazy_Productions]

Possibly Insane

Registered
  29/12/2002
Points
  2505
9th July, 2003 at 05:25:58 -

thats a good formula but its not too precisly so you will get wrong on 3-7 pixels

 
Beware of life ...so far noone have survived it.......

RPG Player 2003



Registered
  27/06/2003
Points
  248
10th July, 2003 at 15:26:32 -

Shab's formula works. But there's a problem - More than one unit of the same type. They all shoot or no one shoots. Someone can solve this one?

P.S. No values available!

 
"I see", said the blind men to his deaf wife.

Beware of the grass, don't step on the dog!

Long John Kickbag



Registered
  26/08/2002
Points
  148
10th July, 2003 at 16:45:51 -

That doesn't work, if you were to draw the range of how far a unit could see and they had a set distance you would get a diamond shape around the object. What's wrong with an expression involving a square root anyway? This example shows how to do range detection for many objects (picks closest of other objects): http://nimble.icetec.net/?page=6&listid=4 , it uses a proper distance formula though.

 
Resize! - www.clicksplat.com/comparison.html

RPG Player 2003



Registered
  27/06/2003
Points
  248
10th July, 2003 at 18:29:40 -

No, thx, I prefer the way I know it works. And I have something to do with Sqrts in range detection formulas : I had to download Advanced Math, other dozens of extensions and examples, and it didn't work.

Can someone solve my problem about everyone shooting or no one shooting???

 
"I see", said the blind men to his deaf wife.

Beware of the grass, don't step on the dog!

Assault Andy

Administrator
I make other people create vaporware

Registered
  29/07/2002
Points
  5686

Game of the Week WinnerVIP Member360 OwnerGOTM JUNE - 2009 - WINNER!GOTM FEB - 2010 - WINNER!	I donated an open source project
11th July, 2003 at 03:43:59 -

Yes RPG pyr2003 - It's because you told them all to shoot, i know that doesn't help much but you're going to need some alt values or maybe a flag or two. To turn on, then when the flag is on - shoot.

-Andy

 
Creator of Faerie Solitaire:
http://www.create-games.com/download.asp?id=7792
Also creator of ZDay20 and Dungeon Dash.
http://www.Jigxor.com
http://twitter.com/JigxorAndy
   

Post Reply



 



Advertisement

Worth A Click