The 3rd Age

Age of the Firstborn

Age of the Firstborn

A mod that adds two new factions, new CaH-Class, new maps and more

Button for The 3rd AgeButton for The HiveButton for The Rhovanion AllianceButton for The Elven AllianceButton for The Four AgesButton for CNC3.NetButton for Age of MenButton for Atomic WienerdogButton for Helms Deep : Last HopeButton for OpenWarButton for Schlacht-um-MittelerButton for Lord Of the Rings FilesButton for Middle Earth CenterButton for BFME Game ReplaysButton for HDR HeadquartersButton for RTS Community

Become an affiliate!

   

Quick Lists

Top Rated Popular New Updated Last Comments Users

Register and log in to move these advertisements down

In-depth AI Coding

Article for Battle for Middle-earth II BFME 2, Battle for Middle-earth II: Rise of the Witch-king ROTWK

Avatar of Sûlherokhh

Sûlherokhh

Category: Code
Level: Expert
Created: Wednesday October 3, 2007 - 8:28
Updated: Thursday December 27, 2007 - 5:38
Views: 2295
Summary: The beginning of a comprehensive guide to AI-modding for BfME2

Rating

Staff says

5.0

Members say

4.4

Average

4.6/5.0

10 votes

Page 1 2 3 4 5 6 7
In-depth AI-Coding


This tutorial will show you different ways in making the AI use Special Powers, take specific actions or limit/randomize it's options. It is suited mostly for the advanced coder, though some of it's elements are easy to implement for beginners too.

While i will try to keep it organized, i will necessarily jump back and forth between several different aspects of coding. I might try and add several sections about BaseBuilding, SpellPurchase etc. later-on.

Newest addition: Custom AI-module for difficult special powers (example Faramir) on page 7

Index:

A. Starting Simple
This contains 2 straightforward AI modules to put in your objects.

A1. 'AISpecialPowerUpdate' (page 2)
A2. 'AutoAbilityBehavior' (page 3)


B. Advanced AI modding.

This section contains a lot of specialized modules, as well as a custom approach on implementing it for the AI (and NOT for the player)

Knowledge of LUA-scripting, ModelConditions, the works of Upgrades and a general feel for all Object-code is a prerequisite.

B1. The Basic Setup(page 4)
B2. Straightforward uses of the AI-Upgrade (page 5)
B3. Complicating the issue (page 6)
B4. Practical Use of 'AutoAbilityBehavior' for the AI controlled unit (page 7)


C. Special Cases.

This section contains a step by step explanation (as far as possible) on some very common issues.

C1. Spell Purchase Scripts(not done yet)
C2. New Structures (not done yet)
C3. General SkirmishAI settings (not done yet)


Comments and Suggestions are appreciated. Please go and try out these goodies. Should help in tuning up any mod. *grin*



Edit: Did some reformatting. Hopefully it looks readable now. Also reformatted and split up from 2 to 7 pages.

------------------------------------------------------------------------------------------------------------------------------

Credits

robnkarlainspiration on AI modding
cahik_inspiration on AI modding, some AI module templates in his tutorial
Dark Lord of the Sithhinting at LUA scripting.

Comments

Display order: Newest first

Sûlherokhh (Team Chamber Member) - Thursday November 29, 2007 - 18:26

I sure will...

Edit: Do you have any particular requests? If i have done it already, it shouldn't be hard to post a solution here. If it's not, chances are that i was going to look into it anyway. Except for the general skirmishsetup and bases, since those will require extesive explanations which i was planning to do anyway when i find the time.

So shoot! :)

Rob38 (Administrator) - Thursday November 29, 2007 - 12:00

This is by far one of my favorite tutorials on T3A! Please continue to add more :)

Sûlherokhh (Team Chamber Member) - Thursday October 4, 2007 - 1:07

I am glad you can put it to use, Rob! Your feedback means a lot to me. :D

Rob38 (Administrator) - Thursday October 4, 2007 - 0:27

Amazing! I also found a way to recognize if a player is controlled by the AI, but this looks to be a much easier method to use. Thank you for all your wonderful knowledge as there is some really cool stuff in here.

Sûlherokhh (Team Chamber Member) - Wednesday October 3, 2007 - 21:18

I'll split it up. Let's see what would be a good way. - Edit: Done. I hope you like it.

Crashdoc - Wednesday October 3, 2007 - 18:48

Nice findings and interesting ways to use them. Thanks for sharing the knowledge!

2playgames (Administrator) - Wednesday October 3, 2007 - 14:41

Couldn't you split it into a few more pages? ;)

Sûlherokhh (Team Chamber Member) - Wednesday October 3, 2007 - 12:23

I was being brief, you know?

Guess Who - Wednesday October 3, 2007 - 12:13

Does it have to be so long? :P

Sûlherokhh (Team Chamber Member) - Wednesday October 3, 2007 - 8:54

I guess i'll need to make a pdf or word file out of this. The format just sucks and is really hard to read.

Go to top

 

"One site to find them all, one site to guide them,
one site to host them all, and on the network bind them."

 
11:53:18