Jump to content

AI Question - Making Missions


Legion

Recommended Posts

Hello guys. 

I'm new to making missions for dune. I have learnt alot and already made 1 mission work well. However the 2nd mission I have mad, involves 2 practice mods AI's flying in an MCV similar to WoL Ared mission 11 where after a condition is tiggered an MCV arrives and the AI starts building a base. Everything works fine until the AI MCV deploys, as soon as it deploys the AI sells the con yard and throws all at the enemy. I've tried looking at WoL Ared 11 for how Feda got it to work for the emperor. But even having the AI allied to all but the player at the start then the allegiance changes after the AI deploys the con yard, it still just sells it. They have 50,000 credits so its not a money issue. I'm abit lost as to why they just sell as soon as they deploy. Any help would be amazing.

Thank you.  

Link to comment
Share on other sites

On 6/30/2021 at 9:21 PM, Legion said:

Hello guys. 

I'm new to making missions for dune. I have learnt alot and already made 1 mission work well. However the 2nd mission I have mad, involves 2 practice mods AI's flying in an MCV similar to WoL Ared mission 11 where after a condition is tiggered an MCV arrives and the AI starts building a base. Everything works fine until the AI MCV deploys, as soon as it deploys the AI sells the con yard and throws all at the enemy. I've tried looking at WoL Ared 11 for how Feda got it to work for the emperor. But even having the AI allied to all but the player at the start then the allegiance changes after the AI deploys the con yard, it still just sells it. They have 50,000 credits so its not a money issue. I'm abit lost as to why they just sell as soon as they deploy. Any help would be amazing.

Thank you.  

Hey mate. This is an easy fix, thankfully - the AI as a practice mode AI will keep fighting until it thinks it cannot, Because it flies in with an MCV later, it doesn't have an MCV from the start of the map and on, I presume, so because it doesn't have any means to fight, it goes into berserk mode right away. The solution is to place an MCV in some unreachable corner of the map, maybe get rid of it with some neighboring units that turn hostile after that faction deploys a ConYard or otherwise suffers one casualty (above threshold zero), and that'll work.

In this example, a sandworm Deviator spawns in right next to the dummy MCV when another unit that appears alongside the real MCV exists, and as long as a sandworm Deviator doesn't exist. The sandworm side then leaves as long as it owns an MCV, effectively destroying the MCV (and any sandworms that happen to be on the map, temporarily, which is useful for lowering the amount of chaos going on on the map at the time the MCV shows up).
1655939495_deviatorspawn.png.753523bddd9332bf3dc133c252188ba2.png

Very common problem with an easy solution. :) Hope that helps!

Edit: Wait a minute, didn't you pop by the single player Discord server recently? Sorry, I think you asked this there already. Anyway, I'll leave this answer up in case anyone else is wondering about it. Weird, although this question was asked a few days ago, only now did the thread appear at the top of the forum for me.

Edited by Fey
Link to comment
Share on other sites

  • 3 weeks later...

Hey Fey 

Thanks for the help, I have been able to make missions. I have more questions regarding AI. In 1 mission I have a campaign AI who starts with a base, lots of money, silos. But no matter what I set, like build rate to a low 100 - 50 or change unit build pros to higher levels or increase guard/attack/protect group sizes. The AI sits there with lots of money and builds a unit from time to time like maybe 1 tike then 1 light inf, then 1 combat tank. I don't understand I thought the logic is if the AI has the money and group size high and build rate low shouldn't the AI be building from all barrack, light fact and heavy fact all the time. Why does it just sit and maybe build 1 - 3 units over the space of 1-3 mins. They have income and the silos to store the spice, plus large starting amount so money is not an issue. Because with a practice AI, it builds and builds units e.g when a Practice AI builds its 1st barracks it just keeps building infantry like 20+ in the same space the Campaign AI builds 1- 4 units. Like i tested this with a campaign AI vs a practice AI and the practice AI given it has the money will always keep pumping out with all there unit types at all times. While the campaign AI looks like it goes "build 1 Tike, wait wait build 1 tank and 1 inf, wait has a total of 15 units in base, wait build 1 tank, 1 trooper wait wait" meanwhile practice AI almost has an attack force ready to attack. I tried looking for differences between the AI's but nothing I do seems to change this. I feel like westwood has designed two different AI's which have different base programing. Because I put a practice AI in the Campaign AI spot and it started building constantly all 3 and had an army like 5-10 mins, it performed how I wanted the campaign AI to but it was building buildings around the place so yeah. 

 

Regards Legion

Link to comment
Share on other sites

36 minutes ago, Legion said:

units

Sounds like an issue with UnitBuildPriorities. Campaign mode AIs can be rather scary, but they need some configuration to do their best.

Basically, unit build priorities are ratios that tell the AI how much of a certain unit to build compared to other sorts of units. Like three Light Infantry for every Combat Tank, for instance. Obviously, Light Infantry are trained very fast compared to Combat Tanks, so the AI will actually stop training Light Infantry to reach its quota of Combat Tanks before continuing.

The answer is to calculate a good balance of units to be built from each sort of factory available to an AI. I like to use a total value of 18-20 for all infantry, 8-10 for all light vehicles, and 6-7 for all heavy vehicles. This seems to keep an AI producing units regularly.
1895972195_unitbuildprioritiesexample.thumb.png.3abc8fba50bd347f7ce20ce357ce71cd.png

When a campaign AI is configured properly, it can be a serious threat.
110297880_configuredproperly.thumb.png.7b72e4a34121b75802c3c3e029b8f95c.png

You may also need to change some other things if you want it to be aggressive. AttackBuildingStrength, for instance. These two AIs have an ABS of 100, meaning they send all available units on each attack. They also have GGS (GuardGroupSize) disabled, meaning zero units are assigned to defense, but the AttackBuildingPriorities also all being set to 0.000 mean they'll send attackers towards the nearest unit or structure. Which is how they achieve any form of defense - if the player has moved out of his base with a bunch of units, those units will be the next target. There are also units other than Harvesters scattered around that the AI is set to protect, another way in which it defends itself.

Another neat trick is placing units on the map that are in the UnitBuildPriorities. Sonic Tanks in the screenshot list up there have a priority of 0.750, so the AI never builds them until the player makes some progress. After damaging some Sonic Tanks that are carefully placed directly in the way of where the player is inclined to go, the AI will send those pre-placed Sonic Tanks back to a Repair Pad for repairs, and then assign them to attack the next time it's ready to attack. Then, because the AI sees it's lacking in Sonic Tanks, it'll build another at the factory to reach its ratio.

Hope that helps.

Link to comment
Share on other sites

Legend thank you FEY. That's some crazy looking units there haha, I'll mess around with the unit build priorities and see if it fixes the campaign AI.  Also How do I do colours, I was using indexing like index 9 is like a light blue weird colour. But how do you and others make true different colours? 

Edited by Legion
Link to comment
Share on other sites

1 hour ago, Legion said:

Legend thank you FEY. That's some crazy looking units there haha, I'll mess around with the unit build priorities and see if it fixes the campaign AI.  Also How do I do colours, I was using indexing like index 9 is like a light blue weird colour. But how do you and others make true different colours? 

Just think that the AI always build following their priorities, just as Fey said.

If an AI is said to build 1 of each unit and you give him the barracks and the heavy factory + Ix, one infantry will be trained, then a devastator, and will wait just to have a second infantry because the AI is set to never have 2 infantry if there isn't at least 1 devastator ready.

So it's all about thinkin on the proper priorities; once, on a tech 1 of AI (trike and infantry only) I manage to make it to build units non-stop from both production at the same time. Although with higher tech it's not that easy but it can be done to be a faster production.

Fey is more expert than me, but if you want your AI to be stronger than the practice AI (for example), you can make the AI to have a high-production of infantry, a middle production of heavy vehicles and a low production of light vehicles. Yes, vehicles build faster, but they also are the units to die the first, so after the first enemy wave, and once all the light vehicles are killed the AI will start mass-produccing then at the base while the slower heavy machinery/troopers are still figthing.

Edited by Cm_blast
Link to comment
Share on other sites

2 hours ago, Legion said:

colours

Feda's new mission launcher is extremely powerful for modding. It allows you to load mods on a per-mission basis, and colors separately from that! So you can customize a colours.bin and select it for use with a CustomCampaignData folder and the new Mission Launcher.

Here's a thread about the new Mission Launcher:

I recommend using the latest version of the d2k editor too, which automatically saves submods to specific folders, among a lot of other things.

But for editing the colours.bin in particular, you'll need this tool:

It can only read a file with that exact filename, so after saving a new colours.bin, you have to rename it manually to whatever the map itself will read. Like COLOURS_18V1.bin.

Anyway, for more info about loading submods, I'd give Feda's tutorial in the Mission Launcher thread a watch. He designed the Mission Launcher after all. It's always a bit of a hassle on the modder's end of things to get everything organized so thoroughly, but making it easy for the player to enjoy any map is the goal.

Hope that helps. :)

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...