AI Development Discussion

classic Classic list List threaded Threaded
1250 messages Options
1 ... 31323334353637 ... 63
Reply | Threaded
Open this post in threaded view
|

Re: AI Development Discussion

Black Elk
This post was updated on .
captaincrunch wrote
wanted to ask if you are using AI 50/50 or are you letting the AI run all the countries for every
round or what.
Quoted from:
http://tripleadev.1671093.n2.nabble.com/AI-Development-Discussion-tp7585227p7587969.html

Neah, I take control of one side as a human for the duration and I let the AI take the other side for the duration. Then I play against it as if it were a human opponent. Lately if I play as Axis against HardAI Allies I've been giving them a bid of 36 split evenly, just to see what they do with it and how long they are able to fight. Then I play against the AI for as long as it continues to entertain me, and in the process try to see when the AI goofs or does something fascinating. I play for speed mainly, and the enjoyment of beating up the machine, to see how the AI is holding up lately for v5, since I think that's a board where it has some strong potential once a few more kinks are worked out with transport fleets and carrier based air.

In this last game I was curious, given all the TUV Allies threw into Africa, how long it would take to recover that continent. So I decided to play on after "Axis Honorable victory" at the end of the 11th round. I did several rounds of solid air production after Moscow collapse, with plans to outclass the Anglo Americans and deny them any good drops into Europe or Africa. HardAI Allies held me off the suez canal for several rounds, but eventually the Axis bomber armada was able to force his fleets away from Africa as Axis crescendoed in production. Took 30 rounds to completely annihilate the Allied navies and embark on a comfortable "Invasion USA!" ...

Pretty fun for a game against HardAI. I enjoy how they never quit, so you can see the endgame after capital collapse, which is somehow satisfying and makes testing the AI relaxing. :)

Against the computer you have to set different goals to stay engaged like always playing out your blunders, and seeing how quickly you can take all their capitals. Because you're clearly an insomniac Haha.

Hard_AI_Allies_bid_36_ipcs_round_29_Invasion_USA.tsvg

The AI Allies fought bravely, but tonight I was all for unconditional surrender! ;)
Reply | Threaded
Open this post in threaded view
|

Re: AI Development Discussion

redrum
Administrator
@Black Elk - Long game and more like total destruction than unconditional surrender. It might be a more balanced game if you just give Russia a larger bid and give nothing to the other allies. The issue seems to be that Russia collapses before the Allies can help.
Reply | Threaded
Open this post in threaded view
|

Re: AI Development Discussion

captaincrunch
This post was updated on .
Black Elk, hey thanks I just wanted to be sure how you were testing the AI.



Alllllllright, had a blast testing the latest AI.jar update and played 4 matches and lost the 1st, won the 2nd, lost the 3rd, then won the 4th.




1st match: I was the Allies and the AI was the Axis and I forfeited my 1st turn with Russia just for fun and I almost beat the AI! Most hilarious loss I ever had ... I played Russia and U.K. maybe best I ever had and took Germany in maybe round 6 or 7 BUT eventually I accidentally sent 1 or 2 many USA planes to help take Germany (neglected the Japan AI assault on west USA) and the Japan AI landed in west USA and I could not kick them out and the Japan AI always marches right from the get go picking up territories and had tons of cash and the Axis AI had Economic Victory in maybe round 12 and it was so funny because the Japan AI took both my Russian capitol and my USA capitol in round 15 and so the entire world map was all yellow except only the UK and the German capitol which both I owned by UK so the whole map was yellow except the brown UK controlled Britain and Germany and looked so funny and I hadto give up. What a funny match that I so should have won but was a blast but I gave up in like round 18 maybe.




2nd match: I was the Allies and the AI was the Axis and this time I didn't forfeit my 1st move with Russia because its a tough challenge but anyways I ownt with Russia and I think I had good defensive battle dice rolls but I took Germany with USA in round 7 and then it took me 20 more rounds to beat back Japan and end the match;

latestaxisaidefeated11.tsvg





3rd match: I was the Axis and the AI was the Allies and this was a hilarious match I lost. I played Germany so awesome and took the Russian AI capitol in like round 4 and I thought for sure I was gonna finish and win but the USA AI ownt everywhere and I had a hard time clearing the waters around the UK because the AI has improved its navy ability. The USA AI overwhelmed Germany and then I think it was the UK AI that liberated the Russian AI capitol in maybe round 12 and there was no way I was going to liberate Germany with Japan so I gave up in maybe round 14 or so.




4th match: I was the Axis and the AI was the Allies and this time I tried hard to build an airforce with Germany and also bought the occasional ship to keep the UK AI waters clear and I took the Russian AI capitol in round 5 with Germany and then swiftly took the UK AI capitol in round 10 and then ended the match by taking the USA AI capitol in round 15 with Japan;

latestalliesaidefeated11.tsvg






So, I want to tell redrum that I feel the AI navy is looking better and can't think of any way to improve it since its playing well and also I watched for bad AI plane placement and did not see anything other than if the AI needed a plane for an important battle it might haveto land a single plane somewhere but the end justified the means so that is not an issue for the AI now.


Way back in the beginning of this game I first commented about the AI that I felt it wasn't purchasing enough Infantry and buying too much artillery and then you Devs started to tinker with the AI's purchases ... in my opinion, right now, I feel the AI's best chance to be challenging completely relies on number of units the AI has or can purchase. So my point is I thought about it and will suggest the AI should be purchasing Infantry at about 80% of its total purchase and then the remaining 20% to purchase Tanks and/or Artillery at an even ratio ... leaving Navy and Airforce purchases as is right now because I no longer feel the AI has issues with weak Navy or weak Airforce so congrats on that success.


So Redrum, do you think my thought that the AI being heavy (80%) for Infantry and then light (20%) for Tanks or Artillery is a fair ratio? Am I close to your ratio you set the AI's purchasing at for those 3 units?



Great stuff and look forward to the next update!
Reply | Threaded
Open this post in threaded view
|

Re: AI Development Discussion

Black Elk
This post was updated on .
Nice saves Captain! Haha I remember in the first game I played the exact thing happened to me, with Japan taking the west coast USA. And I thought "whoa this hard AI is trying to get hard on me!" Since then I've seen that if you leave 'em alone that HardAI Japan loves to gun for North America, and if you don't keep a navy in the Pacific, they love to shoot there ships to panama to lock off the USA Naval builds in the back. Using the old technique of the W. Canada push I've found that the AI is a bit more reluctant to invade, but even then they'll press soon as they get a chance. Its kind of entertaining though right? I admire their determination :)

Oh also, for Redrum here is a save showing what I would consider a fairly consistent Goof by HardAI Russia.  Actually its hard to pin entirely on Russia, more a coordination failing between UK and Russia to hold Caucasus.

The save also highlights the transport problem with HardAI UK, as they sacrifice 3 transports (21 ipcs) in the sz 5, reducing their ability to stack the north the following round. Then they landed 3 bombers in Caucasus (36 ipcs). Rather than staying put to protect the bombers, and hold the line against the Germans in Ukraine for another round in relative safety, HardAI Russia made the calculation to attack the Japanese force in Persia, leaving the British bombers to be annihilated and allowing the Germans to take their Caucasus factory. I think in this situation, even if there were no British bombers to protect, most human players would elect to stay in Caucasus for at least one more round, or stack W. Russia. Then, when Axis inevitably take Caucasus they'd pull back to Moscow and stack it with all their ground for defense. Doing this Russia could hold for several more round, especially with British units coming to back them up from the north.

Hard_AI_Allies_Russia_bids_36_Caucasus_goof_round_7.tsvg

Hard_AI_Allies_Russia_bids_36_Caucasus_goof_round_7_result.tsvg

Granted its not the end of the world for Allies, and I'm going to play it out a while longer to see if its all part of some master plan by the AI hehe, but basically this is one of those situations where the HardAI fails to see the importance of staying strong defensively at the center.

In the game above I gave all 36 ipcs of the bid to Russia, which they used for 2 tanks and 8 infantry. Appreciating that a German tank drive would be much harder under such conditions, I went with a Med carrier + 9 inf opening for G, and after that bought a fighter a round + ground. Japan just pushed infantry for the first few rounds for the same reason, thinking that I would need a lot more fodder to overcome all those extra Russian units. So far the HardAI has been doing pretty well, but I think this round 7 goof will likely be their undoing ;)

ps. yep, the Russian focus on Persia gave Germany a chance to hit Moscow at odds in following round.

Hard_AI_Allies_Russia_bids_36_Caucasus_goof_result_G_takes_moscow_round_8.tsvg

By the 10th round, the Allied situation at the center has completely deteriorated, and the Axis airwall is about to start pushing the Allied fleets back (since without fighters on carriers its hard for them to match my air attack with their naval defense. Optimal trading of territories for another round or two will surely allow the Japanese to just go monster ;)

Hard_AI_Allies_Russia_bids_36_Caucasus_goof_result_round_10.tsvg

And it all goes back to that Russian decision to attack into Persia rather than staying at Stalingrad and protecting the Moscow pocket. Just stacking infantry they could have held for a while against my slow moving Japanese infantry, but as it happened, Germany was able to just sneak in and burn the soviet captial to the ground! hah!
Reply | Threaded
Open this post in threaded view
|

Re: AI Development Discussion

redrum
Administrator
@all - Just committed the latest changes and updated the pre-release. Mostly just small enhancements and some bug fixes.
Reply | Threaded
Open this post in threaded view
|

Re: AI Development Discussion

redrum
Administrator
@all - Just committed the latest changes and updated the pre-release. The main change is the AI now understands scrambling when its attacking and utilizing scrambling to defend itself. I've only tested on Global 1940 and it seems to work. Please test and let me know if there are any issues.
Reply | Threaded
Open this post in threaded view
|

Re: AI Development Discussion

Black Elk
This post was updated on .
First game with the latest jar in v5! I somehow feel a marked improvement in the way Japan is handling itself. This time I played as Allies and faced down HardAI Axis, decided to give Germany and Japan each a dozen ipcs on the bid, like I had been doing with HardAI Allies in other games. So 24 ipcs spotted to the Machine felt about right. HardAI use its bid to give Germany 2 additional Armor, and Japan wisely used their portion for a transport, an infantry unit and 2 ipcs in the bank. Solid.

Look at this position they've maintained against the KGF, playing into round 11...

Their Japanese bomber armada just wiped the British in the baltic! At first I had thought to airblitz Berlin down to nothing with UK, but the first round of combat went well, so thought I could hold the fleet, but the Japanese were having none of that hah! Still I think they should have flown everything to the defense of the German capital. Or maybe used those bombers to SBR Russia out of the game. Instead they let USA sneak in an emergency D-Day, with the British getting wasted in vast numbers to set it up. Fun endgame


Hard_AI_Axis_bid_24_round_12_KGF.tsvg

Nice work HardAI Axis :)

This is the best I've seen AI Japan doing yet hehe - Mechagodzilla!

ps. gave it a few more rounds to see how Japan would manage, they played pretty well in the deep endgame. But its hard for the Japanese to face down America when freedom is on the march across all of eastern europe from the Rhine to the Volga.  Endgame advantage of KGF on pretty much every boards, but it is enjoyable to see the HardAI Japanese fighting so damned hard for it haha

Hard_AI_Axis_bid_24_round_18_KGF.tsvg

round 30 Allied Honorable victory. Going to give HardAI Japan the honorable nod for fighting so valiantly, and allow them to bow out with their stronghold in Manchuria :)

I was interested to see how they played against the push from the west with an air wall. USA just kept trying to back them up territory by territory until eventually Moscow could be liberated and collect without just giving up the loot to Japan immediately. Took a while, and Japan battled for sure hehe. They seemed to be more effective with their bomber positioning, and tank drives, and less time spent racing for panama. Well done HardAI! Your Axis kept me amused

Hard_AI_Axis_bid_24_round_30_KGF.tsvg

Reply | Threaded
Open this post in threaded view
|

Re: AI Development Discussion

redrum
Administrator
@Black Elk - Pretty epic game. So I loaded up your first save and decided to let Japan play its round 11 turn again to see why it didn't defend Germany. So I load it up and it sinks the UK navy then moves all its planes and tanks to Germany. Here is the save game after Japan's turn: Japan_11_redo.tsvg

It essentially comes down to how many planes it has left after the naval battle. In your original game it lost more planes and determined it couldn't even try to hold Germany so retreats. In the redo I ran, it survives with a few more planes and decides to throw everything to try to hold Germany. Running the numbers in the battle calc, its probably actually a good call by the AI as those few planes make a pretty big difference in chance to defend and average TUV swing.

Reply | Threaded
Open this post in threaded view
|

Re: AI Development Discussion

captaincrunch
Wow this AI just handed me 2 straight losses. I will post when I have 2 wins vs both the Axis AI and the Allied AI.

Anyways, I wanted to mention to whomever testing the AI that I feel you can hold back the AI navy without even building a navy by simply stacking Planes. Thats what I do and it will keep an AI navy back until it has numbers.

Anyways, the more challenging this is the longer it takes me to win against it so I will post my victorys when I can lol.



@Redrum, oh hey I mentioned your ratio for Infantry, Tanks, and Artillery ... I like 80% Infantry purchases and then 20% remaining equal for Tanks/Artillery.

Is that what the AI is roughly at right now for those 3 units? This latest AI update it felt there was more AI units ... are you tweaking AI Purchases lately?
Reply | Threaded
Open this post in threaded view
|

Re: AI Development Discussion

redrum
Administrator
@captaincrunch - Glad to hear its giving you some tough games!

For purchases it varies based on factory distance from enemy territories, if I need to defend, the unit set, and a few other minor factors. In general, the AI tries to build around 75-80% 'fodder' units if its close to the enemy and as the factories get farther away from the enemy it will focus less on fodder and more on multi-move units. On most WW2 maps you should see Russia primarily build infantry with a few artillery/tanks for firepower. If you see instances where you feel it should build either more infantry or less infantry please post so I can take a look.
Reply | Threaded
Open this post in threaded view
|

Re: AI Development Discussion

Black Elk
This post was updated on .
Fascinating! I can honestly say, if Japan had done that it might have just backed me off Berlin for another round. Usually I don't use the calculator myself, in a really critical PBEM game against a human opponent, I might maybe use it once or twice in a game, but usually when playing live I try to resist the urge (not least because it seems to give me a false sense of confidence that's come back to bite me more times than I can count haha). Against the AI I make a point not to calc and just go by my gut, so seeing that many planes on Berlin, I probably would have been too nervous to go all in. Similarly had those planes been in Berlin instead of Karelia a turn earlier, I'd almost certainly have foregone an airblitz with the British.

Its cool to see that there is this degree of variability in what the AI does during Non Combat.

What's interesting to me, in terms of giving the HardAI Japanese some post-game pointers, was how they allowed Moscow to survive for so long, after completely encircling it. I think the best thing they could have done, would have been to Air blitz Moscow earlier. In round 10 say, they could have peeled off a some Russian infantry on an airblitz, and then set up to take it in round 11.

I suppose that would fall somewhere in the dev category, of "attacking over multiple rounds" or "strafing." The latter concept especially would be interesting, since I don't think the AI knows right now that their are situations where retreating after a single round of combat can be very advantageous in the TUV trade. Usually if they attack and then retreat it seems to only be the fear of catastrophic loss that motivates them backing down.

Oh one thing I did mean to bring up earlier but forgot. I've noticed that in many games the HardAI Japanese will send a battleship to Alaska in the opening round and just park it there. I've seen them do this pretty much every time, unless UK does something particularly aggressive in the Pacific that draws the same battleship into an attack. Otherwise it loves to head to Alaska by itself.

Not sure if this is a bait of some sort? But the trade in TUV for Japan is fairly poor, since USA can just kill it with a sub and some Air, without putting their Pacific fleet out of position. Or they can launch the Pacific fleet north to crush it in force, and generally come out clean. In v5 going north for 1 round is often a good move anyway, so Japan placing the battleship here is like just icing on the cake. Anyway, was wondering why Japan HardAI thinks putting the battleship there is a good opening move :)
Reply | Threaded
Open this post in threaded view
|

Re: AI Development Discussion

redrum
Administrator
@Black Elk - Yeah, the AI right now doesn't understand strafing or multi-turn attacks/defenses. It essentially decides whether it has a good chance to win the battle or not.

I looked at the Jap battleship and that is definitely a bug. It has to do with the naval bombardment that I recently implemented. It originally planned to attack Alaska but realized its fleet would get annihilated so aborted but forgot to clear the planned battleship moves! I fixed it and re-ran the first Jap turn from your save and it doesn't move the battleship to Alaska. The fix will be in the next pre-release.
Reply | Threaded
Open this post in threaded view
|

Re: AI Development Discussion

panguitch
In reply to this post by redrum
redrum wrote
@panguitch - So essentially I wrote the mobile factory selection logic based on Napoleonic . . . It essentially has 'isFactory' and 'canNotMoveDuringCombatMove' has the properties to identify it as a mobile factory. So the logic assumes that any unit that can move during combat move has combat value and isn't a true factory.
Okay, after much fiddling around, I believe I've got it working. To the point where the Hard AI just beat me twice in a row, even after I scaled back the AI income percentage.

Here's what I did:
  • Added "isFactory" back to leaders and heroes, rather than just "canProduceUnits" and "isInfrastructure"
  • Gave leaders, heroes, and bowmen "canNotMoveDuringCombatMove".
  • With these two changes in place, the Hard AI started recognizing them as mobile factories. This allowed me to remove my earlier attempts at fixes: the stacking limit on heroes, and the triggers that flipped their support abilities off during movement.
However, the canNotMoveDuringCombatMove change violates some of my principle intentions in the game design, and makes impossible some of the most important game features. To work around this I've created a custom tech. This "I am a human player" tech can be gained freely through a user action, or through a game option to begin with. It basically re-enables the features during that player's turn that have been disabled for the AI's sake.

It's not automatic, which I'd prefer. But it's pretty simple to set the game options to indicate human players. And this way it's the best of both worlds: Greyhawk with all its features fully realized for human players, and Greyhawk playable with Hard AI. And as I've said, the Hard AI is performing well, if not quite as optimally as it does in typical WWII scenarios.

You may remember there was also the issue of the ungovernable terrain type, with territories that were permanently contested and not capturable. This caused a lot of warnings, and the AI sometimes fixated unproductively on them. In the latest release I've changed these terrains to disallow any entry. AI will no longer get mired in them. And the same "I am human" tech allows human players to access them, so they can still seek their magic treasure as intended.

In the new version (0.9.8) there are still many warnings, but Hard AI no longer crashes in Greyhawk, and it performs competitively. Like I said, it's knocked my teeth in a couple times already. When you think about how different Greyhawk is from the various WWII maps, I think that's pretty impressive for the AI.

I'm sure I've tweaking left to do, but with Hard AI playable, I feel like I'm nearing the finish line.

Greyhawk Wars
TripleA in the original Dungeons & Dragons world

Reply | Threaded
Open this post in threaded view
|

Re: AI Development Discussion

redrum
Administrator
@all - Just committed the latest changes and updated the pre-release. Main changes:
- Fixed bugs around naval bombardment that were causing ships to move to unsafe territories
- Fixed issues with territory effects and blitzing
- Fixed issues with placing non-purchased units

@panguitch - I fixed a bunch of bugs that were causing warnings especially around failed purchases and blitzing. There are still a few warnings left that I'll need to look at. But the AI does seem to be playing the map pretty well.
Reply | Threaded
Open this post in threaded view
|

Re: AI Development Discussion

redrum
Administrator
@panguitch - There appears to still be a few rare warnings that occur that seem to be issues with either the map or the engine. There is a strange situation where an event spawns units onto an enemy territory and the units lose the battle to the enemies but they gain control of the territory. This leaves a bunch of enemy units in a territory that they don't control (Fellreev East): test.tsvg

The AI ends up throwing some warnings so I loaded it up as a human and get weird behavior as well. It allows me to move 1 or more units from Fellreev East to The Horned Society but then if I try to move any remaining units from Fellreev East it won't let me. So if I move them all at once then its fine but if I move them one at a time then only the first one can move.

If this situation isn't something you are intending then I would just rework the events that can spawn units in enemy territories. If it is then we probably need Veqryn to weigh in on the expected behavior.

@Veqryn - Should land units be able to move out of contested territories? Does this require certain game options? Or does the engine currently just not support this? There are a number of variables at play here including blitz units, territory effects that remove blitz, and contested land territories.

The issue appears to be this code in MoveValidator:

final Boolean wasStartFoughtOver = AbstractMoveDelegate.getBattleTracker(data).wasConquered(route.getStart())
                        || AbstractMoveDelegate.getBattleTracker(data).wasBlitzed(route.getStart());
nonBlitzingUnits.addAll(Match.getMatches(units,
                        Matches.unitIsOfTypes(TerritoryEffectHelper.getUnitTypesThatLostBlitz((wasStartFoughtOver ? route.getAllTerritories() : route.getSteps())))));
for (final Unit unit : nonBlitzingUnits)
{
        // TODO: we need to actually test if the units is being air transported, or mech-land-transported.
        if (Matches.UnitIsAirTransportable.match(unit))
                continue;
        if (Matches.UnitIsInfantry.match(unit))
                continue;
        final TripleAUnit tAUnit = (TripleAUnit) unit;
        if (wasStartFoughtOver || tAUnit.getWasInCombat() || route.someMatch(notEndOrFriendlyTerrs) || route.someMatch(notEndWasFought))
                result.addDisallowedUnit(NOT_ALL_UNITS_CAN_BLITZ, unit);
}

The code initially allows units to blitz out because wasStartFoughtOver is false. Then after a unit blitzes out the territory switches control and wasStartFoughtOver becomes true which prevents the rest of the units from blitzing out.
Reply | Threaded
Open this post in threaded view
|

Re: AI Development Discussion

Veqryn
Administrator
can you be more specific?
i'm not sure I follow


i do know that whatever the current behavior is, is probably what we want, because i spent a lot of time refining it when we created politics (thereby allowing units/countries to switch sides, stranding units that might have previously been allies, etc)

Please contribute to the TripleA 2013 donation drive:
http://tripleadev.1671093.n2.nabble.com/2013-TripleA-Donation-Drive-tp7583455.html
Reply | Threaded
Open this post in threaded view
|

Re: AI Development Discussion

redrum
Administrator
This post was updated on .
@Veqryn - I'm almost positive you don't want the behavior I'm seeing as its inconsistent when moving all your units vs moving them 1 at a time. The easiest thing would be to download panguitch latest version of Greyhawk Wars and load the save game I posted.

To describe it in more depth:

At the beginning of combat move, I have 3 units with canBlitz and have 2 movement in a territory with the territory effect 'noBlitz' owned by an enemy player but has no remaining enemy units. I move 1 of these units to an adjacent enemy territory and this causes the start territory to be conquered and is now owned by me. I then try to move the remaining 2 units to the same enemy territory (or any surrounding territory) but it won't let me move them giving me the message "Not all units can blitz". If I instead undo my first move and move all 3 units at once to the enemy territory then it allows it.

I traced the issue down to the code I posted in the previous post and in particular the problem seems to be this:

final Boolean wasStartFoughtOver = AbstractMoveDelegate.getBattleTracker(data).wasConquered(route.getStart())
                        || AbstractMoveDelegate.getBattleTracker(data).wasBlitzed(route.getStart());

When combat move begins, this value is false but as soon as I move a unit out of the territory it conquers the starting territory and the value becomes true. Now that the value is true it removes blitz ability from the remaining units and doesn't allow me to move them out of the starting enemy territory.

PS - It actually can be simplified further as it occurs with non-blitz units and without the territory effects. So it just boils down to moving multiple times from an originally contested territory.
Reply | Threaded
Open this post in threaded view
|

Re: AI Development Discussion

Veqryn
Administrator
In reply to this post by redrum
so this looks like it is maybe 2 separate issues

issue 1: things can happen during combat move, that change the state of the game.  when in actuality, the game state really should not change until the user presses "done"

issue 2: units with blitz that are in an enemy territory (not yet conquered) with the "no blitz" territory effect, are able to blitz out of the territory (because it isn't conquered yet)
nonBlitzingUnits.addAll(Match.getMatches(units, Matches.unitIsOfTypes(TerritoryEffectHelper.getUnitTypesThatLostBlitz((wasStartFoughtOver ? route.getAllTerritories() : route.getSteps())))));



So issue #1 is a legacy issue that is not going to get solved any time soon.  It affects far more than this situation, with the most well known example being that AA guns in Revised shoot at aircraft as they pass over during combat move, when they really should wait to shoot until the user presses done for the phase.
There is also a subset of this, that the state of the game at the start of the phase is not really recorded anywhere, or it is but haphazardly.  If this was solved, it would affect only a subset of errors related to issue #1.
I do not think we should deal with issue #1 in any way at this point.



Issue #2:
Check out my save game.  I modified pact of steel (version 1, which is based on revised) so that infantry have 2 movement.
blah.tsvg
Try moving the infantry out of Caucasus, you get an error because only blitzing units are allowed to "conquer then move"

I think this could potentially be easily solved with the following:
Chang this:
nonBlitzingUnits.addAll(Match.getMatches(units, Matches.unitIsOfTypes(TerritoryEffectHelper.getUnitTypesThatLostBlitz((wasStartFoughtOver ? route.getAllTerritories() : route.getSteps())))));

To this:
nonBlitzingUnits.addAll(Match.getMatches(units, Matches.unitIsOfTypes(TerritoryEffectHelper.getUnitTypesThatLostBlitz(((wasStartFoughtOver || route.getStart() is enemy owned) ? route.getAllTerritories() : route.getSteps())))));


Please contribute to the TripleA 2013 donation drive:
http://tripleadev.1671093.n2.nabble.com/2013-TripleA-Donation-Drive-tp7583455.html
Reply | Threaded
Open this post in threaded view
|

Re: AI Development Discussion

redrum
Administrator
@Veqryn - That pretty much covers my understanding as well. But I'm not sure your fix covers everything.

#1 - This is definitely a big issue that would be very difficult to fix but is at the root of it since if the state doesn't change then it eliminates these weird inconsistencies. I agree that there isn't much we can do but hack around it to make things work.

#2 - That is part of the fix I was thinking about as well. I just wasn't sure on the particulars of blitzing. So if I have a non-blitz unit (or unit that loses its blitz ability) in an enemy territory at the start of combat-move then it shouldn't be able to move to any other enemy territory at all correct? But it can move to an allied territory but only if the starting territory is empty?

So in your save game it blocks moving the infantry out of Caucasus to adjacent enemy territories but allows it to move to enemy territories through an allied territory. So I can use one of the infantry to conquer Archangel. But if I instead first use a tank to conquer Kazakh then it no longer lets me move an infantry to Archangel! So I think there are still some other fixes that need done as well. You may want to consider trying to combine all the blitz validation logic together in that method instead of having the separate contested blitz checks then the rest of the blitz validation later on.


Reply | Threaded
Open this post in threaded view
|

Re: AI Development Discussion

panguitch
This post was updated on .
In reply to this post by redrum
redrum wrote
But it can move to an allied territory but only if the starting territory is empty?
Actually, you can move to an allied territory even if there are enemies in the starting territory. To see this, edit in a Russian unit in Caucasus. The Italians can still move to allied territories during combat move.

In fact, I depend on this in Greyhawk. Mobs spawn every round in the ungovernable magic territories, and you'd be trapped forever if you couldn't leave to an adjacent allied territory during combat move.

Here's something else I've noticed, related to redrum's last point: Fellreev East (or Caucasus) goes from contended to conquered any time you move one or more units from it to an enemy territory, but not if you move them to an allied territory. So you can move them all at once or one at a time to an allied territory without any errors. Why does it consider a battle/blitz to have taken place if you move from contested to enemy, but not from contested to allied?

Anyway, this is starting to go over my head, but I'll follow closely so that I can adjust Greyhawk if necessary.

For instance, how big a problem is this issue in the Fellreev East example? Just warnings and I can let it go? Or should I consider changing the triggers so that they don't give territory ownership to Iuz, just place units for Iuz? Then those units either conquer or die, and if they die the ownership won't have changed and this problem won't arise. (Although I suspect the AI would also throw out warnings if it found itself with some new gifted units sitting in territories it didn't control.)

Greyhawk Wars
TripleA in the original Dungeons & Dragons world

1 ... 31323334353637 ... 63