AAI 0.76 released
Moderators: hoijui, Moderators
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.
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.
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.
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.
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.
- 1v0ry_k1ng
- Posts: 4656
- Joined: 10 Mar 2006, 10:24
-
- Posts: 17
- Joined: 27 Jun 2006, 11:28
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
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
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.
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.
-
- Posts: 17
- Joined: 27 Jun 2006, 11:28
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?
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?
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.
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.