Advertisement
Civilization Fanatics' Center  

Welcome to Civilization Fanatics' Center.

You are currently viewing our site as a guest which gives you limited access to our site features. By joining our free community, you will be able to participate in the discussions, search the forum, send private messages, vote in polls, upload your own screenshots to the gallery, and access many other special features. Registration is fast, simple and absolutely free, so sign up today! If you have any problems with the registration process or your account login, please contact support.

Go Back   Civilization Fanatics' Forums > CIVILIZATION IV > Civ4 - Creation & Customization

Notices

Reply
 
Thread Tools
Old Jul 30, 2006, 08:19 PM   #1
TyloniusFunk
Chieftain
 
Join Date: Jul 2006
Posts: 8
Worker AI Modification

Before I go through the trouble of downloading the SDK, I'm hoping someone can answer this question.

Is it possible, with the SDK, to modify the worker improvement AI. If so, is it also possible to add multiple priorities (similar to "Build Trade Network", "Improve closest city", etc.")?

I'm hoping to step up the intelligence of the worker automation so that automating a worker is no longer a strategic disadvantage. Also, this could significantly improve lower levels of difficulty as your AI opponents would benefit from improved worker decidsions as well.

Feel free to slap me if there is already such a modification available or in progress that I should know about.
TyloniusFunk is offline   Reply With Quote
Old Jul 31, 2006, 01:29 AM   #2
Gerikes
User of Run-on Sentences.
 
Gerikes's Avatar
 
Join Date: Jul 2005
Location: Massachusetts
Posts: 1,753
Quote:
Originally Posted by TyloniusFunk
Before I go through the trouble of downloading the SDK, I'm hoping someone can answer this question.

Is it possible, with the SDK, to modify the worker improvement AI. If so, is it also possible to add multiple priorities (similar to "Build Trade Network", "Improve closest city", etc.")?

I'm hoping to step up the intelligence of the worker automation so that automating a worker is no longer a strategic disadvantage. Also, this could significantly improve lower levels of difficulty as your AI opponents would benefit from improved worker decidsions as well.

Feel free to slap me if there is already such a modification available or in progress that I should know about.
Yup, it's all in the SDK. Adding things such as new worker automations aren't too difficult either, you just need to be able to find where the old ones are and add code to their locations.

For an idea of what you're looking at, here's a snipper from "AI_update" (taken from the Vanilla source, although it'll probably be similar in Warlords) located in the file CvUnitAI.cpp. This is the "jumping point" for all worker automatization. Each one of the functions called has all the juicy details of what's actually done, but this gives you a good idea of how it gets there.
Spoiler:

Code:
if (getGroup()->isAutomated())
	{
		switch (getGroup()->getAutomateType())
		{
		case AUTOMATE_BUILD:
			if (AI_getUnitAIType() == UNITAI_WORKER)
			{
				AI_workerMove();
			}
			else if (AI_getUnitAIType() == UNITAI_WORKER_SEA)
			{
				AI_workerSeaMove();
			}
			else
			{
				FAssert(false);
			}
			break;

		case AUTOMATE_NETWORK:
			AI_networkAutomated();
			// XXX else wake up???
			break;

		case AUTOMATE_CITY:
			AI_cityAutomated();
			// XXX else wake up???
			break;

		case AUTOMATE_EXPLORE:
			if (getDomainType() == DOMAIN_SEA)
			{
				AI_exploreSeaMove();
			}
			else
			{
				AI_exploreMove();
			}
			break;

		default:
			FAssert(false);
			break;
		}
	}
__________________
MODDDDDS INNNNNN SPAAAAAAAACE
Gerikes is offline   Reply With Quote
Reply

Bookmarks

Go Back Civilization Fanatics' Forums > CIVILIZATION IV > Civ4 - Creation & Customization > Worker AI Modification

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Worker AI sveint Civ4 - Creation & Customization 1 Dec 19, 2007 12:47 PM
Future Civ games need AI leader aggression modification settings per era stavka Civ4 - General Discussions 2 Dec 04, 2007 05:08 AM
(AI Issue) Threatened AI worker doesn't retreat Jet Civ4 - Bug Reports 6 Jul 30, 2007 03:55 AM
Goblin Worker AI Vs. Dwarven Worker AI? BainIthron Civ4 - Fall from Heaven 2 Apr 02, 2007 04:02 AM
Worker Modification hansdampfaka Civ3 - General Discussions 0 Feb 03, 2002 10:00 AM


Advertisement

All times are GMT -6. The time now is 05:42 AM.


Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
This site is copyright © Civilization Fanatics' Center.
Support CFC: Amazon.com | Amazon UK | Amazon DE | Amazon CA | Amazon FR