• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[General] How to make AI? How to get hints to trigger? How to make buildable gates that work?

Status
Not open for further replies.
Level 8
Joined
Dec 2, 2015
Messages
235
I don't want to spam the forums with my threads so I will ask all my current questions together.

  1. I am trying to learn how to make AI for an additional faction I am introducing to an alternate version of the 2nd mission of the TFT Alliance Campaign. Where is a good place to start learning this? I have created a map to test learning this stuff (attached) so I can try to figure things out before trying to implement it into the rip of the official campaign mission.
  2. How do I get hints to work? I thought this one would be easy because I could just copy how the triggers for pre-existing hints work, but I couldn't get it to work. I want various hints to occur after certain cutscenes at a certain amount of time apart. (So like, the first hint is after the cutscene and then each hint is 5 seconds after that or something.)
  3. How can I make gates/walls as structures rather than destructibles which also function by opening/closing but which can be destroyed and do not heal when opening/closing. I know how to make destructible gates open/close using triggers, but not much else.
Edit: updated map uploaded.
 

Attachments

  • BootyBay AI testing v2.w3x
    144.5 KB · Views: 38
Last edited:
Level 23
Joined
Jul 26, 2008
Messages
1,321
Does your AI work? You havent posted any information about it except a file. If you explain what issues you are encountering it will be easier to help.

For hints, i really suggest going to the 2player forum, where the maps are all open source and you can read the tirggers from the preview trigger function on hive without needing to open WE. I personally checked for the missions where a new unit is given to the player and just copied that directly from the bliz campaign into my map.

Download the Campaign
 
Level 8
Joined
Dec 2, 2015
Messages
235
About AIs... I have literally never created an AI before and I have no clue where to start. Previously for campaign style maps I have just created a serious of triggers to create the illusion of an AI. Like, waves of footmen will spawn in a region and attack move to a point until a barracks is destroyed. I have no idea how to get an actual AI to work and there is so much out there that when I google it I am not finding a good tutorial to help me get started for where I need to go.

About Hints, thanks, I will check it out, but it will have to be later. I have to go to bed as it's late and got that work in the morning.
 
Level 8
Joined
Dec 2, 2015
Messages
235
Does your AI work? You havent posted any information about it except a file. If you explain what issues you are encountering it will be easier to help.

Let me try again. Sorry if I wasn't more informative at first.

What I want from the AI is this.

-The AI ally arrives during a cutscene and builds its base.
-The AI ally defends its base, repairs/rebuilds structures, replaces units, and harvests resources.
-The AI ally sends ground unit attack waves against enemy base C until enemy base C is destroyed and then those attack waves attack enemy base B instead until enemy base B is destroyed and then finally it sends ground attack waves against enemy base A until the end of the mission.
-The AI ally sends air unit attack waves against enemy base E until enemy base E is destroyed and then those attack waves attack enemy base D instead until enemy base D is destroyed and then finally it sends air attack waves against enemy base A until the end of the mission.

I think that's everything I want from the AI. Except maybe to defend to try to defend the player base when its being attacked? I'm on the fence about whether I even want that.

Try messing around with AI editor. For campaigns, you should go start with JASS AI, I remember there are documentations at Jass/AI Tutorials.

Thanks, will do.
 
Level 23
Joined
Jul 26, 2008
Messages
1,321
Let me try again. Sorry if I wasn't more informative at first.

What I want from the AI is this.

-The AI ally arrives during a cutscene and builds its base.
-The AI ally defends its base, repairs/rebuilds structures, replaces units, and harvests resources.
-The AI ally sends ground unit attack waves against enemy base C until enemy base C is destroyed and then those attack waves attack enemy base B instead until enemy base B is destroyed and then finally it sends ground attack waves against enemy base A until the end of the mission.
-The AI ally sends air unit attack waves against enemy base E until enemy base E is destroyed and then those attack waves attack enemy base D instead until enemy base D is destroyed and then finally it sends air attack waves against enemy base A until the end of the mission.

I think that's everything I want from the AI. Except maybe to defend to try to defend the player base when its being attacked? I'm on the fence about whether I even want that.



Thanks, will do.
I can tell you from playing around with the AI editor, for me it is far easier to do, and if time is limited i suggest not learning JASS just for the AI.
Basically you can easily make a campaign AI with the editor, but you need to move things around your map for it to work. For example, when you say "arrived and builds a base".
I'm not sure how to make the AI make the base using the AI editor, but you can place the buildings, then for your "cutscene" show a terrain area that players cannot see that is identical to the area you want it built, so in the cut scene you see the peasants arriving and then building something (use triggers to make them build), but then have the real place where the base is set up revealed.

For sending waves, you using the AI editor you can choose what units the bases makes and sends (air/ground like you want).
For the order of attacking bases, you cannot do this with the AI editor, so you need to place the bases so the closest is the one you want attacked first, then the second furthest is the 2nd one you want attacked etc.
My advice is lay around with the AI editor (not JASS AI :p ), it is fun and simple *my opinion*.
 
Level 8
Joined
Dec 2, 2015
Messages
235
Maybe what I want exactly is too ambitious and I will have to settle for an alternative. It's too early to tell.

But I believe everything I want is some variation/combination of what I have already seen in the campaign.

In the orc campaign in RoC (2nd mission I think), Grom is your ally and he attacks the various human bases in a cycle and stops attacking human bases that have been destroyed.

In one of the night elf missions in RoC, an undead base, an orc base, and a human base send endless air wave attacks at each other.

I'm not sure if I can get it to work exactly how I am imagining it at this stage, but I am sure that it is doable or at least something very similar.

I'm not sure how to make the AI make the base using the AI editor, but you can place the buildings, then for your "cutscene" show a terrain area that players cannot see that is identical to the area you want it built, so in the cut scene you see the peasants arriving and then building something (use triggers to make them build), but then have the real place where the base is set up revealed.

Like for this, I won't be able to use the exact trick you mentioned, but I might be able to force the AI to build its base using triggers and then the AI can just maintain its base or something.
 
Level 23
Joined
Jul 26, 2008
Messages
1,321
Maybe what I want exactly is too ambitious and I will have to settle for an alternative. It's too early to tell.

But I believe everything I want is some variation/combination of what I have already seen in the campaign.

In the orc campaign in RoC (2nd mission I think), Grom is your ally and he attacks the various human bases in a cycle and stops attacking human bases that have been destroyed.

In one of the night elf missions in RoC, an undead base, an orc base, and a human base send endless air wave attacks at each other.

I'm not sure if I can get it to work exactly how I am imagining it at this stage, but I am sure that it is doable or at least something very similar.



Like for this, I won't be able to use the exact trick you mentioned, but I might be able to force the AI to build its base using triggers and then the AI can just maintain its base or something.
The things you mention about the Orc campaign with Grom, and the Night elf missions with the air waves, would all need JASS AI. I know many people prefer the JASS AI, but personally I would never touch it unless I had lots of free time to learn something that looks so complicated :p. Anyway good luck
 
Level 8
Joined
Dec 2, 2015
Messages
235
I finally got a chance to fiddle with the AI editor. I feel like I don't even understand what I don't understand.

This is probably going to take a long time because it needs a bunch of time investment that I don't have right now to learn.
 
Level 13
Joined
Oct 12, 2016
Messages
769
I can help you out this weekend with the AI after work.
I just finished making some custom AI scripts for squad-based factions myself.
To learn it yourself, the best thing to do is open up the "GruntMaster" .wai script in the AI Script folder from the AI editor, and look at how Blizzard does it.
I will admit, even after, it takes some tinkering to get it working right.
This is the best tutorial I know and use as a reference:
Competitive AI Step by Step with AI Editor - Wc3C.net

To make an AI start at a specific area, manually order their worker to start building their town hall at the desired region, then trigger the script to start after it finished construction. Or, just "create" it there.

As for buildable gates, I got something for that too.
You'll need a trigger, a dummy ability, and 2 separate gates in the object editor: 1 for open state, 1 for closed state.
Fair warning: the basic AI script will never use gates or walls effectively.
 
Last edited:
Level 8
Joined
Dec 2, 2015
Messages
235
I can help you out this weekend with the AI after work.

That would be great if we could arrange the time. Already half way through Sunday though and I am not sure if we are in the same time region. Edit: I forgot to mention that I am on AEST.

For AI, what I've seen so far is that probably JASS is going to be the way to go if I actually want to get it done even if it's maybe the harder route to go.

As for buildable gates, I got something for that too.
You'll need a trigger, a dummy ability, and 2 separate gates in the object editor: 1 for open state, 1 for closed state.
Fair warning: the basic AI script will never use gates or walls effectively.

That's just for the player. All I want from the AI is to attack the gates/walls and the AI doesn't attack destructibles.
 
Last edited:
Level 13
Joined
Oct 12, 2016
Messages
769
Alright, all I'll need is some object data.

EDIT:
I looked at your test map. You have a couple of islands, and you basically have premade bases.
If you want something that continuously spawns units, that's completely possible with triggers alone.
Attacking destructables? Also doable with a periodic trigger
If you want a slightly interactive AI, you won't need JASS either for this map.

What exactly do you want each side to do?
Just rebuild their structures, and send units on a suicide mission?
 
Last edited:
Level 8
Joined
Dec 2, 2015
Messages
235
What object data do you mean?

I looked at your test map. You have a couple of islands, and you basically have premade bases.
If you want something that continuously spawns units, that's completely possible with triggers alone.
Attacking destructables? Also doable with a periodic trigger
If you want a slightly interactive AI, you won't need JASS either for this map.

What exactly do you want each side to do?
Just rebuild their structures, and send units on a suicide mission?

Yeah, basically. [Campaign] - AU Alliance Campaign Act 1 (Mission 1+2) is what I am actually working on.

In Mission 2, I am removing the Naga and at 30 minutes I want an AI ally to enter the map, build its base, and then sent attack waves against the enemy to help the player. I also want to try to figure out how to get the ally to respond to attacks on the player base specifically with gryphon riders.

Also, the armies used are not the standard armies but rather armies that include custom units (such as human priests).

I thought that maybe figuring out some stuff about AI separately would help me learn what I needed to do in that mission. Maybe just taking a straight look at that would help you understand what I am looking for.

I'll PM you with my Discord. Hopefully we can chat sometime this weekend. Thanks for your help thus far.
 
Level 12
Joined
Jun 15, 2016
Messages
472
Just dropping in about a few things. Dunno if you solved the problem with hints, but there's a neat little trigger blizzard uses a lot for their hints:

(You can skip the gameover thing here)
  • Hint Sacrificial Skull Q
    • Events
    • Conditions
      • GameOver Equal to False
    • Actions
      • Quest - Display to (All players) the Hint message: |cff32cd32HINT|r - ...
      • Wait Campaign hint delay seconds
      • Trigger - Remove (This trigger) from the trigger queue
About the AI, there are a few things I would advise, and some I would advise against:

For starters, using periodic triggers as a replacement is not a good idea. I can't stress this enough. I saw it being done in Chasing the Dawn, and later in Legacy of the Master, both amazing projects with missions ruined by extremely dumb computer player behavior. Second, as tulee pointed out, you can technically make the AI work as you want of you play around with player locations. But even then, having something like an aerial wave sent to a specific player is not possible. These are things simply not done with the editor. Lastly, about attacking destructibles: this one is a real problem with the AI, but there is a possible workaround.

While the AI will not attack destructibles, It is possible to order units to attack destructibles with a trigger. So, you can send the coordinates of any gate created to the AI, and have the AI move units to around it's location. Once there, a periodic trigger should catch all AI player units in a certain radius around the gate and have them attack it. There are a few problems with that but that's for later.

The only advice I have for actually learning JASS/JASS AI is that once you go through the first few bumps, it's not as evil and complicated as it seems (seriously). Naturally, if you have any questions after reading the tutorials, feel free to post here or PM.
 
Status
Not open for further replies.
Top