Checking for Attackers on a map

A forum for discussing map making ideas and problems for the Myth series.
User avatar
Baak
Posts: 1109
Joined: Sat Mar 20, 2004 6:26 pm
Location: Mything

Checking for Attackers on a map

Post by Baak »

I have a feeling I'm doing something wrong with my GEOM checking for a team attacking. It appears that sometimes it triggers and sometimes it doesn't. I need to failsafe it.

Here's what I'm doing with some questions included - all help greatly appreciated!

GEOM action that includes the following:

Link --> == TEAM 0 MONSTERS ==

Tests for Attacking Monsters

Tested Items Inside Field Name --> subj

Results Action Identifier --> <<<Team 0 Attacking>>>

Entire Map

Activates on Success --> Team 0 Attacked


Questions:

The "<<<Team 0 Attacking>>>" is an empty action. I believe this is where the results of the action go? Is this correct?

Does the GEOM expiration need to be never? I reactivate it after processing "Team 0 Attacked" and when it works it works great.

Does it make a difference if Entire Map is shrunk? If so, is it better to use a circle or a polygon?

Is there something going on where the units that *don't* attack are cancelling out the ones who do by way of the Results Action Identifier?

I'm wondering if there's a split second where units can be attacking and the GEOM doesn't pick it up - possibly because it is checking the entire map and/or because I am doing something obviously wrong.

It works great when it works but is frustrating that it is not failsafe.


This is the only way to check for attacking monsters, correct?

Thanks in advance! :)
gugusm
Posts: 487
Joined: Mon Aug 22, 2005 1:16 pm
Location: Klucze, Poland
Contact:

Post by gugusm »

Hmm, not everything is clear for me, but it looks like in action "Team 0 Attacked" someone should attack Team 0 Attacking, right? If so, you should change your Tested Items Inside Field Name from subj to obje in your GEOM. If I didn't understand right, ignore it.

Next thing is I don't know specifics of Tests for Attacking Monsters, cause I haven't really ever used it.

And maybe some other actions are buggy? I don't think so, but everything may happen...
User avatar
Baak
Posts: 1109
Joined: Sat Mar 20, 2004 6:26 pm
Location: Mything

Post by Baak »

Thanks gugusm -- I tried using obje instead of subj but it appears to make no difference, because the "Team 0 Attacked" action calls another action that attacks the entire team, thus the targets aren't necessary.

When I look at the debug log it appears that sometimes the test for attacking simply doesn't detect that units are attacking. This is what makes me wonder if there's something more subtle going on here that I need to change.

It also doesn't seem to matter if I make the GEOM actions' expiration as "never" and stop them when I'm done later or just leave them as "on successful execution". Seems like the GEOM actions just do their thing until you cancel them.


Something interesting: *one time* when I ran a series of six tests it worked six times in a row!! I continued testing it and it started working sporadically again. Nothing had changed throughout these tests.

This is what makes me think the granularity of the testing for attackers is not fine enough to *always* match when someone attacks.


Anyone else had experience with this? :)
User avatar
Baak
Posts: 1109
Joined: Sat Mar 20, 2004 6:26 pm
Location: Mything

Post by Baak »

Sorry to double post - it's an update:


I've tried just about everything I can come up with, including separate tests using the simplest setup.

It appears from everything I've done that the GEOM filter "Test for Attackers" can't always catch a single attack from a group of units.

Hopefully someone can confirm whether this is true or not. :)
User avatar
iron
Site Admin
Posts: 2006
Joined: Thu Feb 26, 2004 1:21 am
Location: diving out of the Sun at 10 o'clock high!
Contact:

Post by iron »

A few comments...

Entire Map is fine if you don't have a need for identifying units within a specific geometry, as with Entire Map it'll simply check every unit in the list you provided. If you do need to filter them, a circle geometry is an easier test for Myth to perform than a polygon test.

Anyway, I'd say the granularity is at fault. What's the trigger time on the action?

Lastly, if you simply want to see if a group of units is being attacked or in danger of attack, you're probably better off with the tried and tested TUNI, testing for "Change in Vitality" and/or "Enemy Closer than Radius".
User avatar
Baak
Posts: 1109
Joined: Sat Mar 20, 2004 6:26 pm
Location: Mything

Post by Baak »

Heya iron! :D


This test is part of my StoneHeart map and works very well for maps where players start with more and varied units. I'm doing an update and would really like to "failsafe" this scripting if possible. The reason it differs from most tests is the object of the whole thing: Players are not allowed to attack before a siren blast (because they are in such close quarters). If they should attack early, they risk the "Wrath of Baak" (some nasty red lightning from the sky!).

I do "Entire Map" because the starting units could have been converted to Leggo Airships or something else odd, so it seems easier than a very large circle.

I need to know who attacked because I have to whack 'em! ;) This is also why I don't necessarily need to save the attackers info, because I have had it broken into teams that are attacked "as a team", adding a little randomness to the wrath.


That said, I have tried doing the GEOM with "never" expires (but killing later), 0.00 trigger time - also with "on successful execution" expiration and 0.00 trigger time and then having the Wrath kick off the GEOM again on deactivation. I've even tried a single GEOM with *all* starting units but saving the offenders to all be attacked - same result.


I'm starting to think it's the granularity because there are times when I do attacks that every single one is caught and other times where whole bunches are *not* caught. It's like the check happens just before/after the actual attack. I may have to just be OK with rolling the dice but I sure wanted to failsafe this!


Man I wish there was a TUNI that said "is attacking" like the "is taunting" one!!! :D
User avatar
Baak
Posts: 1109
Joined: Sat Mar 20, 2004 6:26 pm
Location: Mything

Post by Baak »

I made a super simple test of this on Gimble by adding a GEOM test for the starting dorfs. Alas, it appears checking the Entire Map only catches some of the attacks (i.e. the granularity isn't big enough). :(

What really bummed me out though was the fact that if I removed some of the necessary test params it seemed to find the attackers *every single time* BUT wouldn't succeed (because of the missing params) yet wouldn't give an "error" (as in Activate on Error)! Oh man, I thought I had a perfect solution there! Doh.

So I think I'll try smaller circle test areas for the individual dorfs on my map.

Definitely learned a LOT about how this works though! :)
User avatar
ozone
Posts: 744
Joined: Wed Mar 24, 2004 5:05 pm

Post by ozone »

how many units are in the original subject list?

== TEAM 0 MONSTERS ==


also..wondering if you could send me a text file of the geom and the attack...SO I can see it up close and personal...

maybe?
do it.
User avatar
iron
Site Admin
Posts: 2006
Joined: Thu Feb 26, 2004 1:21 am
Location: diving out of the Sun at 10 o'clock high!
Contact:

Post by iron »

Back in the bad old Myth II 1.3 days, a lot of monster lists would cause problems if they had more than 32 units in them. I'm pretty sure we expanded this limit, but perhaps it'd be worthwhile having a few GEOMs with a smaller list in each?

A more complex method ... edit every unit's attack projectile so that it creates an invisible & stationary projectile that just sits there for 5 seconds or so. Then have the GEOM checking for instances of that projectile ... activating on success another GEOM that finds the closest unit to it ... then whammo :)
Graydon
Posts: 1605
Joined: Sun Mar 21, 2004 5:10 pm

Post by Graydon »

Your goal is to whack the individual units that did the attacking, and not the whole group of that specific Team numbered offender right?

I've always just stayed away from some of those 'Tests for untis doing this', cause inevitably if there's other thigns going on in your map, some of those thigns its cehcking for happen so fast in game, that it just... misses them sometimes. As you've found out.

Maybe try making your GEOM, but having it ACOS a second GEOM just like it that activates a couple of ticks later, sending any ADDITIONAL attacking units containers to a seperate container. Then in your 'Kill the offender' action, you just include both subject lists under your 'link' action. Might fool-proof it a little bit better. ??
Image
User avatar
Baak
Posts: 1109
Joined: Sat Mar 20, 2004 6:26 pm
Location: Mything

Post by Baak »

I've uploaded my very basic separate test case (easier to mess with) on Gimble: the Dorfs you don't have to trade for are all tagged as the potential attackers to monitor in a single GEOM on the Entire Map. If the GEOM succeeds, it calls one of the Tutorial sounds of "KA BOOM!! That'll teach 'em!". To test do NUT/NPT on Gimble and start attacking the ground or friendlies with the Dorf right away.

The zip is here.

Where I left off with my testing that appears in this zip is to have the GEOM expire "on successful execution" and then have the SOUN call the GEOM again on deactivation. I've tried all the permutations: GEOM of "never" initially starting, etc., etc. You're all welcome to try anything and everything - just wanted to let you know where I left off last.

I'm next going to try smaller circle checks on each team on my actual map and will report my progress here.


ozone: In my map I've had 20 or so units per team and as little as 6 per team. What I'm noticing is that using "Entire Map" seems to miss if you do an attack with one Dorf or one Warrior, whereas a single Bowman almost always works. I think it must be the longer attack of the Bowman gets caught. A single Warlock seems to always trigger it as well.

iron: I keel u! :D Seriously - this would be insane because this map is used all the time for Rocket Dorf Fest, Bushido, Trebuchets, Airships, Uber Ghol Riot, WWII - even SitH. Unfortunately I'd have to keep a list of every projectile and do all the substitutions and I'd probably finish in 2017. ;)

Graydon: Actually I am whacking the whole team (just attacking the team but it's a helluva jolt!) so I don't have to save off the offenders. I've tried some permutations leaving those params out but I may give that another go jic. I also did try a combination of a global GEOM that checked for any attackers on all teams present which then kicked off individual team GEOM checks and it worked a bit better, but still not 100%. Perhaps if I tighten that up a bit and/or combine it with the circle areas (i.e. smaller areas even with the initial big check) it might work. I'm game to try anything that ends up being foolproof and doesn't slow the game to a crawl.


Excellet feedback guys! I'm going to bang around on it for another hour here and see if I get anywhere. Let me know if you find anything (I will too). Really appreciate it! :)


Edit: it appears the testing that fails without the geom area params actually doesn't succeed in catching the mons attacking every time as I earlier thought. This is interesting in itself because there is no geom area to test against and it still doesn't catch them all.
User avatar
Baak
Posts: 1109
Joined: Sat Mar 20, 2004 6:26 pm
Location: Mything

Post by Baak »

Oh, great... It looks like a Dorf dropping a satchel is considered an attack!

I think I may have to completely rethink this whole thing... :?

Perhaps I'll go back to iron's previous suggestion of using a TUNI to check for damage to a team and just have an announcement to the effect of "Team X Damaged before Siren - Game is DEAD" that can be ignored in non-tournament games.

May be the easiest way.

Certainly not as sexy as the Wrath of Baak red lightning from the sky! ;)
User avatar
Baak
Posts: 1109
Joined: Sat Mar 20, 2004 6:26 pm
Location: Mything

Post by Baak »

I think I have a solution for the drop the satchel attack problem: I adjusted the mons tag for Dorfs on the map to not include the satchel drop (or satchels) - since half the map is an inside map, that should be fine. The all-dorf map is normally converted to RDF or Flare Dorfs anyway, so this shouldn't be an issue.

The only downside would be converted units that drop satchels on these "starts inside" maps, such as the Rocket Mortar from Bushido.

I think people can live without satchels. ;)


I'll try the smaller circle radius right around the teams tomorrow sometime and post the results here.
User avatar
iron
Site Admin
Posts: 2006
Joined: Thu Feb 26, 2004 1:21 am
Location: diving out of the Sun at 10 o'clock high!
Contact:

Post by iron »

Baak wrote:Perhaps I'll go back to iron's previous suggestion of using a TUNI to check for damage to a team and just have an announcement to the effect of "Team X Damaged before Siren - Game is DEAD" that can be ignored in non-tournament games.
Sorry, even that's not the best. How hard would it be for some 1us3r to arrow one of his own units in the back & thus trigger the announcement?

Or how about healing wights to make pus?

I don't know anything about how your maps setup, so please disregard this is ifs inappropriate ... but how about limiting the area each team can move units within prior to the siren blast, and zap any that stray out of bounds? Would that work?
User avatar
Baak
Posts: 1109
Joined: Sat Mar 20, 2004 6:26 pm
Location: Mything

Post by Baak »

Agreed that someone could shoot themselves - for example if they didn't like the setup, etc. - or even by accident, so the TUNI is definitely out.

I tried the Wight healing and it seems fine, so for some reason a Dorf laying satchels is considered an attack. :)

The way the map works you're in close quarters with gates and the gates go up at a slightly random interval after the siren sounds, which is about 40 seconds after the start. You could actually shoot each other using RDF Mondos, or RD's if the enemy is standing right behind a gate, or toss a flare as a Flare Dorf, etc., which is why I need something to keep people from attacking pre-siren.

I think this will work well now - just have to get the time to do the circle areas around the player starts.

If you want to see how this works right now, the previous version of the map is available at the top of the OoH Downloads - it's called StoneHeart RDF and the version available publicly is v1.1g. The only map on that with the Wrath of Baak is the "Cage 6" map, which also includes the randomly slamming gates after the siren. It's our most-played plugin. I want to get this other fix in to have a "final tourney-ready" version. So on this version if you play Cage 6 with no conversions and drop satchels at the start you'll see the Wrath of Baak (unless it doesn't work of course). Also the new version has no auto-attack for all the inside variants (Cage/Frenzy/Maze).


Edit: Because we sometimes play with Leggo Airships and thus can move outside the start area (right over the walls/gates) I had originally leaned towards "Entire Map" as the area. I'm now going to test using a circle with radius 48 - which gives enough space - and will check *both* for attacking or moving beyond (two different GEOM's I guess?). That way if you move an Airship past the edge... BOOM!!

Is it true that testing a circle of radius 48 will be faster/more efficient than "Entire Map"?
Post Reply