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 > Resources > - Submit a resource -
User Name
Password
Register Rules Get Hosted! Chat Pastebin FAQ and Rules Members List Calendar



Reply
 
Thread Tools Search this Thread
Old 04-09-2011, 12:33 PM   #1
Michael Peppers
Lepus?
 
Michael Peppers's Avatar
 
Join Date: Jan 2009
Posts: 1,306

Michael Peppers is a jewel in the rough (184)Michael Peppers is a jewel in the rough (184)Michael Peppers is a jewel in the rough (184)

Default [Script, AI] Michael Peppers's Melee AI template

After all this community has given me, and due to my inactivity, I thought it would be a good idea to make my most valuable resource available to everyone here, on this site.
That's right, this is and will stay a WC3C-exclusive resource. No exceptions allowed.

This is an .ai template that eases the burden of AI scripting. It has been used as a base for the Melee AIs in my project (The Withering Kind) and in Kam's Beyond The Throne. (from version 3.9.4.2 to 3.9.4.4 at least, latest version's one is "streamlined" according to the release notes so I'm not sure it's the same)

.ai scripts are pure JASS. This script is aimed at JASS/vJass coders that want to script quick 'n' dirty Melee AIs or that want to learn how to script AIs.

Its features: (and also its non-features)
  • Most common racial tasks are either fully automatized or streamlined. Namely, the AI will:
    1. Build houses automatically.
    2. Tier up when a set amount of gold and wood is reached.
    3. (added in v0.4.1) Train workers automatically with a system that covers:
      • An user defined number of them, divided in main base workers and expansion workers.
      • Having different harvesters types for gold and wood. (max. 2)
    4. Build/research/train most buildings, upgrades and units without modifications to the BuildPriorities and UpgradePriorities as long as you've set the IDs correctly. (To make the AI work right, though, you'll still have to tweak those according to the race's needs)
  • Most of the AI scripting now consists in setting global variables at the beginning of the script. Most users will only have to set variables and tweak the two functions I named above to have a fully working, competitive AI.
  • The most common racial differences (like the UD harvesting mechanics, the fact Naga can swim etc.) are supported. As always, it's a matter of setting up a couple of variables.
  • The AI can stop creating Basic Melee (Footmen) units when they're obsolete, saving food for better units, if you want to.
  • There's a basic implementation of difficulty settings.
  • The HallCount function.
  • If a variable that should store an ID is unused, set it to 0. No, the script won't crash and burn.
  • The template script is (badly) commented.
  • Uhhh.... AI scripts support 4 heroes.

Differences with Blizzard's Melee AI: (and downsides)
  • The AI will build houses quicker than the standard AI.
  • It will also (normally) start raiding creep camps later, but...
  • Will Tier up and build armies faster.
  • It will not buy Zeppelins as it is now, as it got stuck once trying to buy one. (sigh)
  • Difficulty settings for now consist in Hero and Expansion number differences. Nothing more.
  • It's able to rebuild and recover if it can.
  • Sometimes it likes to spam towers in useless positions. There's nothing I can do about it, blame Blizzard. =P
  • (Obviously) more error-prone than the standard one, it may sometimes act *weird*.
  • (Rare) If on the verge of being defeated it may enter a loop, thus start sucking memory cycles and noticeably slow down the game. If you resist a couple of minutes it will stop. (Yes, it's like a crybaby that doesn't want to admit defeat)
Expand JASS:

Last edited by Michael Peppers : 07-15-2011 at 05:35 PM.
Michael Peppers is offline   Reply With Quote
Sponsored Links - Login to hide this ad!
Old 06-18-2011, 03:26 PM   #2
Michael Peppers
Lepus?
 
Michael Peppers's Avatar
 
Join Date: Jan 2009
Posts: 1,306

Michael Peppers is a jewel in the rough (184)Michael Peppers is a jewel in the rough (184)Michael Peppers is a jewel in the rough (184)

Default

If there's no one able/willing to moderate this, may I suggest sticking this resource into the "Triggers & Scripts" section?
__________________
Projects:Tutorials: Competitive AI Step by Step with AI Editor (Pending)
Resources: [AI Script] Michael Peppers's Melee AI template (Pending)

Last edited by Michael Peppers : 06-18-2011 at 04:30 PM.
Michael Peppers is offline   Reply With Quote
Old 06-18-2011, 06:20 PM   #3
deolrin
Tas'dingo!
 
deolrin's Avatar
 
Join Date: May 2008
Posts: 872

Submissions (13)

deolrin is a jewel in the rough (167)deolrin is a jewel in the rough (167)

Send a message via MSN to deolrin
Default

Quote:
(Rare) If on the verge of being defeated it may enter a loop, thus start sucking memory cycles and noticeably slow down the game. If you resist a couple of minutes it will stop. (Yes, it's like a crybaby that doesn't want to admit defeat)
I lol'd. xD
No contributory comment, sorry, I'm a dummy when it comes to JASS, vJass, and even GUI. (And other coding languages)
I just felt the need to comment, because you seem to have put quite a lot of effort into this. :3
__________________
Resources: "I'm going to cut you into strips, dry you, and smoke you in my pipe!"
"Don't wait for the Grim Reaper - I'm going to mow you down!"
"Hasta la vista, baby!"

~Gladiator, Sacred
deolrin is offline   Reply With Quote
Old 06-18-2011, 07:26 PM   #4
Michael Peppers
Lepus?
 
Michael Peppers's Avatar
 
Join Date: Jan 2009
Posts: 1,306

Michael Peppers is a jewel in the rough (184)Michael Peppers is a jewel in the rough (184)Michael Peppers is a jewel in the rough (184)

Default

You bet! =D
I spent countless hours making it this as automatized as possible with my limited JASS skills, but it's been an investment more than a loss of time.

Aaand... off for saturday night!
__________________
Projects:Tutorials: Competitive AI Step by Step with AI Editor (Pending)
Resources: [AI Script] Michael Peppers's Melee AI template (Pending)

Last edited by Michael Peppers : 06-18-2011 at 07:26 PM.
Michael Peppers is offline   Reply With Quote
Old 07-15-2011, 04:39 PM   #5
Michael Peppers
Lepus?
 
Michael Peppers's Avatar
 
Join Date: Jan 2009
Posts: 1,306

Michael Peppers is a jewel in the rough (184)Michael Peppers is a jewel in the rough (184)Michael Peppers is a jewel in the rough (184)

Default

Update! I noticed I forgot to implement a functionality: now the AI will create harvesters automatically using the number variables for them, instead of hardcoded numbers... dumb me, the infrastructure for this was all set, but it seems like I never got around to make use of it.

This means that the version number has been bumped up. (Now it's v0.4.1)

(And you believe me when I say that the AI I'm coding with this has took me less than 1 hour to set up and now I'm testing it?)
__________________
Projects:Tutorials: Competitive AI Step by Step with AI Editor (Pending)
Resources: [AI Script] Michael Peppers's Melee AI template (Pending)

Last edited by Michael Peppers : 07-15-2011 at 04:47 PM.
Michael Peppers 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 04:37 AM.


Affiliates
The Hubb The JASS Vault Clan WEnW Campaign Creations Clan CBS GamesModding Flixreel Videos

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