Scripting and AI GUI changes in master

For AI and campaign script related discussions and questions
Post Reply
Per
Warzone 2100 Team Member
Warzone 2100 Team Member
Posts: 3780
Joined: 03 Aug 2006, 19:39

Scripting and AI GUI changes in master

Post by Per »

I took a break from the graphics coding to do something I promised a long time ago -- a way to choose which AI you wanted to play with from the GUI. Screenshots of the new system:
Pre-game dialog
Pre-game dialog
Choosing between AIs
Choosing between AIs
Choosing difficulty level
Choosing difficulty level
As you can see, difficulty is now a series of four steps (Easy, Medium, Hard, and Insane). The real reason I changed it now is that I needed the pixels. However, I also think it is a good idea going forward, since such steps are easier to communicate meaningfully, and we can add non-linear behaviours to them. I will make a separate post about my ideas for them later. For now, they just map to slider points (1, 10, 15, 20 on the 1-20 scale, respectively).

Each AI now requires a .ai suffix INI file that describes it. The fields in the .ai file are for now:
* name -- the visible name of the AI
* vlo -- the VLO file for the AI
* slo -- the SLO file for the AI
* tip -- the tool tip shown for the AI, can be used to add extra description to it

You can still add AIs as mods as before, but I moved Semperfi and Dydo into main so that they don't require mod loading to use.

Scripts changes:
* The getPlayer() function now takes a string parameter, which has to be the name of the AI exactly as typed into the name field of the .ai INI file.
* MAX_PLAYERS is now a built-in constant, do not define it in your own script

Challenge changes:
* The difficulty field now has to be a string, one of "Easy", "Medium", "Hard", or "Insane". Old challenges that use numbers should work, but will be reset to default difficulty.
* There is not yet any way to specify which AI to use. TBD.
Wolftrak
Trained
Trained
Posts: 57
Joined: 20 Apr 2009, 17:47

Re: Scripting and AI GUI changes in master

Post by Wolftrak »

Great job,Per!!
I hope to see more new things in WZ,beside the usual bug fixes.
Anyway,a minor suggestion:Why don't you put the 4 files into a archive (as the base.wz,mp.wz) instead of making an INI file with the list?
Per
Warzone 2100 Team Member
Warzone 2100 Team Member
Posts: 3780
Joined: 03 Aug 2006, 19:39

Re: Scripting and AI GUI changes in master

Post by Per »

Thanks. The reason why they are not contained in an archive is somewhat technical -- it is just much easier this way (they need unique names to avoid overrides, and we need a way to find them; also you may want to reuse slo files between AIs).

I added one more change for experimentation with the new difficulty levels. The insane AI will now start with full defenses even in no base and small base setups. I hope this will be an interesting twist, so give it a whirl and let me know if it works out.
Per
Warzone 2100 Team Member
Warzone 2100 Team Member
Posts: 3780
Joined: 03 Aug 2006, 19:39

Re: Scripting and AI GUI changes in master

Post by Per »

I also added one new scripting function - getDifficulty(int player) - to find the difficulty level associated with a player, and four corresponding built-in constants: EASY, MEDIUM, HARD and INSANE. The semperfi AI has been modified to be less nasty at lower levels. Note that the semperfi AI does not cheat (the above base change for insane excepted) at any difficulty level at the moment.
User avatar
macuser
Regular
Regular
Posts: 1052
Joined: 19 Mar 2010, 23:35
Location: USA
Contact:

Re: Scripting and AI GUI changes in master

Post by macuser »

thanks - nice work ;)
ArtRev Website

ImageImage

System: AMD Phenom II x4, 4GB RAM, 640GB HD, Nvidia GeForce GT 240 1GB, Mac OS X 10.6
User avatar
Rman Virgil
Professional
Professional
Posts: 3812
Joined: 25 Sep 2006, 01:06
Location: USA

Re: Scripting and AI GUI changes in master

Post by Rman Virgil »

.

WZS aka Warzone Starter (2000-2005) for v.1.10.... it will, I am certain, be welcome by many to have one of WZS's great (& most popular) features built into game itself as this utility was obsolesced some 5 years ago now. :3

- RV :hmm:
.
.

Impact = C x (R + E + A + T + E)

Contrast
Reach
Exposure
Articulation
Trust
Echo
.
User avatar
milo christiansen
Regular
Regular
Posts: 749
Joined: 02 Jun 2009, 21:23
Location: Perrinton Michigan

Re: Scripting and AI GUI changes in master

Post by milo christiansen »

speaking of warzone starter, does anyone know where I can get a copy? I want to see if there are any features it has that I can implement in the mod manager but Google cant find it for me.

Are we going to get the AI selector in 3.x? soon? please please please :wink:
In general, if you see glowing, pulsating things in the game, you should click on them.
- Demigod Game Ganual
User avatar
Rman Virgil
Professional
Professional
Posts: 3812
Joined: 25 Sep 2006, 01:06
Location: USA

Re: Scripting and AI GUI changes in master

Post by Rman Virgil »

milo christiansen wrote:speaking of warzone starter, does anyone know where I can get a copy? I want to see if there are any features it has that I can implement in the mod manager but Google cant find it for me.

Are we going to get the AI selector in 3.x? soon? please please please :wink:
http://www.troman.de/wz/downlods/

- RV :hmm:
.

Impact = C x (R + E + A + T + E)

Contrast
Reach
Exposure
Articulation
Trust
Echo
.
User avatar
milo christiansen
Regular
Regular
Posts: 749
Joined: 02 Jun 2009, 21:23
Location: Perrinton Michigan

Re: Scripting and AI GUI changes in master

Post by milo christiansen »

404 file not found
In general, if you see glowing, pulsating things in the game, you should click on them.
- Demigod Game Ganual
User avatar
Rman Virgil
Professional
Professional
Posts: 3812
Joined: 25 Sep 2006, 01:06
Location: USA

Re: Scripting and AI GUI changes in master

Post by Rman Virgil »

milo christiansen wrote:404 file not found
That's too bad. :( The updated .exe is still available (as are most of the other files on the site) but you need the FULL install file. Didn't migrate this one to my current archive (I just checked) which means it's in deep storage which I'm not going to any time soon. Maybe Lav has it in his current, accessible, archive. The 2 files all told are little over 600 kbs as I recall. Maybe shoot Lav or Troman a PM & ask if they could send 'em as an email attachment. :hmm:
.

Impact = C x (R + E + A + T + E)

Contrast
Reach
Exposure
Articulation
Trust
Echo
.
Post Reply