A shopping list of elements I want to employ

lindsay40k

Emperor
Joined
Mar 13, 2009
Messages
1,696
Location
England
I've been working for some time on a rules set that could be implemented as a Civ mod. It's got some features I'm not sure how to implement, though. Right now I'm asking for community opinions on feasibility, not soliciting free code for my personal project! (In all cases, assume the player controls a single city.)

(1) Is it possible to make a Dark Age system, parallel to the Golden Age system, and having a similar but incompatible (triggering one cancels the other) effect?

Is it possible to make techs that:
(2) require the player to have a certain building constructed
(3) require the player to run a certain specialist
(4) increase in cost if certain other techs are researched
(5) are unlocked by spending accumulated values (be they labelled as money, beakers, culture or whatever) as opposed to filling a bucket of beakers turn by turn

Is it possible to make buildables (units, buildings, etc) that:
(6) require the player to run a certain specialist
(7) require the player to be in a Golden (or Dark) Age

Is it possible to make specialists that:
(8) have a cost to recruit
(9) have a cost to recruit that varies with the number of certain specialists
(10) have a cost to recruit that varies with the square of the number of certain specialists
(11) have an upkeep cost
(12) have an upkeep cost that varies with the number of certain specialists
(13) have a cost that varies with the square of the number of certain specialists

(14) Is it possible to make a diplo option to spend money to gift someone a Golden Age?

(15) Is it possible to increase the cost of all techs from an era until a tech from that era has been researched?

(16) Is it possible to make starvation cause unhappiness rather than population loss?
(17) Is it possible to make food surplus generate wealth rather than population growth?

(17) Is it possible to make unit construction reduce population by one?

(18) Is it possible to make population growth happen on the basis of a RNG with success likelihood determined by certain techs and whether or not a food surplus exists?

(19) Is it possible to make a cap on (population plus number of units)?

(20) If (19) is possible, would it be possible to make functions that reduce one player's population cap and increase another player's cap?

(21) Is it possible to make the death of a friendly unit have a likelihood of making a specialist appear in the player's city?

(22) Is it possible to permanently add points to scores, so as to make a 'victory points' system?

(23) Are global projects, like the Civ V World's Fair, doable?

Many thanks for any answers people provide :)
 
All buildings, techs, units etc can be enabled or disabled via canConstruct, cannotTrain etc in CvGameUtils, and of course these can be done in dll also.

Spending points for gaining tech is already in the game. Advanced mode.

17, 18, 21 not hard to code.
 
Thanks, that's helpful! What is advanced mode - I've not heard of it and google's not helping?
 
Advanced Start or whatever it is called. One of the game options that gives you points to place your cities, add techs etc at start of game.
 
Oooh, that! Silly me :)

Hmm. So, the hooks exist to have a menu where you can press a buttons d spend accumulated values to gain a tech. I wonder if it will be possible to have those values go up and down as other techs are gained.
 
I would say that all of your items are doable. Some would require some heavy DLL modifications.

And the specialist stuff would likely require a major interface change as well. Currently you can just add and subtract specialists whenever you want. If you want to institute a "cost" for doing so, you would need to let the player adjust their specialists and then click a submit button to lock in their selections (and subtract the cost).

You have a lot of interesting ideas. I'm looking forward to seeing your game develop.
 
That's reassuring. I don't know if I'll ever be able to make more than a proof of concept, but thanks for the vote of confidence :)

Yes, the interface would be a radical departure from the default one.

(24): Is it possible to manually position techs on the tree?

(25): Is it possible to give techs a 'class' that determines how other techs relate to them? (Example: Ironworking and Tumbaga are both classed as Level 3 Metalurgy. Quicksilver can be researched if one has a Level 3 Metallurgy tech. Plough can be researched if one has Ironworking.) A manual workaround is possible, but I'd prefer to automate.
 
(24): Is it possible to manually position techs on the tree?.

Not sure I understand this - they are all manually positioned as you define the X and Y position in the XML for technologies.

(25): Is it possible to give techs a 'class' that determines how other techs relate to them? (Example: Ironworking and Tumbaga are both classed as Level 3 Metalurgy. Quicksilver can be researched if one has a Level 3 Metallurgy tech. Plough can be researched if one has Ironworking.) A manual workaround is possible, but I'd prefer to automate.

You can have techs require one or more techs you would just need to list them. You can also do A and (B or C) in the XML. Doing (A or B) and (C or D) would require code.

If you want techs to be coloured by group in the tree in some way that is also possible with Python code. I do that in a mod I am working on using a slight variation to Platyping's techtree code.
 
Those are helpful answers, @Dancing Hoskuld. Regarding tech requirements: is "(A or B or C) and (D or E or F or G or H)" possible?

The colours for tech groups - how large a palette do we have to work with? Ideally, I'll have at least a hundred… can work with much less, though.
 
I hope to use adapted Terra map scripts that add two new terrain types - Land Bridge and Glacier. They use the Plains Hill and Ice graphics, respectively, and behave exactly as the above. The start date is 10,000 BC and all continental masses are connected by Land Bridges. Global Warming is in effect from the start, and causes Glaciers to disappear and Land Bridges to change into Reefs (Coastal waters that provide cover but have a strong chance of destroying naval units as they move through).

(26): If terrain becomes impassable between a player's turns, is it possible to have their units deposited on the nearest navigable terrain, as if some open borders had closed?

(27): If leaderheads are static image files, is it possible to have images that are used in place of the 'angry' and 'pleased' diplo reaction animations?
 
Those are helpful answers, @Dancing Hoskuld. Regarding tech requirements: is "(A or B or C) and (D or E or F or G or H)" possible?
Not out of the box with existing code and XML. You can only do A and (B or C or D or ...) with zero or more techs in the OR block.

You could modify the DLL to expand on this.
 
It is possible, sort of, to have Y needs "(A or B or C) and (D or E or F or G or H)" in XML but you would need to add another tech Z where Z needs "(A or B or C)" then Y needs "Z and (D or E or F or G or H)"
 
Of course from a player perspective this means that an additional tech has to be researched.
 
It's a workaround that would fit into most of what I've developed :)
 
(27): If leaderheads are static image files, is it possible to have images that are used in place of the 'angry' and 'pleased' diplo reaction animations?

Yes. His Holiness in the Charlemagne scenario does this.
 
Of course from a player perspective this means that an additional tech has to be researched.

Not necessarily. If you check whenever a tech is researched or acquired you could give that joining tech for free when all the and prerequisites have been got. Slow if you don't code it right.
 
I would say that all of your items are doable. Some would require some heavy DLL modifications.
I agree. I went though the entire list (all 27 as you have now). GUI stuff tend to be python only (possibly aided by xml) while the rest are in the DLL and can be modded in the DLL. There are cases where the DLL makes use of python and xml, which unlocks the ability to mod it there as well. Personally I recommend DLL rather than python changes if possible for various reasons, most noteworthy debugging ability and performance.

Having said all are possible to implement, I question if all are worth it. I'm thinking gameplay benefits vs coding time and coding difficulty.


Regarding tech requirements: is "(A or B or C) and (D or E or F or G or H)" possible?
I did something like that for M:C. Well not completely, but something somewhat similar. Instead of just having one tech for AND and OR, I made lists, meaning I can make a tech require 9 techs if I like as there is no hardcoded max. It would be a bit more complex to code "(or list) and (or list)", but certainly doable. In fact requirements can be made to whatever you like. You could require a minimum of X cities for a tech to be researchable and place X in xml. Do note that changing conditions of a tech requirements like this is DLL only. While it might be doable to do something in python in a hackish way, it will never be good code and the DLL needs to be modded to handle xml changes.

(3) require the player to run a certain specialist
Somewhat easy to implement, but could be tricky to do without a significant slowdown. You need to check one int or one index in an array when checking this. Making a check, which loops though cities/specialists will come back to haunt your performance when you play real games and not just small test games. General rule is avoid looping as much as possible in all functions, which starts with can (canBuild, canMove etc) because the AI use those heavily and they should be fast.
 
performance.

Yes some of the calls from the dll to Python were never optimised and so should be used with care. These are the ones defined in the Python Callbacks XML file.

I did something like that for M:C. Well not completely, but something somewhat similar. Instead of just having one tech for AND and OR, I made lists, meaning I can make a tech require 9 techs if I like as there is no hardcoded max.

The number of elements allowed in any of the lists is not hard coded but specified in one of the global XML files. An obvious way of giving variable lengths but why they did not go with lists to start with I am not sure.
 
Thanks for replies, I guessed that this project would produce a pretty bloated and inelegant end result but it's primary purpose would be as a rules demo :)
 
Not necessarily. If you check whenever a tech is researched or acquired you could give that joining tech for free when all the and prerequisites have been got. Slow if you don't code it right.

Actually, this would resolve an issue I've been considering and streamline various things. So: researching Iron Working or Tumbaga will also give one the tech 'Metalworking Lv 3'. Plough requires Iron Working. Quicksilver requires Metalworking Lv 3.
 
Back
Top Bottom