wc3campaigns
WC3C Homepage - www.wc3c.netUser Control Panel (Requires Log-In)Engage in discussions with other users and join contests in the WC3C forums!Read one of our many tutorials, ranging in difficulty from beginner to advanced!Show off your artistic talents in the WC3C Gallery!Download quality models, textures, spells (vJASS/JASS), systems, and scripts!Download maps that have passed through our rigorous approval process!

Go Back   Wc3C.net > Warcraft III Modding > Hosted Projects > AMAI
User Name
Password
Register Rules Get Hosted! Chat Pastebin FAQ and Rules Members List Calendar



Reply
 
Thread Tools Search this Thread
Old 12-08-2009, 01:03 PM   #1
leric
User
 
Join Date: Nov 2009
Posts: 80

leric has little to show at this moment (0)

Default Learning about Melee AI

I'm currently trying to develop my own version of AI and is seeking some guidance here since there don't seem to have other forum section dedicated to AI development. I'm still new to warcraft III modding, thus not knowing all the features of Jass and vJass, but do have some general programming knowledge.

Currently i feel that it is so limited that can be done using natives from common.ai and don't really know what exactly how some natives works. I've read a few threads from this forum and found that you guys have been writing your own natives. Mind tell me how to write own natives and make it usable by my AI?
leric is offline   Reply With Quote
Sponsored Links - Login to hide this ad!
Old 12-09-2009, 12:25 PM   #2
Strategy Master
Great Sage
 
Strategy Master's Avatar


Project Leader: AMAI
 
Join Date: Jun 2003
Posts: 688

Submissions (1)

Strategy Master has a spectacular aura about (76)Strategy Master has a spectacular aura about (76)Strategy Master has a spectacular aura about (76)

Default

@leric: We modify the common.ai and human.ai, orc.ai etc scripts for AMAI. Common.ai is the control hub of all AI and the functions you make or define in it yourself you can use in all those racial ai files which is the start point of ai. Thats pretty much all there is too it.

Native functions are a different barrel of fish. These are the hardcoded unmodifiable functions that are part of the game engine. We dont touch these but new ones can apparently be made using the grimoire tool on wc3 campaigns resource section. Native functions are all stored in the Common.j and can be used by any warcraft scripts. AI specific natives are single lines stored at the top of the common.ai file and can only be used by ai.
__________________
Strategy Master is offline   Reply With Quote
Old 12-10-2009, 07:32 AM   #3
leric
User
 
Join Date: Nov 2009
Posts: 80

leric has little to show at this moment (0)

Default

Have you been making the AI to pass information around to another AI? I've learnt that gamecache works for it, but also heard that there is a fix 255 instance are allow in the gamecache and they are slow in multiplayer games. From the files in AMAI, i notice blizzard.j have been modified. So does that mean we can modify blizzard.j and common.j? and how we do it? I'm try to add globals in these files so that sharing of variables between AI is available.

Does the user made natives using grimore tools stored inside the map file or i will require to install these files into the .mpq?

Did you mean AMAI have not been using any self made natives?

Lastly, is there a place to read the usage of each natives? Sometimes the natives name are just not self explanatory enough. Like there is a instance GetGoldOwned(), there is another GetGold() function which return the controller gold which confuses the existence of this natives. If you have such a list with simple or detailed explanation on the natives, i hope that you can share it.

I've less than 2 months time left to create the AI for my college project.
leric is offline   Reply With Quote
Old 12-10-2009, 08:50 AM   #4
AIAndy
User


Respected User
 
Join Date: Oct 2002
Posts: 1,296

AIAndy is on a distinguished road (21)

Default

Quote:
Originally Posted by leric
Have you been making the AI to pass information around to another AI? I've learnt that gamecache works for it, but also heard that there is a fix 255 instance are allow in the gamecache and they are slow in multiplayer games. From the files in AMAI, i notice blizzard.j have been modified. So does that mean we can modify blizzard.j and common.j? and how we do it? I'm try to add globals in these files so that sharing of variables between AI is available.
Every AI script execution uses a separate variable space so you can't transfer information with globals.
There are two ways to transfer information to other AIs iirc. The simple one is the alliance target which is shared between the AIs in an alliance. The other one is sending commands with the native CommandAI and reading it with GetLastCommand and similar natives. Since it has been some time, I might have forgotten some ways though or there might have been new ways found in the meantime.

AMAI changes blizzard.j to give the chance to control the AI somewhat to the user via a command interface.

Quote:
Originally Posted by leric
Does the user made natives using grimore tools stored inside the map file or i will require to install these files into the .mpq?

Did you mean AMAI have not been using any self made natives?
At the time when I wrote the majority of AMAI self made natives were not available, so yes, AMAI does not use any of those. Besides, doing these things requires that you use programs outside the scripting system.
AIAndy is offline   Reply With Quote
Old 12-10-2009, 10:40 AM   #5
leric
User
 
Join Date: Nov 2009
Posts: 80

leric has little to show at this moment (0)

Default

Thanks for the response both of you.

I'll go check more on about CommandAI(). Since you've used it, is it good for synchronizing variables?
Any manual for me to read the natives usage? Any tutorial as well?
Some of the common.j natives doesn't seem to work especially the String Utility API. You guys face such problem? Is there alternatives?

I've not been using JNGP effectively due to it says unable find the directory. Is there any good tools to check AI script? Both JassCraft and JNGP gives me alot declaration problems since those globals in common.ai is not taken for checking. I also receive error such as comparing two different primitive but it is actually integer comparing with integer.

Last edited by leric : 12-10-2009 at 10:46 AM.
leric is offline   Reply With Quote
Old 12-13-2009, 05:51 PM   #6
leric
User
 
Join Date: Nov 2009
Posts: 80

leric has little to show at this moment (0)

Default

How to force the AI to display text as chat message to allies and all? I do not want to use DisplayTextToPlayer().
leric is offline   Reply With Quote
Old 12-14-2009, 01:00 PM   #7
AIAndy
User


Respected User
 
Join Date: Oct 2002
Posts: 1,296

AIAndy is on a distinguished road (21)

Default

As far as I remember there is no direct way to use the chat message system for scripts.
AIAndy is offline   Reply With Quote
Old 12-14-2009, 01:23 PM   #8
moyack
Evil Emoticon
 
moyack's Avatar


Respected User
Project Leader: PoC
 
Join Date: Jan 2006
Posts: 3,182

Submissions (18)

moyack is a splendid one to behold (624)moyack is a splendid one to behold (624)moyack is a splendid one to behold (624)moyack is a splendid one to behold (624)moyack is a splendid one to behold (624)moyack is a splendid one to behold (624)moyack is a splendid one to behold (624)

AI Tournament #2 - 2nd PlaceHero Contest - Second place

Send a message via MSN to moyack
Default

It can't be done, sorry. You have to use the infamous but practical DisplayTimedTextToPlayer command.
moyack is offline   Reply With Quote
Old 12-23-2009, 10:08 AM   #9
leric
User
 
Join Date: Nov 2009
Posts: 80

leric has little to show at this moment (0)

Default

what is SetGroupsFlee() for? i don't see difference between true or false value put in it.
leric is offline   Reply With Quote
Old 12-24-2009, 10:48 AM   #10
Strategy Master
Great Sage
 
Strategy Master's Avatar


Project Leader: AMAI
 
Join Date: Jun 2003
Posts: 688

Submissions (1)

Strategy Master has a spectacular aura about (76)Strategy Master has a spectacular aura about (76)Strategy Master has a spectacular aura about (76)

Default

@leric: With the original blizzard ai it controls how groups of units flee from battle or not. In AMAI it has no effect as AMAI uses its own more advanced group fleeing code.
__________________
Strategy Master is offline   Reply With Quote
Old 01-06-2010, 10:00 AM   #11
leric
User
 
Join Date: Nov 2009
Posts: 80

leric has little to show at this moment (0)

Default

Is there a way for me to register a building e.g: Tree of Life as a town?
I am trying own spot as town so expansion doesn't have to be near goldmine or those expansion spot chosen by blizzard's AI.

I'm only able to ask the unit to build directly on which part of the map but the game doesn't register it as another town so whenever i want a building to be build near this expansion it will build in the initial base and also it doesn't admit that there is a second town exist.
leric is offline   Reply With Quote
Old 01-23-2010, 01:30 PM   #12
leric
User
 
Join Date: Nov 2009
Posts: 80

leric has little to show at this moment (0)

Default

i've seen the manipulation of captains in AMAI. mind share on how to correctly manipulate them in order to ask the ai to attack and so on? currently i'm having problem that the captains makes my unit retreat to the base whenever i'm out of the base.
leric is offline   Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

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


All times are GMT. The time now is 05:14 AM.


Donate

Affiliates
The Hubb http://bylur.com - Warcraft, StarCraft, Diablo and DotA Blog & Forums The JASS Vault Clan WEnW Campaign Creations Clan CBS GamesModding Flixreel Videos

Powered by vBulletin (Copyright ©2000 - 2010, Jelsoft Enterprises Ltd).
Hosted by www.OICcam.com
IT Support and Services provided by Executive IT Services