AAI 0.76 released - Page 7

AAI 0.76 released

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

Moderators: hoijui, Moderators

somazx
Posts: 5
Joined: 05 Jan 2007, 06:18

Post by somazx »

K, its been crashing like that on all sorts of maps including Small Supreme Battlefield and others which are pretty well tested.

Sometimes it doesn't crash after retrying enough times. So it comes and goes.

Should I edit my previous post to shorten it up since the info isn't that useful?
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

I would suggest that you add exception handling. In the past you and krogoth have opposed it with the arguement that you want it to crash so users will report it, however you dont necessarily need to keep the AI running once an exception is caught, and instead use it as a neater tidier error reporting tool, possibly showing information that would help determine the crash and be more informative than "exception in globalai aai.dll please contact the author".

This would be easy by using a proxy class which then calls the AAI classes but encased in try catches, that then stops passing the calls on once an exception has occured.

Such a proxy class can easily be improvised using the CNTai class which does exactly what I said above, save it logs errors rather than halting the AI when an error occurs, unless it happens during initialization, all you'd need todo is change a boolean value to false. Actually I think I'll create a nice and neat class for it now.
User avatar
MadRat
Posts: 532
Joined: 24 Oct 2006, 13:45

Post by MadRat »

You really, really need to clear that damn buildtable_<modname>.txt file once in awhile or it'll keep on crashing. This is one of those unwritten fixes. Just delete it from the logs folder and retry a game. It fixes stability.

Also make sure you use a dynamic swap file for the system.
Tobi
Spring Developer
Posts: 4598
Joined: 01 Jun 2005, 11:36

Post by Tobi »

C++ exception handling won't stop crashes. The only thing you catch with it are bugs in the arguments passed to std::string::substr or bad allocations (if memory is full, but you're going down anyway then...) and if you use iostream for IO (as opposed to stdio.h) you'll catch IO errors too.

Signal handling or Win API exception handling (like spring does now) is the only way to catch crashes, but as you can expect this will conflict with springs crash handling. A far better solution is to just make your code stable (a few checks for NULL pointers really don't make it slower on todays hardware...) and make sure the divisor in a division can't be zero.
User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6241
Joined: 29 Apr 2005, 01:14

Post by FLOZi »

When can I have the version you were testing the other day? AAI crashes on startup with me for Spring44, with or without a cfg setup for it. :P
submarine
AI Developer
Posts: 834
Joined: 31 Jan 2005, 20:04

Post by submarine »

i got my new pc yesterday (core2duo 6600, radeon 1950xtx (btw: does dynamic water work with ati cards?) and i havent had the time to install vs.net yet. i'll send you a working dll asap
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

dynamic water == nvidia only
tb87670
Posts: 24
Joined: 16 Jan 2007, 05:19

Post by tb87670 »

I have a problem with AAI in Small Supreme Battlefield V2. When i choose the player picks spawns, and I set a box for each team to choose in, it gets to the map and then freezes. Me and my friends all tried this, and when we remove the box, it spawns in the top left corner all the time. I was just wondering if this was addressed or not yet.
User avatar
Peet
Malcontent
Posts: 4384
Joined: 27 Feb 2006, 22:04

Post by Peet »

That's a problem with Spring. The workaround is to type .cheat and then .team <playernumber> to each of the ai's numbers, then set positions, then go back to your own team. Don't click ready until you're back in your own team.
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

Best not to use AIs with choose pos ingame.
tb87670
Posts: 24
Joined: 16 Jan 2007, 05:19

Post by tb87670 »

Ok, thanks for the workaround. I think that would be a handy feature for AAI to have is a system to intellegently choose a spot in a choose pos game, then it would be that much closer to a person (kinda hard to simulate a person, because by then our robot masters would own all lol)
User avatar
1v0ry_k1ng
Posts: 4656
Joined: 10 Mar 2006, 10:24

Post by 1v0ry_k1ng »

that would be very hard to do. what probably could be done is to find the most metal intensive spot in the start box and make AAI choose to start there, and make sure AAIS wont start within a range of say 500 of eachother.
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

aside from that the AI in spring is created and initialized AFTER the position choosing, making it impossible to let it choose a position.
kineticdeath
Posts: 17
Joined: 27 Jun 2006, 11:28

Post by kineticdeath »

I'm happy with aai, it actually runs FF and, puts up a decent fight, I tested it so on the core prime rev2 map and it threw some decent numbers at me.

My only problems are - It built veery limited, only had 2 adv shipyards and no lvl 2 + defenses (but had a few builders guarding those for faster build) and it refused to play on metal corners. I will test it on other maps later tonight, but still it was mesmerising watching those beams going off, great stuff. Hope we can have some total FF warfare shortly, would make my day.

Space battles ftw
User avatar
yuritch
Spring 1944 Developer
Posts: 1018
Joined: 11 Oct 2005, 07:18

Post by yuritch »

Only 2 adv. shipyards: increase MAX_FACTORIES_PER_TYPE to more than 2 in the config file.
No lvl. 2+ defences: show their usefulness to the AI (build some and let it lose some units to them). It will probably start making them after that. Another reason might be their cost. There is a MAX_METAL_COST setting in the config, anything that costs more will not be built.
The config file is probably called something like "FF 1.18 S.cfg" and is located in <Spring dir>\aai\cfg\mod.
kineticdeath
Posts: 17
Joined: 27 Jun 2006, 11:28

Post by kineticdeath »

ohh right, thanks i remember reading about aiconfigs but never new what it meant, time for me to start learning. FF is my favourite mod in spring and OTA and i really want to play some huge battles, I love the spring visuals its just so pretty

Just updating this, I been playing with the config, increasing most parameters. The AI is more powerful now for sure, but still kinda has a tendancy to bunch up its ships, is there a parameter i can use to make it at least fly them out and around its base, perhaps patrolling until a set number is reached then attacking?
Stigern
Posts: 20
Joined: 03 Sep 2006, 14:27

Post by Stigern »

I get an error when using map Small Divide and AAI:

Incorrect Global AI dll Version
AI/Bot-libs/AAI.dll

:?
User avatar
yuritch
Spring 1944 Developer
Posts: 1018
Joined: 11 Oct 2005, 07:18

Post by yuritch »

You are using a bot compiled for the old Spring version. You have probably used the 0.74b3 updating installer (4 MB one) wich doesn't update AIs.
The 0.74b3 Regular installer or GPL content installer (30 and 25 MB ones) come with AAI compiled for the new version that should work, try downloading one of them.
User avatar
Slamoid
Posts: 237
Joined: 25 Jan 2005, 19:23

Post by Slamoid »

Submarine, are you going to allow AAI to autogenerate it's own config files from in-game data at some point in the future?

Thanks :-)
Coolio
Posts: 5
Joined: 17 Nov 2006, 16:47

Post by Coolio »

Question, SPring 0.74b3 already comes with updated AAI?
Post Reply

Return to “AI”