49 posts
Skills: Coding, Historical Research, Modding Units, Finding Bugs, Bug Fixing, Modding Technologies
|
Post by Tiberius - EvW-Dev on Jan 9, 2015 17:49:22 GMT
I seem to be the only nation on earth who gives a shit about rebellions: In the Soviet Union, that's Belarus, Ukraine, Kazakhstan, and Russia scattered inside its territory. East Germany is at war with Soviet Union, as was West Germany against GBR for a while, so I assume these sprung up from rebellion too. Nationalist China is as bad as French Africa and likewise, a couple of nations have popped up in its territory. I assume fixing this will mean working on the AI, which I have no idea how to do. The AI seems not to really even do anything about these single militia divisions roaming around its territory.
|
|
71 posts
Skills: Historical Research, Writing Events/Decisions, Modding Countries/Leaders
|
Post by Medibee on Jan 9, 2015 21:11:17 GMT
ANARCHY! I think the source of this in the early war is the nationalist revolt risk modifier. It causes a bazillion revolts in occupied Germany and other places. Then It spreads.
|
|
66 posts
Skills: Historical Research, Writing Events/Decisions, Modding Units, Finding Bugs, Bug Fixing, AI Programming, Graphics, Modding Countries/Leaders, Modding Provinces, Economic Balancing, Map Editing, Modding Technologies, Modding User Interface
|
Post by nguyenthepatriot on Jan 10, 2015 14:20:35 GMT
ANARCHY! I think the source of this in the early war is the nationalist revolt risk modifier. It causes a bazillion revolts in occupied Germany and other places. Then It spreads. Could it also be the result of unbalanced spy actions? Does anyone know if the AI uses spy actions?
|
|
49 posts
Skills: Coding, Historical Research, Modding Units, Finding Bugs, Bug Fixing, Modding Technologies
|
Post by Tiberius - EvW-Dev on Jan 10, 2015 14:32:59 GMT
I think Medibee is right - I played as USSR and as Nationalist China (in the game from OP) and they were sending troops around to do it, but they didn't have enough supplies left to actually advance into their territory. This is because the AI was dumping all their money into infrastructure - to the point of extreme deficit in China's case. The AI seems to be very economically stupid.
Nationalism definitely needs to be worked on anyway, at the moment it's lasting ~20 years in occupied space, which I think should be halved.
I haven't seen whether or not the AI is using spy actions but I have to assume for now that they are. That's not so much the issue though - the problem is either a) that nationalist germans are rebelling against the British and Americans, which just wouldn't happen IRL and/or b) the nations being rebelled against aren't programmed to economically respond to the threat and keep their supplies high enough to deal with it.
|
|
66 posts
Skills: Historical Research, Writing Events/Decisions, Modding Units, Finding Bugs, Bug Fixing, AI Programming, Graphics, Modding Countries/Leaders, Modding Provinces, Economic Balancing, Map Editing, Modding Technologies, Modding User Interface
|
Post by nguyenthepatriot on Jan 10, 2015 14:43:30 GMT
It'll be a problem if it's b), because if the AI is like HoI3 then IIRC we have little to no ability (without source) of telling the AI how to use its troops. The military LUA AI is on the scale of weighing fronts/theaters and dividing troops between them.
|
|
20 posts
|
Post by jetblackissp on Jan 10, 2015 14:46:30 GMT
yeah germany needs some work but i think the best rebellion ive seen is Alaska entirely rebelling
|
|
49 posts
Skills: Coding, Historical Research, Modding Units, Finding Bugs, Bug Fixing, Modding Technologies
|
Post by Tiberius - EvW-Dev on Jan 10, 2015 14:58:39 GMT
It'll be a problem if it's b), because if the AI is like HoI3 then IIRC we have little to no ability (without source) of telling the AI how to use its troops. The military LUA AI is on the scale of weighing fronts/theaters and dividing troops between them. They seem to be using their troops ok, the problem is that, under the Economy tab, all their money is going into Infrastructure. To the point that their daily budget runs into the negative, and they aren't buying the supplies. I've had a look through EastvsWest\script\ai_economy_minister.lua and it looks like their actions are based on Defcon level. Since rebels don't raise Defcon, they don't switch to a military spending focus.
|
|
49 posts
Skills: Coding, Historical Research, Modding Units, Finding Bugs, Bug Fixing, Modding Technologies
|
Post by Tiberius - EvW-Dev on Jan 10, 2015 15:01:04 GMT
I guess we could fix it by creating an event that triggers any time you have rebellion, to raise Defcon to one of the levels that will prompt military spending.
|
|
49 posts
Skills: Coding, Historical Research, Modding Units, Finding Bugs, Bug Fixing, Modding Technologies
|
Post by Tiberius - EvW-Dev on Jan 10, 2015 16:28:24 GMT
I've been digging around and I think I see a way forward, but I don't know the specifics of the strings to use, so I'm hoping someone can help fill in those blanks.
The two files we need to play with are:
EastvsWest\events\Defcon.txt EastvsWest\script\ai_economy_minister.lua
First, we need to get the nation to respond to rebellion by raising the Defcon. Here's a sample trigger:
country_event = {
id = 5002
trigger = { OR = { defcon = 2 NOT = { defcon = 3 } }
faction_member_at_war = yes war = no
}
title = "EVTNAME5002" desc = "EVTDESC5002" picture = "defcon3"
option = { name = "EVTOPTA5002" set_defcon = 3 } }
I've never actually seen Defcon 3 in game, just 5, 4, and 2, so it might be the right one to modify, if that's even possible. What I don't know is how to get rebels to trigger it in the above string.
Here's the string from ai_economy_minister.lua that's relevant:
local SLIDER_AUTOMATION_MANUAL = 0 local SLIDER_AUTOMATION_MILITARY_BUILDUP = 1 local SLIDER_AUTOMATION_MILITARY_MAINTAIN = 2 local SLIDER_AUTOMATION_INFRASTRUCTURE = 3 local SLIDER_AUTOMATION_RESEARCH = 4 local SLIDER_AUTOMATION_COUNT = 5
local DEFCON_5 = 0 local DEFCON_4 = 1 local DEFCON_3 = 2 local DEFCON_2 = 3 local DEFCON_1 = 4
function EconomyMinister_Monthly(minister, vMoney) local mCountry = minister:GetCountry() end
function GetBestPriority(minister, vMoney) local Prio = 0
local mCountry = minister:GetCountry() local Defcon = mCountry:GetDefconLevel() local War = mCountry:IsAtWar() local Clock = CAI.GetDoomsDayClockMinutes() local Factory = mCountry:GetFactoryRateInGDP()
if Defcon == 1 or Defcon == 2 then Prio = SLIDER_AUTOMATION_MILITARY_BUILDUP end if War or Defcon > 2 then Prio = SLIDER_AUTOMATION_MILITARY_MAINTAIN end
I see a couple of obstacles here:
a) 'local Prio = 0'. I've loaded the save game from OP another couple of times, and both USSR and Nat.China are set to Manual (useless for the AI) - the *only* slider that has any investment at all is Infrastructure. I *think* I can infer from this that 'local Prio' corresponds to the numbers from the first table. I'd suggest using SLIDER_AUTOMATION_MILITARY_MAINTAIN (2) instead.
b) The Defcon triggers. SLIDER_AUTOMATION_MILITARY_MAINTAIN is the one we want for the AI to keep its units supplied and chase down the rebel forces, but it isn't activated until Defcon 2. I think bringing this down to Defcon 3 might do the trick.
If anyone has an idea for a string to make rebels trigger a Defcon change, I will test this ASAP. Or if it's not really doable, let me know, and I'll try think of something else.
|
|
84 posts
|
Post by HansWormhat EvW-Dev on Jan 10, 2015 18:18:09 GMT
In defcon.txt, what if you put the line:
controlled_by = REB
right under war = no? That may be it.
|
|
49 posts
Skills: Coding, Historical Research, Modding Units, Finding Bugs, Bug Fixing, Modding Technologies
|
Post by Tiberius - EvW-Dev on Jan 10, 2015 18:43:13 GMT
I'll give it a shot - do you think that needs another variable though? It reads like it needs a province.
|
|
84 posts
|
Post by HansWormhat EvW-Dev on Jan 10, 2015 18:58:55 GMT
That line I think is just a generic call to any province in a nation. It's written the same way in the rebel types text file.
|
|
49 posts
Skills: Coding, Historical Research, Modding Units, Finding Bugs, Bug Fixing, Modding Technologies
|
Post by Tiberius - EvW-Dev on Jan 10, 2015 19:47:12 GMT
Alright, after making a backup copy and a dev copy of the game, I made the edit and tried. And you know, I think something might be wrong with the sliders altogether (or, the automated options anyway). I played as the UK, USSR, and France, all with these same results. I put it on manual and moved the infrastructure slider all the way to the right, and took funding away from everything else: Then I changed it and waited for the sliders to move, but they didn't: And then again: Same results for all 3 nations. I realised also that all 3 nations with large rebellions in the save from OP (France, USSR, Nat. China) were at Defcon 2, which means they should've been set to SLIDER_AUTOMATION_MILITARY_MAINTAIN. USSR and Nat. China were spending on reinforcements but France was spending nothing on the sliders and had everything dumped into tech. I'm gonna have a look around to see if I can find the slider settings but I get the feeling they're hard coded. Can you have a test to see whether changing the setting actually moves the sliders around for you?
|
|
84 posts
|
Post by HansWormhat EvW-Dev on Jan 10, 2015 22:27:45 GMT
Changing the settings changes the sliders in my trials. I'm not seeing the issue anywhere.
|
|
66 posts
Skills: Historical Research, Writing Events/Decisions, Modding Units, Finding Bugs, Bug Fixing, AI Programming, Graphics, Modding Countries/Leaders, Modding Provinces, Economic Balancing, Map Editing, Modding Technologies, Modding User Interface
|
Post by nguyenthepatriot on Jan 10, 2015 22:32:20 GMT
I'll give it a shot - do you think that needs another variable though? It reads like it needs a province. If it is like HoI3, I think you'll want to instead use this country trigger: www.paradoxian.org/hoi3wiki/Event_Commands
|
|