Jump to content

AI problem


Helkor Duner

Recommended Posts

On 2/14/2019 at 1:46 PM, Fey said:

The H7V1 AI is kinda weird in how it's set up. The player's own rock island is actually within the AI's defense zone, so if the player builds far enough to the right (or moves units on the right side of the island), it triggers the AI's "emergency" mode.

Sorry for a very little off-topic question, but I just checked the map of H7V1, and found out that the left-most Atreides building (rocket turret at 66, 56) is actually outside the right-most border of player's island, so what you said is kinda not true. So how it actually is?

Link to comment
Share on other sites

41 minutes ago, Klofkac said:

Sorry for a very little off-topic question, but I just checked the map of H7V1, and found out that the left-most Atreides building (rocket turret at 66, 56) is actually outside the right-most border of player's island, so what you said is kinda not true. So how it actually is?

The AI react like 4-6 tiles away before reaching the base. In this case what Fey said it's true.

Here it's the proof: https://prnt.sc/msdssu

I placed a bunch of devs and some windtraps (+ outpost + reveal map=0) at the right part of the rock area; there is still a couple of more tiles that I could place my units, but wasn't even needed. You can see how the Atreides initial spawn it's already rushing me.

Walls also count.

Link to comment
Share on other sites

4 hours ago, Klofkac said:

Sorry for a very little off-topic question, but I just checked the map of H7V1, and found out that the left-most Atreides building (rocket turret at 66, 56) is actually outside the right-most border of player's island, so what you said is kinda not true. So how it actually is?

Aye, what Cm said. There should be a "base defense radius" parameter in the AI that should govern this behavior, IIRC, and typical of AIs is a few tiles out from the box it draws around all its buildings.

Link to comment
Share on other sites

7 hours ago, Fey said:

Aye, what Cm said. There should be a "base defense radius" parameter in the AI that should govern this behavior, IIRC, and typical of AIs is a few tiles out from the box it draws around all its buildings.

Do you know what parameter is that? Is it one of the "unknown" parameters in AI?

Link to comment
Share on other sites

4 hours ago, Klofkac said:

Do you know what parameter is that? Is it one of the "unknown" parameters in AI?

On the AI tab there is a "BaseDefenseRadius" set to 64, but that doesn't seem to do anything. Reducing the number the AI still comes at me when I approach a certain tile (6 tiles of distance from the wall).

I tried with "0" and "4" (in case the value it's bynary, so 2^2), but nothing.

Probably you can't change that, because AI units are always using the "guarding" command by default. So even the player's units will start figthing if you set them with the "guarding" command once a unit come 5-6 tiles next to your unit.

Edited by Cm_blast
Link to comment
Share on other sites

7 hours ago, Klofkac said:

Do you know what parameter is that? Is it one of the "unknown" parameters in AI?

I didn't know what the BaseDefenseRadius did, I never touched it, but apparently it doesn't do what I thought it might.

What I do know is that Defense Areas can be used to override the AI's default defense box. Use of defense areas comes with a bunch of other weird behaviors though, like my AIs won't send units to repair after they're assigned to a defense area, so that's kinda unfortunate.

Link to comment
Share on other sites

On 3/1/2019 at 3:49 PM, Fey said:

Hey, nice timing. I just got on. :P

Intervals are timers measured in tics. 25 tics = 1 second in in-game time, 1500 tics = 1 minute. What differs intervals from timers is this:
 - You can specify how many times you want the event tied to an interval to run.
 - It has different timers for initial trigger and repeated triggers.

So, let's say you want to have reinforcements show up for the player at 5 and 8 minutes in, and that's that. The interval would have:
 - 7500 Start Delay
 - 4500 Interval
 - 2 Run Count

Reinforcements will show up at 7500 tics, then another 4500 tics later, and then never again.

Casualties are kind of weird, but they work around proportions. You've got a threshold and proportion, and what they do is this:
 - Thresholds are how many units, minimum, need to be lost for the faction this is for.
 - Proportions are a ratio of how many units are killed compared to how many units are lost.

So let's say you don't care about the proportion and simply want to make it so that "when 10 units are lost, my event will trigger." Here's what ya'd do:
 - Set the threshold to 9. It will trigger when units lost surpasses the threshold.
 - Set the proportion to 0.001. This is failproof as the side would need to kill 1,000 units for every 1 lost to make the event not work.

And there you go.

Now, just as a good final example, let's say you want the player to be doing really well against an AI enemy for them to receive infinite reinforcements, you want the first reinforcements to arrive no sooner than 10 minutes in, and it's on an interval for every minute. Here's how we'd set that up:
 - Create an interval with start delay 15000 (ten minutes), interval 1500 (one minute), and a run count of 99999.
 - Create a casualties event with a threshold of 49 and a proportion of 1.100.
 - Add a reinforcement event giving the AI one Combat Tank using both of the above conditions.

Once that's done, the player will need to kill 11 units for every 10 lost AND 50 of the AI's units will need to die before the casualties condition is met. If that's done, then one Combat Tank will arrive every miunte (at 10 minutes and on) for that AI. Should the player lose enough units compared to the AI, the casualties condition will no longer be met and the Combat Tanks will stop coming.

Hope that helps!

Returning to the condition of "casualties". I looked it again, but I did not see the fractions. How to understand the "Flags?:", where instead of a fraction is a long number of zeros. And under what condition the event is executed - if the true proportion is greater than that specified in the event and when the threshold is greater?

I’m trying to figure out if this condition can be done so tat if a player reaches a high KD (that is, if there are more kills than losses in a certain number of times), then the event is executed.

663160399_(297).png.77a0b448d0933e4a7e1a15c499433262.png

Edited by Helkor Duner
Link to comment
Share on other sites

36 minutes ago, Helkor Duner said:

Returning to the condition of "casualties". I looked it again, but I did not see the fractions. How to understand the "Flags?:", where instead of a fraction is a long number of zeros. And under what condition the event is executed - if the true proportion is greater than that specified in the event and when the threshold is greater?

I’m trying to figure out if this condition can be done so tat if a player reaches a high KD (that is, if there are more kills than losses in a certain number of times), then the event is executed.

663160399_(297).png.77a0b448d0933e4a7e1a15c499433262.png

You have impeccably good timing, my friend. XD I get on after like twenty hours and see you posted twenty minutes ago. lol

I dunno how that keeps happening, it's just funny.

Uhh... anyway, pardon me! The "Flags?" was changed to a proportion in a later update. The flags are actually... well, here:
https://www.h-schmidt.net/FloatConverter/IEEE754.html

Put 1.1, 1.25, etc in the "You entered" spot and then copy part of the hex representation into the editor. 0.9 means the player needs to lose 9 units for every 10 killed. 1.5 means the player needs to kill 15 units for every 10 lost. Or... not necessarily the player, but any opposing faction present on the map, really. Apparently, it all counts.

If you want more info on casualties research, here ya go:
https://forum.dune2k.com/topic/27397-condition-type-casualties-research/

And if you want to deal with casualties as a proportion, the latest version of the editor can be found here:
https://forum.dune2k.com/topic/27824-map-and-mission-editor-finally-a-small-update-after-all/?do=findComment&comment=396362

(some minor additional setup might be needed with the new tool, but it has a ton of useful new features).

Hope that helps!

Edited by Fey
Link to comment
Share on other sites

On 3/5/2019 at 7:55 PM, Helkor Duner said:

Returning to the condition of "casualties". I looked it again, but I did not see the fractions. How to understand the "Flags?:", where instead of a fraction is a long number of zeros. And under what condition the event is executed - if the true proportion is greater than that specified in the event and when the threshold is greater?

In the most recent version of the editor, Klof changed that part, this is what it show now.

 

Fey already pointed you some directions, the most easy part it's simply downloading the new version and start trying for that; to get extra info you can open later (with a newer version) the original Ordos final maps, which make use with the mercs.

I did research when the flag was still hexadecimal, I don't remember exactly, but if you set a proportion of 2,000, that means that for every kill the current faction do, 2 casualties need to suffer to trigger the event.

The threshold it's just to avoid that if the faction suffer 1 casualtie the event trigger early. I can't tell you (honestly, I don't remember) how exacty the threshold works, but I think if in the "proportion = 2,000 - threshold = 10" scenario the faction (Atreides in this case) need to loose double units per kill +10, so if this faction kill 20 enemies, need to loose 50 to trigger the event.

I may be a bit wrong on the treshold part, so feel free to explore that. And check the Link Fey pointed about the research I did (2 years and a half ago; I can't remember everything) to pick up the whole meaning; Probably somewhere I write if the buildings count or not, of if the ally of that faction killing enemies count or not.

I only know that doesn't matter if it is infantry or dev, both count. Not sure about deviators though. and I never tried if "killing" sandworm also affects.

Edited by Cm_blast
Link to comment
Share on other sites

12 minutes ago, Cm_blast said:

ayy lmao

Also, just for the record: If you're doing precision casualties triggers (always trigger past a certain threshold), it's a greater than value, not greater than or equal to.

In other words, if you have 10 enemies on a map and the threshold is set to 10 and proportion to 0.001, you'd need to actually kill 11 enemies to make the event go.

Whether the sandworm works or not could be interesting. 😮 It probably does count for side 7. It dies and respawns on a timer; I think that's how its "sleep" works.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...