HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Locust unit InRange

05-14-2007, 04:08 AM#1
MaD[Lion]
I though of a way to get units in range that has locust and belongs to a group.
This is for collision detection on locust units.
But i dont know how slow this is.

-If i pick all units in a group
-remove locust
-hide/unhide
-GetUnitInRange
-do collision detections
-add locust

will this be possible in theory?
05-14-2007, 09:43 AM#2
DioD
create rect and detect units in rect
05-14-2007, 10:16 AM#3
Tide-Arc Ephemera
Locust units don't have collision as far as I know... but that's probably innate knowledge at this stage...
05-14-2007, 10:24 AM#4
Toink
The problem with rects is that they're always square or rectangle, which means you can't use it to detect 'Units in Range' because some will be left out.
05-14-2007, 11:06 AM#5
MaD[Lion]
im not asking for an alternate solution, im asking for if my theory works (in theory).
Creating rect or whatsoever is really slow for collision detection system.
05-14-2007, 01:09 PM#6
iNfraNe
Quote:
Originally Posted by DioD
create rect and detect units in rect
locust units arent picked in "Units in rect".

in theory your "solution" should work yes, but I dont think it will be nearly fast enough, but its worth a try.
05-14-2007, 09:37 PM#7
Joker
Sry for off topic but...What does people mean by "not fast"?
05-14-2007, 11:06 PM#8
Ammorth
not fast == slow
fast != slow
fast is good
slow is bad

Usually you don't notice the speed of functions and natives. When you make a system that does a lot of calculations every time-step (about 0.035 for visual systems), the speed of functions becomes noticeable. Increasing speed is then a most, as systems that are "not fast" and not optimized will lag.
05-15-2007, 05:39 AM#9
MaD[Lion]
my system do calculation every 0.03 ;)
05-15-2007, 09:34 AM#10
Toadcop
Quote:
-If i pick all units in a group
-remove locust
-hide/unhide
-GetUnitInRange
-do collision detections
-add locust
it might be slower than to detect UnitEnterRegion event =) cause the war3 "engine" must do some special calcs to make unit unselectable etc... + i think
!!! a + you must call for group ! the for group intialization is fucking slow ! (i think they use some rocket alg to call custom functions cause for group 1 unit is slower than to do this manualy but if you have a bunch of unit's (100) for group is faster than to loop throuht !!!) so i don't know... i would say this solution sucks ! + i am got a 100% better solution ! =)

USE VEX TRICK TO MAKE UNITS UNSELECTABLE BUT I MAKES UNITS TARGETABLE + GroupEnumUnitsInRange works very well ! + (don't forget to add Invurnablility)
but it's you disicion...

Quote:
create rect and detect units in rect
yes i doesnt work ! (my washing machine does not work some one have fucked my washing machine =) ... my washing machine does not work ! WHY DID YOU fuck my washing machine !? FUCK ! ... awesome track =) ) + the rect must exist before unit "is in" and etc. but enter/leave events works well !
05-15-2007, 11:00 AM#11
MaD[Lion]
why would i do for group -.-
05-15-2007, 02:44 PM#12
iNfraNe
because for group is freakin awsome, thats why.

is for group still slower if you you firstofgroup loop and want to keep the units? like, have 2 groups, delete units from 1, add them to the other and use the other group the next run trough?

Quote:
Originally Posted by Toadcop
USE VEX TRICK TO MAKE UNITS UNSELECTABLE BUT I MAKES UNITS TARGETABLE + GroupEnumUnitsInRange works very well ! + (don't forget to add Invurnablility)

which would be?
05-15-2007, 08:03 PM#13
Toadcop
Quote:
which would be?

UnitAddAbility(u,'some chaos transform spell')
UnitAddAbility(u,'Aloc')

and if you got alot unit's in group ForGroup is faster than a loop !
05-15-2007, 08:05 PM#14
iNfraNe
noone is talking about alot of units here.
05-15-2007, 08:19 PM#15
Toadcop
100 are alot =)