questions concerning modding

Various topics about the game, the website, or anything else Freeciv related that doesn't fit elsewhere.
Post Reply
letsdance
Posts: 7
Joined: Fri Aug 09, 2013 9:05 pm

questions concerning modding

Post by letsdance »

hi all!

thank you for recreating civ =). this is a great project. i tried to mod a few things and have a few questions, maybe you can help me.

1. in game.ruleset i set tech_leakage = 3. the help text reads:
; 3 - Technology cost is reduced depending on the number of normal
; players (human and AI) which already know the tech.
i started a new game and waited 150 turns without doing anything. the costs for the start techs was still the same. why? i also used tech_cost_style = 1 and base_tech_cost = 30. how exactly does tech leakage work?

2. how does flags="IgWall" in units.ruleset work? i am asking because i played with city wall defense bonus. if i add another defense bonus that only triggers with a city wall AND some other requirement, will it also be ignored by such units? what about other defense boni (fortress for example, or other buildings or just techs?). is it possible to add a "downgraded" city wall with lower defense bonus and have it be ignored by igWall units as well?

3. how is the AI coded? i moved the warrior code tech behind feudalism. will the AI try to research it immediately, like it probably would normally. or is it intelligent enough to choose from existing options? same with units: i kind of replaced archers by elephants. does the AI recognise, a tech gives units with certain AI flags (like AttackStrong) and uses this as basis for research decisions? i rearranged some techs and increased tech cost by about 50 %, can the AI cope with this (it looks like, but it seemed to build less wonders altough it had the needed techs, in my recent test game)

4. how does MinSize work in effects.ruleset? could you give an example? everything i tried just produces an error message and i couldn't find it used anywhere to copy it. i wanted to add a Defense_Bonus that triggers with citysize 3+.

5. is there a good way to test if my Defense_Bonus modifications work? like a combat log that shows those modifiers?

6. is it possible to trigger an effect when researching a technology? for example, lets say i want philosophy to give a free tech to everyone, not just to the first who researches it. i could use the Give_Imm_Tech effect. but currently it seems i can't trigger it.

thx,
Last edited by letsdance on Sun Aug 11, 2013 11:17 am, edited 3 times in total.
dance!
cazfi
Elite
Posts: 3077
Joined: Tue Jan 29, 2013 6:54 pm

Re: questions concerning modding

Post by cazfi »

letsdance wrote:2. how does flags="IgWall" in units.ruleset work? i am asking because i played with city wall defense bonus. if i add another defense bonus that only triggers with a city wall AND some other requirement, will it also be ignored by such units? what about other defense boni (fortress for example, or other buildings or just techs?). is it possible to add a "downgraded" city wall with lower defense bonus and have it be ignored by igWall units as well?
As currently implemented, IgWall units ignore any "Defend_Bonus" effects of the defender. Name "IgWall" refers more to its traditional use than its current overall behavior. Were you to give that flag to sea unit for example, it would ignore coastal defense.
Fortress usually has its defense value defined as value in its base -section and not as "Defend_Bonus" effect, so it's not subject to IgWall. Then again, if you want, I don't see anything preventing you from setting defense value in base -section to 0, and adding "Defend_Bonus" effect(s) with requirement "Base" "Fortress" "Local" instead.
letsdance wrote:3. how is the AI coded? i moved the warrior code tech behind feudalism. will the AI try to research it immediately, like it probably would normally. or is it intelligent enough to choose from existing options? same with units: i kind of replaced archers by elephants. does the AI recognise, a tech gives units with certain AI flags (like AttackStrong) and uses this as basis for research decisions? i rearranged some techs and increased tech cost by about 50 %, can the AI cope with this (it looks like, but it seemed to build less wonders altough it had the needed techs, in my recent test game)
For this basic ruleset changes AI should be able to cope.
letsdance wrote:4. how does MinSize work in effects.ruleset? could you give an example? everything i tried just produces an error message and i couldn't find it used anywhere to copy it. i wanted to add a Defense_Bonus that triggers with citysize 3+.
[effect_big_city_defense]
name = "Defend_Bonus"
value = 100
reqs =
{ "type", "name", "range"
"MinSize", "3", "City"
}
letsdance wrote:5. is there a good way to test if my Defense_Bonus modifications work? like a combat log that shows those modifiers?
The victory probability values you get when middle-clicking potential target may help you some way.
letsdance
Posts: 7
Joined: Fri Aug 09, 2013 9:05 pm

Re: questions concerning modding

Post by letsdance »

thank you for the quick reply!
dance!
letsdance
Posts: 7
Joined: Fri Aug 09, 2013 9:05 pm

Re: questions concerning modding

Post by letsdance »

i found part of the answer to 1. in the code of tech.c. tech leakage is supposed to reduce the tech costs by the percentage of other players who already know the tech. example: if 50 % of all other players know the tech, my tech cost should be reduced by 50 %. if all other know the tech, i should get it for free?

it seems to work, but the reduced tech cost is not displayed. instead the research is simply finished earlier.
dance!
Post Reply