Future Worlds

When the new version does come out, would you mind posting a simple explanation of all the changes/fixes/new stuff in it? I'd appreciate it, especially since I already tweak this mod a teensy bit to fit my preferences.

PS. So, you once mentioned adding Manganese as a bonus-or-luxury resource having to do with the aforementioned undersea mining, but you don't mention it now. Did you drop the idea for some reason?

PPS. In my game, got no trouble producing Fighters. Guess the other guy had a collision with some other mod.
 
When the new version does come out, would you mind posting a simple explanation of all the changes/fixes/new stuff in it? I'd appreciate it, especially since I already tweak this mod a teensy bit to fit my preferences.

PS. So, you once mentioned adding Manganese as a bonus-or-luxury resource having to do with the aforementioned undersea mining, but you don't mention it now. Did you drop the idea for some reason?

Sure, I can include a list of the various changes when I post it here. I usually try to list them all in the changelog on Steam when I post an update.

I'd originally planned for the Undersea Mining Facility to reveal Manganese deposits in the ocean, but was running into some issues with it, so I ultimately didn't include it in v4. It did make use of SaveUtils as well, which I've since learned can cause serious conflicts with other mods that use TableSaverLoader, so for now I've removed SaveUtils. At some point I'll probably revisit the Manganese concept, but for now it's on hold.
 
Hello bouncymischa,

maybe it would be possible to use TableSaverLoader instead of SaveUtiles for the Resource Generator?
 
Hello bouncymischa,

maybe it would be possible to use TableSaverLoader instead of SaveUtiles for the Resource Generator?

Oh, undoubtably -- and I plan to do so when I get the chance! It's just another thing to stack on a pile of other things to work on, so it's a bit lower in priority than the various other things I want to complete that I can do with what I know now. :p
 
Well I will see if I get it done, resources on ocean tiles is something that I need as well for my mod. I will come back to you if I manage to do it.
 
Well I will see if I get it done, resources on ocean tiles is something that I need as well for my mod. I will come back to you if I manage to do it.

Oh, spawning resources on ocean tiles forcibly is easy, as long as you aren't going through AssignPlots or whatever - pick a set of ocean tiles and put the resource there yourself. My problem is, I want this code to only fire once per city, which I used SaveUtils for. But I don't know how TSL saves data, so I'll have to figure that out...
 
Oh, spawning resources on ocean tiles forcibly is easy, as long as you aren't going through AssignPlots or whatever - pick a set of ocean tiles and put the resource there yourself. My problem is, I want this code to only fire once per city, which I used SaveUtils for. But I don't know how TSL saves data, so I'll have to figure that out...

Essentially, it saves the tables themselves only when a player does any form of "Save Game", and thus also avoids the problem where data is saved but the game itself is not, and thus a dysynch occurs between the state of the saved game and the state of the persisted data that gets reloaded for a saved game.

So in the meat of your code you never concern yourself with "Save This Data Right Now" methods (which ought to raise a giant red flag to anyone using such a method), you just update the tables you are using, and the current state of the tables is saved by TableSaverLoader when a player saves the game.
 
Essentially, it saves the tables themselves only when a player does any form of "Save Game", and thus also avoids the problem where data is saved but the game itself is not, and thus a dysynch occurs between the state of the saved game and the state of the persisted data that gets reloaded for a saved game.

So in the meat of your code you never concern yourself with "Save This Data Right Now" methods (which ought to raise a giant red flag to anyone using such a method), you just update the tables you are using, and the current state of the tables is saved by TableSaverLoader when a player saves the game.

Does that save on autosaves too? Or would there be issues if CTDs occurred?
 
Does that save on autosaves too? Or would there be issues if CTDs occurred?

It saves during autosave. If CTD occurs, you just go back to the most recent "clean" savefile, and everything that was correct for that savefile is what is loaded along with the savefile.

I also recommend using DarkScythe's TSL Serializer in conjunction with TableSaverLoader as this sorts and prevents any potential clash between multiple mods all running at the same time that are all using TableSaverLoader. DarkScythe's Add-on also makes it simpler to "connect" TableSaverLoader to the code in the body of your main lua file.
 
Hello bouncymischa,
I'm having a issue,

After building "Feedsite Hub" wonder my culture make a big jump, from 2100 per turn to 26000 per turn!! Is this intentional? It make the game off balance I think.

Can you please check this up. Thanks a lot for this awesome mod.
 
Hello bouncymischa,
I'm having a issue,

After building "Feedsite Hub" wonder my culture make a big jump, from 2100 per turn to 26000 per turn!! Is this intentional? It make the game off balance I think.

Can you please check this up. Thanks a lot for this awesome mod.
Most likely coming from a combination of
Code:
<Building_BuildingClassYieldChanges>
	<Row>
		<BuildingType>BUILDING_FW_FEEDSITE_HUB_DUMMY_1</BuildingType>
		<BuildingClassType>BUILDINGCLASS_FW_FEEDSITE_NODE</BuildingClassType>
		<YieldType>YIELD_CULTURE</YieldType>
		<YieldChange>1</YieldChange>
	</Row>
</Building_BuildingClassYieldChanges>
and
Code:
function FeedsiteHubBonus(iPlayer)
	local pPlayer = Players[iPlayer];
	local pCapital = pPlayer:GetCapitalCity();
	local iNumHappiness = 0
	local iNumCulture = 0
	if (pCapital) then
		if pCapital:IsHasBuilding(iBuildingFeedsiteHub) then
			iNumCulture = pCapital:GetNumGreatWorks()
			if pCapital:IsHasBuilding(iBuildingColosseum) then iNumHappiness = iNumHappiness + 1 end
			if pCapital:IsHasBuilding(iBuildingTheatre) then iNumHappiness = iNumHappiness + 1 end
			if pCapital:IsHasBuilding(iBuildingStadium) then iNumHappiness = iNumHappiness + 1 end
		end
		for pCity in pPlayer:Cities() do
			if pCity:IsHasBuilding(iBuildingFeedsiteNode) then
				pCity:SetNumRealBuilding(GameInfoTypes["BUILDING_FW_FEEDSITE_HUB_DUMMY_2"], iNumHappiness)
				pCity:SetNumRealBuilding(GameInfoTypes["BUILDING_FW_FEEDSITE_HUB_DUMMY_1"], iNumCulture)
			end
		end
	end
end
GameEvents.PlayerDoTurn.Add(FeedsiteHubBonus)
  1. If a player stacks all their great works in the capital city, then the number of BUILDING_FW_FEEDSITE_HUB_DUMMY_1 buildings that will be added to each city will be equal to that heavily stacked-up number of great works in the capital city
  2. Since each copy of a BUILDING_FW_FEEDSITE_HUB_DUMMY_1 building will want to try to add +1 culture to every copy of BUILDINGCLASS_FW_FEEDSITE_NODE everywhere in the empire this means effectively that if there are 10 cities in the empire each with a BUILDINGCLASS_FW_FEEDSITE_NODE building, all of a sudden every one of these BUILDINGCLASS_FW_FEEDSITE_NODE buildings are going to start generating +10 Culture.
    • The effect wil be multiplied if there are even more cities in the empire, or if there are more cities than cities that actually have a BUILDINGCLASS_FW_FEEDSITE_NODE building because the dummy is being added in all cities.
    • <Building_BuildingClassYieldChanges> effects don't stack for multiple copies of the same building within the same city, but they do stack for multiple cities each having at least one copy of the building.
    • <Building_BuildingClassYieldChanges> effects are also global and affect every such specified building fitting within the BuildingClassType that exists within the empire.
    • You can also get very bizarre effects from having multiple buildings all adding an additional yield via <Building_BuildingClassYieldChanges> such that if all copies of BUILDING_FW_FEEDSITE_HUB_DUMMY_1 are eliminated from every city within an empire, this does not always result in all the effects also being removed that were originally added via BUILDING_FW_FEEDSITE_HUB_DUMMY_1 to some other building-class through table <Building_BuildingClassYieldChanges>
    • It is generally best to not use table <Building_BuildingClassYieldChanges> with a BuildingType that is not a World or National wonder (or that will ever have more than one copy added to an empire)
  3. This is in addition to the culture every city will generate equal to the number of great works in the capital.
  4. 26000 still seems like an awful high number so there may also be something else going on
 
Most likely coming from a combination of
Code:
<Building_BuildingClassYieldChanges>
	<Row>
		<BuildingType>BUILDING_FW_FEEDSITE_HUB_DUMMY_1</BuildingType>
		<BuildingClassType>BUILDINGCLASS_FW_FEEDSITE_NODE</BuildingClassType>
		<YieldType>YIELD_CULTURE</YieldType>
		<YieldChange>1</YieldChange>
	</Row>
</Building_BuildingClassYieldChanges>
and
Code:
function FeedsiteHubBonus(iPlayer)
	local pPlayer = Players[iPlayer];
	local pCapital = pPlayer:GetCapitalCity();
	local iNumHappiness = 0
	local iNumCulture = 0
	if (pCapital) then
		if pCapital:IsHasBuilding(iBuildingFeedsiteHub) then
			iNumCulture = pCapital:GetNumGreatWorks()
			if pCapital:IsHasBuilding(iBuildingColosseum) then iNumHappiness = iNumHappiness + 1 end
			if pCapital:IsHasBuilding(iBuildingTheatre) then iNumHappiness = iNumHappiness + 1 end
			if pCapital:IsHasBuilding(iBuildingStadium) then iNumHappiness = iNumHappiness + 1 end
		end
		for pCity in pPlayer:Cities() do
			if pCity:IsHasBuilding(iBuildingFeedsiteNode) then
				pCity:SetNumRealBuilding(GameInfoTypes["BUILDING_FW_FEEDSITE_HUB_DUMMY_2"], iNumHappiness)
				pCity:SetNumRealBuilding(GameInfoTypes["BUILDING_FW_FEEDSITE_HUB_DUMMY_1"], iNumCulture)
			end
		end
	end
end
GameEvents.PlayerDoTurn.Add(FeedsiteHubBonus)
  1. If a player stacks all their great works in the capital city, then the number of BUILDING_FW_FEEDSITE_HUB_DUMMY_1 buildings that will be added to each city will be equal to that heavily stacked-up number of great works in the capital city
  2. Since each copy of a BUILDING_FW_FEEDSITE_HUB_DUMMY_1 building will want to try to add +1 culture to every copy of BUILDINGCLASS_FW_FEEDSITE_NODE everywhere in the empire this means effectively that if there are 10 cities in the empire each with a BUILDINGCLASS_FW_FEEDSITE_NODE building, all of a sudden every one of these BUILDINGCLASS_FW_FEEDSITE_NODE buildings are going to start generating +10 Culture.
    • The effect wil be multiplied if there are even more cities in the empire, or if there are more cities than cities that actually have a BUILDINGCLASS_FW_FEEDSITE_NODE building because the dummy is being added in all cities.
    • <Building_BuildingClassYieldChanges> effects don't stack for multiple copies of the same building within the same city, but they do stack for multiple cities each having at least one copy of the building.
    • <Building_BuildingClassYieldChanges> effects are also global and affect every such specified building fitting within the BuildingClassType that exists within the empire.
    • You can also get very bizarre effects from having multiple buildings all adding an additional yield via <Building_BuildingClassYieldChanges> such that if all copies of BUILDING_FW_FEEDSITE_HUB_DUMMY_1 are eliminated from every city within an empire, this does not always result in all the effects also being removed that were originally added via BUILDING_FW_FEEDSITE_HUB_DUMMY_1 to some other building-class through table <Building_BuildingClassYieldChanges>
    • It is generally best to not use table <Building_BuildingClassYieldChanges> with a BuildingType that is not a World or National wonder (or that will ever have more than one copy added to an empire)
  3. This is in addition to the culture every city will generate equal to the number of great works in the capital.
  4. 26000 still seems like an awful high number so there may also be something else going on

Really thanks for the very informative reply. I've zero knowledge about modding though I've understand little from your explanation. I was really surprised from that jump :D.

Yes I stack up great work of art in capital, was playing with France and manage to build up most of the wonder that have work of art slots in the capital and fill them with max theming bonus. France have 100% extra theming bonus for capital, is that causing this somehow?
 
Really thanks for the very informative reply. I've zero knowledge about modding though I've understand little from your explanation. I was really surprised from that jump :D.

Yes I stack up great work of art in capital, was playing with France and manage to build up most of the wonder that have work of art slots in the capital and fill them with max theming bonus. France have 100% extra theming bonus for capital, is that causing this somehow?

It's possible. I think I've already fixed one of the bugs LeeS pointed out, where the I'd forgotten to update the code in the dummy building I was using to generate the bonus culture, which resulted in a more geometric rather than linear progression. Version 4 was actually an effort to get rid of most of the <Building_BuildingClassYieldChanges> I was using, but I obviously missed this one. :p
 
It's possible. I think I've already fixed one of the bugs LeeS pointed out, where the I'd forgotten to update the code in the dummy building I was using to generate the bonus culture, which resulted in a more geometric rather than linear progression. Version 4 was actually an effort to get rid of most of the <Building_BuildingClassYieldChanges> I was using, but I obviously missed this one. :p

Really hope a fix in v5 :D if it's possible.

Can't appreciate enough for the time and effort you put behind this mod. :goodjob:
 
Just need to finish up a few civilopedia entries and v5 should be ready to go.

Anyone want to offer witty quotes for the new Autonomous Systems and Transgenics techs? I'm having a difficult time finding good ones. XD
 

Except that quote isn't about automation in the technological sense, but rather autonomy in the sociopolitical sense. This one is MUCH more appropriate:

&#8220;Never do anything yourself that others can do for you.&#8221;
&#8213; Agatha Christie, The Labours of Hercules

As for Transgenics...

&#8220;Nothing is so painful to the human mind as a great and sudden change.&#8221;
&#8213; Mary Shelley, Frankenstein
 
Okay, so v5 is up on dropbox and available here. I'll try to get it updated on Steam later today, but I haven't been able to properly playtest it. Hopefully there's no bugs, but if anyone notices immediate problems let me know. XD

As per DistantRainbow's request, I'll try and summarize the various changes. Since they're kind of scattered, I may miss a few:

-Added the Nanohive and Crawler units
-Added the Special Forces unit, which is an upgrade to the Marine, and upgrades to Organic Infantry
-Mutants now may cause nearby enemy units to become Barbarians when the Mutant unit is killed
-Added the Jurassic Park wonder (comes with Genetic Manipulation)
-Added Brain Uploading Facility building (which reduces population, replacing them with fixed yields)
-Added Bioenhancement Centre (provides unique Biomod promotions)
-Revised tech tree slightly, adding Autonomous Systems and Transgenics techs.
-Modified building and unit costs a bit, increasing them somewhat
-Skynet now requires Artificial Intelligence
-Core now requires Autonomous Systems
-Biofactory now requires Ecotheory, no longer requires an Implant Clinic
-Autoplant now requires Distributed Computing
-Drone Hive now requires Autonomous Systems

If I remember any other changes, I'll add them to the list!

Also, thanks to BackseatTyrant for the quotes!
 
Top Bottom