Wildmana 7.x - Offer your help! Coding, translating etc.

IMPORTANT : I'll do a complete changelog step by step. That way you can keep track and change what you don't like.
no need for a complete changelog, using winmerge I can see the changes very easily. If you still want to make a changelog, I suggest you only list the values of a leader that are characteristic (like a contactrand of 1 or 500) If he has a contactrand value similar to those of 85% of all other leaders, no need to mention it.

anyway, good luck and have fun :goodjob:
 
Will do as suggested (no detailed changelog is rather good for me !), and post results in a new thread, like Goodgimp.
 
I don't like how the AI to AI demands/give help/etc work. If I merge it in from my old options mod, would you be interested?


I looked at the source code and from what I can tell this is how it currently work:
  • Some things are still human-AI only, like asking to stop trading.
  • The chance of an AI accepting a demand from another AI is 100%.
  • There is no change in diplomatic relations.
  • Techs are picked at random as long as more than one team know them.
  • Basicly, it's a free gift with no consequences. Demands are just a free gift going the other way!

How it will work if I add my code:
  • If the AI can ask a human, it can ask an AI.
  • The chance of an AI accepting a demand is the same as them accepting it from a human. (If you prefer I can make it 2/3, like normal AI-AI deals. Otherwise the AI reject a lot of demands from other AIs.)
  • AIs will never make demands when they're at war. (that's just weird)
  • The AI demanding will get upset if the other side says no, happy if it says yes. The one being demanded from will get upset either way unless it was "asked for help". I *believe* this work as human-AI demanding/asking for help but I'm not certain as a lot of diplomacy code is not available.
  • When giving/asking for techs the AI is more likely to pick ones they value less. More likely to get accepted/less likely to give away a recently discovered really good tech.


Sadly it appears I've accidently deleted my code for making AI-human trading more fair compared to AI-AI trading. Maybe I'll find the time to remake it but that's unlikely so for now won't ask if you want it :p




***edit***
Alternatively, if there's some code (including bug finding/fixing) you'd like done that doesn't take too much time I can do that. I have some time to spare between now and january.
 
yes, I am sure there are better ways to code this than I did. The main problem I think is the limited information the AI currently has to plan grand strategies. Most of the decisions are based only on power. The AI should understand that a war against a more powerful enemy can be a good thing if it is likely to get support from other Nations.

thanks for the offer Snarko, but unfortunatly I have only very limited time at the moment, so if you come up with something really really great I probably wouldn't have the time to look at it for a month or maybe much longer.

One small thing (don't know how difficult it is) that could prove to be very useful in the future, not just in wildmana but in any FFH modmod is an easy way to change the bonus a building gives. Currently only Yield of buildings can be changed (the monument event for example can add food to the momument). It would be useful if it is possible to change the bonus a building gives with a single python command.

capturing the last city could then spawn a palace ruins which randomly grants one of the palace manas of the previous owner. Right now this would need to create 21 palace ruins buildings
 
Code is pretty much complete. Will upload source tomorrow. There's no code which actually does anything, only code which allow it. Opening a new thread for letting people test it wouldn't make much sense - I'll put the code here.

How it work:
Python/SDK only.
You tell the game "I want buildingCLASS X in city Y to produce T of bonus Z". It doesn't matter if the city has the building or not.
Buildings display the effect in the GUI, whether they're already built or can be.
NO code has been altered or removed. Only added. Should make merging easy.

What can be improved:
Should it be possible to change via an XML file? If so which and how?
AI doesn't take it into account when choosing what to build. Only matters if you change a building the city hasn't built yet.
If the building get the same bonus from XML (freebonus1-5) then it'll be displayed twice.
While negative numbers are possible they are not supported. Don't do it.
Anything else?
 
wow, that sounds great. Can't think of a use for a XML file. AI building choice is currently hardcoded a lot. Would be difficult anyway since there is no general calculation function yet on how much a bonus helps a specific civ. (death mana has same value for Elohim or Sheaim IIRC)

Looking forward to this. Thanks for your work.
 
Code commented like this
Spoiler :
Code:
/*************************************************************************************************/
/**	Change Building Bonuses  Snarko                                   					        **/
/**																								**/
/**						                                            							**/
/*************************************************************************************************/
Code:
/*************************************************************************************************/
/**	END Change Building Bonuses	                                        						**/
/*************************************************************************************************/


I did have one CtD when loading a save but it was most likely due to running out of memory (got a msg that windows had to increase size of the swap file). Repeated reloading of the same save did not reproduce the issue.


New functions
CvCity
int getBuildingBonusChange(BuildingClassTypes eBuildingClass, BonusTypes eBonus) //If you want to know what extra bonuses the building is producing (in that city). Used to display it in the city screen.

void setBuildingBonusChange(BuildingClassTypes eBuildingClass, BonusTypes eBonus, int iChange); //Changing the number of eBonus the building produce. This is the most useful function.

void changeBuildingBonusChange(BuildingClassTypes eBuildingClass, BonusTypes eBonus, int iChange); //I copied the code from something else and saw no reason to remove this. Haven't tried using it but it's a simple function so should be fine.

void calculateBuildingBonus(BuildingClassTypes eBuildingClass, BonusTypes eBonus, int iNumBuilding); //Used only when buildings are proccessed, to update the bonuses. Not intended to be used anywhere else. Leave it alone unless you do some really weird stuff bypassing proccessBuilding.

CyCity has getBuildingBonusChange and setBuildingBonusChange.
 

Attachments

Back
Top Bottom