84 posts
|
Post by HansWormhat EvW-Dev on Dec 30, 2014 23:17:47 GMT
Greetings, I've been pouring over this problem for several days and here is what I've found. From the initial bug reports thread I found that the military supplies stockpile (the "Bullets" icon in the top of the screen, also in the Economy window) would constantly drop to the point where your military would run out, and the stockpile would never be replenished. I found that this issue can be fixed by opening the common/defines.lua file and changing the value for MAX_STOCK_SUPPLIES_FACTOR to 1 instead of 2. For reasons I find difficult to explain, it appears to work. My proof is here in this graph I made during several runs of game experiments: My supply slider was set to the minimum (furthest left, 30 days stockpile) and you can see approximately how much quantity that equated to (~600 units) and my budget at the time (~50 surplus). At point 1, I upped the slider to maximum (90 days stockpile, ~1600 units), and my economy began to buy up additional supplies to meet my new stockpile request. As you can see, my supplies began to slowly increase as I bought up more, and my budget dipped simultaneously (~30 surplus) from the extra daily purchasing. When my supplies reached maximum at point 2, my budget returned to its previous surplus as I had stopped buying more. Then I reset the slider to the minimum at point 3. My supplies began to drop, as I had stopped buying more to meet the maximum stockpile limit, while they continued to be used by the military. My budget then climbed to a ~90 surplus, as I was no longer buying supplies for my stockpile daily. When my supplies reached the minimum, they leveled out at ~600 again, and my budget returned to a previous normal of ~50 surplus. So, I can conclude that, from my trials, whatever code I changed in defines.lua did the trick. I can recommend you do the same. However, fuel is still broken. What I see when I experiment is that, you begin the game with a set quantity of fuel, and that quantity never gets replenished no matter what you set your slider to. I tried to run my fuel stockpile down to 0 to see if that would trigger anything, and it did not. I was able to maneuver all types of units even with fuel at 0. Despite having fuel refineries in my country constantly producing fuel, and selling it, my stockpile never changed. Additionally, the global stock of fuel (can by found by hovering the mouse over the fuel icon at the top of the screen, or by going to the Trade tab in the economy window) was always 0, never changing. I'm not sure what to make of this, because I've modified defines.lua very often and have not found a solution. Starting to think this is a problem with the game code itself. Thoughts?
|
|
110 posts
Skills: Localisation/Language Translation, Historical Research, Finding Bugs, Modding Countries/Leaders, Modding Provinces, Economic Balancing
|
Post by Viking Panda on Dec 30, 2014 23:53:41 GMT
The fuel bug could be related to an inability to convert the fuel resource into the fuel stockpile good that's used by the military. Good work by the way
|
|
110 posts
Skills: Localisation/Language Translation, Historical Research, Finding Bugs, Modding Countries/Leaders, Modding Provinces, Economic Balancing
|
Post by Viking Panda on Dec 30, 2014 23:58:35 GMT
I went through the defines.lua and found all the entries related to fuel:
FUEL_DECAY = 0.15, -- a factor to scale value of good lost every day, when above the limit FUEL_STOCKPILE_FACTOR = 200, -- factor to scale each good's limit value (unused yet) UNITS_GOODS_USAGE = 30, -- days of usage for fuel and supplies, used for min stock MAX_STOCK_FUEL_FACTOR = 1, -- used to set max stock OFFENSIVE_FUEL_RATE = 3,
|
|
84 posts
|
Post by HansWormhat EvW-Dev on Dec 31, 2014 0:38:09 GMT
The fuel bug could be related to an inability to convert the fuel resource into the fuel stockpile good that's used by the military. Good work by the way Was thinking the same thing, because in goods.txt in the common folder you see at the bottom: I can't find comparable definitions in any HoI3 folder/file so I'm wondering if this could be the problem. I suspect the same thing, that at some fuel created by refineries is not being converted to fuel available to use for stockpiles. And those lines in defines.lua...changing any of those things has no effect as I've found, but may impact fuel stockpiles if we can genuinely fix this fuel issue first.
|
|
110 posts
Skills: Localisation/Language Translation, Historical Research, Finding Bugs, Modding Countries/Leaders, Modding Provinces, Economic Balancing
|
Post by Viking Panda on Dec 31, 2014 0:41:43 GMT
The fuel bug could be related to an inability to convert the fuel resource into the fuel stockpile good that's used by the military. Good work by the way Was thinking the same thing, because in goods.txt in the common folder you see at the bottom: I can't find comparable definitions in any HoI3 folder/file so I'm wondering if this could be the problem. I suspect the same thing, that at some fuel created by refineries is not being converted to fuel available to use for stockpiles. And those lines in defines.lua...changing any of those things has no effect as I've found, but may impact fuel stockpiles if we can genuinely fix this fuel issue first. I'm sure we can fix this. But even if it is a hard-coded thing we can't fix due to the beta leak being unfinished we are modders so we'll definitely be able to jerry rig something to give nations fuel in the stockpile for military use (even if it's just an event based on the number of fuel refineries a country has).
|
|
84 posts
|
Post by HansWormhat EvW-Dev on Dec 31, 2014 0:49:07 GMT
I'm trying a funny workaround to see if that's truly what the problem is...a function duplicating the name of an existing variable. So what I'm doing is changing the "fuel" on the left side of that code to "electricity" which is a commodity we know works. So if I'm right, the country will restock its fuel stockpile using electricity instead of fuel. I'll test it and see if it works...
Haha that did it! Fuel now behaves like supplies. The stock drops when used by units, and is replenished by buying electricity from the market. Changing sliders for fuel now has meaning. Unfortunately it means that all military units are battery powered, but that's just for now, haha...
What I'm going to try now is see if I can change the name of the fuel variable created by refineries to something else, like "petroleum" or something. Stand by.
|
|
110 posts
Skills: Localisation/Language Translation, Historical Research, Finding Bugs, Modding Countries/Leaders, Modding Provinces, Economic Balancing
|
Post by Viking Panda on Dec 31, 2014 0:54:06 GMT
I'm trying a funny workaround to see if that's truly what the problem is...a function duplicating the name of an existing variable. So what I'm doing is changing the "fuel" on the left side of that code to "electricity" which is a commodity we know works. So if I'm right, the country will restock its fuel stockpile using electricity instead of fuel. I'll test it and see if it works... Haha that did it! Fuel now behaves like supplies. The stock drops when used by units, and is replenished by buying electricity from the market. Changing sliders for fuel now has meaning. Unfortunately it means that all military units are battery powered, but that's just for now, haha... What I'm going to try now is see if I can change the name of the fuel variable created by refineries to something else, like "petroleum" or something. Stand by. I want your babies, you're a freaking genius man
|
|
15 posts
|
Post by quaza on Dec 31, 2014 0:55:12 GMT
Good job 2 Gamebreaking bugs less haha
|
|
110 posts
Skills: Localisation/Language Translation, Historical Research, Finding Bugs, Modding Countries/Leaders, Modding Provinces, Economic Balancing
|
Post by Viking Panda on Dec 31, 2014 1:01:45 GMT
Good job 2 Gamebreaking bugs less haha Alexsey and his friend will be pleased when they get back from their holidays haha 2 critical bugs eliminated means more work can be done on AI must faster
|
|
15 posts
|
Post by quaza on Dec 31, 2014 1:05:01 GMT
Good job 2 Gamebreaking bugs less haha Alexsey and his friend will be pleased when they get back from their holidays haha 2 critical bugs eliminated means more work can be done on AI must faster Definetly. So happy to see that EvW maybe actually will be finished.
|
|
110 posts
Skills: Localisation/Language Translation, Historical Research, Finding Bugs, Modding Countries/Leaders, Modding Provinces, Economic Balancing
|
Post by Viking Panda on Dec 31, 2014 1:13:54 GMT
Alexsey and his friend will be pleased when they get back from their holidays haha 2 critical bugs eliminated means more work can be done on AI must faster Definetly. So happy to see that EvW maybe actually will be finished. Finishing it is just the start, we have some very talented people on this forum so once we fix it and make it playable we should expand the mod and make it even better than vanilla. Maybe extending the timeline to 2025 or add new features like the British Commonwealth, Climate Change, war on terror, Al-Qaeda, the internet etc
|
|
84 posts
|
Post by HansWormhat EvW-Dev on Dec 31, 2014 3:01:35 GMT
Well unfortunately it appears changing the name of the fuel resource to something else crashes the game, so it's obviously hardcoded somewhere in the .exe. If you change the fuel variable name in the goods.txt, population_demand.txt, and economy_buildings.txt files, it appears to work in the game, UNTIL you open the Economy window and place your mouse on the stockpile slider for fuel. The instant you do that, crash.
Maybe I'm missing something, like a line in another file somewhere, but that's all I'm capable of doing. So we know for certain the problem is a matter of converting the fuel commodity to the fuel stock. How to fix it beyond that looks like something Alexey and friends will have to do.
|
|
15 posts
|
Post by quaza on Jan 2, 2015 6:26:15 GMT
I'm trying a funny workaround to see if that's truly what the problem is...a function duplicating the name of an existing variable. So what I'm doing is changing the "fuel" on the left side of that code to "electricity" which is a commodity we know works. So if I'm right, the country will restock its fuel stockpile using electricity instead of fuel. I'll test it and see if it works... Haha that did it! Fuel now behaves like supplies. The stock drops when used by units, and is replenished by buying electricity from the market. Changing sliders for fuel now has meaning. Unfortunately it means that all military units are battery powered, but that's just for now, haha... What I'm going to try now is see if I can change the name of the fuel variable created by refineries to something else, like "petroleum" or something. Stand by. What About trying to change that into "oil" instead of electricity? would be nice because it also would make alot more sense^^
|
|
110 posts
Skills: Localisation/Language Translation, Historical Research, Finding Bugs, Modding Countries/Leaders, Modding Provinces, Economic Balancing
|
Post by Viking Panda on Jan 2, 2015 7:15:31 GMT
I'm trying a funny workaround to see if that's truly what the problem is...a function duplicating the name of an existing variable. So what I'm doing is changing the "fuel" on the left side of that code to "electricity" which is a commodity we know works. So if I'm right, the country will restock its fuel stockpile using electricity instead of fuel. I'll test it and see if it works... Haha that did it! Fuel now behaves like supplies. The stock drops when used by units, and is replenished by buying electricity from the market. Changing sliders for fuel now has meaning. Unfortunately it means that all military units are battery powered, but that's just for now, haha... What I'm going to try now is see if I can change the name of the fuel variable created by refineries to something else, like "petroleum" or something. Stand by. What About trying to change that into "oil" instead of electricity? would be nice because it also would make alot more sense^^ why not just make a new resource called petrol, change the output of the refinery factory from fuel to this new "petrol" good and then change the conversion bit from fuel = fuel to fuel = petrol I will test this now.
|
|
84 posts
|
Post by HansWormhat EvW-Dev on Jan 2, 2015 22:47:13 GMT
What About trying to change that into "oil" instead of electricity? would be nice because it also would make alot more sense^^ why not just make a new resource called petrol, change the output of the refinery factory from fuel to this new "petrol" good and then change the conversion bit from fuel = fuel to fuel = petrol I will test this now. Actually that's exactly what I did. Unfortunately it's a little more complicated than that, as I found. There's 3 files where the change needs to be made, goods.txt, economy_buildings.txt, and population_demands.txt. In each one, you change "fuel" to "petrol" as I did...I literally also used petrol, haha. In the conversion block in goods.txt, you change the line fuel = fuel to -> petrol = fuel. I found that this does work...for a time. Provided you never touch the fuel stockpile slider in the Economy window, it will work indefinitely. However, when you try to move the slider, or even just mouse over the slider, the game crashes. And for my own personal game's sake, I did change it to oil eventually. Electricity was just something I tried to see if that's what the problem was (lo and behold, it was). But I'm using oil now, which renders fuel a useless commodity...but to be fair, it already was useless thanks to this bug. That way I can continue observing the fuel stockpile system for further bugs (none yet). Something in the code for the sliders is probably the culprit, and it's probably something as simple as changing a variable from "fuel" to "petrol" like with the .txt files...but that's something we don't have access to yet.
|
|