Any mods limiting max factories for AI or research?

Advanced Tactics is a versatile turn-based strategy system that gives gamers the chance to wage almost any battle in any time period. The initial release focuses on World War II and includes a number of historical scenarios as well as a full editor! This forum supports both the original Advanced Tactics and the new and improved Advanced Tactics: Gold Edition.

Moderator: Vic

Post Reply
mattpilot
Posts: 103
Joined: Thu Mar 08, 2018 1:17 pm

Any mods limiting max factories for AI or research?

Post by mattpilot »

Hi,

As i understand it, the AI gets 'crutches' to PP where it basically gets free research and factories via events, and seems only to be limited in gameplay by the supply output from cities.

Either way, it doesn't take long for the AI in my games to litter the map with factories and an ungodly amount of armored vehicles. Makes the game challenging, but also 'unfun' for me, especially as i like to play drawn out games.

I get why the the AI needs 'help', i just wish i could have an option to tone it down.
I thought of two 'options' that might be moddable and then toggable when creating a map?

1) Would it be possible to limit the AI's maximum factories it gets via events by a factor multiplied by the number of cities it controls (maybe an option during game creation). Like say '2' factories per City.

2) Would it be possible to change the AI's research in a way that it doesn't get it via Events, but that it has access to exactly the same Research the player has? I'm imagining some interesting scenarios this way - where the AI will not 'run away' from you technologically but also, it would give the player the option of focusing the entire game on a 'naval' playthrough by researching only navy stuff, but also allows for things like a 'no tank' game too.


Looking forward to feedback - thanks.
User avatar
Ormand
Posts: 828
Joined: Tue Feb 17, 2009 1:31 am

RE: Any mods limiting max factories for AI or research?

Post by Ormand »

The answer is yes! I did this in my FourSeasons mod with the variant "Limit AI Factories". It should make the time between factories decrease, eventually taking forever.

It is fairly straightforward, although takes some knowledge of the of the inner workings. There is a counter that is steadily increasing each turn, and when it gets greater than 4000, the AI will build a factory. The counter is RegimeVar(15) "AI Factory Points". This is increased each turn in the event "All turns: AI build points rising" (in AnewDawn this event #14 in FourSeasons it is #17). The increase each turn is the "Number of Production Points"/100. So, as the number of factories increases, the factories will come faster as well. What I did is to divide this number by the number of factories on the map when there are more than 3 factories. Thus, the rate of increase in the counter decreases with each factory the AI produces. In FourSeasons, I keep track of how many factories a regime has in RegimeVar(8) so that you don't have to check.
One man alone can be pretty dumb sometimes, but for real bona fide stupidity, there ain't nothin' can beat teamwork -- Edward Abbey
User avatar
ernieschwitz
Posts: 4557
Joined: Tue Sep 15, 2009 3:46 pm
Location: Denmark

RE: Any mods limiting max factories for AI or research?

Post by ernieschwitz »

Nice solution :)

As for the research, I am sure it is possible, but would require a think through before it can be done. Unfortunately AI research is not programmed by event code. It is hard coded. I believe there is a rulevar governing how much (in % of something (it doesn't mention) it researches. You could set this at a lower rate. Or even make some code to set it at a rate according to the size of the map
Creator of High Quality Scenarios for:
  • Advanced Tactics Gold
    DC: Warsaw to Paris
    DC: Community Project.
Try this Global WW2 Scenario: https://www.vrdesigns.net/scenario.php?nr=280
User avatar
Ormand
Posts: 828
Joined: Tue Feb 17, 2009 1:31 am

RE: Any mods limiting max factories for AI or research?

Post by Ormand »

ernieschwitz is right. The AI research is not governed by events, but by internal algorithms. I suspect that it looks at what units will be produced with a given tech and then computes how much of an upgrade it will be. What I mean is that for a given given tech what will be the benefit. I have no idea if it uses PP or not actually. There aren't any Rulevars that would push it one way or another really. Although, some of the Rulevars relating to the ratio of armor to infantry or Raider, etc., might have some effect. This kind of a black box to us modders.
One man alone can be pretty dumb sometimes, but for real bona fide stupidity, there ain't nothin' can beat teamwork -- Edward Abbey
mattpilot
Posts: 103
Joined: Thu Mar 08, 2018 1:17 pm

RE: Any mods limiting max factories for AI or research?

Post by mattpilot »

You, sir, have just revolutionized my game. I honestly don't know what to say. I've seen your mod before, tried to install it, but gave up after, what i perceive to be, a too complicated of a process. Finding the files took me way longer than i'm willing to admit (incl. the 'generals' mod that is apparently required). Honestly i hate the vrdesigns website. Anyway ... if it weren't for you indicated that the factory problem was 'solved', i would of given up again.

Your mod is ... amazing. I mean it literally should be the base game! The game should be repackaged with your mod and called 'Advanced Tactics Platinum'. I would buy the game again just for that mod! [&o]

Thank you!



User avatar
ernieschwitz
Posts: 4557
Joined: Tue Sep 15, 2009 3:46 pm
Location: Denmark

RE: Any mods limiting max factories for AI or research?

Post by ernieschwitz »

Some of us would like to see more than just a repackaged ATG become ATP ... but I'll admit that Four Seasons is a GREAT mod :)
Creator of High Quality Scenarios for:
  • Advanced Tactics Gold
    DC: Warsaw to Paris
    DC: Community Project.
Try this Global WW2 Scenario: https://www.vrdesigns.net/scenario.php?nr=280
User avatar
Ormand
Posts: 828
Joined: Tue Feb 17, 2009 1:31 am

RE: Any mods limiting max factories for AI or research?

Post by Ormand »

You make me blush! Thanks. It has taken a long time, and it is good to have it solidifying.

I just put up v3.10 FourSeasons-at2-v3.10.atzip, which fixes that annoying little bug in EU and makes some mild changes to recon and hide numbers.

I am sorry that it is a bit complicated. This is due to the 20 MB file limit for uploads. Vic will do a larger one, but I can't do that with every bug fix, and once the graphics were stable, that split off. Also, the Generals Project grew to be too big to go with the at2 files, and someone might want it separately. Thus, three files, two of which I can maintain. I had a lot of help tracking down bugs, it is very satisfying when the frequency drops down!

I am glad you like it!
One man alone can be pretty dumb sometimes, but for real bona fide stupidity, there ain't nothin' can beat teamwork -- Edward Abbey
Post Reply

Return to “Advanced Tactics Series”