1. We have added a Gift Upgrades feature that allows you to gift an account upgrade to another member, just in time for the holiday season. You can see the gift option when going to the Account Upgrades screen, or on any user profile screen.
    Dismiss Notice

[MOD] More Naval AI

Discussion in 'More Naval AI Modmod' started by Tholal, Mar 18, 2010.

  1. Darkling

    Darkling Chieftain

    Joined:
    Apr 3, 2010
    Messages:
    24
    Congratulations Tholal.

    Just noticed a couple of things in my latest game. The Bannor have just appeared in the game adn they have kept their good alignment despite following the Veil. I'm pretty sure that they just emerged through a revolution so it might be to do with that.
    I also watched an AI (Hippus) escort a Galleon and galley with a privateer, where the privateer had the hidden nationality promotion.
    I do like how in the last few versions of the mod the Barbarians have been using galleons and galleys to land troops. Keeps you on your toes!
     
  2. Freesmog

    Freesmog Skeptic1938222569

    Joined:
    Nov 15, 2007
    Messages:
    176
    Location:
    outside the city
    Grats on a successful birth!

    I summoned Basium as the Kuriotates (played the Mercurians), and afterwards a Kuriotate hero, a centaur charger, committed suicide charging (solo) towards Acheron who was closeby.
     
  3. Bickendan

    Bickendan Chieftain

    Joined:
    Mar 6, 2011
    Messages:
    71
    They had Cultists? (And Octopus Overlords to build them?)

    I've noticed this as well -- the AI loves adepts. And chariots... which does play into my counterattack strategy...
     
  4. Tholal

    Tholal Chieftain

    Joined:
    May 19, 2009
    Messages:
    1,676
    What mechanized units do you have that you dont want to be tradeable? I'm probably not going to add a new XML tag just for this, but I might try and set up a CannotTradeUnit python callback that will give you more control. Though I haven't done anything like that before, so it may not be in the next release.

    Looks like the code is causing Held units to also be flagged as Immobile for 999 turns. I'll see what I can do to make that work better.

    Not a priority for me. You can always add some code to onUnitBuilt function in python that strips out the racial promos.

    That's a new one. I'll take a look at it.

    Arg! Damn Gargoyles. I'll look into this again.

    I'm pretty sure that the AI does not use the Governor code. I haven't done anything to the Governor code myself. I'll add it to the list.


    Any chance you can send me this savegame?


    There is, but defending units rarely leave the city they are in, so if that city doesn't have the proper training buildings, the chance of them upgrading is rather slim.

    I can try futzing around with the code a bit, but this sort of Unit AI is difficult to code.


    There are some exploitation issues with being able to drop items at will, but the main hindrance is that it would require a new spell for every single item in the game (manipulating items is a 'spell'), which is a major pain in the ass.

    My bad. Will be fixed in the next release.

    Seems like that should be possible. I'll look into it.

    Its definitely possible. I'll have to make sure that it doesn't result in any other issues.

    Before.

    Yes, otherwise there are a large number of buildings and units that a player would not be able to get any information about. Though it does result in some strange entries, I would prefer to have the information available to players so they can find answers in-game rather than trying to dig through outdated manuals or comb through forums.

    You are free to change it in your mod. It's handled in python.

    SevoPediaMain.py - look for and not getInfo(iItemID).isGraphicalOnly()) . That's the line that I changed.

    OK. The revolutions code has lots of confusing formulas in it. Looks like you've hit one that wasn't properly coded. I'll have to try and figure out what that section of code is trying to do.

    OK. I'll look into this as well.

    Was it the event where you cede power for 10 turns? If so, having only a single city shouldnt necessarily prevent it from happening.

    Not entirely sure what you're referring to. Can you give me a more detailed example?

    I blocked civs without cities from engaging in diplomacy because it was resulting in lots of strange diplomatic occurrences with rebels and also just made sense from a gameplay perspective.

    I can look into that.

    Awesome! Thanks!

    And thanks to Terkhen as well!

    OK.


    Damn Heroes! I've tried before to make Heroes stay in groups, but for some reason they seem to often end up out on their own. I'll look into it again.
     
  5. scutarii

    scutarii Chieftain

    Joined:
    Jun 10, 2008
    Messages:
    741
    ah, Tholal - catapults are overpowered - especially for the ranged attacks. Catapults - IMO wildly inaccurate siege engines(IMO weakness to fire is a must have promo for siege engines, and cannons always explode on "dying" but are resistant to collateral dmg from archer line) - only good for breaking walls and palisades.

    so far cannons are worse than catapults - due to lower withrawal rate. I'd remove attack and witrawal from catapults completely(only collateral dmg and dmg vs defence) and I'd give flanking bonuses for cannons against of archer line(on attack, but withrawal rate no higer than 50%).
     
  6. Bickendan

    Bickendan Chieftain

    Joined:
    Mar 6, 2011
    Messages:
    71
    It's a v2.1 save, not v2.2.
    Also, the error that generates on CTD is 'Reduce graphics settings', so I believe that this will be a system specific error (P4 2.5 GHz, 2 Gb RAM, nVidia GeForce 5200FX).

    However, it may be worth sending just because the Balseraphs culture flipped themselves out of the game. Capria had captured all but one of Perpentach's cities, forced him to capitulate. Later, I found out during game replay, Perpentach's last city flipped over to Capria's side.
     
  7. scutarii

    scutarii Chieftain

    Joined:
    Jun 10, 2008
    Messages:
    741
    AI Arthendain is not using his destry undead spell although my city is full of undeads. And yes, he wandered around alone.

    AI - stacks with cultists - no tsunami and mixed with other units - tends to walk away from water anyway.
     
  8. Terkhen

    Terkhen Chieftain

    Joined:
    Aug 1, 2011
    Messages:
    909
    Gender:
    Male
    Location:
    United Kingdom
    Yes, the AI is still fond of letting heroes run into enemy lands alone. Hyborem does that all the time, even when I have far more militar strength.

    I also noticed two weird things regarding war and peace in our last multiplayer game. I was about to conquer one city, when my adversary used the Seven Pines spell. All of my heroes and catapults where expulsed of his territory... but my Grigori Medics stood there. Then he immediately declared war against me again (still in the same turn), and killed my medics which where still there.

    I would expect Grigori Medics to be expulsed when a war is declared, even if they can normally move across enemy lands when on peace. Also, IMO the peace granted by the Seven Pines should have the usual "cannot declare war" turn limit.
     
  9. MagisterCultuum

    MagisterCultuum Great Sage

    Joined:
    Feb 14, 2007
    Messages:
    15,975
    Location:
    Kael's head
    The mechanized units that seemed to cause the most trouble being traded are Severed Souls, but I also really dislike how the Lanun are so eager to give away their hero The Black Wind. (I suspect that the Doviello will also trade away their hero The War Machine, but they haven't engaged in diplomacy with me after building it yet.)

    I also think it would be a good idea to allow some non-mechanized units to be traded in diplomacy. I'm mostly thinking Slaves, but maybe Mercenaries too. (Of course, since Mercenary in my mod is a promotion rather than a unit that would probably require a python callback.)
    Bear in mind the reason why Kael made the Held promotion block casting spells. It was to prevent units that got the Held promotion from the Cage outcome of exploring a lair from freeing themselves, as that would make that lair result completely pointless.

    Personally I always thought that it would be much better to allow promotions to block units from casting specific spells.

    I had actually changed it just before asking.

    It just seems like it would make a lot more sense just to change the bGraphicalOnly tags on anything you want to be visible.
    I don't think it said anything about ceding power only temporarily, but I have never selected Agree so I don't know its actual effect.
    I believe that Firaxis coded the game so that players cannot trade away the city containing their palace, in order to make sure that the player retains at least one city and does not trade itself out of existence. Since puppet states do not have palaces, they are able to trade away every last city they own. Since they usually have very good relations with their masters, they are typically very willing to liberate cities even when they only have a single city and liberating it is thus suicide.

    Edit: This does not seem to be the case in my current game, but maybe I just don't have enough culture in their cities for liberation to be an option.

    Could you at least make an exception so that they can engage in diplomacy with members of their own team? And maybe so that human players without cities can still use diplomacy?

    ----

    I've noticed in my current game that all of the players that keep spawning from violent revolutions are being given Adventurers. These are essentially useless before the rebels have captured a city in which they can be upgraded, and giving out Adventurers so easily to any civilization don't quite seem fair to the Grigori.


    I've had complaints in my modmod thread that the AI is never using any world spells. I can recall at least one worldspell being used in the version based on v2.1, but none since v2.2; did that version do something to the AI that makes it forget about worldspells?
    Edit: Right after I made this post my permanent ally Arendel Phaedra used March of the Trees, so I guess that is not a real issue.
     
  10. Tholal

    Tholal Chieftain

    Joined:
    May 19, 2009
    Messages:
    1,676
    Severed Souls are mech units? That's a little strange.

    I meant to add a catch to keep hero units from being traded but never got to it. I'll do that for the next release.

    OK. So why do you want Held units to be able to cast?

    You can probably do that in python via spellinterface.py

    Hmmm. Looks like you're right! I thought the bGraphicalOnly tag was also used to, you know, display graphics, but apparently not! I'll revert my change and use your suggestion instead for the next release.

    I believe the text says something about demanding a change in leadership. I'll try to track that bit of text down and make it more informative.

    OK. I should be able to fix that.

    That should also be doable.

    I thought it was kind of an interesting occurrence and sort of viewed the Adventurer unit as the 'leader' of the rebel forces. Didn't seem like it was particularly unbalancing or unfair to me, so I never bothered to try and track down the issue. But I'm willing to add it to the bugfix list if you feel strongly about it.

    I just ran a test game and saw several World Spells being cast and notifications appearing for them as well. The AI isn't especially smart about when to use their World spells though. I'm open to suggestions for improvements on this front.
     
  11. Tasunke

    Tasunke Crazy Horse

    Joined:
    Mar 20, 2009
    Messages:
    2,800
    Location:
    the 1800s
    What about instead of adventurers .... spawn [unit at tech parity X] with the Hero and Great Commander promotions?

    That way, less flexibility than an adventurer, but can be used immediately.

    Never a tier 4 unit mind you ... but a tier 2 or 3 unit (say a Swordsmen, or Hunter, or HorseArcher, or Chariot, or Champion, or Assassin), just depending on the civ type, tech level, and a few other variables.
     
  12. timfi

    timfi Chieftain

    Joined:
    Aug 29, 2009
    Messages:
    15
    Hey there guys. Just wondering if I can switch in and out the mod features, namely, plugging only the Naval AI improvement, or getting it standalone. The Naval AI passiveness is quite nasty, but I suspect that new features in modmods lay additional burden on it, due to fewer testers and attention.
     
  13. doktarr

    doktarr Chieftain

    Joined:
    Jan 31, 2005
    Messages:
    213
    In my most recent game, I know I saw the Llosafar, Clan of Embers, Dovielo, and Amurite world spells. I'm pretty sure some others got shot out too, but I didn't notice. In most cases, they were fairly well-timed; the Llosafar in particular easily won a war that they probably would have lost otherwise by hitting the panic button and burying the invading Hippus in Treants. So world spells seem to be working fine.

    I did also see Basium wander into enemy lands unsupported, despite having some angels and Paladins to draw from.
     
  14. lfgr

    lfgr Chieftain

    Joined:
    Feb 6, 2010
    Messages:
    620
    Revolutions and Advanced Tactics are optional. You can disable both via Custom Game.
     
  15. Red Key

    Red Key Modder

    Joined:
    Sep 24, 2011
    Messages:
    386
    Location:
    USA
    In my most recent game the AI was consistently choosing to move its units into a desert (-25% defense) instead of a forest (+25% defense). I had a city fairly close to Acheron, so every few turns an axeman would be sent towards my city. Adjacent to my city were a forest and a desert that were both equal distance for the axemen. The axemen consistently moved into the desert rather than the forest which made it easier for me to use a chariot to wipe each one out when it was in the desert. However, it might be possible the axemen weren't charging the city, but were after something else like my workers or something. (I don't have a saved game from that point in the game anymore to go see what they were really after)

    P.S. World spells seem to be working okay from what I have seen.
     
  16. Aline

    Aline Cat

    Joined:
    Dec 10, 2007
    Messages:
    465
    Worldspells work fine, the AI is not to smart about it sometimes though.
    Also i had the Lanun and Mercurians pop their worldspells the same turn once, killing pretty much all defenders(PZ´s) in my costal citys and acctualy winning them the game.
     
  17. Tholal

    Tholal Chieftain

    Joined:
    May 19, 2009
    Messages:
    1,676
    Hey all. Thanks for the continued feedback! Just wanted to let you know that I'm still here and trying to work on the mod when I can, though it would be nice if I could sit down at my computer for more than a half-hour at a time!

    Just last night I discovered that I had been making some improper calls to getGroupSize(), which apparently has something to do with the artwork and not the size of the unit's stack. I should have been calling getGroup->getNumUnits() instead! :hammer2:

    I think this is what was causing the AI heroes to run around alone, and was likely also causing other unwanted unit behavior.
     
  18. MagisterCultuum

    MagisterCultuum Great Sage

    Joined:
    Feb 14, 2007
    Messages:
    15,975
    Location:
    Kael's head
    I would like Acheron to be able to cast Breath Fire and Roar while still stuck in his city.

    I would also be nice to be able to make the Committed to Asylum promotion hold the unit in a city while allowing it to cast a spell to remove that promotion and add back Crazed and Enraged. (Currently I use a spell with a python prereq that checks to see if the unit is still in the city and switch the promotions otherwise. I'd like to be able to cut down on such spells, as they can be processor intensive.) In the past I wanted arcane units on a certain improvement to be able to cast a spell that would boost their magical abilities so long as they were immobilized in the tile. I'm not as keen on the idea now, but would still consider it if it were possible.

    I'd also considered the possibility of a spell that give enemies a promotion that disables their magic until it wears off, but without immobilizing them.

    Note that if you don't add another tag that allows a promotion to block all spell casting then I would much rather you left bHeld alone. It is very important that I be able to prevent my Sluagh units from using any spells or abilities. I guess could make it so that the Barbarians build a DOMAIN_IMMOBILE version of Acheron that can use his abilities and changes to the normal dragon once captured.


    I just got that same divide by zero error in RevUtils.py again.

    On the issue of trading mech units, I could settle for simply blocking all world units, limited duration units, and any unit that has a summoner (including permanent summons) from being traded.

    I've never been a fan of how Kael made permanent summons immobile for their first turn. Would you mind changing that?

    Is there a way to set one unit as the summoner or the summon of another unit in python? How about to identify all the summons of a summoner without cycling through all the player's units? If not, these would be welcome additions. It might also be nice if you could add a way in the game to identify what summoned what, as I believe is already done in other modmod's using code by xienwolf.
     
  19. doktarr

    doktarr Chieftain

    Joined:
    Jan 31, 2005
    Messages:
    213
    I assume those latter blocks would be for the benefit of your modmod, as there aren't any limited duration or summoned mechanical units in the base game, right?

    For my part, one annoyance with trading mechanical units is the city that they end up in. In my most recent game, there were two pole-to-pole continents that split the world into two distinct oceans. I had a decent naval presence in one, but almost nothing in the other. When I traded for boats from a civ in the other ocean, rather than gaining those boats in the nearest port city to the boat's position, or any port city I owned that the boat could reach without flying, I gained that boat in the port city nearest to my capital... on the other ocean.

    Personally, I like this - it means that if you want to use permanent summons as cannon fodder, you have to plan ahead a bit. It makes their role a bit more distinct from the temporary summons. I suppose you can look at that both ways, but I wouldn't like the change.
     
  20. Red Key

    Red Key Modder

    Joined:
    Sep 24, 2011
    Messages:
    386
    Location:
    USA
    I agree with doktarr. This should not be changed. Magister should make this change (and possibly some of the other ones he/she requested) himself/herself in his/her own mod.

    edit: It should be kept the same in More Naval AI, but it would be fine if it was made easily moddable through python or a new XML tag then both Magister and us would be happy.
     

Share This Page