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, 01:33 PM   #1
Michael Peppers
Lepus?
 
Michael Peppers's Avatar
 
Join Date: Jan 2009
Posts: 1,308

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

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

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. 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)
    5. (added in v0.5) Can focus on either researching upgrades or tiering up, depending on FocusTiering's value.
  • Most of the AI scripting now consists in setting constants 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.
  • IDs aside, all constants are already set to values that should work fine with most races.
  • 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.
  • (added in v0.5) Easy and Normal difficulties are handled just like standard AI does.
  • (added in v0.5) New Attack function, it's more streamlined, almost identical to standard AI and... it buys Zeppelins! Woot! (disabled by default because it makes the AI do pretty reckless stuff at times, but other than that it's fine)
  • 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 & bugs or other misc notes:
  • The AI will build houses quicker than the standard AI.
  • Will Tier up (if not focusing on upgrades) and build armies faster.
  • Will actually research upgrades (standard AI gets stuck on that at times )
  • It will not buy Zeppelins as it is now, it does with SimpleAttack enabled, but it doesn't use them anyway, so...
  • Hard and Insane difficulties for now consist in Expansion number differences. Nothing more. (might be on par with what Blizzard did actually. Maybe even better)
  • It's able to rebuild and recover if it can.
  • Building placement can be weird. There's nothing I can do about it, blame Blizzard. =P
Expand JASS:

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

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

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 05:30 PM.
Michael Peppers is offline   Reply With Quote
Old 06-18-2011, 07:20 PM   #3
deolrin
Tas'dingo!
 
deolrin's Avatar
 
Join Date: May 2008
Posts: 873

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, 08:26 PM   #4
Michael Peppers
Lepus?
 
Michael Peppers's Avatar
 
Join Date: Jan 2009
Posts: 1,308

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

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 08:26 PM.
Michael Peppers is offline   Reply With Quote
Old 07-15-2011, 05:39 PM   #5
Michael Peppers
Lepus?
 
Michael Peppers's Avatar
 
Join Date: Jan 2009
Posts: 1,308

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

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 05:47 PM.
Michael Peppers is offline   Reply With Quote
Old 12-02-2018, 02:21 AM   #6
Michael Peppers
Lepus?
 
Michael Peppers's Avatar
 
Join Date: Jan 2009
Posts: 1,308

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

Default

Shameless necro-bump-update!

This new version (v0.5) includes:
- Focus on either tiering up or upgrades
- An alternative attacking function that probably works better than the old one, it's disabled but can be enabled by changing a variable
- Easy and Normal difficulty are just like Blizz's good ol' (bad) AI
- Bugfixes, better and leaner code, some useless stuff removed, other stuff added
__________________
Projects:Tutorials: Competitive AI Step by Step with AI Editor (Pending)
Resources: [AI Script] Michael Peppers's Melee AI template (Pending)
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 03:58 PM.


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

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