bouncymischa
Synthetic Genie
Or, more specifically, how does it work if there's multiple copies of a building with BuildingClassYieldChanges?
When I was working on buildings for Future Worlds, I decided to try and represent some of the interconnectivity between certain buildings by having them use BuildingClassYieldChanges to modify their yields -- for example, the E-Commerce Server causes the Autoplant to gain +1 Gold. My original thought was that this effect would stack -- if you had 3 E-Commerce Servers, then each Autoplant would generate +3 Science. However, after getting some reports that the buildings weren't working like they were supposed to, I did some experimenting and got some odd results. It appears that the additional yields are being stacked, but if I remove the affected building, then any additional yields beyond the first remain in the city. If I had a city with an Autoplant and 3 cities with E-Commerce Servers, the city with the Autoplant would show a +3 Gold yield from Buildings... but if I removed the Autoplant, only 1 Gold would disappear, leaving +2 Gold from no source at all!
I'm guessing that there's probably some code in the DLL responsible for this -- I believe there are some Lua codes that get used occasionally to adjust yields from buildings directly (rather than through spawning dummy buildings), so I'm wondering if the code increments the yields from buildings properly, but if a building is removed, doesn't check to see how many copies of a building with BuildingClassYieldChanges exists, and thus only decrements one copy. Even the incrementing process seems a bit bugged -- in one test, it seemed like if Building A is modified by Building B, then each time a new Building B was built the yields for each Building A got incremented... but if a new Building A was built, it only checked for BuildingClassYieldChanges once.
All in all, I'm not familiar enough with the DLL code to say for sure... thus, I'm wondering if anyone out there might be able to shed some light on the phenomenon. At the very least, though, I figured it might be a cautionary tale for anyone else considering playing around with the same idea.
(All told, I'm probably just going to have to look at using Lua and more dummy buildings to handle yield modification more effectively... XD)
When I was working on buildings for Future Worlds, I decided to try and represent some of the interconnectivity between certain buildings by having them use BuildingClassYieldChanges to modify their yields -- for example, the E-Commerce Server causes the Autoplant to gain +1 Gold. My original thought was that this effect would stack -- if you had 3 E-Commerce Servers, then each Autoplant would generate +3 Science. However, after getting some reports that the buildings weren't working like they were supposed to, I did some experimenting and got some odd results. It appears that the additional yields are being stacked, but if I remove the affected building, then any additional yields beyond the first remain in the city. If I had a city with an Autoplant and 3 cities with E-Commerce Servers, the city with the Autoplant would show a +3 Gold yield from Buildings... but if I removed the Autoplant, only 1 Gold would disappear, leaving +2 Gold from no source at all!
I'm guessing that there's probably some code in the DLL responsible for this -- I believe there are some Lua codes that get used occasionally to adjust yields from buildings directly (rather than through spawning dummy buildings), so I'm wondering if the code increments the yields from buildings properly, but if a building is removed, doesn't check to see how many copies of a building with BuildingClassYieldChanges exists, and thus only decrements one copy. Even the incrementing process seems a bit bugged -- in one test, it seemed like if Building A is modified by Building B, then each time a new Building B was built the yields for each Building A got incremented... but if a new Building A was built, it only checked for BuildingClassYieldChanges once.
All in all, I'm not familiar enough with the DLL code to say for sure... thus, I'm wondering if anyone out there might be able to shed some light on the phenomenon. At the very least, though, I figured it might be a cautionary tale for anyone else considering playing around with the same idea.
(All told, I'm probably just going to have to look at using Lua and more dummy buildings to handle yield modification more effectively... XD)