Staredit Network > Forums > SC1 UMS Mapmaking Assistance > Topic: Tracking Similar units
Tracking Similar units
Mar 24 2010, 12:11 am
By: Randy.G  

Mar 24 2010, 12:11 am Randy.G Post #1



So basically I'm making a game where city life exists and I want the players to be able to interact with individual units. I can't think of a way to track several instances of the same type of unit efficiently. I want to track them so you can tell the difference between units. :/ These units will have to be able to move, as I want a kind of city life going on even if players are not present. Please Help!!



None.

Mar 24 2010, 12:23 am Cinolt Post #2



Roughly how much of the same unit do you want on at a time? If there's only going to be around 3-5 the most easiest and obvious choice is different players.

If they will never touch each other, you could have a small locations for each unit that constantly centers on them.

Otherwise the only other method I can think of is very EUD and trigger intensive and may not even be worth it, but if you can't use the above two then I could attempt to explain it.



None.

Mar 24 2010, 12:24 am JaFF Post #3



You could use a 1x1 pixel location to track each unit individually provided that it can't escape it. This will cost you a location per unit, though. You also could try splitting the units between several computer players if that is possible, but the limit is that the number of units of each type you can have is the number of players you are willing to spare.

Long story short, it's really not worth doing it just for an aesthetical touch.



None.

Mar 24 2010, 12:26 am Randy.G Post #4



The game is multiplayer and I was hoping to be able to do at least 20. I'm all up for intense triggers as long as it doesn't wear out all of my resources.



None.

Mar 24 2010, 12:30 am Randy.G Post #5



I'm not entirely sure how I would keep the unit from escaping the location if it ran into its own type of unit that happened to be a unit that was destined to die. I really want this to work because I want relationships in the game to be possible.



None.

Mar 24 2010, 12:31 am JaFF Post #6



Then just get the rest of the map done and if you have locations to spare at the end, use them for this.



None.

Mar 24 2010, 12:33 am Cinolt Post #7



Now that I think of it there shouldn't be a problem with the small locations constantly centering if you're using a slow unit like a marine. With units like vultures, maybe. Anyways this should be your first method to attempt. In the marine's case, you'd have 1x1 locations constantly centering onto their respective marines, then you'd move a larger location onto each 1x1 location and detect if the player's unit is there.



None.

Mar 24 2010, 12:33 am Randy.G Post #8



So if I just set a 1x1 location to center on the unit already placed within it, it should stay on them?



None.

Mar 24 2010, 12:35 am Randy.G Post #9



Alright I'm going to test it out real quick



None.

Mar 24 2010, 12:39 am Kaias Post #10



Don't even bother with tracking the units at all. If you want to be able to interact with them you can just find their unit index number when you need it.

For instance, say the player does whatever he is supposed to to 'talk' to a unit. You could then just center a location on his Hero and modify health of all the unit types that you could talk to in that location to 0%. Then just detect which unit indexes have a health of 1 and thats the unit that you are interacting with. Its fairly easy.

To clarify, all units in the game have a unique index number.



None.

Mar 24 2010, 12:43 am Randy.G Post #11



O.O Where can i read this tutorial



None.

Mar 24 2010, 12:48 am Apos Post #12

I order you to forgive yourself!

If they are all the same is there a reason you can't just do a randomization of what they say or do to interact with the player?

If it's a city, you can just divide it into sections and the units would always move in a predefined location that way it makes your life easier.




Mar 24 2010, 12:49 am Cinolt Post #13



Quote from Kaias
Don't even bother with tracking the units at all. If you want to be able to interact with them you can just find their unit index number when you need it.

For instance, say the player does whatever he is supposed to to 'talk' to a unit. You could then just center a location on his Hero and modify health of all the unit types that you could talk to in that location to 0%. Then just detect which unit indexes have a health of 1 and thats the unit that you are interacting with. Its fairly easy.

To clarify, all units in the game have a unique index number.

That would work if he didn't want to keep the unit's HP easily. Well it depends, but with HP in the hundreds it could cause way too much triggers.

What I was thinking of was moving nearby units one by one to a static area whose coordinates is known, then have a series of triggers detecting which 'unit index' has the current coordinate of that area. Couldn't work so well for stacked air units though, or maybe a similar effect could be achieved with unit order coordinates.



None.

Mar 24 2010, 12:51 am Kaias Post #14



Quote from Randy.G
O.O Where can i read this tutorial
There is no such tutorial. I'm trying to remember off the top of my head, but I believe the EUDs for detecting health being 1 is:
Player 8 has suffered At most 256 deaths of [13478 - (Index#-1)*7]

You can find the index number of a unit by going into properties of a unit in the latest version of Scmdraft under the index column.



None.

Mar 24 2010, 12:51 am Randy.G Post #15



-.- I have no idea how to detect or use the unit whatchamacallit. Although combined with what you said yoonkwun it sounds like exactly what I want to be using.



None.

Mar 24 2010, 12:53 am Kaias Post #16



Quote from name:yoonkwun
That would work if he didn't want to keep the unit's HP easily.

What I was thinking of was moving nearby units one by one to a static area whose coordinates is known, then have a series of triggers detecting which 'unit index' has the current coordinate of that area. Couldn't work so well for stacked air units though, or maybe a similar effect could be achieved with unit order coordinates.
This would work too.

But if you don't care about retaining these units' healths then you may as well use health detection.



None.

Mar 24 2010, 12:57 am Apos Post #17

I order you to forgive yourself!

Kiss




Mar 24 2010, 1:01 am Randy.G Post #18



:( sounds like if I want to add it, it would be near the end since only SCMDRAFT uses it and I'm not to fond of the program. Thanks anyway, I'll be heading over to concept ideas to see if anyone can stir up a way to handle in game relationships.



None.

Mar 24 2010, 1:04 am Apos Post #19

I order you to forgive yourself!

If someone tries to talk to one of your units, just display a random message and it should work. (Make enough so the same message doesn't show to often. (This should be even better than tracking the units since you get the same amount of message as you wanted but less repetitively.)

Post has been edited 1 time(s), last time on Mar 24 2010, 1:08 am by apos. Reason: Double posted so I edited the wrong post




Mar 24 2010, 1:12 am Kaias Post #20



Quote from Apos
I'm not sure who that was directed at, but I consider my method far superior and more simple than yours.

Quote from Randy.G
:( sounds like if I want to add it, it would be near the end since only SCMDRAFT uses it and I'm not to fond of the program. Thanks anyway, I'll be heading over to concept ideas to see if anyone can stir up a way to handle in game relationships.
99% of SEN the userbase uses Scmdraft, and with good reason. What are you using if not Scmdraft?



None.

Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[03:08 pm]
Oh_Man -- example of wat u mean?
[05:59 am]
NudeRaider -- *is
[05:17 am]
NudeRaider -- despite all its flaws the sound design its fantastic
[10:29 pm]
Oh_Man -- homeworld 3 = massive disappointment
[2024-5-14. : 10:05 am]
Moose -- ya
[2024-5-14. : 5:23 am]
zsnakezz -- yes
[2024-5-12. : 8:51 pm]
l)ark_ssj9kevin -- Are you excited for Homeworld 3?
[2024-5-12. : 8:44 pm]
l)ark_ssj9kevin -- Hi Brusilov
[2024-5-12. : 4:35 pm]
O)FaRTy1billion[MM] -- Brusilov
Brusilov shouted: Hey, what happened to EUDDB? Is there a mirror for it somewhere? Need to do a little research.
my server that was hosting it died
[2024-5-10. : 8:46 pm]
NudeRaider -- Brusilov
Brusilov shouted: Hey, what happened to EUDDB? Is there a mirror for it somewhere? Need to do a little research.
https://armoha.github.io/eud-book/
Please log in to shout.


Members Online: 9alicee3385ha1, Ultraviolet, 6audreyc5485er9