The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 871 - File: showthread.php PHP 7.4.33 (Linux)
File Line Function
/showthread.php 871 errorHandler->error




Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
some AI work
#1
I've been doing some stuff with the Yuri AI, working mostly on special attack type stuff like repairing multiple bridges, using alternate attack routes, and making invasion forces with multiple transports grouped together. I've got the multiple bridge repair stuff working decently, but it's not perfect yet because I'm still figuring out how to force it to take certain routes / go to certain bridges. One of the main things I still need to figure out is exactly what logic is attached to the different numbers that can be added to the buildings list (0,65534,131072,196608). There definetly is some logic attached to them and I think I understand some of it, but not all of it is clear yet. I tested this stuff out on the Bering Straight map against one soviet AI with either me in the bottom left corner and them in the top right corner or the other way around.

The TaskForce I used was

1 Soviet Engineer (SENGINEER)
1 Flak Track (HTK)

and the Script I used was

14,0 - Load Transport
47,30+(0,65534,131072,196608) - Move to enemy Bridge Repair Hut
8,2 - Unload and lose transport
46,30+(0,65534,131072,196608) - Attack enemy Bridge Repair Hut

Using the different building offsets in this script causes 4 different results and so far these are my best guesses as to what each offset number does

+0 (no offset) ?= goes to the building that is closest to the top of the map and reachable

+65534 ?= doesn't go anywhere even if all buildings are reachable

+131072 ?= goes to the building that the team is currently closest to

+196608 ?= goes to the second reachable building within a certian min/max distance range, also must be enemy to attack

These results could be off some from what the numbers actually mean, but this is my best guess using these test conditions. The one I'm most certain about is 131072, the others seem less predictable. I'm thinking they have something to do with distance, or possibly threats / enemy ownership.

The other big thing I've been working on is trying to get a group of more than one loaded transport to attack at the same time. I've managed to get 2 transports to load and get into one team using "shell" teams and some Change Team(18,n) trickery, but once they're together the first transport that loaded starts acting screwy like its being dragged around and always ends up getting stuck. I'm thinking its getting hung up on the Load Transport(14,0) command when the second group is loading, and doesn't recover after that. I've been testing this stuff using Soviet Heavy Tanks and Armored Transports and these are the steps I've been taking -

Step 1: Create the first team with 4 tanks and the transport and load them up - the taskforce is just 4 tanks and the transport, the script just tells them to Load Transport(14,0) then it has them join/create the second team with Change Team(18,n)

Step 2: Force Create the second team that contains all the units and load the next 4 tanks - this is done by the Change Team(18,n) command from the first team/script. From what I can tell when members of a team's taskforce have been put into that team then the rest of the missing members are created and the script is run. The taskforce of the second team is just 2 transports and 4 tanks, this is because it seems to consider the joined transport as empty, so it then creates 1 transport and 4 tanks, but since the first transport is full the 4 tanks load into the second transport. Theres no problems getting the 4 tanks in the second transport, but its about this time that the first transport starts acting weird. After both transports are loaded I either have them join a third team that has a taskforce of just 2 transports and a script of Gather at the enemy base, or I just put that script stuff after the rest of the second script. Either way the result is that the second transport that loaded acts fine, but the first one floats around weird and gets stuck somewhere. I thought using the third team and setting Full=yes in the TeamType properties would help, but it doesn't work when the third TaskForce is just 2 transports or the 2 transports and the 8 tanks.

(note - using the Change Team command seems to be able to override the Max=n value in the TeamType properties)

I've also tried a different way of getting 2 loaded transports to work together by loading the first one, having it Gather, then using the Guard Area command as a "Wait" command for the time I give it, then move to the destination and Unload. The second transport loads then Gathers at the same place, then has the Follow Friendly command to follow the first transport to the destination, then the Unload command. This almost works and both transports Gather at the same place, but the since the first transport is still sitting there in Guard Area for a little while the second transport just pauses for a second for its Follow Friendly command, then moves onto its Unload command. I'm thinking I can get this method to work somehow by switching around some of the commands in one team to the other or something, or by using some Change Team voodoo somewhere.

Theres some other crazy ideas i've thought about messing with, but they'd required hacking up the rules file and once I start doing that I'm sure I'll get tempted by a lot more bad ideas. One of the ideas is making units transform into other "twin" units that are used for special purposes by the AI, either by deploying into an intermediary structure that undeploys into the second unit, or possibly by using some of the genetic mutator stuff. I'm not sure if its possible to get the AI to undeploy structures yet. The other idea was to try to add in some AND logic for the triggers to require multiple combined conditions to set off a trigger. I think it might be possible by "linking" some triggers and using some invisible dummy units and the right TeamType properties, specifically ones dealing with recruitability/recruiter and some Change Team commands, but i'm thinking you'd need an exponential number of dummy units for each additional condition, and some way to kill off the dummy units individually. Right now it just seems a little too dirty.

Right now I'm just trying to figure some stuff out about some of the Script commands and TeamType properties like -

Scout(48,0) - does it actually work at all ? and if so how ? I think i've got it to move units different directions occasionally, but it seems to be very unreliable and most of the time they don't go anywhere.

Move to enemy(47,n) / Move to friendly(58,n) - how do each of them handle neutral buildings, or what if you tell it to Move to enemy but give it a friendly building, or the other way around.

Prebuild= - does it actually work ?

UseTransportOrigin= - how exactly does it work? the guide doesn't seem to cover everything about it

LooseRecruit / AreTeamMembersRecruitable - are they different and if so how ? I'm thinking LooseRecruit causes the TeamType to be dissolved automatically when the Script is done and AreTeamMembersRecruitable waits until they are actually recruited to dissolve the TeamType.

Lastly, how does the AI handle the units it starts with ? They seem to be recruited for TeamTypes that have recruiter=no so I'm thinking they might be handled in a special way.
Reply


Messages In This Thread
some AI work - by matt7785 - 20.07.2007, 02:45:40
RE: some AI work - by Dracaveli - 20.07.2007, 07:05:50
RE: some AI work - by DCoder - 20.07.2007, 07:56:36
RE: some AI work - by matt7785 - 20.07.2007, 20:08:38
RE: some AI work - by DCoder - 20.07.2007, 20:29:52
results + more ideas - by matt7785 - 23.07.2007, 22:25:59



Users browsing this thread: 1 Guest(s)