Edwin P. Posted May 6, 2006 Share Posted May 6, 2006 The best way to learn AI scripting is to start simple, and Bill Macon's Tactics III Mod - available at cmmods.com - is a great place to start. The map is small, the units few and rebuilding the AI scripts takes no time at all, compared to the standard SC2 1939 campaign scripts. A perfect learning tool for those wanting to Mod SC2. The Challenge: Build the best AI for Blue that you can and post your development notes here. 0 Quote Link to comment Share on other sites More sharing options...
Hubert Cater Posted May 6, 2006 Share Posted May 6, 2006 Great idea! 0 Quote Link to comment Share on other sites More sharing options...
Edwin P. Posted May 7, 2006 Author Share Posted May 7, 2006 Step 1 - Before you try changing anything play the scenario a few times to learn what the winning strategies are and to see the weaknesses in Blue's strategy. Step 2 - Now, the first weakness you see is that Blue's research has no purpose, its totally random. They have a lot of infantry units (corps and armies) but rarely research the techs that these units use. So lets fix this first. In the SC2 Editor open the Tactics III Campaign file (the file that ends with cgn.) and then go to Campaign > Edit AI scripts. Select the Blue Standard Research Script: { #NAME= BLUE Standard Research #POPUP= #FLAG= 1 #TYPE= 2 #COUNTRY_ID= 2 #TRIGGER= 30 #LEVEL= 0 #INFANTRY= 10 [1] #HEAVY_TANKS= 10 [1] #JETS= 5 [1] #HEAVY_BOMBERS= 5 [1] #GUN_LAYING_RADAR= 5 [1] #LONG_RANGE_AIRCRAFT= 5 [1] #ADVANCED_SUBS= 5 [1] #ROCKETS= 5 [1] #ANTI_TANK= 10 [1] #MOTORIZATION= 10 [1] #ANTI_SUBMARINE= 5 [1] #ANTI_AIRCRAFT_RADAR= 5 [1] #INTELLIGENCE= 5 [1] #INFRASTRUCTURE= 5 [1] #PRODUCTION= 5 [1] #INDUSTRIAL= 5 [1] #DATE= 1940/01/01 #FRIENDLY_POSITION= 54,41 #VARIABLE_CONDITION= 2 [2] [100] [0] #TACTICAL_CONDITION= 54,41 [0] #ACTIVATE_POSITION= 0,0 [0,0] [0,0] [0] #CANCEL_POSITION= 0,0 [0,0] [1,1] [0] } There are two important areas; 1st - in the Trigger= 30, means that this will only trigger 30% of the time. 2nd - Look at the research areas. The first number after the tech type is the percentage chance the AI will research this area and the second in brackets is the maximum number of chits it will purchase in this area. Example: #INFANTRY= 10 [1] This means that the AI will research infantry techs only 10% of the time, and when it does it will only purchase 1 chit in this tech area. Since most of its land forces are infantry this is a bad strategy. Not lets change the script to so that it executes 100% of the time and it always; 100%, purchases chits in Infantry while never purchasing chits in areas such as gun laying radar and submarine warfare. { #NAME= BLUE Standard Research #POPUP= #FLAG= 1 #TYPE= 2 #COUNTRY_ID= 2 ; Trigger changed from 30 to 100, so it execute 100% of the time. #TRIGGER= 100 #LEVEL= 0 ; Infantry changed to 100 from 10 so that it purchases infantry chits (Max 2) 100% of the time if it has the money - until it has five chits in this tech area. #INFANTRY= 100 [2] #HEAVY_TANKS= 10 [1] #JETS= 0 [1] #HEAVY_BOMBERS= 0 [1] #GUN_LAYING_RADAR= 0 [1] #LONG_RANGE_AIRCRAFT= 0 [1] ; Advanced Subs reduced to zero % as there is no submarine warfare in this game. #ADVANCED_SUBS= 0 [1] #ROCKETS= 0 [1] #ANTI_TANK= 50 [2] #MOTORIZATION= 10 [1] #ANTI_SUBMARINE= 0 [1] #ANTI_AIRCRAFT_RADAR= 0 [1] ; Intelligence reduced to 0% chance #INTELLIGENCE= 0 [1] #INFRASTRUCTURE= 0 [1] #PRODUCTION= 0 [1] #INDUSTRIAL= 0 [1] #DATE= 1940/01/01 #FRIENDLY_POSITION= 54,41 #VARIABLE_CONDITION= 2 [2] [100] [0] #TACTICAL_CONDITION= 54,41 [0] #ACTIVATE_POSITION= 0,0 [0,0] [0,0] [0] #CANCEL_POSITION= 0,0 [0,0] [1,1] [0] } This simple and dramatic change to the AI focuses the AI on researching Infantry tech and gives it a good chance of reaching level 5 infantry. Note: After you change the AI script, save it (file > save) and then press the update button before pressing the ok button and returning to the main map and exiting the SC2 Editor. 0 Quote Link to comment Share on other sites More sharing options...
pzgndr Posted May 7, 2006 Share Posted May 7, 2006 A perfect learning tool for those wanting to Mod SC2 Yeah, that's one of the main reasons I posted it. Being relatively small and balanced between only two sides, you can see what the generic AI does and doesn't do. I did include multiple research strategies for both sides, so there should be some variation with each game. If you try to force something like infantry tech you're likely to miss out on other surprises. A better approach may be to try balancing the different unit types by adjusting the CTVs so all units are more or less equally balanced. A game which provides wide-open opportunities would be more fun than playing against a cookie cutter. :cool: PS - Don't forget about RED. 0 Quote Link to comment Share on other sites More sharing options...
AZGungHo Posted May 10, 2006 Share Posted May 10, 2006 Hey Pzgndr - Thanks - I downloaded and have had time to sneak in a couple of turns at work, more later but it's very well done! I never had a chance to play Tactics II back in the day, so now I can. I might even take a shot at the scripts later! Scary!! 0 Quote Link to comment Share on other sites More sharing options...
pzgndr Posted June 4, 2006 Share Posted June 4, 2006 FYI, I just posted a v1.01 update at CMMODS.com. Changes include: - added Scorched Earth on Invasion - reduced Max Occupational Efficiency from 80% to 60% - reduced Max Research MPP from 1500 to 1000 - added Partisan event scripts for ungarrisoned cities - improved Research and Production AI scripts - adjusted some CTVs and unit costs consistent with v1.01 patch - reduced spotting ranges - added optional AI Handicap unit event scripts I'd like feedback on the revised spotting ranges. I think the game plays better, and is more challenging. Makes researching L/R air more important! The AI planning script was not changed except for revising a few "steal" parameters. In a test game last night, BLUE AI attacked on the right flank with a sizeable force. AI research, production and upgrades are also working well now. Enjoy! 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.