Jump to content
Helkor Duner

AI problem

Recommended Posts

Hello. I tried to create missions for the company. Now there was a problem. I am sure that in most of the original missions, bots do not create engineers and MCV even if it is required (except for maybe 9 levels). But in my mission, the bot still hires engineers. It is desirable for me to get rid of attacks on buildings from the enemy at all (as is necessary in the mission), I tried to change all the values - make first attack building delay to 9999999, attack building stength 0, etc. All this does not help.

Share this post


Link to post
Share on other sites
34 minutes ago, Helkor Duner said:

Hello. I tried to create missions for the company. Now there was a problem. I am sure that in most of the original missions, bots do not create engineers and MCV even if it is required (except for maybe 9 levels). But in my mission, the bot still hires engineers. It is desirable for me to get rid of attacks on buildings from the enemy at all (as is necessary in the mission), I tried to change all the values - make first attack building delay to 9999999, attack building stength 0, etc. All this does not help.

Hey there!

The value to prevent the AI from making Engineers is in the UnitBuildPriority. Set this to 0.000:
https://prnt.sc/mj8pw2

That will make the AI never train Engineers. The UBPs can be customized to make the AI use a specific combination of units. In that AI, the Missile Tank is set to 0.010, so the AI will make sure to have at most one Missile Tank among its forces at any time - and that's all.

It's impossible to prevent the AI from attacking buildings unless you make those buildings belong to a side friendly to that AI, but setting all "AttackBuildingPriority" entries to 0.000 will cause the AI to attack the nearest target, not specific buildings (note: this will break special weapons like Saboteurs). You can also set their Morale AttackBuilding and MinMorale to 0, though they may send at least one attack before never doing it again.

Also, make sure EnablePractice is set to 0 unless you want the AI to build new structures beyond what you place on the map for them. Among other weird things "practice AIs" tend to do, like build MCVs.

Hope that helps!

Edited by Fey

Share this post


Link to post
Share on other sites
2 minutes ago, Fey said:

Hey there!

The value to prevent the AI from making Engineers is in the UnitBuildPriority. Set this to 0.000:
https://prnt.sc/mj8pw2

That will make the AI never train Engineers. The UBPs can be customized to make the AI use a specific combination of units. In that AI, the Missile Tank is set to 0.010, so the AI will make sure to have at most one Missile Tank among its forces at any time - and that's all.

It's impossible to prevent the AI from attacking buildings unless you make those buildings belong to a side friendly to that AI, but setting all "AttackBuildingPriority" entries to 0.000 will cause the AI to attack the nearest target, not specific buildings (note: this will break special weapons like Saboteurs). You can also set their Morale AttackBuilding and MinMorale to 0, though they may send at least one attack before never doing it again.

Also, make sure EnablePractice is set to 0 unless you want the AI to build new structures beyond what you place on the map for them. Among other weird things "practice AIs" tend to do, like build MCVs.

Hope that helps!

Thank you very much, this information will be very useful to me.

Share this post


Link to post
Share on other sites

Fey already answered your question. Keep in mind that the AI will always send eengineers paired with some infantry and trooper if possible. Eengineers, St.Fremen and Saboteurs have their own behaviour and his attacks canot be modified directly. As soon as those units are ready (or Sab has the full Stealth bar) they will "attack".

But yes, a priority of "0.000" will prevent that AI to produce the specific unit on the name.

Edited by Cm_blast

Share this post


Link to post
Share on other sites

Hello again, I will not even create a new topic. I completed this mission, about the effect that I wanted, I received. In the new mission, I have another task, which I have been trying to set up for an hour.

It is necessary to make AI attacks similar to the attack of the Harkonnen from the 7th mission for the Atreides. There, they wait a fairly long time, train the army, units do not go anywhere, but then a large army sharply attacks. I even tried to completely copy the settings of Harkonnen from that mission, but alas, it did not help.

What happens to me? From the very beginning of the mission, the enemy begins to train the trikes on one base, to order a missile tank to the old port on the other base. After they immediately attack.

Thanks.

On 2/10/2019 at 10:35 PM, Fey said:

No prob, mate! If ya need anything else, there's the AI manual:
https://forum.dune2k.com/topic/27803-d2k-ai-manual/

Or ya could always ask me. I helped Cm_blast write it. :)

On 2/10/2019 at 10:55 PM, Cm_blast said:

Fey already answered your question. Keep in mind that the AI will always send eengineers paired with some infantry and trooper if possible. Eengineers, St.Fremen and Saboteurs have their own behaviour and his attacks canot be modified directly. As soon as those units are ready (or Sab has the full Stealth bar) they will "attack".

But yes, a priority of "0.000" will prevent that AI to produce the specific unit on the name.

619976497_(226).thumb.png.efd0dbba9b00a873cf7a0a29e6da1dd1.png511639094_mapimage.thumb.jpg.2df9b2d624ffd58d9acebf52ee7cb34a.jpg

Edited by Helkor Duner

Share this post


Link to post
Share on other sites
7 hours ago, Helkor Duner said:

snip

Hallo!

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. This forces it to ignore its cashstash and switch from a 1250 tic buildrate to a 1 tic buildrate, and it'll send defense forces to your base since it thinks you're in its base.

The AI you've got there has a build rate of 1000 tics, which is one unit every 40 seconds. And this could be a tank or just a Light Infantry. Since it attacks every 9000 tics (6 minutes), it'll send very few units along with whatever it's ordered at the starport.

To make the AI build up more stuff for a stronger attack, change the BuildRate parameter to something faster, like 250-500 (new unit every 10-20 seconds). You could also boost the AttackBuildingStrength to something like 50-70 so the AI dedicates more of its standing forces to an attack. You could also spawn some free units in at the start so the AI gets a little something to buff up its first attack, and fill in the blanks with some reinforcements. Not too many reinforcements though, just a couple of Carryall drops near the start will do to keep the player on his toes.

If the AI is attacking constantly, it seems you've got two side 1 bases there in a formation where the AI's defense area will be in the player's base. That's probably the issue. Try making the bottom-left or top-right bases belong to a different allocation index, so the defense boxes are drawn like this:
https://prnt.sc/ml0ww6

Instead of like this:
https://prnt.sc/ml0x5t

Hope that helps. :)

Share this post


Link to post
Share on other sites
7 hours ago, Helkor Duner said:

Hello again, I will not even create a new topic. I completed this mission, about the effect that I wanted, I received. In the new mission, I have another task, which I have been trying to set up for an hour.

It is necessary to make AI attacks similar to the attack of the Harkonnen from the 7th mission for the Atreides. There, they wait a fairly long time, train the army, units do not go anywhere, but then a large army sharply attacks. I even tried to completely copy the settings of Harkonnen from that mission, but alas, it did not help.

What happens to me? From the very beginning of the mission, the enemy begins to train the trikes on one base, to order a missile tank to the old port on the other base. After they immediately attack.

Alright, I was about to answerd this but Fey caught me.

Overall it's just this part.

24 minutes ago, Fey said:

Instead of like this:
https://prnt.sc/ml0x5t

the AI just draw an imaginarie rectangle around all the buildings owner of that AI; I am talking only about the Harkonnen ones, here the smuggler and Atreides doesn't count. As you can see, the player it's inside the area the AI it's about to defend, it believes that you are attacking it because you are "near" his base; that's the logic the AI uses and, because of that, he will try to fight you with any units available.

The best you can do it's what suggest Fey: 1 of those two bases, instead using the "harkonnen" side; change it into other side; Imperial, for example.

Then, on the missions settings change the alloc. index of the Emperor to be Harkonnen and that's it: of course later you need to update the Imperial AI tab, but at this point I guess you know how to do that (or you can just simply export/import the one the Harkonnen are using to have those two Ais to behave the same).

With that it's enough; with the "first attack building delay" you can control the time the AI waits until attacking for the first time. The bigger the number it's, the more time the wait to attack the first time.

Remember that 1500 ticks = 1 minute (in game time); so if you want that AI to wait 15 minutes before attacking the first time, his first attack building delay needs to be 15*1500 = 22500 ticks.

Edited by Cm_blast

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×