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 - ptanhkhoa

#1
AI Scripts / Time Racer AI 0.1
June 09, 2010, 01:36:24 AM
The Time Racer AI is a cheating AI version for Green Tea AI.
Unlike other cheating AI, which give the AI significant bonus at the begining, so they have unrealistic opening, and because of that maybe weak about later game.

Time Racer AI is different, at the begining, AI won't have any bonus resources. But after 3 minutes, it will have 0.2 bonus resources, 6 minustes will have 0.4 and until 15 minutes it can have 2x resources.

The later you let the AI survive, the harder it will be.

The purpose of Time Racer AI is keep the standard and reasonable opening of the AI but give more pressure in late game than Green Tea AI version:
_ In Green Tea AI version, after defeated at the first match, AI seem much weaker and has a long time before it can recover and start a second match.
_ So in Time Racer AI, AI will recover faster and give more pressure to player. The player shouldn't turtle and wait for enemy attack because AI will have faster resources as long term.
_ I have some long strip in business and let my desktop at home so I can't tested this AI working yet. ( just edit by notepad :|, in case it black screen tell me to correct ).
_ So the AI not only the enemy but also the time. You must race again it xD
#2
In this post, you can suggest some opening for the Generals to use.

Each Opening should have 2 or 3 followup depend on the situation:

_ For example :

Opening Reaper Rush ( vs Protoss )

    * 8 - Barracks
    * 8 - Refinery
    * 8 - 3SCV
    * 10 - Depot
    * 11 - Tech Lab
    * 11 - Reaper
Folow up 1 ( when enemy rush ( 2 gate ) )
...
Folow up 2( when enemy Cybernectice core and 1 stalker )
...
Folow up 3 ( when enemy have cannon )
...

#3
AI Discussion / Green Tea AI General Rating
May 28, 2010, 05:37:41 AM
This thread you can rating general at the rank from 1 to 10 and following suggest to improve them.

For example :

Grey Tanker : 6/10
_ Need better opening (
    Your opening here ... )

Mouse : 3/10:
_ Improve late game ...

Black Reaper: 2/10
_ Faster rush, should target probe, not building ..

Ofcourse don't need to rate all generals, maybe the one you really favourite or the ones that too weak, need to improve.
#4
AI Development / A whole new functions in Patch 9
April 23, 2010, 07:32:16 AM
At first i'm very disappoint in Patch 9 because the AI don't run but affter take a look carefully at the core.base, i see that they change a lot with a new very interesting function, not only helpful for map maker but also our AI developer as well.

In the natives.galaxy

First, the problem how to receive player message now resolved with this :

Quoteconst int c_invalidConversationId           = 0;
const int c_invalidReplyId                  = 0;

const int c_conversationReplyStateUnread    = 0;
const int c_conversationReplyStateRead      = 1;
const int c_conversationReplyStateOld       = 2;

native int          ConversationCreate (bool visible);
native int          ConversationLastCreated ();
native void         ConversationDestroy (int intId);
native void         ConversationDestroyAll ();

native void         ConversationShow (int intId, playergroup to, bool visible);
native bool         ConversationVisible (int intId, int player);

native int          ConversationReplyCreate (int intId, text inText);
native int          ConversationReplyLastCreated ();
native void         ConversationReplyDestroy (int intId, int replyId);
native void         ConversationReplyDestroyAll (int intId);

native void         ConversationReplySetText (int intId, int replyId, text inText);
native text         ConversationReplyGetText (int intId, int replyId);

Interesting right, so we can use this to make a command function to make the AI to to do what we want, for example, starting a specific opening.



now, another previous problem about the coordinate, take a look at this guy, now we can make them build at any place, so walling should be no problem ( damn, I should waiting for this patch, all the time I thinking to build wall now useless >.< ).

Quotenative point Point (fixed x, fixed y);
native point PointWithOffset (point p, fixed x, fixed y);
native point PointWithOffsetPolar (point p, fixed distance, fixed angle);
native point PointFromId (int id);

native fixed PointGetX (point p);
native fixed PointGetY (point p);
native void  PointSet (point p1, point p2);

native fixed PointGetFacing (point p);
native void  PointSetFacing (point p, fixed inFacing);

native fixed PointGetHeight (point p);
native void  PointSetHeight (point p, fixed inHeight);

native bool  PointsInRange (point p1, point p2, fixed range);

native fixed AngleBetweenPoints (point p1, point p2);
native fixed DistanceBetweenPoints (point p1, point p2);

native int   PointPathingCost (point p1, point p2);
native fixed PointPathingCliffLevel (point p);
native bool  PointPathingPassable (point p);
native bool  PointPathingIsConnected (point p1, point p2);
native point PointReflect (point source, point dest, fixed angle);

Not only building, but also strategy too, the pathing problem now solved easily. not to mention some math function like

Quotenative fixed SquareRoot (fixed x);
native fixed Pow (fixed x, fixed power);
native fixed ModF (fixed x, fixed m);
native fixed MinF (fixed x1, fixed x2);
native fixed MaxF (fixed x1, fixed x2);
native fixed AbsF (fixed x);

native int   ModI (int x, int m);
native int   MinI (int x1, int x2);
native int   MaxI (int x1, int x2);
native int   AbsI (int x);

// Trigonometry
// Note: All angles are in degrees
native fixed Sin (fixed degrees);
native fixed Cos (fixed degrees);
native fixed Tan (fixed degrees);
native fixed ASin (fixed x);
native fixed ACos (fixed x);
native fixed ATan (fixed x);
native fixed ATan2 (fixed y, fixed x);


Imagine that, with this we could make the Transport Medievac to enemy base, if it discover an anti-air, it can change direction to get out the range of that anti-air.


Not only the point, put the region has some nice function too
Quotenative region RegionEmpty ();
native region RegionEntireMap ();
native region RegionPlayableMap ();
native void RegionPlayableMapSet (region r);

native region RegionRect (fixed minx, fixed miny, fixed maxx, fixed maxy);
native region RegionCircle (point center, fixed radius);
native region RegionFromId (int id);

native void RegionAddRect (region r, bool positive, fixed minx, fixed miny, fixed maxx, fixed maxy);
native void RegionAddCircle (region r, bool positive, point center, fixed radius);
native void RegionAddRegion (region r, region regToAdd);

native void  RegionSetOffset (region r, point offset);
native point RegionGetOffset (region r);

native bool RegionContainsPoint (region r, point p);

// RegionRandomPoint attempts to find a random point somewhere within the region.  For regions
// containing only a single positive shape, this is guaranteed to work, but for more complex
// sets of shapes it may give up after a maximum number of tries and return (0, 0).
//
native point RegionRandomPoint (region r);

native point RegionGetBoundsMin (region r);
native point RegionGetBoundsMax (region r);
native point RegionGetCenter (region r);

// Setting the center will adjust the offset such that
// the region becomes centered on the given point.
//
native void RegionSetCenter (region r, point p);

// RegionAttachToUnit will attach the region to the given unit such that the region center
// is always at the unit's position plus the given offset.  Use a null unit to detach the region
// from whatever unit it may already be attached to.
//
native void RegionAttachToUnit (region r, unit u, point offset);
native unit RegionGetAttachUnit (region r);

So we can actually make a unit don't run out of the region and return to center when necessary, that good when making AI for terran, where we get Siege Tank at the center and the soldier should not go far for it, notice that we can plus 2 region together so that mean, 2 siegetanks means 2 circle.
I think with this, we can add our drop location, not depend on the LastDropLocation fuction anymore  :thumbsup: .

And much much more interesting function that make develop AI more convenient.

#5


Link mediafire:
GT AI Arena

With the inspiration of Suxue AI, I made it first for testing purpose only, but I see that they are quite interesting, so I would like to share it to the public.
At the title say, it can let each AI fighting with each other, for example, Starcrack AI 0.72 Protoss vs Strategy AI Terran 0.4
It hard to solve the conflict between AI when putting all in the same folder, I had to read every code lines and function of every AI Script.
Anyway, I'm  finish with it
It can be quite useful for the player if you want to select the best Ai for each race to play with, or want to test the strength of each
For the developer, it can be quite useful for testing your AI among these strong AI.

_ The first version will include these AI  ( all of these are semi-noncheat , only cheat vision )

Starcrack AI 7.02 by Turdburger & Starcrack Team
Strategy AI 0.4 by XPL
Ghost AI 1.1 by harlowmoo.
Poulet AI 2.0 by Poulet
Aiur 2.0 alpha 3 by Suxue
Dozerg AI by Chriamon
and my Green Tea 0.4


I would like to give my credits to all the AI author above.

The first thing you must do is using Zocx Launcher, ( this can only work by replacing file in Trigger Libs, so Zocx Launcher is neccesary.Copy entire folder to the Mod folder of Starlauncher, it should include 2 folder GameData and Trigger Libs . You should use clean map, if the AI don't repair that mean you are not using clean map
Zocx Launcher

How to run, in the Trigger Libs folder it has the folder AI Package, each of these content the Package AI for you to select. Copy and replace the Zerg.galaxy, Protoss.galaxy and Terran.galaxy in which AI you like with the current one.



Select the AI Package folder


Select galaxy file in each folder Package

For example, you want to select Strategy Protoss 0.4,Terran Green Tea 0.4 and Dozerg AI 0.2, just copy the Protoss.galaxy in Strategy AI folder, Terran.galaxy in Green Tea AI folder and Dozerg 0.2 in Dozerg AI folder and replace with the current Terran, Protoss and Zerg.galaxy file outside.
When you play, it will appear like this "Activate Strategy 0.4 AI by XPL, Activer Terran AI by Green Tea 0.4 AI
If you see that the AI seems weaker when they stay in this version, report to me, so I can correct it.

Enjoy and have fun playing  :thumbsup:

Ptanhkhoa

This is Chriamon Updated Zerg, you should replace it with the current  Zerg.galaxy in Chriamon folder. It stronger than the old ones
#6
AI Scripts / Green Tea AI 0.56
April 05, 2010, 09:43:41 AM
With commander system, every time you play, the AI will use different strategy.
Notice:
_ You must see welcome screen " Green Tea AI 0.x version", otherwise it is not working. It should be only one folder inside the AI/Mods folder
For example: + /AI/GreenTea Ai/ Trigger Libs.
+ not /AI/Green Tea AI/ Green Tea AI/ Trigger Libs

Version Explain:

Green Tea AI 0.55, edit some difficulty
Very Easy : 10 minutes countdown, the AI won't attack you in these time. APM limit 300.
Easy : Don't using micro. Show Commander name
Medium : Using Micro ( like evade storm, burrow,.... ), hide commander name, no limit APM. ( Best non-cheat AI ).
Hard : The harvest rate increase from 1 to 1.5 times in 10 minutes. After that remaining at 1.5 times.
Very Hard : The harvest rate increase from 1 to 2.0 times in 10 minutes. After that remaining at 2.0 times.
Insane : Very powerful Boss AI ( 2.0 harvest rate at the start ).

Insane AI
Starcraft 2 GT AI PvZ.avi

Medium AI
Starcraft 2 GT AI TvP (Medium).avi


Green Tea AI 0.51
_ Force field ability modified target.
_ Some fix about changing commander.
_ The HR rate now display to Minerals and Gas, so you can know exactly the mining rate of AI in very hard / insane mode

Green Tea 0.4 beta

_ Force field ability modified target.
_ Some fix about changing commander.
_ The HR rate now display to Minerals and Gas, so you can know exactly the mining rate of AI in very hard / insane mode

_ Expansion now working better. Normal will be 3 expansion, only   expand at the 4 mines when the first one almost out of minerals.
_   Transport working : AI will transport the harvester to the island or   transport units to attacking enemy if there is no ground access
_ Infestor will burrow when moving.
_ Ghost and Banshee will permanent Cloak when be attacked.
Compatible with the difficulty setting of SC2AllInOne.
Very Easy: APM 300
Easy : APM 600
_ Reveal commander name
_ No Micro ( evade storm, hit & run )
* The very easy and easy ai will reveal the commander name at the   beginning. So you can practice and build counter for each commander.
Medium: APM 900
Hard : No limit
_ Hide commander name
* These like the standard version of Green Tea, enough all feature,   the Medium AI have reduce APM so it can be easier for longterm when   there are many units.
Very Hard: Slow bonus harvest rate
Insane : Fast bonus harvest rate
* These are cheating resources like the Green Racer AI, the different   is very hard AI have slower cheating race compare to Insane.
 

GreenTea 0.47d:
_ 2 commander for Zerg Race :
  Mole : Standard 14 pool
  Mouse : Zerg Rush 6 pool
_ CreepTumor build ( testing ) : the AI will starting build Creeptumor and make it spam on the map ( will stop if it reach a wall )


At the end of the match, the Commander will reveal their name.

Installation Step
You can use this AI for SC2Launcher of Zocx or SCALLInOne of Vernam as well
When using SC2 Launcher of Zocx:
Link: SC2 Launcher
_ Extract folder GreenTeaAI into /Mod folder.
_ Delete all the file in the /Plugin folder,
_ Select the latest patch
_ Choose FreeForALL mode only.

When using SC2 AllinOne of Vernam:
Link: SC2 All In One
_ Copy GreenTeaAI to AI/ folder

_ Choose OtherAI in Difficulty and select GreenTeaAI 0.45


#7
Here is the non-cheating version of Green Tea.
_ It not so hard like the other version, so better used for practicing.
_ The only things it cheating is Vision :P
_ Each race has 3 different attack style :
   + Protoss using power with strong force.
   + Terran using harassing style.
   + Zerg using large quantity and massive army.

_ Credit for Dark Zero. Most of my code based on his IAI ( I don't like the AISetstock function as well XD, the AIBuild function is more effective ).
_ Also credits for Starcrack team, ofcourse for their original work.
_ Some of code I learn from the website, and credit to people who works on it.

Try it out, and feed back for me, thanks. :X

Below I included 2 file ( using it depend on your launcher )
GreenTeaZero TriggerLibs
and Base.SC2Data
#8
  Ai cannot compare to human, so it is fair to give them some advantage, so that player can be more satisfy on 1 vs 1 match.
  _  Unlike the previous one, I don't give the AI so much money, but   instead improve the combat style of the AI:
  _ It will response to your   unit, if you buy air unit, expect some anti-air from them.
  _ The Attack and retreat function now working well.
  _ Expecting some drop attack from them.
  _ Some harassing unit

For those who wanted the 2x version, it will be publish soon.

Have fun  :thumbsup: .
 
 
#9

Thanks Dark Zeros for his awesome script and Starcrack team. I make my AI based mostly from them.
Thinking that, with x2 money, how can you use it more effective ?
_ So I make these AI with can do really "something" :
    + Use money effectively at the beginning.
    + Know how to attack and retreat when they feel losing.
    + Upgrade as fast as possible
    + Late game will build more unit generator that consume every money they harvest. ( Gas always shortage before minerals )
    + The Ai will be more passive at the beginning but very aggressive at the late. So it enough time for player to build their defense.

_ So far, it just the basic version, some bug of it can happen in some game about the supply.

Some picture of it ( click to zoom):

They will use money very efficiency


Can do multiple task, product, build and research at the same time.


How are their army in late game ?  Here comes,

The Mighty Protoss


The MMT Terrans ( Marine & Medic & Tank )


The Hell Zerg


How to install, using SC2 Launcher, just copy the folder with Trigger Library to their Mod folder

It work and compatible best with Zocx launcher

http://darkblizz.org/Forum2/sc2-tools/starcraft-ii-launcher/