Staredit Network

Staredit Network -> Concepts -> Detecting Health AI
Report, edit, etc...Posted by ShinRa_Soldier on 2004-11-29 at 14:02:06
Ok a few things before I tell you how to do it.

A. It will only work with melee units attacking you
B. if a friendly unit attacks u it won't work.

First off all you can only detect the health for sparate units, for example You can't detect the health of 2 Marines (Unless you can get a following location around both of them) but u can detect the health of 1 Marine and 1 Jim Raynor.

Ok first thing you do is put a location around the unit u want to detect health for. make the trigger so the location follows the unit. (E.g. move location to all 'UNIT' at location 'anywhere', Preserve trigger)

Second is you make a seperate unit, we will call this the "Clone" unit. Make one for all the units you are detecing hp for. (or you can just use the same unit u will just have to set his health to lower than the hero's health) For Example, If I had a Jim Raynor and i wanted to detect his health I could make him a Defiler ''Clone'' (this is good because the defiler cannot attack.)

Ok once this is done its mostly easer from here. Next you place the ''Clone'' unit in its own separate place in the map (should not be visable for the players). Make sure the place where u set the clone is isolated from everywhere else. Next put a location around the area where u set the clone so here are the locations we have so far.

Location 'Jim Raynor' the location that follows the unit
Location 'Heatlh testing area' the location around the clone units area.

Next (you must do this for each unit) make the trigger:

CONDITIONS:
If (Enemy player) brings at least one (Any melee unit) to location 'Jim Raynor'
(Enemy Player) brings exactly 0 (any melee unit) to location 'health testing area'

ACTIONS:
Create 1 (Melee unit) at location 'Health testing area' for (Enemy PLayer)
Preserve trigger
Comment "Whatever"

So when jim raynor is in combat with a melee unit it will create the same unit near the clone unit (Make sure the clone unit is not allied with or owned by the same player as the enemy, this is so they will fight)

Now you do the same thing except change the "Brings Exactly 0" to bring's exactly 1" and u must modify all the triggers to set it so if two melee units are attacking Jim raynor then create 2 melee units at the "health testing area''

And of course this:

CONDITIONS:
If (Clone unit owner) brings exactly 0 of ''Clone'' to location ''Health testing area''

ACTIONS:
Whatever actions u want when the players health is low.
Create 1 "clone'' at location ''Health testing area''

You should understand how it works, of course there can be much more to it for example on mine people could health themselves then switch characters, so, i made it so if the player heals it heals the clone also.

Hopefully that is understandable for most of you if u have any questions ask me !
Report, edit, etc...Posted by Staredit.Net Essence on 2004-11-29 at 15:35:58
That's neat but every melee unit has a different speed so you'd have to use two melee units and do it for every units speed for a unit that may attack it. It would work reasonably well if you did that and had it times right, but it won't work with upgrades unless you use some extra sqitches and mineral counting and stuff.
Report, edit, etc...Posted by ShinRa_Soldier on 2004-11-29 at 15:41:01
First off the units wouldn't have different speed cause the same melee unit that attacks the main person is also the same one that u create at the health testing area, and the ''Clone'' with hyper triggers it create the unit at almost the exact same time as it attack the unit (Considers the location around the Hero isn't very small.) I never used upgrades with it, I never felt the need to. You could replace that will levels then just increase the clones health, Like set the health to the clone to 10% then when the hero levels up u could set the clones health to 20%.
Report, edit, etc...Posted by D-Von on 2004-11-29 at 21:36:26
It wouldnt be perfect, but hey what is. and it would take a few tests to really determine when the real unit's health is low, and the clone has died blankblank times. And defiler would be kinda bad for low hp units because of heal, why not a medic, maybe even a building, or you could do any ranged unit and have it being moved constantly so it wont fire but thats a lot of work for nothing.
Report, edit, etc...Posted by Do0mEd[i]CoN on 2004-11-29 at 21:43:10
QUOTE(D-Von @ Nov 29 2004, 07:36 PM)
It wouldnt be perfect, but hey what is.  and it would take a few tests to really determine when the real unit's health is  low, and the clone has died blankblank times.  And defiler would be kinda bad for low hp units because of heal, why not a medic,  maybe even a building, or  you could do any ranged unit and have it being moved constantly so it wont fire but thats a lot of work for nothing.
[right][snapback]104863[/snapback][/right]


That is a really neat idea. I always wondered about something like that
Report, edit, etc...Posted by ShinRa_Soldier on 2004-11-29 at 21:58:46
Yes any unit that won't fight back (and isn't cloaked) would work i was just using defiler as an example, and yes buildings would even work too, never thought of using that tho, not sure if ill ever need to use this system again, unless I decided to go through with my arena game where your all on a team and you go in and fight in an arena against computer players, but besides that I probably won't use that system so I hope someone else finds it useful! (It took me 2 days to figure this out lol)
Report, edit, etc...Posted by terrenblade on 2004-12-10 at 09:29:51
good Idea thanks, now I can finaly start working on a reverse RPG map biggrin.gif
I'd been wanting to do one for the longest time.
Report, edit, etc...Posted by SaLaCiouS(U) on 2004-12-10 at 09:43:59
This is the same system used in the unpopular AE: After Earth map. The health AI did not work well at all, and had units healing with 570/600 HP still left.
Report, edit, etc...Posted by Urmom(U) on 2004-12-10 at 16:00:28
i dont understand how this detects health wouldnt it just detect whether or not the unit is alive?
Report, edit, etc...Posted by SaLaCiouS(U) on 2004-12-10 at 16:17:45
The unit in the corner dies faster than the normal unit, so when it dies, the computer heals. Unfortunately this system is too inaccurate to use as it creates situations where the computer heals itself when it has 570/600 health, thus using up all it's medkits wastefully. Since you would never use this feature in a map where the computer has infinite medkits, the system is for the most part useless.
Report, edit, etc...Posted by Commanda_Panda on 2004-12-10 at 16:27:55
I don't understand how that would detect health or even what you were talking about, but If you use a trigger to move the unit to a place with a medic and detect how long it takes the medic to heal the unit, you can determine what health they are at.. But you would have to find out how much a medic can heal every second or something. This wont be perfect either. You would have a medic placed out of the loc wit the unit you're testing, If the medic NEVER moves into the loc, the player is fully healed obviously. But If the unit needs to be healed the medic will go into the location and then you can start timing how long it is until the medic finishes, then she will move back to where she was... But this is just an experiment, I haven't tested It, But I'm sure It'll work. This will also take a lot of triggers... plus you can't set the health of another unit perfect to It because you can only set to percentages.

tongue.gif
Report, edit, etc...Posted by SaLaCiouS(U) on 2004-12-10 at 16:35:57
His system which stinks is still A LOT better than that. It had a duplicate unit in the corner with SLIGHTLY less health. Whenever there is an enemy unit near the real unit, it creates a copy of that enemy unit in the corner with the duplicate unit. When the real enemy unit is killed, the duplicate enemy is killed. When the duplicate unit in the corner is killed, the real unit will be healed. The one in the corner dies first because it had slightly less health, so in theory the real unit should be near death when it is healed.

The problems with this are that the chances that the unit is actually being attacked by a unit near it are slim when you have multiple people on one side. You can't use anything but melee units, and anyone who has any micro skills will cause the system to malfunction. There will be a few extra attacks. Everytime the system screws up, it will end up even more screwed up the second time around. Thus you can end up with scenarios where you have 570/600 health and the computer heals itself, wasting a medkit.
Report, edit, etc...Posted by .Coko[CK] on 2004-12-11 at 07:27:02
And also this cannot work for loads of units being around the player, because of the timing.
Report, edit, etc...Posted by Commanda_Panda on 2004-12-14 at 15:56:16
well I'm just saying how you can detect what health a unit is at, Shinra's system would detect If the unit is close to dying, but It don't think It could detect weather a unit is at 50% health....... well anyways jus trying to help.
Report, edit, etc...Posted by SaLaCiouS(U) on 2004-12-14 at 16:37:13
Yes, that is all it is meant to do, check to see if the unit is about to die.
Report, edit, etc...Posted by PearS on 2004-12-14 at 20:48:57
Shinra didn't you quit Starcraft? If not I say you finish the AE series. Maybe people didn't care much for the first...more reason to blow them away with the second...which can ONLY be better because you have more experience and you have some idea what people like and dislike.
Report, edit, etc...Posted by FaZ- on 2004-12-14 at 22:30:58
wtf? this is completely illogical. First off, why dont ranged units work...? you can create copies of them just the same. Anyway, pauses between attacks aren't all the same length, so that will cause problems. Also screwing the system:

- Stim, or any other dmging spell
- Ensnare, Swarm, Etc.
- Either unit running away.
- Shield or life regeneration.

Multiple of the same unit, as you said, would not be a problem. You could set a switch when 1 enters, and create one copy. when exactly 2 units are in the area, set another switch and add another copy. etc for more units.

I don't see why this could help, unless you wanted the approximate life of a unit not in your normal vision. That could be interesting. But still, you can't detect when to use a healthpack or whatnot like someone was talking about. A very odd system, and I can't think of a single map where the system would be needed.
Report, edit, etc...Posted by SaLaCiouS(U) on 2004-12-14 at 22:42:55
He MADE a map that USED the system and it WORKS. There is NO dispute here. The problem is that it DOESN'T work very well for the reasons you think AREN'T problems. As you are just making assumptions where as some of us have first hand expierence seeing this system in action in a map where it WOULD be useful, what we are saying matters where as what you say is incorrect.
Report, edit, etc...Posted by eXiLe on 2004-12-14 at 23:42:51
Thats cool

PS: yo ShiNra did u quit (U) or battle net?
Report, edit, etc...Posted by Commanda_Panda on 2004-12-15 at 17:48:11
So SaL, do you see the reason I even bothered to put that in now?
Report, edit, etc...Posted by SaLaCiouS(U) on 2004-12-15 at 20:42:20
Shinra quit Battle.net and I don't think he's even going to come back and post in here again.
Next Page (1)