Restricting Factory Usage (Full Version)

All Forums >> [New Releases from Matrix Games] >> Advanced Tactics Series >> Mods and Scenarios



Message


tortugapower -> Restricting Factory Usage (12/19/2016 6:15:49 AM)

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




ernieschwitz -> RE: Restricting Factory Usage (12/19/2016 8:24:54 AM)

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.




bobarossa -> RE: Restricting Factory Usage (12/19/2016 1:57:49 PM)

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.




tortugapower -> RE: Restricting Factory Usage (12/20/2016 7:10:42 AM)

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?





ernieschwitz -> RE: Restricting Factory Usage (12/20/2016 8:09:52 AM)

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.




bobarossa -> RE: Restricting Factory Usage (12/20/2016 1:48:16 PM)

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.




tortugapower -> RE: Restricting Factory Usage (12/21/2016 1:09:16 AM)

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.




Ormand -> RE: Restricting Factory Usage (12/21/2016 9:30:28 AM)

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.




davebob -> RE: Restricting Factory Usage (1/3/2017 8:11:04 AM)

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.




GaryChildress -> RE: Restricting Factory Usage (1/31/2017 1:07:54 AM)

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. :)




balto -> RE: Restricting Factory Usage (2/2/2017 9:34:12 PM)

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




Page: [1]

Valid CSS!




Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI
1.796875