[MOD] Colonization: 2071

Hi lampuiho,

Yes, the standard victory condition is to withstand an invasion of your colonized planets. If you play as one of the Human civs, your tyrannical Earth Government invades when you declare independence; if you play as an Alien civ then the Progenitor Overlords invade you instead.

Also available are the standard conditions of Conquest or Domination that can be turned on/off via custom game options. (The victory conditions are all described in the first popup window you see when you begin playing a game). ;) I think the special Transcendence Victory is not yet working with the current older DLL version but hopefully should be working in version 2.0 (which will be in beta by 2053 at the latest) :old:
 
While we are on the topic of victory conditions, I would like to add that I located the code to check if a player won. This mean I can add new behavior yo check for. The victory conditions are defined in CIV4VictoryInfo.xml, but you have to look in the code to see details on how each bool is checked. We can add more bools if we like to make brand new victory conditions.

While I'm not going to code this anytime soon it wouldn't be bad to consider what to add. For instance which rule(s) should apply to Transcendence Victory? Could we come up with other victory conditions? Something like an invention, which is only researchable when you have the end of all branches in the techtree. No Europeans left (yourself excluded). No aliens left (yourself excluded). We can come up with a lot of ideas for victory conditions, but I would like a playable game before we do something to end the game.
 
Phew, I think I better give up on trying to get Coast/Ocean terrains to work with the mapscript until a separate Space Domain is in. :crazyeye: It doesn't seem to be anything related to the latitudes, since it can generate the terrains using fractals with latitudes totally eliminated; hopefully it's just something that'll be resolved when there's a separate domain. In the meantime I'll replace the Coast terrain types from the design with Fertile terrain types having matching yields to keep everything balanced.
While we are on the topic of victory conditions, I would like to add that I located the code to check if a player won. This mean I can add new behavior yo check for. The victory conditions are defined in CIV4VictoryInfo.xml, but you have to look in the code to see details on how each bool is checked. We can add more bools if we like to make brand new victory conditions.

While I'm not going to code this anytime soon it wouldn't be bad to consider what to add. For instance which rule(s) should apply to Transcendence Victory? Could we come up with other victory conditions?
There are <VictoryThresholds> in buildingclassinfos.xml to allow a Victory criteria to include completion of certain numbers of certain Buildingclasses; I think those were used for Spaceship victory in Civ4, so I'm not sure if the code to actually use them is still active in Civ4col. That could allow conditions using a number of high-tier buildings, or also allow criteria using special pseudo-buildings (like in M:C, how many Relics you captured and turned into city buildings.)

I also see some leftover tags from Civ4 Cultural Victory:
<CityCulture>NONE</CityCulture>
<iNumCultureCities>0</iNumCultureCities>
<iTotalCultureRatio>0</iTotalCultureRatio>
I'm guessing those are currently not checked in the code, but maybe they could be reactivated to use the culturelevel of cities (based on YIELD_CULTURE / prosperity in M:C).

The old Transcendence Victory attempted to use <Industrialization> tag from the old Inventor Modcomp for a given amount of a yield sold to Earth, I think that may have been bugged in the old version but hopefully fixed now. In the old version I had been thinking of a special victory condition involving construction of an expensive improvement called the Janus Device which would let you access the Progenitor homeworld. But I think this might be more interesting simply as a top-tier tech you can use to construct the Device in space near an isolated colony, and if you protect it long enough to complete construction it will rip open several Wormhole tiles nearby to enable rapid transit to Earth. (probably done via a python Event that creates travelplots).
 
Phew, I think I better give up on trying to get Coast/Ocean terrains to work with the mapscript until a separate Space Domain is in. :crazyeye: It doesn't seem to be anything related to the latitudes, since it can generate the terrains using fractals with latitudes totally eliminated; hopefully it's just something that'll be resolved when there's a separate domain. In the meantime I'll replace the Coast terrain types from the design with Fertile terrain types having matching yields to keep everything balanced.
I still think you should focus on just getting the game to work. This mean adding all units, buildin, inventions etc from 1.42 and then be able to play in a way, which is somewhat similar to 1.42. Adding brand new features makes little sense until you have a working mod to add them to.

I think those were used for Spaceship victory in Civ4, so I'm not sure if the code to actually use them is still active in Civ4col.
Copying code from vanilla civ4 could be trivial. Victory conditions are placed in a fairly confined part of the code meaning it might be one or two blocks of code to simply copy.

The old Transcendence Victory attempted to use <Industrialization> tag from the old Inventor Modcomp for a given amount of a yield sold to Earth, I think that may have been bugged in the old version but hopefully fixed now. In the old version I had been thinking of a special victory condition involving construction of an expensive improvement called the Janus Device which would let you access the Progenitor homeworld. But I think this might be more interesting simply as a top-tier tech you can use to construct the Device in space near an isolated colony, and if you protect it long enough to complete construction it will rip open several Wormhole tiles nearby to enable rapid transit to Earth. (probably done via a python Event that creates travelplots).
That gave me an idea: teleport
It is a building, which has a value set, which is used as range. The range of a city is the range of the building present with the highest range. If two cities are within range of each other (both have teleporters), then the pathfinding algorithm will move from one to the other using 1 movement point (or whatever). This allows teleporting between neighbor planets, across water etc if you have the right tech. I don't know if the pathfinding is compatible with this idea (never looked at it), but if it is, then even the AI can figure out how to use this. Everything but the pathfinding appears to be trivial.

One question remain though: will it break gameplay if the AI is able to move troops around your blockades like this?
 
ok, but are there going to be any upcoming changes in the M:C DLL that will affect XML tags? I could make a start relatively soon on creating the Techs/Civicinfos xml tree, but if there are going to be any xml format changes (eg putting tech categories in civicoptioninfos) it would be best to make xml once the format is finalized; likewise for any planned change with equipment/promotions xml. OTOH I don't want to put off any other more pressing issues going on with the M:C DLL.

I do think I need to find a way to make the mapscript work much better than it currently does for the game even to be playable. With the number of yields now close to RaR, it's important that players can actually access them in order to use any of the resulting techs/units/buildings. In the current offline version I have, latitude is now totally removed and it's making terrain types using fractals without that, but the current results aren't going to be playable, and the entire Bioscience yield group will be totally inaccessible without any water. By tweaking how the fractals are generated I'm hoping I can make it work well enough to be playable; I'm also changing the base Terrain design to work around the absence of water, with all yield groups becoming accessible by land Terrains so the absence/presence/amount of water will have less of an overwhelming effect.
 
I don't think we will make major changes to XML. Considering the current development activity (or lack hereof) I would say we should focus on making the source stable and adding new features, not rewrite existing ones with little or no ingame benefits.

I think the map script should be postponed until we get an extra domain. I have been thinking. Maybe it would be better to add DOMAIN_PLANET_OCEAN. That way we will not conflict with the current code to place Europe access plots and stuff like that. On the other hand it could leave us with waves in the stars. Either way the map can't be finished until we get another domain. Maybe it would be an idea to make a game with all yields on land and get a fully working game that way without DLL modifications. I prefer not to add new features to a game until the game itself is working. Testing and bugfixing is way easier when you only change one thing at a time. Changing python, XML and DLL at the same time makes bugs come out of a mystery box with no real indication to where the cause is.
 
I'm getting the following Assert on creating techs:
Assert Failed
File: CvGlobals.cpp
Line: 3791
Expression: strcmp(szType, "NONE")==0 || strcmp(szType, "")==0
Message: info type 1 not found, Current XML file is: xml\GameInfo/CIV4CivicInfos.xml

Also I think I've gotten the resolution of the tech advisor screen to display appropriately, but the techs aren't showing up on it with the iX_Location and iY_Location set. Do you know what could be causing this or the assert? Other than coordinates the only tag where content is "1" would be <iChange>1</iChange> , but I think that's how it's supposed to be in the M:C and Tech modcomps.
 
Code:
<AllowsYields>
	[COLOR="red"]<AllowsYield>[/COLOR]
		<YieldType>YIELD_ACTINIDES</YieldType>
		<iChange>1</iChange>
	[COLOR="Red"]</AllowsYield>[/COLOR]
</AllowsYields>
You forgot the code written in red. Without it, the DLL will try to convert everything it finds to numbers. YIELD_ACTINIDES is 4, but no yield is named "1". With the correct XML formatting it looks up YIELD_ACTINIDES and then it writes 1 in the 4th location in the array (zero indexed).

Fusion cores has the same issue.

I decided against fixing this as you will most likely want to fix it in a script rather than manually. Also I can't make the assert tell more than it does without a major code design change. I guess we will just have to rely on the debugger to figure out precisely where it goes wrong if this happen again.
 
Doh! :crazyeye: with that fixed it now loads assert-free. It still isn't displaying techs in the tech advisor though; I also turned python exceptions on and no exceptions when opening the advisor. (edit: I think it may be cost requirements, I'll try adding those. I noticed none of the M:C techs have <RequiredYields>, is it still
<RequiredYields>
<RequiredYield>
<RequiredYieldType>YIELD_X</RequiredYieldType>
<iYieldCost>40</iYieldCost>
</RequiredYield>
</RequiredYields>
with <iCostToResearch> giving the number of units of YIELD_IDEAS needed?
 
I modified ARCHAEOLOGY (shouldn't that be TECH_ARCHAEOLOGY to keep to naming convention :confused:)
Code:
<InventionCategory/>
<iX_Location>0</iX_Location>
<iY_Location>0</iY_Location>
I replaced it with
Code:
<InventionCategory>MEDIEVAL_TRADE_TECH</InventionCategory>
<iX_Location>1</iX_Location>
<iY_Location>1</iY_Location>
Now I have one tech showing up. I thought location was enough, but category appears to be important as well.
 
Archaeology is one of the tech categories rather than a tech in itself; I think these are supposed to be declared by a civicinfos entry with an empty <InventionCategory/> tag .

It looks like the M:C techs themselves are named bare words; but I renamed the tech categories to start with TECH_CATEGORY_ and techs to start with TECH_ .

I moved all the tech categories to the top of the file to try to avoid any possible xml load order issues, but techs still aren't displaying. I'm not sure why it appeared for the specific combo you tried and not for these.. Is there any specific DLL behavior for some of the MC-hardcoded tags like MEDIEVAL_TRADE_TECH and the others? Or maybe it's expecting to start exactly at coordinate 1,1 ?
 
After a lot of trial and error I found things must have changed a great deal in the DLL from the original Inventor Modcomp used for 2071. Everything has to be given the same tag <InventionCategory>MEDIEVAL_TRADE_TECH</InventionCategory> , where before this was used for the category the tech belonged to. Another category NATIVE_TECH is still required by asserts from the DLL, but I'm not sure if anything that has this would be able to function as a tech. It's kind of cumbersome to have all these categories also declared as entries within civicinfos.xml itself, like you mentioned I agree it would be much better to try to simplify/consolidate this using civicoptioninfos.xml . But I've at least got it to work for now, although it looks like actual categories for techs aren't currently possible. Does anyone know how to shrink the text size in python to prevent it overflowing the box?
 
did you try plt.tight_layout?

@ Nightinggale; Just a suggestion concerning your teleport idea, you may want to check with Psicorps over in the Babylon 5 mod team thread (civ iv) as I think they have used that code as a base for their jump gates idea. They may be able to give you some ideas/thoughts to help you out.

Lol, sorry to jump into your thread like this, but I rather like your mod and have a habit of coming back to COL every 6-8 months or so just to see what's new. Immpressive.
 
After a lot of trial and error I found things must have changed a great deal in the DLL from the original Inventor Modcomp used for 2071. Everything has to be given the same tag <InventionCategory>MEDIEVAL_TRADE_TECH</InventionCategory> , where before this was used for the category the tech belonged to. Another category NATIVE_TECH is still required by asserts from the DLL, but I'm not sure if anything that has this would be able to function as a tech. It's kind of cumbersome to have all these categories also declared as entries within civicinfos.xml itself, like you mentioned I agree it would be much better to try to simplify/consolidate this using civicoptioninfos.xml . But I've at least got it to work for now, although it looks like actual categories for techs aren't currently possible. Does anyone know how to shrink the text size in python to prevent it overflowing the box?

edit: attached crop files for hrochland. thanks a lot hroch! :scan::goodjob:

Sorry just now seeing this. If you have any specific questions about M:C or the differences between that and other versions of the Inventor mod ask me in a PM so I want miss it. Yes, dealing with all the Civic infos, options, categories, and such are a pain. I once started to working to make it simpler but when I deleted some of the Civicoptionsinfos the game would crash on start up so I stopped working on it. And I must apologize for my naming conventions, it's call lazyness :mischief:

Has anyone heard from Nightinggale of late, I sent him a PM but no replies in a while?
 
No I haven't heard anything from Nightingale lately, hopefully he will come back sooon since his programming talents are much needed & appreciated!

I've created tech tree lines for production of raw and processed goods; in conjunction with carefully adjusting the production of terrain types, I've been balancing it to allow a gradual progression of available yields while ensuring that players always have something available to produce. The initial number of available yields are similar to the vanilla game, while the total number of possible yields that can be eventually unlocked are similar to RaR. It won't be mandatory to unlock all of these and you will probably research only a subset based on your particular situation and environment, making each game play out slightly differently from the last. Because of the balanced amount of yields available from terrains, there will always be something available for each player to produce, and the generic (always-available) yields are used as inputs for researching the more advanced and more valuable ones.

Kailric, is the feature of consuming certain yields to do research still functioning in M:C or was this disabled since the Inventor modcomp? I put yield costs in for each of the techs like below, but they're not showing up. (edit: I've attached a zip of civicinfos in case I've set something up incorrectly.)

<RequiredYields>
<RequiredYield>
<RequiredYieldType>YIELD_MACHINE_TOOLS</RequiredYieldType>
<iYieldCost>40</iYieldCost>
</RequiredYield>
</RequiredYields>

Also I wonder if you had any suggestions about how to get the tech screen to display well at multiple resolutions; I don't know if it's possible to make this screen more adaptive for multiple settings, but if so this could help a lot with usability of standard M:C as well. Thanks for the comments Drakarska, I'm a novice at python and don't know what plt.tight_layout is, do you have any pointers on how to do this? I have adjusted the font size downward and now the tech names fit within the box at high resolutions, but still overlap at some low resolutions; the spacing of the boxes themselves is also highly dependent on screen resolution and often overlaps at some settings as seen in the attached screenshot, but appears well spaced at some other settings.
 
Hmnn, good question. I haven't modded in a long time, so my skills are rusty. I believe there was a way to adjust for multiple rez's, but unfortunately I don't remember. As for your python skills, that's not a major issue. Just PM Platyping over in the BTS forums, as he is the local python Diety (he has done more stuff with python then I ever thought possible) and is extremely active on the boards. Additionally, I believe he (and several others) have created several python guides/excerpts over in the customization sub-forum. Nothing wrong with getting a little cross gamer help now and then :)
 
No I haven't heard anything from Nightingale lately, hopefully he will come back sooon since his programming talents are much needed & appreciated!

Kailric, is the feature of consuming certain yields to do research still functioning in M:C or was this disabled since the Inventor modcomp? I put yield costs in for each of the techs like below, but they're not showing up.

<RequiredYields>
<RequiredYield>
<RequiredYieldType>YIELD_MACHINE_TOOLS</RequiredYieldType>
<iYieldCost>40</iYieldCost>
</RequiredYield>
</RequiredYields>

Also I wonder if you had any suggestions about how to get the tech screen to display well at multiple resolutions; I don't know if it's possible to make this screen more adaptive for multiple settings, but if so this could help a lot with usability standard M:C as well. Thanks for the comments Drakarska, I'm a novice at python and don't know what plt.tight_layout is, do you have any pointers on how to do this? I have adjusted the font size downward and now the tech names fit within the box at high resolutions, but still overlap at some low resolutions; the spacing of the boxes themselves is also highly dependent on screen resolution and often overlaps at some settings as seen in the attached screenshot, but appears well spaced at some other settings.

I had decided not to go with the required yields to do research early on with M:C so this feature probably was not incorporated. I'll have to check into that for you and reactivate it. I'll have to download the production version of 2071 and see what can be done about the resolution.

I have been looking into the whole Building/Unit demand feature that Nightinggale added recently but I am having a hard time figuring out how to balance it all. You and him talked about this so do you have any ideas? Is this type of feature present in another mod already?

Also, I see one major draw back to this system and I think Nightinggale mentioned it and that is there is a limit to the number of goods you can sell each turn. The default is two, meaning you can only sell two units of one good per turn in each city. But, even if you raised that to 12 and say if you have 6 goods you would like to sell in a city you may could only sell up to 12 of any one good, depending on their demands, so some goods would not even get sold, causing you to have to micro manage which goods to sell.

What could be done is to divided the market cap by the number of goods you want to sell. So in the above example 12/6=2, so you would sell 2 of each good each turn. However, couple that with trying to balance out which buildings and units create a demand for which goods, how much of a demand, and making sure all goods are represented sounds like a complex system to balance out so I am not so sold on this feature just yet. I think a more practical and simpler solution is to stick with what I had originally started, with the auto selling of goods, except lower the profits made from auto selling so you are not receiving 100% profit and thus you make more profit from manually trading with other Towns or along Trade Routes.

Also, after playing around with it I don't really like the idea of buildings having a "demand". They already have a "demand" as far was what they need in order to produce a good so this seems like overkill and a confusing addition. This system could still be utilized if we found a good balance but instead of calling it a "demand" just change the terminology, like I had started, in that certain buildings allow goods to be sold at the local market, like an Inn would allow Wine to be sold at the local market instead of calling it a "demand". Just changing the terminology would make this a less confusing feature but still have the same mechanics. Units having a "demand" is another question and I'll address this in another post as I have a special ideal on this.

The post is here http://forums.civfanatics.com/showpost.php?p=12945073&postcount=20
 
Phew, I have figured out how to restore the feature of using certain yields to do research, so it is not missing after all :king: Apparently there just needs to be <iCosttoResearch> as well as <RequiredYields> for this to function. I think it will be interesting to let advanced yields be inputs for researching certain techs which give an in-game advantage. That way there can be good strategic reasons for wanting acquiring certain good types, not just to always sell everything all of the time. I'm still clueless about improving the python screen format, maybe I should PM platyping but I'm not sure he even does Civ4Col related stuff.

One other python thing I've really wanted to add is some way to make the tiny Yield icons more clear to players. For mods like this, M:C, and RaR with lots of new yield types it's hard to tell from the little yield icons in pedia and other screens what that yield is. It would be good to add the yield's text name in some Pedia screens or maybe enable a mouseover tooltip to show the yield's name.

I have been looking into the whole Building/Unit demand feature that Nightinggale added recently but I am having a hard time figuring out how to balance it all
The mods that have used Domestic Markets include RaR, Androrc's mods, and old 2071; I am not sure how they balanced things, but I probably just did it how I felt was most appropriate for the units and could try to be more systematic in future lol. The big benefit from allowing local prices to adjust based on supply/demand is that creates a powerful self-balancing mechanism which should help a lot. As a starting point you could let each unit demand one or two of the processed good types, whichever you think are appropriate (e.g. Ale could be favored by working-class unit types while Wine could be favored by upper-class ones. I know Monks like their booze for sure!:p). Not all the goods have to get a demand; if you want you could have only a few of the goods be consumer goods and the rest be traded normally. In fact it might also be interesting to let some goods such as Ale have relatively low prices in "Europe" and trade screens but generate a good amount of demand from your citizens, that way it could sometimes make sense to want to import some Ale from abroad.

The building demands as currently implemented could be an interesting option that lets some buildings consume or export certain goods (ie consuming some of your finished yields for gold, which is different from a citizen using raw goods to produce something else). I agree I don't think I would use building demands very extensively in 2071, but it would be cool for a few special cases such as a Smuggler's Lair that can generate demand for certain nefarious goods :scan: For M:C, perhaps a Caravan Route could be a neat option that adds a demand to sell certain goods for export. But, I also think it's actually a good idea you had to add a buildinginfos tag that unlocks local sales of a certain good, for instance Tavern unlocking the local consumption of Ale & Wine etc.

I agree I'm not sure why the default total sales cap is so low, it could be higher for M:C which will depend a lot on domestic consumption. Still, you could use the chain of Market type buildings to raise this cap, it makes sense that towns with a larger Marketplace would be able to handle much more of these local sales.
 
@ Nightinggale; Just a suggestion concerning your teleport idea, you may want to check with Psicorps over in the Babylon 5 mod team thread (civ iv) as I think they have used that code as a base for their jump gates idea. They may be able to give you some ideas/thoughts to help you out.
That sounds interesting. In fact just trying more Civ4 mods (with sources) might not be a bad idea for rapid expansion of the code base.

No I haven't heard anything from Nightingale lately
Me neither. I think he teleported off the planet or something
teleport.gif


I agree I'm not sure why the default total sales cap is so low, it could be higher for M:C which will depend a lot on domestic consumption. Still, you could use the chain of Market type buildings to raise this cap, it makes sense that towns with a larger Marketplace would be able to handle much more of these local sales.
The initial cap is set in XML and I didn't put much thought into it. At the time I had no idea what the right number should be so I just wrote something. It might be way too low and it might be just right depending on how much buildings increase this and how soon you can build buildings to increase the cap.

Reading what you wrote about this gives me an idea. Right now the cap bonus to buildings is absolute. We could add a new field, which is the bonus for each citizen. Sure this number shouldn't be int as steps of 1 per citizen is a bit too big for a minimum setting. Doing this will encourage big city building, specially if we combine it with buildings, which increase profit for each yield sold (+X% to price). This would reward big cities, which in turn encourage the player to increase the population cap. Aiming hard at the population cap is a tradeoff as certain other stuff isn't build, which can cause problems later. This will hopefully lead to strategic decision making, which ends up as an improvement to the gameplay.
 
Phew, I have figured out how to restore the feature of using certain yields to do research, so it is not missing after all :king: Apparently there just needs to be <iCosttoResearch> as well as <RequiredYields> for this to function. I think it will be interesting to let advanced yields be inputs for researching certain techs which give an in-game advantage. That way there can be good strategic reasons for wanting acquiring certain good types, not just to always sell everything all of the time. I'm still clueless about improving the python screen format, maybe I should PM platyping but I'm not sure he even does Civ4Col related stuff.

One other python thing I've really wanted to add is some way to make the tiny Yield icons more clear to players. For mods like this, M:C, and RaR with lots of new yield types it's hard to tell from the little yield icons in pedia and other screens what that yield is. It would be good to add the yield's text name in some Pedia screens or maybe enable a mouseover tooltip to show the yield's name.


The mods that have used Domestic Markets include RaR, Androrc's mods, and old 2071; I am not sure how they balanced things, but I probably just did it how I felt was most appropriate for the units and could try to be more systematic in future lol. The big benefit from allowing local prices to adjust based on supply/demand is that creates a powerful self-balancing mechanism which should help a lot. As a starting point you could let each unit demand one or two of the processed good types, whichever you think are appropriate (e.g. Ale could be favored by working-class unit types while Wine could be favored by upper-class ones. I know Monks like their booze for sure!:p). Not all the goods have to get a demand; if you want you could have only a few of the goods be consumer goods and the rest be traded normally. In fact it might also be interesting to let some goods such as Ale have relatively low prices in "Europe" and trade screens but generate a good amount of demand from your citizens, that way it could sometimes make sense to want to import some Ale from abroad.

The building demands as currently implemented could be an interesting option that lets some buildings consume or export certain goods (ie consuming some of your finished yields for gold, which is different from a citizen using raw goods to produce something else). I agree I don't think I would use building demands very extensively in 2071, but it would be cool for a few special cases such as a Smuggler's Lair that can generate demand for certain nefarious goods :scan: For M:C, perhaps a Caravan Route could be a neat option that adds a demand to sell certain goods for export. But, I also think it's actually a good idea you had to add a buildinginfos tag that unlocks local sales of a certain good, for instance Tavern unlocking the local consumption of Ale & Wine etc.

I agree I'm not sure why the default total sales cap is so low, it could be higher for M:C which will depend a lot on domestic consumption. Still, you could use the chain of Market type buildings to raise this cap, it makes sense that towns with a larger Marketplace would be able to handle much more of these local sales.

Platy jumps from project to project, and absolutely loves any type of Python challenge (I think he takes it as a personnel affront at times if he can't figure something out :crazyeye:), so PM'ing for help really shouldn't be an issue. After all, the worse that could happen is him saying no, right :)

As for the Python buttons, yields, etc, did you take a peek over in the Civ IV/BTS tech forums like I suggested? Python is used quite extensively in several of the most popular mods (including the one in my sig :eek:), and there is nothing wrong with asking for a little input ;).

While I haven't modded in a rather long time, taking a quick peek at the code looks quite similar to vanilla civ (lol, if I remember correctly). IMO, getting some cross modder help could bring in all sorts of possibilities. After all, you folks don't have to be on your own little planet after all, do you :mischief:?
 
Back
Top Bottom