You must be logged in to post messages.
Please login or register

Modding and Scripting
Moderated by Yeebaagooon, nottud

Hop to:    
loginhomeregisterhelprules
Bottom
Topic Subject: AI Trigger Interface
posted 06 January 2009 09:55 AM EDT (US)   
It's a known fact that triggers can call up functions that belong to an AI script, these can be used to fire up a rule inside the AI...
But getting the AI to fire triggers, it's quite a different story... Infact, it wasn't a story at all because it was simply thought impossible.. Until now. .

I'm working on a Interface between AI and Triggers, so far I've got an AI script to fire 2 rules simultaneously, and using Quest Vars too!
The Showcase Test Scenario:
AI Sample Code:
// Testing AI Interface
include "X Library.xs";

void main() { }

rule TriggerFire
active
minInterval 1
{
xsEnableTrigger("KillA");
xsEnableTrigger("Move");
xsDisableSelf();
}

rule WhateverInc
active
minInterval 1
{
trQuestVarSet("Whatever", trQuestVarGet("Whatever")+5);
}

At the moment, it only works for Vanilla. I will try to port it to AoT. It will be release in the Trigger Loader after insane testing.

Now AI and Triggers are closer than ever.. . Any comments?
-invent00r

My Work: 1 2 3 4 5 6 7 8 9 10

WIP: Master XS Battle Micro AI
Paused: AI (%4.247)
Os segredos são de quem os souber guardar.
Replies:
posted 06 January 2009 10:34 AM EDT (US)     1 / 11  
Pfff... all interesting things happen when I'm studying. >_<

Good job, weird we didn't think of that earlier...

If we knew what it was we were doing, it would not be called research, would it? - Einstein, A.
Master XS - AoM Code Reference - Trigger Loader - Trigger Requests - Chess

Wow, I never thought that I would actually know something before nottud did... it's actually not all that satisfying ~ Steak
posted 06 January 2009 10:58 AM EDT (US)     2 / 11  
I had worked it out on my mind before..

I'm just passing through the real world now .
-invent00r

My Work: 1 2 3 4 5 6 7 8 9 10

WIP: Master XS Battle Micro AI
Paused: AI (%4.247)
Os segredos são de quem os souber guardar.
posted 06 January 2009 11:36 AM EDT (US)     3 / 11  
Hey, this is a good stuff.

You are basically upgrading our trigger system with the AI stuff!

So we can control AI, set up AI for the gameplay, and retrieve AI variables if we use AI stuff through trigger?
posted 06 January 2009 11:51 AM EDT (US)     4 / 11  
Not quite. I'd say it's more the other way around. .

We can now control Triggers, and retrieve trigger variables, and edit them using AI..
-invent00r

My Work: 1 2 3 4 5 6 7 8 9 10

WIP: Master XS Battle Micro AI
Paused: AI (%4.247)
Os segredos são de quem os souber guardar.
posted 06 January 2009 01:20 PM EDT (US)     5 / 11  
Ah, that would be good.
posted 06 January 2009 04:00 PM EDT (US)     6 / 11  
hey guys
if that ai scrpit is just C++
maybe we could include other c++ libraraies
and include them just like X Library.xs
if i for example write include "windows.h"
i could maybe make popup messages
and in i include "stdo.h"(think the name is wrong)
i can write dat to files and much more!!!

i donn't know if it's possible, this is the first time i actually see a ai script :P

>> www.EmjeR.com <<

Mods - EmjeR's eyecandy pack :: Improved Greeks look :: Ghengis Khan - Mods
Programs - BCTool Attachpoint Editor :: BCTool :: Words - Programs
Games - 0 AD :: Stronhold 2 :: BfME 2 - Games
!! Proud member of WildFire Games !!
posted 07 January 2009 04:36 AM EDT (US)     7 / 11  
Nope, it's far from C++.

If we knew what it was we were doing, it would not be called research, would it? - Einstein, A.
Master XS - AoM Code Reference - Trigger Loader - Trigger Requests - Chess

Wow, I never thought that I would actually know something before nottud did... it's actually not all that satisfying ~ Steak
posted 10 January 2009 08:18 AM EDT (US)     8 / 11  
I know you've only just started this and call me vague, but what possibilities does this open up? is it just a way to make a more powerful AI? Or is there more than that? ~ Khan

EDIT: Wow, that UI is modded to the max!

<||=================================||>
Proud Member of Forgotten Empires
96Reviews KaS Dota2 Halo 5 Reach
{ "Work until your idols become your rivals" }
༼ つ ◕_◕ ༽つ trGetUnitScenarioName(); ༼ つ ◕_◕ ༽つ

[This message has been edited by Steak And Khan (edited 01-10-2009 @ 08:29 AM).]

posted 10 January 2009 09:00 AM EDT (US)     9 / 11  
It will mainly make AI more powerful..
With the AI script and Triggers well coded, it allows AI to send custom chat, check if a GP is being active, Flare, fire Triggers, convert and change unit type of units, use GP more tightly and without plans (underworlds for example), garrison & ungarrison units, move units in group without using plans...

Triggers could benefit from functions like Buy & Sell at the market and knowing how much it costs, resource income, random numbers from AI, getting the AI personality, tell AI to build walls from point A to B, tell AI to research a tech, use aiIsMultiplayer to check if it's a multiplayer game..

And I can't think of anything else at the moment.. But obviously the AoM default AI don't have this interface installed, so this will only benefit coders. At the moment, I'm doing some tests to see if it will work online. If it doesn't work online it still makes a difference for campaigns that want to have a nice AI. .
-invent00r

My Work: 1 2 3 4 5 6 7 8 9 10

WIP: Master XS Battle Micro AI
Paused: AI (%4.247)
Os segredos são de quem os souber guardar.
posted 20 January 2009 10:25 PM EDT (US)     10 / 11  
If it doesn't work online, would it be due to the same reasons mods can't be played online?
If so, if both people in a LAN have this you'd still be able to play?

I know it really early in development and your currently testing the stuff, but if you find out you'll post it here right..? ~ Steak

<||=================================||>
Proud Member of Forgotten Empires
96Reviews KaS Dota2 Halo 5 Reach
{ "Work until your idols become your rivals" }
༼ つ ◕_◕ ༽つ trGetUnitScenarioName(); ༼ つ ◕_◕ ༽つ
posted 21 January 2009 06:27 AM EDT (US)     11 / 11  
@:Steak And Khan
Most work done so far doesn't work online, because only the host runs the AI.. . There are a few exceptions like - Move To Point\Unit, and Garrison..

Luckily, AI can still read Quest Vars without problems. So it is possible to set variables and issue AI to do certain tasks on a online game. Very limited online yes, but very capable otherwise.

This interface is going to be part of the next TL update. So no mods are really required. I think both LAN & ESO work the same way when it comes to sync games, which means what you get on ESO is what you'll also get on LAN.
-invent00r

My Work: 1 2 3 4 5 6 7 8 9 10

WIP: Master XS Battle Micro AI
Paused: AI (%4.247)
Os segredos são de quem os souber guardar.
Age of Mythology Heaven » Forums » Modding and Scripting » AI Trigger Interface
Top
You must be logged in to post messages.
Please login or register
Hop to:    
Age of Mythology Heaven | HeavenGames