NTai XE10.1b - Page 28

NTai XE10.1b

Here is where ideas can be collected for the skirmish AI in development

Moderators: hoijui, Moderators

User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

Tobi
Spring Developer
Posts: 4598
Joined: 01 Jun 2005, 11:36

Post by Tobi »

Good work, it almost compiles on Linux now! :-)

Two errors left tho. One is solved (no clue what the error was about) by adding boost/spirit.hpp to #includes in TdfParser.cpp: moving ../Core/helper.h down.

Code: Select all

#include <algorithm>
#include <cctype>
#include <stdexcept>
#include <boost/spirit.hpp>
#include <boost/scoped_array.hpp>
#include <boost/lexical_cast.hpp>
#include <boost/algorithm/string/trim.hpp>
#include <boost/spirit/utility/confix.hpp>
#include "../Core/helper.h"
#include "TdfParser.h"
#include "tdf_grammar.hpp"
The other is solved by some preprocessor magic, the error is:

Code: Select all

AI/Global/NTAI/Helpers/Terrain/RadarHandler.cpp: In function 'float Dist(float, float, float, float)':
AI/Global/NTAI/Helpers/Terrain/RadarHandler.cpp:13: error: '_hypot' was not declared in this scope
Just adding something like this to that file (RadarHandler.cpp)

Code: Select all

#ifndef WIN32
#define _hypot hypot
#endif
solves it as hypot is declared on linux.

Note that I didn't test whether it actually runs, that takes me too much time at the moment (need to study :?)
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

*_8 Veylon will be happy to learn that. Since RadarHandler is OTAI code proted to XE8, I wasnt aware that even existed. Please add that as a comment on FU so others know, I dont have time to repackage the source wiht that change
User avatar
Lindir The Green
Posts: 815
Joined: 04 May 2005, 15:09

Post by Lindir The Green »

AF wrote:I intended much greater changes to the buildtree after I noticed something while debugging that got me very happy, I want the commander to guard the lvl 1 factory, even just temporarily, and let the construction units do the expanding.
I'm completely redoing the buildtree; now the commanders will repair a bit near the beginning and then after expanding a while will return home and guard a factory.
I have also added a feature I've crudely named Rule Interpolation.

When turned on say the build list is a,b,c,d,e,f, what it does is add a B_RULE_EXTREME in between each so a,*,b,*,c,*,d,* etc. This can be halted and resumed using keywords no_polate and interpolate.
:? B_RULE_EXTREME has never worked well for me. But I'll try it.
Also as a consequence of the new TDFParser, AI\\MetaTags is now useless and is ignored as it isn't needed anymore. Also all metatags need to be lowercase to be detected properly.
Just when defining them? Or all the time? I'll assume the latter for now.

It's a Saturday, so I can work on the buildtree the whole day. Expect a insanely awesome one tonight.

edit: Actually, expect it tomorrow at some point. Sry.
User avatar
rattle
Damned Developer
Posts: 8278
Joined: 01 Jun 2006, 13:15

Post by rattle »

The global constructor bug is still in for me. The debug one still works though. :?
User avatar
Vassago
Posts: 77
Joined: 25 Jun 2006, 00:03

Post by Vassago »

The latest version chugs insanely bad for me, regardless of map. The version that came with the latest TASpring worked smooth as silk, but crashed a lot. This new version doesn't crash, but there are just huge lag spikes for no reason.

system:
AMD64 3500+ o/c 2.35ghz
2GB Corsair ULLL DDR
2x160GB HDD Raid0
GeForce 6800GT o/c 420/1120

Any ideas?


The error I'm getting is like lag, and it even says delayed synch responses, and my 'ping' jumps to 2000 or more.
Ringold
Posts: 7
Joined: 19 Jun 2006, 16:32

Post by Ringold »

Vassago wrote:The error I'm getting is like lag, and it even says delayed synch responses, and my 'ping' jumps to 2000 or more.
Doesn't seem to happen really early on, or later in the game after I nuke/ravage most the map.. and its not graphics related.
User avatar
rattle
Damned Developer
Posts: 8278
Joined: 01 Jun 2006, 13:15

Post by rattle »

Diy you turn on .aicheat?


Looks silly huh? :)
Image
hollowsoul
Posts: 665
Joined: 06 Jun 2006, 19:49

Post by hollowsoul »

AF AI compiles under linux nice :)

One thing though were can i get hands on config files for bot ????
i.e AI/Default/commander.txt etc
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

Oh, bugger, they're in the installer.

as for _hypot and hypot, I've changed it as hypot works just as well in Visual Studio.

As for lag, I get lag, but I dont think thats NTai because when I view the debug mode stats it shows that the vats majority of lag is caused by the simulation tiself, and I get the lag regardles of wether NTai is there or not.

As for that metal in a factory, thats a spring bug todo with handling yardmaps, see my screenshots where I built lots of units in the middle of an open factory.

However I have a solution for that. Expect a new building placement algorithm in the next release. It may take a little longer than the last few as I've been working a bit more than usual on my latest project (see the dev mailing list).
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

PS :: Lindir, before any new major reworkings of the buildtree, I suggest you outline a plan and submit it first as I want to know what your aim and goals are in how exactly it will work so that i can adapt NTai as needed to support any features I think would aid you, or dismiss bad ideas.

And possibly that aswell as just buildtrees in whole you submit diff patches so I know exactly what was added/changed/removed and where and when. It would also make it easier for if I moved the whole thing into svn.

Also you forgot to add a section in the rules section of mod.tdf that includes rule values for B_RULE_EXTREME/CARRY. Original tests showed that NTai was far better at preventing stall with the interpolation thing that shoved a B_RULE_EXTREME inbetween every other task.

Also with meta tags, it loads the mod.tdf sections and then looks directly at the section rather than reading the tag. So if soemthign is defined in that section then thats all thats needed, it doesnt need "AI\\metatags" to be defined.

Also stop using the DT metatag for walls and use B_FORTIFICATION. Use universal keywords at every possible opportunity, it makes the buildtre more flexible.

Also B_GLOBAL == B_RULE. The global buildtree system has been commented out as it isnt performing nearly as well as B_RULE does.
User avatar
rattle
Damned Developer
Posts: 8278
Joined: 01 Jun 2006, 13:15

Post by rattle »

The current version's builttrees are much better than in RC17, it could withstand KAI on DeltaSiege until the comm was destroyed and spring crashed.

Code: Select all

Team0(Player) has been shown the door
Game over
GlobalAI0: error in Chaser::FireWeaponsNearby()
There are still some major pathfinding problems because it's not unusual that small buildings get in the way, e.g. LLT on the side of a cliff and units try to walk along that side and they pile up there not getting anywhere. Also some units try to get in the water because there's a ramp there for hovercraft or amphibious units. And the sometimes have troubles getting out of factories even though they're not blocked or anything. Lastly ships don't seem to work properly. They often try to get on the land or builders want to help other land builders. Or builders spam shipyards in closed ponds.

By the way the Aircraft Plant didn't have any troubles pumping out new planes. They were built right inside the mex :P
hollowsoul
Posts: 665
Joined: 06 Jun 2006, 19:49

Post by hollowsoul »

Grabbed the missing files from the win32 installer, but ran into a prob :(

Gonna go out in abit, will try run game through gdb later or anything else u like to try & use to debug it :(


Number of damage types: 5
TA Spring 0.72b1
AI has enabled cheating.
GlobalAI1: error in Global InitAI, cannot continue
GlobalAI1: St9exception
GlobalAI1: Error :: InitAI() in XE9RC18 failed, please notify AF at once
GlobalAI1: Error :: http://www.darkstars.co.uk
User exited


AI/Logs/<foo> = http://pastebin.ca/71180

note :- didnt get your group ai to compile (forgot to copy/paste error) will try it again later tonight, but got your ai to compile :P
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

I'm guessing it's the untidef reader.

UnitNamer and Unitdef reader groupAI cna safely be ignored completely as they shouldnt of much use to you anyways.

Thanks though
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

"Section game missing in file script.txt"

Try constructing a script.txt and using that to start the game. I never planned for such an eventuality as there not being one, and trying to handle data in empty cotnainers may be the cause of that.
User avatar
Lindir The Green
Posts: 815
Joined: 04 May 2005, 15:09

Post by Lindir The Green »

AF wrote:Also B_GLOBAL == B_RULE. The global buildtree system has been commented out as it isnt performing nearly as well as B_RULE does.
:?

I don't like how I can't decide what B_RULE builds. And it can't build defenses at all.

If you really want B_GLOBAL removed, then add more functionality to B_RULE.

I just want some control, to prevent NTai from doing stupid decisions. Something like:

Code: Select all

IF metalIn < metalOut
{
    B_MEX
}
IF (metalIn > (metalOut + 6)) AND (metalStorage > 30%)
{
   B_FACTORY
}
IF (metalStorage > 60%)
{
   heavy_defense
}
// And then if it doesn't do any of those
B_GUARDIAN
And it should be read from the top to the bottom, doing the first thing that it meets the condition for. Just something so that I have some control.

About the revised buildtree:

I am rewriting all of the constructors, taking advantage of B_RULE. Basically, the constructors will have something like:

Code: Select all

corgant, coralab, corlab, B_RADAR, B_DEFENSE, B_RULE, B_RULE, B_RULE
It will be designed so that B_RULE shouldn't ever need to build a factory, it will usually build resources. Most of the factories in the buildlists will be ignored because of the antistall algorithm, but only just enough to prevent horrible stall.

The change should help NTai to utilize all of its resources and tech up faster.

I guess I will also have to reduce its dependance on B_GLOBAL...
User avatar
Lindir The Green
Posts: 815
Joined: 04 May 2005, 15:09

Post by Lindir The Green »

And here's the buildtree!

It performed great against KAI on deltasiege, and its few problems had to do with NTai, not the buildtree:

-When the commander was told to B_RULE, it would run off to the water and build a uwmex, instead of building one nearby on land. I don't know how to fix this.

-resurrect apparently isn't a keyword. Am I spelling it wrong?

-B_GUARD_LIKE doesn't work.

-The advanced constructors never wanted to build advanced infrastructure.

-Constructors kept running off towards the enemy looking for metal, and then dying.

http://www.fileuniverse.com/?p=showitem&ID=3564
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

B_RESSURECT/B_RESURECT

and B_GUARD_UNIT_LIKE not B_GUARD_LIKE aswell as B_GUARD_FACTORY.


The uwmex, was it closer than the land as in if you drew a direct line through any cliffs and regardless of height differences?

As for B_RULE, you CAN decide.

The rules in B_RULE are rodered as follows

metal
energy
factories
metal makers
metal storage
energy storage

Should they be re-arranged?

Whatsmore the rules are defined similar to what you said, with the modifying values or multipliers tied in to the mod.tdf directly.

Look at CEconomy.cpp it's what drives the rules, adn its pretty much all there is in there so it'll be easier to understand.

If you have new rules to add or suggestions I'll happily add them in.

I'd also find a defence rule telling whether to build them or not would be very useful, as would one for factories that used a scout:attacker:builder ratio with say values such as

builders=0.2;
attackers=0.7;
scouters=0.1;

maybe if ratio of buidlers is < definedOR scouters < defined minimum N# ratio B_BUILDER
else if ratio of atatckers is < defined OR scouters < defined minimum N#then B_ASSAULT
else if scouters is M defined ratio OR scouters < defined minimum N# then B_SCOUT
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

Also relying on B_RULE totally for resources may nto eb as good, afterall soemtimes it's a godo diea to copy AAI and do mexes with missile towers nearby, or to build mexes anyways in order to expand. Mex building was always a big driving force for early NTais, as it brought with it expansionism, without ti NTai would stay stuck around a abse that got crowded and bigger and bigger instead of spreading out.
hollowsoul
Posts: 665
Joined: 06 Jun 2006, 19:49

Post by hollowsoul »

"Section game missing in file script.txt"

Try constructing a script.txt and using that to start the game. I never planned for such an eventuality as there not being one, and trying to handle data in empty cotnainers may be the cause of that.
Can u point me to an example for script.txt or info on how to make one ???
Also were u u put the script ?
Do i need to tell spring to load the script ?
Post Reply

Return to “AI”