[MOD] Colonization: 2071

It could be something like Genetic Material(Spice) and Gene Sequencing (Lux. Food) and these make Super Alien Hybrid Cybernetic Eungeniced Beings!

And it don't have to be an "Elite" class, it could be anything really, from Hybrid Aliens to Robots.

I have been thinking about the growth code. I would like to merge it all into one. Civics can then set growth unit and which yield is used to grow it. That way you can have 5 growth yields if you want, purely by XML setup and you can have just one. However YIELD_FOOD will presumably stay hardcoded in the AI DLL code forever meaning you can't have none. It's far from top priority though.

This would be a good idea, so what your saying is we could set our Growth classes up in the XML and then the DLL will store those in a Cache and loop that Cache for Growth, yeah, something like that would be awesome.

I forgot that there was quite a bit of work already done to merge in 2071. Glancing through the files I see the Progenitor Secrets already there. It is going to be a chore to get the XMLs of 2071 all setup to be used in the shared DLL, but after this next release I am going to make that a priority.
 
And it don't have to be an "Elite" class, it could be anything really, from Hybrid Aliens to Robots.

Originally Posted by Nightinggale View Post
I have been thinking about the growth code. I would like to merge it all into one. Civics can then set growth unit and which yield is used to grow it. That way you can have 5 growth yields if you want, purely by XML setup and you can have just one. However YIELD_FOOD will presumably stay hardcoded in the AI DLL code forever meaning you can't have none. It's far from top priority though.

This would be a good idea, so what your saying is we could set our Growth classes up in the XML and then the DLL will store those in a Cache and loop that Cache for Growth, yeah, something like that would be awesome.
That sounds good.. with a flexible system like that if you wanted you could potentially mod 3 classes of "Growth"-able citizens if you want to enable Working Class, Middle Class, and Upper Class types which could be good for World History to model later historical development of an important middle class etc.

Another odd twist to mention is it is actually possible to have citizens that can be created with Hammers and other Yields if you want this:borg::p - in the currently working 2071 version the Japanese Colonies start out able to manufacture Android and AI citizen types to replace poor immigration of humans from home. :assimilate:

I forgot that there was quite a bit of work already done to merge in 2071. Glancing through the files I see the Progenitor Secrets already there. It is going to be a chore to get the XMLs of 2071 all setup to be used in the shared DLL, but after this next release I am going to make that a priority.
Yeah I had made nearly all the XML for it but I'm not sure it's worth the huge chore of going back over all it to try to figure out how to make that compatible, there have been a lot of changes to DLL and XML Schemas and more are coming (especially major ones such as Traits-Civics rework), so it is best to wait for a near final version before starting XML of modmods based on the DLL. It will be worth it though to have a top quality DLL code base with new features, AI behavior, interface, performance, and bugs being carefully worked out.:king:

Anyway I had designed that Perl script in scripts/xmlgen.pl to generate XML files with game content using the file formats of the old M:C XML schema. The schemas (schemae? schemata?) :p have changed now for most files, but when the schemas are close to finalized with bugs being worked out maybe this could be redesigned using the final XML file formats, which hopefully would not be so bad as trying to sift through all those XML files by hand:crazyeye:. If we can get a good XML content generation script like this working it could hopefully make things a lot easier for XML modders to quickly start making new mods using the final shared DLL version as a base.
 
In FTTW, archid has done some really great work on making 'skeleton' xmls, that only require about 5 entries in them, everything else is optional and will just insert a 'NULL' type of value, which means each entry only needs the tags that it actually uses.

It took my old xml files from about 50000 lines down to less than 10000.

It could also make it much easier for modders to make new entries etc. as if you miss a line, provided the order is right it doesn't matter.
 
It will be worth it though to have a top quality DLL code base with new features, AI behavior, interface, performance, and bugs being carefully worked out.:king:
Hopefully, because that is the whole idea.

In FTTW, archid has done some really great work on making 'skeleton' xmls, that only require about 5 entries in them, everything else is optional and will just insert a 'NULL' type of value, which means each entry only needs the tags that it actually uses.
I came up with some similar, yet different.

Looking at civic schema, I learned that it has lots of tags and they are in more or less random order. Merging with traits would make it so chaotic, that nobody could use it to the full extend.

Solution: grouped tags. There are now 7 groups (I might add more), each containing multiple tags. All content of each group is optional, but the groups have to be there. A list of empty groups can then be the template.

Example:
Say we want an invention, which makes farms produce an additional food. With groups that would look like:
Code:
<CivicGroupYieldProductionModifiers>
	<ImprovementYieldChanges>
		<ImprovementYieldChange>
			<ImprovementType>IMPROVEMENT_FARM</ImprovementType>
			<ImprovementYields>
				<YieldChange>
					<YieldType>YIELD_FOOD</YieldType>
					<iYieldChange>1</iYieldChange>
				</YieldChange>
			</ImprovementYields>
		</ImprovementYieldChange>
	</ImprovementYieldChanges>
</CivicGroupYieldProductionModifiers>
If the civic will not change any yield production, then it is enough to write <CivicGroupYieldProductionModifiers/>

The more I work with this, the more I like this setup. It keeps the "empty" civic to a bare minimum and it makes the XML more readable as each tag has both the tag name and a group to give an indication of what it does. Also tags more or less affecting the same thing are grouped together. The end result makes it a whole lot easier to read and edit the XML file.
 
This would be a good idea, so what your saying is we could set our Growth classes up in the XML and then the DLL will store those in a Cache and loop that Cache for Growth, yeah, something like that would be awesome.
The cache would actually be pretty simple. It would just be a JIT yield array of unit types. Default is NO_UNIT. When calculating growth units, it loops the enabled civics and sets the highest unit ID allowed (just as now), except it is done in an array rather than two fixed ones. The growth code will then loop this array and check for growth in any yield, where the unit isn't NO_UNIT.

This mean the same cache can be used for two different purposes (is yield a growth one and which unit it grows). Also it is dynamic and applies to what is available for the current player here and now. This mean earthlings and aliens can have different growth yields and the DLL will only spend time looking at the correct yield(s) for the city owner.

This makes me wonder if we should enable aliens to eat something other than YIELD_FOOD. That might be too much DLL work due to food being hardcoded in the AI.
 
Looking at civic schema, I learned that it has lots of tags and they are in more or less random order. Merging with traits would make it so chaotic, that nobody could use it to the full extend.

Solution: grouped tags. There are now 7 groups (I might add more), each containing multiple tags. All content of each group is optional, but the groups have to be there. A list of empty groups can then be the template.

Example:
Say we want an invention, which makes farms produce an additional food. With groups that would look like:
Code:
<CivicGroupYieldProductionModifiers>
	<ImprovementYieldChanges>
		<ImprovementYieldChange>
			<ImprovementType>IMPROVEMENT_FARM</ImprovementType>
			<ImprovementYields>
				<YieldChange>
					<YieldType>YIELD_FOOD</YieldType>
					<iYieldChange>1</iYieldChange>
				</YieldChange>
			</ImprovementYields>
		</ImprovementYieldChange>
	</ImprovementYieldChanges>
</CivicGroupYieldProductionModifiers>
If the civic will not change any yield production, then it is enough to write <CivicGroupYieldProductionModifiers/>

Does this only require changes to the XML schema or do you have to make changes in the DLL, too?
Background: I think the Civ4UnitInfos.xml would deserve some overhaul, too.
 
Does this only require changes to the XML schema or do you have to make changes in the DLL, too?

The DLL needs light modifications too. I need to add this:
Code:
if (gDLL->getXMLIFace()->SetToChildByTagName(pXML->GetXML(),"CivicGroupYieldProductionModifiers"))
{
	(some tag reading code)
	gDLL->getXMLIFace()->SetToParent(pXML->GetXML());
}
However that mean the DLL is now more organized as well. I have written a function for each group and while they are all called from the main read, it does provide a better overview.

I started sorting the header as well, but I decided to postpone doing that because I think it will be faster to do them all at once once all tags have been sorted.

Background: I think the Civ4UnitInfos.xml would deserve some overhaul, too.
That one and a number of other files. I will take one at a time. I have written a script to move all tags into their appropriate groups, meaning conversion later on will be easy.

Now that I write this, I came up with the idea to merge the wiki script with the tag moving script. That way it can group based on schema setup rather than me having to write a line for each tag manually.
 
We need to get this mod moving and I have decided to change the plans (partly influenced by World History Mod).

I have decided to focus development on one specific part of the code and that is to finish the XML part of CivEffects. Once the XML files are set, col2071 can start to mod files again.

After work on col2071 has restarted, I can go back to finishing the rest of CivEffects. The code is mostly there, but the GUI is broken, meaning help popup, pedia, tech tree and other screens will need updating since they are currently very blank. I see no reason why XML editing will have to wait for this to be finished as long as the XML layout itself is set.

Also at some point in the near future I will break backward compatibility in savegames in order to make future savegames backward compatible. I don't see that as a valid reason for not making XML editing either.
 
I updated the git repository. It is now designed to work based on the CivEffect branch of source and python submodules.

I added the CivEffect XML files from M:C and ran a script to add all missing tags in all XML files. It worked ok, except the new tags have been added and looks like this:
Code:
<bColonies>!!! MISSING !!!</bColonies>
Next task is to find all "missing" tags and fill out useful info in them and then the game should work again. The game complains about each at startup, meaning it shouldn't be possible to overlook one.

CivEffects appear to be more or less complete from an XML point of view. There are still some issues inside the DLL, but nothing, which should hold back XML modding. However do remember that the help text is incomplete. It is possible to add CivEffect data, which works ingame, but it is hidden from pedia and the help popup.

I would recommend not doing too much regarding yields, at least not until I figured out how to make a script, which makes this part easier.
 
I finished fixing all the XML errors and I have ended up in main menu without any errors at all. However when I start a game, I get an error telling me that there likely is a schema error and the game crashes. I have no idea how that can happen, partly because all XML is loaded before main menu. This mean the error message is likely incorrect. Even worse, the exe is behind the crash and there is nothing from the DLL in the stack :badcomp:

Right now I can't think of anything to do other than replacing the XML with M:C files. Maybe it can be made to work if just one is replaced, but which one?

EDIT
I found the problem and fixed it :woohoo:
It's now possible to start the game, but it asserts a few time due to incorrectly named/missing graphics. I think the solution is to look at the asserts and then fix the XML related problem one by one and then it should work. I don't think I'm the right one for that task though.
 
wow thanks Night, is it really possible to resurrect the current 2071 branch? :eek::king: Since it works by generating the XML files using xmlgen.pl which was written based on the old MC schema, I had expected the script would have to be totally rewritten once the XML schemas are finalized using the new DLL code base. But if it can log tags that are are !!!MISSING in which files, it could become possible to go back over the xmlgen.pl and add in code to generate the missing tags. :scan::cool: I am unfortunately away from my modding pc for the next 2 weeks but will take a look over the branch when I get back :goodjob:
 
Several moons ago (I'm still not clear of the time difference between here and Earth!!) I asked if it were possible for cities captured from other colonists could have the ability to build a City Center (currently it can't). You provided me the the following code snippet to place in Assets/XML/Buildings/Civ4BuildingInfos.xml

<YieldCosts>
<YieldCost>
<YieldType>YIELD_HAMMERS</YieldType>
<iCost>50</iCost>
</YieldCost>
</YieldCosts>

Now with a new PC, an upgrade to Windows10, and a new installation of the mod on top of a steam account, I have lost this ability again. Having looked at that xml file again today, it does seem that there are several entries which refer to Civic Centers. Could you advise me at which line number(s) the above code should be inserted.

Many thanks - Alan

Col 2071 - still a great game to play. Have tried Civ 5 BE which is pedestrian and boring in comparison.
 
Hi Alan,

In the section of Assets/XML/Buildings/Civ4BuildingInfos.xml that goes under <Type>BUILDING_CITY_CENTER</Type> , replace the line that says <YieldCosts/> with that section and it should make them buildable.

Glad to hear people are still playing this mod! Surprisingly to me it's been edging up past 9300 downloads on weplayciv :scan::goodjob:
 
Glad to hear people are still playing this mod! Surprisingly to me it's been edging up past 9300 downloads on weplayciv :scan::goodjob:
That's actually pretty impressive. I just checked RaRE and it has 333 downloads. That's way more than what I expected, particularly since it is a modmod I made for personal usage and I didn't promote it other than on the forum. I guess this mean we better kick some more life into the modding community. It's a bit idle at the moment and I fear I am to blame for that :cry:
 
Hi Orlanth
That worked fine. The length of time it takes to rebuild a civic centre is however perhaps a little long (maybe 25 turns rather than 50) but otherwise a good step forward.

Alan
 
That's actually pretty impressive. I just checked RaRE and it has 333 downloads. That's way more than what I expected, particularly since it is a modmod I made for personal usage and I didn't promote it other than on the forum. I guess this mean we better kick some more life into the modding community. It's a bit idle at the moment and I fear I am to blame for that :cry:
Well you have done more modding work than almost anyone! :worship::goodjob: (BTW I have been abducted by aliens again, so I fear they are to blame for the lack of progress on a new 2071 version) :assimilate::eek: I guess I have lost track lately of the status of M:C. Is work on Civeffects complete and are any other planned changes pending? Once the M:C XML schemas are truly finalized it would be a good time to crank out some XML modmods. I hope it may eventually be possible to get the old xmlgen.pl to be usable again if it's known what tags need to be updated for the changed XML structure. (It had basically generated all the XML files with all appropriate cross-references between them already in place, which can be the main barrier to getting big XML mods off the ground)

BTW Alan, if you want to adjust the number of hammers it takes to build, you can edit the number in the line <iCost>50</iCost> . See, modding can be a lot easier than it looks (sometimes!):crazyeye::cool:
 
I guess I have lost track lately of the status of M:C. Is work on Civeffects complete and are any other planned changes pending?
No, that's the problem. I got stuck on finishing CivEffects for traits due to massive xml edits and I came up with the GUI editor. However non-modding stuff happened and that one too stalled. So many things depend on CivEffects, which mean nothing happens until I finished that one. This is why I said I'm to blame for the lack of activity.
 
Is it intentional that some of my resources are sold every turn? I've run into an issue twice now where I'm trying to complete something like the Garage, but the city keeps auto-selling hydrocarbons every turn. It put me below the required amount to finish, forcing me to ship more from a different city. This also goes for research -- I have an issue with both 'trade goods' and hydrocarbon where 1-2 of each resource gets sold each turn making it harder to complete research at the beginning of the game. I can't find any setting in the XML that might be causing this. I set a minimum 'keep' amount in the import/export screen to a high number, but that also doesn't seem to help. (I'm also seeing it with plasteel and artifacts)
 
It might be a balance issue with game length. (Longer games have larger city capacities and demands I think) It might also be that you need to build a warehouse building in order to store enough stuff for the task at hand.

If memory serves me stuff gets auto sold at a low price when you are over your storage limit in a city for a product.
 
Top Bottom