Matrix Games Forums

Forums  Register  Login  Photo Gallery  Member List  Search  Calendars  FAQ 

My Profile  Inbox  Address Book  My Subscription  My Forums  Log Out

Restricting Factory Usage

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
  Printable Version
All Forums >> [New Releases from Matrix Games] >> Advanced Tactics Series >> Mods and Scenarios >> Restricting Factory Usage Page: [1]
Login
Message << Older Topic   Newer Topic >>
Restricting Factory Usage - 12/19/2016 6:15:49 AM   
tortugapower

 

Posts: 264
Joined: 12/17/2015
Status: offline
Dear all,

I want to start a new scenario, and I want to restrict factory usage. If someone has knowledge of it, what is the easiest way to do this?

In particular, I want to do this to limit the number of factories that the AI will build. So even if there's a shortcut to do this that only affects the AI behavior, I can restrict myself to the same rules.

Cheers,
Tortuga

_____________________________

Matrix Games video tutorials:
Distant Worlds Universe
Advanced Tactics Gold
Post #: 1
RE: Restricting Factory Usage - 12/19/2016 8:24:54 AM   
ernieschwitz

 

Posts: 3893
Joined: 9/15/2009
From: Denmark
Status: offline
Restricting factory building is something I have tried, but I never have restricted it for the AI. I am not sure if it is possible without some event coding.

(in reply to tortugapower)
Post #: 2
RE: Restricting Factory Usage - 12/19/2016 1:57:49 PM   
bobarossa

 

Posts: 262
Joined: 6/11/2002
From: Columbus, Ohio USA
Status: offline
AI factory creation is done through events. You would have to go in and modify them to reduce their frequency. Unfortunately I don't understand how they work.

(in reply to ernieschwitz)
Post #: 3
RE: Restricting Factory Usage - 12/20/2016 7:10:42 AM   
tortugapower

 

Posts: 264
Joined: 12/17/2015
Status: offline
Well, thanks for the replies gentlemen. I guess it's unsolvable. If the AI builds them through events, does that also mean that increasing the cost to build a factory would be ineffective?



_____________________________

Matrix Games video tutorials:
Distant Worlds Universe
Advanced Tactics Gold

(in reply to bobarossa)
Post #: 4
RE: Restricting Factory Usage - 12/20/2016 8:09:52 AM   
ernieschwitz

 

Posts: 3893
Joined: 9/15/2009
From: Denmark
Status: offline
Yes, it does.

However you can prevent the AI from building ANY factories simply by removing the link to event that is connected to it, telling when to build them. It is a stat in the location type part of the editor.

(in reply to tortugapower)
Post #: 5
RE: Restricting Factory Usage - 12/20/2016 1:48:16 PM   
bobarossa

 

Posts: 262
Joined: 6/11/2002
From: Columbus, Ohio USA
Status: offline
Also you can simply edit the event before you start the game (if you are doing Random games). There's probably some way to edit the masterfile too. I also assume the event has a number you can change to reduce the rate of new factories. I also remember seeing a mod that limited you to one factory of each type; I think that went for the AI too.

< Message edited by bobarossa -- 12/20/2016 1:49:02 PM >

(in reply to ernieschwitz)
Post #: 6
RE: Restricting Factory Usage - 12/21/2016 1:09:16 AM   
tortugapower

 

Posts: 264
Joined: 12/17/2015
Status: offline
I know that ernie's own GD1938 limits you to one factory per year (not per type), but the mod that allows one factory per type is actually exactly what I am looking for!

However, until then, I will look at the editor and try to suss out the AI factory-buidling event stuff. Thanks for all the help.

_____________________________

Matrix Games video tutorials:
Distant Worlds Universe
Advanced Tactics Gold

(in reply to bobarossa)
Post #: 7
RE: Restricting Factory Usage - 12/21/2016 9:30:28 AM   
Ormand


Posts: 682
Joined: 2/17/2009
Status: offline
This can be done, but does require modifying events. I made a variant for the 4Seasons-Models that does just this. There are aspects of the system that I don't quite understand as they are probably in the engine. In a nutshell, here is how the AI makes factories.

Notice RegimeVar#15, which is "AI factory points". When the value of this RegimeVar >= 4000 for an AI regime, the AI will build a factory. I tend to think that this specific RegimeVar and value are hard-coded. In the A "New Dawn" scenarios, event #14 "All turns: AI build points rising" controls the rate that RegimeVar#15 increases each turn. It is based on the production the current regime has through CheckRegimeProducingProductionPoints(regime#). Basically, it adds this number divided by 100 to RegimeVar#15 every turn (with bounes for AI+ and AI++). You can use this event to control how quickly the AI reaches 4000 points. For example, I basically divided this number by the current number of factories+1 in the regime. So, once the AI built one factory, the rate would be 1/2 as fast. There are many options.

Once the AI can build a factory, it has to decide which factory. This is controlled via the event specified in the LocType definition under the tab "AI autobuild". This is the "AI Prio Mod Event", which in "A New Dawn" is event#15. Event#15 actually just returns a random number to the engine via the function SetCardXY. Exactly how, I am not sure. But, functionally, what happens is that the engine cycles through the LocTypes that are set to "AI Can Free Build = True" and the one with the largest random number is built. After the LocType is built, it calls the event specified in "AIAfterBuildEvent", which in "A New Dawn" is Event#16. All this does is to reduce RegimeVar#15 by 4000. You can probably control the probability for which factory type via RegimeVar variables. I believe the engine cycles through the AI buildable LocTypes, so you can make a counter, and also store the number of each type of factory in a RegimeVar. Thereby writing code to control probabilities based on what is built. You could also give regime weights, say favoring artillery, etc. These would all be variables that you store in a RegimeVar.

Lastly, you can change whether a LocType can be built with the function ExecLocTypeBuildable(LocType#,0(1)). I used this to make a variant of a scenario so that factories couldn't be built. You could use this to stop an AI regime from building factories after a certain number.

< Message edited by Ormand -- 12/21/2016 9:33:38 AM >

(in reply to tortugapower)
Post #: 8
RE: Restricting Factory Usage - 1/3/2017 8:11:04 AM   
davebob

 

Posts: 63
Joined: 9/9/2014
Status: offline
Simple way I found, place factories on the map using the map editor, where you wish, as many as you wish. Then forbid the building of each factory. Note that factories can be edited as to what they build fairly easily. Including supply and pps.

_____________________________

Having said that,that being said,that having been said,saying that,that having been said,having said all that,that said.....

(in reply to Ormand)
Post #: 9
RE: Restricting Factory Usage - 1/31/2017 1:07:54 AM   
GaryChildress

 

Posts: 6830
Joined: 7/17/2005
From: The Divided Nations of Earth
Status: offline
In a purely random game it seems impossible to prevent the AI spamming factories but I seem to recall some success with the following:

1. Create a random game and click "edit".
2. Edit landscape tiles so that factories can only be built on a certain type of landscape (maybe "suburban" or something.
3. Place the special landscape sparingly on the map.

It's been a while since I tried it but I think I recall the AI doing OK with it. Give it a try and let me know if it works. :)

_____________________________


(in reply to davebob)
Post #: 10
RE: Restricting Factory Usage - 2/2/2017 9:34:12 PM   
balto

 

Posts: 1123
Joined: 3/4/2006
From: Maryland
Status: offline
I have read several threads to the "limiting factories" topic. I do not understand why this is brought up. I think the veterans of this game (everyone that posted above) believe factories are over-powered. I am not that smart so many things go over my head.

I also am not a veteran of this game and I have only played the AI and I have never built any factories. I just thought it was easier to build them in your cities. But clearly I am missing something if you guys keep bringing this up. Can someone help me to understand what the factory problem is or why they are overpowered?

Thanks

(in reply to GaryChildress)
Post #: 11
Page:   [1]
All Forums >> [New Releases from Matrix Games] >> Advanced Tactics Series >> Mods and Scenarios >> Restricting Factory Usage Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts


Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI

1.238