Main Menu
Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Topics - 1337

#1
I want to know how many total players are in the game... Still working hard on the 1337 AI but I really need this (and how to count the number of units in production at a building).


I found these in <SC2>/Mods/Core.SC2Mode/Base.SC2Data/TriggerLibs/GameData/Game.galaxy:


//  EPlayerType
const int c_playerTypeNone = 0;
const int c_playerTypeUser = 1;
const int c_playerTypeComputer = 2;
const int c_playerTypeNeutral = 3;
const int c_playerTypeHostile = 4;
const int c_playerTypeReferee = 5;
const int c_playerTypeSpectator = 6;



But I can't for the life of me find a function to get the enum value given a player number.
#2
Name says it all, I want to know how to check how many units/upgrades are in the build queue at a particular building. I'm writing a Chrono Boost func that prioritizes based on what units are being built.
#3
Or generate any static Point value?


I can't do:
point p;
p = new point(0,0);


any idea?
#4
AI Scripts / 1337 AI V0.8 Preview
March 05, 2010, 06:39:47 PM

NEXT VERSION UPDATE:
Just a little progress update so you don't think I have gone away... ;) I am hard at work on the next version. I am currently on internal revision V0.5. If all goes as planned, the next released version should be v0.8 will contain all the new features for Protoss. v0.9 will be the complete Zerg refit (to match Protoss new state system). v1.0 will have all 3 races functioning under the new state system. This is a huge amount of code so it may take a little while, but I am still writing 100+ lines of code per day so progress is being made... I am leaving right now to go snowboarding for a couple days but I am going to bring my laptop so there should be more done when I get back.


IN PROGRESS/PLANNED FOR V0.8:
Completely new Protoss state system
AI knows what map it is playing on, its relative start location, and how many players are in the game
Fully parallel build system
Fully parallel train system
Adaptive resource management


SLATED FOR V0.9:
Zerg updated to new state system
Adaptive army composition (unit counters)
Intelligent army management (precision timing & formation maneuvers)

Protoss has some new tricks up its sleeve...


SLATED FOR V1.0:
Terran updated to new state system
P/Z have some new tricks up their sleeves...






DOWNLOAD THE OLD VERSION (0.2) HERE
Download Links
(megaupload is being gay)
(scroll to the bottom of the filefactory page to find the real download link, then scroll down again and wait)
http://www.filefactory.com/file/b080190/n/1337_AI_v0.2_TriggerLibs_.zip      1337 AI v0.2 (TriggerLibs).zip
http://www.filefactory.com/file/b0801c1/n/1337_AI_v0.2_Base.SC2Data_.zip      1337 AI v0.2 (Base.SC2Data).zip
#5
After downloading and investigating some of the various AIs on this forum, I have determined that most of them focus on the "macro" aspect of gameplay, with build orders and such. I have been trying to unravel the "micro" AI to modify individual unit AIs.

I found this gem of information in the TactTerrAI.galaxy (reaper AI code):

void AIThinkReaper (int player, unit aiUnit, unitgroup scanGroup) {
    // **Reaper AI reproduced in XML**
    //  Melee AI does not call this AIThink routine.


    //  Reaper AI is left in TactTerrAI to serve as an example of two different ways to write the same
    //  AI.  To see the xml equivalent of the Reaper AI, look in TacticalData.xml and TargetFindData.xml.
    //  In general, AI implemented in galaxy scripts will be slower than AI implemented in data.
    //  If it is convenient to express AI in data, one should do so.  In this case, converting reaper AI
    //  to xml resulted in a 2x performance gain.


It appears that there are two different sources for the unit AI, and which source is chosen is completely arbitrary. I have scoured the MPQ files for the locations of the AIThink calls and I can't find any. This means that the decision whether to call the AIThink routine or use the XML version is made in the main SCII executable.


This means that some AIThink routines can be modified in a useful way, whereas others do nothing. For those abilities that are XML-based, limited modification of the behavior can be achieved by modifying values in TargetFindData.xml.



other random thoughts (from a later post):
High Templars will cast Psi Storm, but most AIs just don't research it early enough. I just tested a game with 5 Goose v4 Protoss in it. Of the 5 AIs, only 1 (the winning AI) researched Psi Storm, despite the fact that they all followed the same build order otherwise. I assume the other AI Stock requirements were not met, so it never moved on to upgrading Psi Storm. Only the winner actually had enough units in stock, so the AI continued to upgrade.


The Psi Storm AI data is definitely stored in the XML. By editing the Psi Storm entry in TargetFindData.xml, I think I can change the behavior of the Templars with regards to when they choose to cast Psi Storm. I am going to try modifying the "MinCount" and "MinScore" values to see if it changes the Templars discretion.