Jump to content

Home

How to mod AI to get a better game from comp...


Guest IdLe_WorkeR

Recommended Posts

Guest IdLe_WorkeR

I thread "Computer AI... lacking", Chessak has outlined exactly the way to defeat the computer on hard. Basically, protect your base enough to withstand the computer's initial rush, build a killing zone, let the comp player waste its resources attacking you, and counterattack to finish it off.

 

I got tired of playing it that way after just a couple of tries bc of all the bl**ping fortresses you have to take down. Boring. So I wondered how the computer would play on hard if it did not receive the extra resources?

 

The computer player in random game mode, difficulty hard, is given 500 extra resources each carbon, food, nova, ore every 10 minutes. To prove this to yourself, watch a recording from the computer's point of view. Between 9:59 and 10:01, you'll see all the resources increase by 500!

 

The code that does this is in the AI script, code section 600008. (The AI script code is stored in file gamedata.drs in directory data, by the way). Here is the code:

 

#load-if-defined DIFFICULTY-HARD

 

(defrule

(true)

=>

(disable-timer t-chatmore)

(enable-timer t-chatmore 600)

(disable-self)

)

 

(defrule

(timer-triggered t-chatmore)

=>

(cc-add-resource carbon 500)

(cc-add-resource food 500)

(cc-add-resource nova 500)

(cc-add-resource metal 500)

(disable-timer t-chatmore)

(enable-timer t-chatmore 600)

)

 

#end-if

 

So I deciding to change the code in gamedata.drs! A hex editor allows one to do this. (!!! Do not use a normal editor like Word, Wordpad, etc. They will render file gamedata.drs unusable. You will have to re-install the game. !!!) I copied the gamedata file, changed the values from 500 to 000 in the copy, and substituted the copy for the original file.

 

End result: you can play a more normal kind of game against the computer, one where you get a chance to rush it (since it doesn't advance to t2 so fast) and try other strategies.

 

To answer a few questions:

 

No, I haven't done a mod like that for "hardest" yet. That would mean changing many more values, I like to creep up on things a tweek slowly. The computer might play better on hardest, though.

 

If you look out on the web, you will find a number of hex editors available.

 

Yes, you will be able to beat the computer opponent easily. The point instead is to give us human players options against the computer opponent otehr than the strategy ontlined by Chessack above.

 

No, I don't have the entire AI script broken out into separate files, available for download somewhere. There are some script components I don't understand yet. There are people working on this, I understand.... Also, there is no program yet available for easily "unbundling" the drs files. There may be people working on propgrams that do this as well.

 

Try this out! The computer DOES play better on hard than moderate, even if it does not get extra resources. The comp player still does too much research, though.....

Link to comment
Share on other sites

Guest Elite Raider

I have broken out all the files and cross-referenced them. If you would like a copy, simply post a request in our scripting forum (link in sig).

 

On second thoughts - just send me an email (in profile)

Link to comment
Share on other sites

Guest Supreme Warlord

Wow how do you learn this my friend? do you know how to program games? Just curious, may have a job for ya. hehehe

Link to comment
Share on other sites

Guest IdLe_WorkeR

with 30+ years on system/370, System/38, AS/400. No PC pgmming experience, though. I can read hex dumps, which is how I did the mod to gamedata.drs. They were EBCDIC, not ANSI ASCII, so I was thrown for awhile by the byte order of the offsets.

 

No desire to do games, or learn C or C++ or VB. Thrity years of pgmming is enough. Noodling around is fun, though.

Link to comment
Share on other sites

Guest Supreme Warlord

Very Impressive but the job is out of question because you have no PC exprience drats.... That is really good though

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...