Jump to content


Photo

I could use some help makeing the AI use transport ships?


  • Please log in to reply
42 replies to this topic

#1 Titan Cronus

Titan Cronus

    Do unto Others...

  • Members
  • 693 posts
  • Location:Ireland
  • Projects:The Battle of the Pelennor Fields Mod.

Posted 22 March 2012 - 08:54 PM

Hey there people.

I want to make the AI use the transport ships to get to islands. I have been able to make the AI build them which they did not before but they will not garrison them. I have looked in the Mumakil and Siege Tower files to see if I could find anything that would help but I couldn't find anything. I also had a look in skirmishaidata but nothing there either.

I was wandering if anyone had any ideas or knows of a mod where this issue had be resolved?


Thanks a million guys.

Battle of the Pelennor Fields

Made by 1 guy, has 13 Factions, 75+ Heroes, 150+ different units and 200+ Special abilities.

 

http://www.moddb.com...pelennor-fields


#2 Elric

Elric

    Designer

  • Hosted
  • 2,857 posts
  • Projects:Middle-Earth Expanded
  •  Coder
  • Donated

Posted 22 March 2012 - 09:58 PM

you may want to link the original topic in this post because then people can see where the problem started...

#3 Titan Cronus

Titan Cronus

    Do unto Others...

  • Members
  • 693 posts
  • Location:Ireland
  • Projects:The Battle of the Pelennor Fields Mod.

Posted 22 March 2012 - 10:18 PM

Good idea fella.

This issue was brought up in another AI problems post but I decided to make a post just for the transport problem. You can find the post here: http://forums.revora...irmish-enemies/

Battle of the Pelennor Fields

Made by 1 guy, has 13 Factions, 75+ Heroes, 150+ different units and 200+ Special abilities.

 

http://www.moddb.com...pelennor-fields


#4 Yaroslav

Yaroslav
  • Project Team
  • 38 posts
  •  if you need help with the AI ​​and expert coder - contact me))

Posted 22 March 2012 - 11:04 PM

Good idea fella.

This issue was brought up in another AI problems post but I decided to make a post just for the transport problem. You can find the post here: http://forums.revora...irmish-enemies/


you can teach the AI ​​to use the ships as needed. Check scripted-AI as in bfme1(only for ships) and do it. By the way the AI ​​is able to blow bfme1 mines. but that it must be done to understand how it works perfectly scripted-AI.

Edited by Yaroslav, 22 March 2012 - 11:05 PM.


#5 Titan Cronus

Titan Cronus

    Do unto Others...

  • Members
  • 693 posts
  • Location:Ireland
  • Projects:The Battle of the Pelennor Fields Mod.

Posted 22 March 2012 - 11:53 PM

Thanks for the reply fella.

Im sorry, Im not sure I understand what you mean by scripted-AI. Do you mean the the scripting in the actual maps themselves? If so, although it's not the fix I had in mind, I'd like to know how to do it that way and would really appreciate it if you could point me to a map with some examples. But, if by scripted-AI, you mean something that can be done with coding, is there any chance you can point me to the files that will get me started.

Thanks a million Yaroslav.

Edited by Titan Cronus, 23 March 2012 - 09:19 AM.

Battle of the Pelennor Fields

Made by 1 guy, has 13 Factions, 75+ Heroes, 150+ different units and 200+ Special abilities.

 

http://www.moddb.com...pelennor-fields


#6 Yaroslav

Yaroslav
  • Project Team
  • 38 posts
  •  if you need help with the AI ​​and expert coder - contact me))

Posted 23 March 2012 - 09:08 PM

Thanks for the reply fella.

Im sorry, Im not sure I understand what you mean by scripted-AI. Do you mean the the scripting in the actual maps themselves? If so, although it's not the fix I had in mind, I'd like to know how to do it that way and would really appreciate it if you could point me to a map with some examples. But, if by scripted-AI, you mean something that can be done with coding, is there any chance you can point me to the files that will get me started.

Thanks a million Yaroslav.

Look libraries\ai_isengardskirmish\ai_isengardskirmish.map (in bfme 1 libraries.big)
You can did something similarly do for ships... You do not need drastic changes, in the spirit of do-scripts.

to make the AI landed on the island of the same reasons that people are not very difficult, I suppose, but you need to make a new flag AI. Put it on the island. *If flag AI_On True *And if the threat is radius xxx flag> = xxx to run the following script which will make with the troops crossed there.
Later, I'll do it for my mod, and send you this AI.
I think it is necessary to register in a shared library that loads the game.
foun in when installed game folder libraries\ai_men of the west\ai_men of the west.map

Edited by Yaroslav, 23 March 2012 - 09:22 PM.


#7 Titan Cronus

Titan Cronus

    Do unto Others...

  • Members
  • 693 posts
  • Location:Ireland
  • Projects:The Battle of the Pelennor Fields Mod.

Posted 23 March 2012 - 11:54 PM

Thanks Yaroslav.

I found the libraries\ai_isengardskirmish\ai_isengardskirmish.map file but when I open it with the WB, its emply, theres not even the ground (and no scripts).

Battle of the Pelennor Fields

Made by 1 guy, has 13 Factions, 75+ Heroes, 150+ different units and 200+ Special abilities.

 

http://www.moddb.com...pelennor-fields


#8 hoogan

hoogan
  • Members
  • 47 posts
  • Location:Center of the third largest continent on Earth

Posted 24 March 2012 - 12:43 PM

I have had good luck in using transports and other ships, but only by heavily scripting their actions. This means you have to lay out specific instructions on exactly where and what the ships are to do.... and timing is important. If left to fend for themselves, the AI tends to either NOT build them at all or lets them lay around doing absolutely nothing and will not load units. I have tried spawning transports and moving them to shore right in front odf the land units. They ignore them. You need to tell them explicitly to get onto the ships. Whoever wrote this game was in the Army, not the Navy.

Example of scripts from Worldbuilder.. This spawns a unit, moves it to a point on the shore, moves an existing transport to that point, and loads the unit onto the transport. It also triggers other scripts to move the loaded transport to the debarkation point and another to spawn another transport if the first is sunk in transit. However, it will be totally useless if the opponents does ANYTHING not covered by the script.... such as sinking the thing before it is loaded, building a wall or structure blocking the debarkation point, attack the transport and force it away without sinking it - leaving it fully loaded and floating useless with no instructions on where to go, etc.....
*** IF ***
    Timer 'PastureStart' has expired.
    *AND*  NOT  Team 'Pasture1' has one or more units.
    *AND*  NOT  Unit 'PastureTransport1' exists and is alive.
*** THEN ***
  Spawn an instance of Team 'Pasture1' at Waypoint 'Mordor3Walkon'.
  Move Team 'Pasture1' to Waypoint 'PickupPoint3'.
  Spawn Unit 'PastureTransport1' of type 'EvilMenTransportShip' on Team 'PastureTransports' at waypoint Waypoint 'OtherShipSpawnPoint'
  Set Unit 'PastureTransport1' strict control to TRUE.
   Unit 'PastureTransport1' EXACTLY follows waypoints, beginning at Waypoint Path 'PickupPath'
  Enable Script 'PastureLoading1'.
  Enable Script 'PastureTransportReplace'.

This is a lot of effort to tell some fool to get on a ship.
This is not an acceptable substitute for good AI. Scripting should be limited to actions taking place where and when the opponent has zero chance of interferring with the instructions because the instructions are dumb and allow no room for improvisation. I usually include an IF condition to delay any necessary action script until the view is elsewhere and the opponent has no units close enough to take "unscripted" action.

Example.... send a bombard ship in to destroy a defending tower. When the tower is gone, the bombard ship will blithley sit there like a duck patiently waiting for the retribution unless you give further instructions.

My suggestion: Script general spawns, start and stop actions, Don't script details unless you are prepared to script all possible details.

#9 Titan Cronus

Titan Cronus

    Do unto Others...

  • Members
  • 693 posts
  • Location:Ireland
  • Projects:The Battle of the Pelennor Fields Mod.

Posted 24 March 2012 - 06:18 PM

Thanks a million for that fella.

It's quite a lot of work for something thats not really failproof but absolutly better that how it is at the moment. I think I'll have this as my "Plan B" for if I fail to find a way to get the AI to do it on their own.

Thanks again hoogan :thumbsuphappy:

Battle of the Pelennor Fields

Made by 1 guy, has 13 Factions, 75+ Heroes, 150+ different units and 200+ Special abilities.

 

http://www.moddb.com...pelennor-fields


#10 Yaroslav

Yaroslav
  • Project Team
  • 38 posts
  •  if you need help with the AI ​​and expert coder - contact me))

Posted 25 March 2012 - 12:16 AM

.

*** IF ***
	Timer 'PastureStart' has expired.
	*AND*  NOT  Team 'Pasture1' has one or more units.
	*AND*  NOT  Unit 'PastureTransport1' exists and is alive.
*** THEN ***
  Spawn an instance of Team 'Pasture1' at Waypoint 'Mordor3Walkon'.
  Move Team 'Pasture1' to Waypoint 'PickupPoint3'.
  Spawn Unit 'PastureTransport1' of type 'EvilMenTransportShip' on Team 'PastureTransports' at waypoint Waypoint 'OtherShipSpawnPoint'
  Set Unit 'PastureTransport1' strict control to TRUE.
   Unit 'PastureTransport1' EXACTLY follows waypoints, beginning at Waypoint Path 'PickupPath'
  Enable Script 'PastureLoading1'.
  Enable Script 'PastureTransportReplace'.


better to scan the island to find the enemy there, and if so what do the ships and the "stuff" to other units script there.

#11 Titan Cronus

Titan Cronus

    Do unto Others...

  • Members
  • 693 posts
  • Location:Ireland
  • Projects:The Battle of the Pelennor Fields Mod.

Posted 25 March 2012 - 01:33 AM

I don't suppose anyone knows if I can successfully make a map with scripts to deal with the AI of units/transport ships and put it in the libraries folder of my mod, will this AI use it like they do the other AI map files?

Battle of the Pelennor Fields

Made by 1 guy, has 13 Factions, 75+ Heroes, 150+ different units and 200+ Special abilities.

 

http://www.moddb.com...pelennor-fields


#12 Vahagn

Vahagn
  • Members
  • 126 posts

Posted 25 March 2012 - 01:03 PM

Hey there people.

I want to make the AI use the transport ships to get to islands. I have been able to make the AI build them which they did not before but they will not garrison them. I have looked in the Mumakil and Siege Tower files to see if I could find anything that would help but I couldn't find anything. I also had a look in skirmishaidata but nothing there either.

I was wandering if anyone had any ideas or knows of a mod where this issue had be resolved?


Thanks a million guys.


You say your enemy builds Transport Ships after you increase that percentage, right? But mine still doesn't... :( I increased it until 50 if you remember but the enemy only builds fighting naval units...

#13 Titan Cronus

Titan Cronus

    Do unto Others...

  • Members
  • 693 posts
  • Location:Ireland
  • Projects:The Battle of the Pelennor Fields Mod.

Posted 25 March 2012 - 02:39 PM

Yep, mine build all the different ships. This is the code I have for the two different types of ships (evilmen ships and elven ships):
;//////////////// Good Faction Ships ///////////////////////////////////////////////
ArmyMemberDefinition ElvenBattleShip_Member
  Unit   = ElvenBattleShip
  PercentageOfArmyPhase1 = 5.0
  PercentageOfArmyPhase2 = 10.0
  PercentageOfArmyPhase3 = 15.0
End
ArmyMemberDefinition  ElvenFireShip_Member
  Unit   = ElvenFireShip
  PercentageOfArmyPhase1 = 0.0
  PercentageOfArmyPhase2 = 5.0
  PercentageOfArmyPhase3 = 10.0
End
ArmyMemberDefinition ElvenShoreBombardShip_Member
  Unit   = ElvenShoreBombardShip
  PercentageOfArmyPhase1 = 0.0
  PercentageOfArmyPhase2 = 2.5
  PercentageOfArmyPhase3 = 5.0
End
ArmyMemberDefinition ElvenTransportShip_Member
  Unit   = ElvenTransportShip
  PercentageOfArmyPhase1 = 1.0
  PercentageOfArmyPhase2 = 2.0
  PercentageOfArmyPhase3 = 3.0
End

;//////////////// Evil Faction Ships ///////////////////////////////////////////////
ArmyMemberDefinition EvilMenCorsairShip_Member
  Unit   = EvilMenCorsairShip
  PercentageOfArmyPhase1 = 5.0
  PercentageOfArmyPhase2 = 10.0
  PercentageOfArmyPhase3 = 15.0
End
ArmyMemberDefinition EvilMenTransportShip_Member
  Unit   = EvilMenTransportShip
  PercentageOfArmyPhase1 = 1.0
  PercentageOfArmyPhase2 = 2.0
  PercentageOfArmyPhase3 = 3.0
End
ArmyMemberDefinition EvilFireShip_Member
  Unit   = EvilFireShip
  PercentageOfArmyPhase1 = 0.0
  PercentageOfArmyPhase2 = 5.0
  PercentageOfArmyPhase3 = 10.0
End
ArmyMemberDefinition EvilShoreBombardShip_Member
  Unit   = EvilShoreBombardShip
  PercentageOfArmyPhase1 = 0.0
  PercentageOfArmyPhase2 = 2.5
  PercentageOfArmyPhase3 = 5.0
End

You need to replace the code in skirmishaidata for each army with one of these code sets, Evil Faction Ships for the evil armies and Good Faction Ships for the good armies. Im not so sure how successful changing it in the map file actually is. It seemed to be working but now I think it was just the changes in skirmishaidata.

ADDED: As you can see, I have lowered the percentages quit a bit from how I suggested to you before. I found that if I had the percentages any higher, the AI armies would spent far too much command points on the ships and would not leave enough command points for their land based army.

ADDED MORE: Also, I found a really good game map to test all this on is the Evendim map. :thumbsuphappy:

Edited by Titan Cronus, 25 March 2012 - 02:52 PM.

Battle of the Pelennor Fields

Made by 1 guy, has 13 Factions, 75+ Heroes, 150+ different units and 200+ Special abilities.

 

http://www.moddb.com...pelennor-fields


#14 Titan Cronus

Titan Cronus

    Do unto Others...

  • Members
  • 693 posts
  • Location:Ireland
  • Projects:The Battle of the Pelennor Fields Mod.

Posted 26 March 2012 - 03:37 PM

Hey again people.

Righty, I found a script (b_AIAttack - Transport Load) in libraries/ai_attack_execution/ai_attack_execution Map file that orders units into a transport unit. Im guessing that this script is not being called for though. So, I reckon, getting that called for should fix our problem.

I've spent ages looking through all the files in libraries but I still can't get a grasp of how it all worrks. For example, there are only four faction skirmish ai files (ai_mordorskirmish ect...) and they are for the four BfMe 1 factions (gondor, rohan, isengard and mordor) and they all seem to have the same content. These files kinda look like they're creating the teams that call on all the scripts in files like lib_attack_behaviors and ai_attack_execution ect.... But, because I haven't worked out how its all working and because I can't comfirm that these files are indeed responsable for creating all teams, I don't know where/how to add new teams that will call on the "b_AIAttack - Transport Load" script.
I don't suppose anyone has any ideas where or how I should start? Also, I may have compleatly misunderstood everything and have all the files figured totally wrong, in which case, if you could correct me I would really appreciate it.

Thanks a million guys.

Edited by Titan Cronus, 26 March 2012 - 03:39 PM.

Battle of the Pelennor Fields

Made by 1 guy, has 13 Factions, 75+ Heroes, 150+ different units and 200+ Special abilities.

 

http://www.moddb.com...pelennor-fields


#15 Yaroslav

Yaroslav
  • Project Team
  • 38 posts
  •  if you need help with the AI ​​and expert coder - contact me))

Posted 29 March 2012 - 10:06 PM

Hey again people.

Righty, I found a script (b_AIAttack - Transport Load) in libraries/ai_attack_execution/ai_attack_execution Map file that orders units into a transport unit. Im guessing that this script is not being called for though. So, I reckon, getting that called for should fix our problem.

I've spent ages looking through all the files in libraries but I still can't get a grasp of how it all worrks. For example, there are only four faction skirmish ai files (ai_mordorskirmish ect...) and they are for the four BfMe 1 factions (gondor, rohan, isengard and mordor) and they all seem to have the same content. These files kinda look like they're creating the teams that call on all the scripts in files like lib_attack_behaviors and ai_attack_execution ect.... But, because I haven't worked out how its all working and because I can't comfirm that these files are indeed responsable for creating all teams, I don't know where/how to add new teams that will call on the "b_AIAttack - Transport Load" script.
I don't suppose anyone has any ideas where or how I should start? Also, I may have compleatly misunderstood everything and have all the files figured totally wrong, in which case, if you could correct me I would really appreciate it.

Thanks a million guys.


I am too lazy to read and translate it all. and to explain the more ... well, these days I'll make you this "logic" for 1 faction. Are you the image and likeness for the rest.
but if you want a reasonable action by the AI​​, you have to add the flags on the island in worldbuider. Later, i'm explane all.

Edited by Yaroslav, 29 March 2012 - 10:08 PM.


#16 Titan Cronus

Titan Cronus

    Do unto Others...

  • Members
  • 693 posts
  • Location:Ireland
  • Projects:The Battle of the Pelennor Fields Mod.

Posted 03 April 2012 - 10:47 AM

Ok, thanks fella.

I have added all the correct AI markers on the islands for the AI to use but it hasn't made any noticable difference. I generally add AI markers to any map I use that hasn't got them on it already.

I think I know what I need to do. I think I need to add new teams that once created, call apon the "b_AIAttack - Transport Load" script. If that is indeed what I should be doing, could someone please confirm that Im on the right path and then I can start concentrating my efforts in that area.


Thanks a million guys.

Battle of the Pelennor Fields

Made by 1 guy, has 13 Factions, 75+ Heroes, 150+ different units and 200+ Special abilities.

 

http://www.moddb.com...pelennor-fields


#17 Titan Cronus

Titan Cronus

    Do unto Others...

  • Members
  • 693 posts
  • Location:Ireland
  • Projects:The Battle of the Pelennor Fields Mod.

Posted 07 April 2012 - 10:11 AM

Hey again.
I have been thinking, the AI does not use the mines either (Dwarves and Goglins resorce structures). I wonder if getting a fix for the mines issue will offer a solution for this transport one. If anyone knows of a fix or a mod that has already fixed it, please point me to it. Maybe if I can see how someone solved the mines issue, I may be able to figure out how to fix the transport issue.

Thanks a million guys.

Battle of the Pelennor Fields

Made by 1 guy, has 13 Factions, 75+ Heroes, 150+ different units and 200+ Special abilities.

 

http://www.moddb.com...pelennor-fields


#18 Ridder Geel

Ridder Geel

    Master Yelloh

  • T3A Staff
  • 10,852 posts
  • Location:The Netherlands (AKA: Holland)
  • Projects:RC Mod + SEE + RTS Engine
  •  The Dangerous T3A Team Chamber Member
  • Division:BFME
  • Job:T3A Staff

Posted 13 April 2012 - 10:20 AM

Scripting stuff on maps should allow this... the only problem is scripting for every map. You can't edit every single AI behavior in BFME, if you could then there would have been quite some major changes made to it by me :p Most of the core AI functions are hardcoded, for advanced (or whatever you want to call this) I advise trying to script it on specific maps, thats what i had to do in order to implement part of the BFME 1 system AI for my mod. Combine map scripting with .INI editing, it works really well, if done correctly that is.
Ridder Geel

#19 Titan Cronus

Titan Cronus

    Do unto Others...

  • Members
  • 693 posts
  • Location:Ireland
  • Projects:The Battle of the Pelennor Fields Mod.

Posted 14 April 2012 - 06:46 PM

Ok, thanks a million for you reply Ridder.

Will making changes to the libraries files have any impact on the game what-so-ever? Like, did you experiment with them and if you did, was there any success at all? Im just a bit reluctant to have to edit every map. I'd kinda like to fully rule out the possibility of using the libraries files. I hope that doesn't sound like Im being a stubborn tit. It's just that if it's possibile, even if it's really hard, then I don't mind doing it.

Thanks,
Titan.

Edited by Titan Cronus, 15 April 2012 - 02:46 PM.

Battle of the Pelennor Fields

Made by 1 guy, has 13 Factions, 75+ Heroes, 150+ different units and 200+ Special abilities.

 

http://www.moddb.com...pelennor-fields


#20 Ridder Geel

Ridder Geel

    Master Yelloh

  • T3A Staff
  • 10,852 posts
  • Location:The Netherlands (AKA: Holland)
  • Projects:RC Mod + SEE + RTS Engine
  •  The Dangerous T3A Team Chamber Member
  • Division:BFME
  • Job:T3A Staff

Posted 15 April 2012 - 11:56 AM

If you edit the library files correctly... some of them still have links with the game yes. Although i did have to add quite a few to my own BFME 1 mode maps...
Ridder Geel




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users