World History Mod Conversation

Ok, but what version of M:C are you using and what all has been changed to fit the new Civics?
Well, I just took the Civ4CivicInfos.xml from the version before the civics and simply expanded the tech tree following Lib.spi't's plan. All the changes are only in this file.
I don't understand what is happening here. Could you be more specific?
When I expanded the tech tree, carpentry had to be researched first, as well as farming. when I tested the expanded tech tree, I found a couple of bugs about this, probably because the AI couldn't have those buildings and those professions from the begining.
Hmm, this is an interesting dilemma. Who where the "inventors" or ancient times?
I had my idea about this. When we research the tech tree, we can have a Shaman's hut to do the Stone Age researching.
But I thought we could research by generating candles, as usual OR by using other yields cheaply, for example lumber when researching archery.
Therefore, a Civ on a desert can take 20 turns to discover it in the traditional way (with candles), or a civ in forested areas can take 10 using the wood arround.
This way, a Civ can follow and develope traits according to the terrain arround: Civs in forrested areas are beter bowmen and ship builders, or at least they mastered it earlier.
 
Yeah, the whole tech problem is not an issue, I just haven't written it down yet.

The problem with the locked buildings and the assert is that currently the code says to build a carpenter and a village hall, but the carpenter is locked.

I jusst need to learn where the various 'city types' are defined with what buildings they get on founding and add some new ones, it is not an issue it is just a job that needs to be done.

The only 'Real' issue with the tech tree as it is is why these arrows are being weird.

As TW said, all that has been changed is the civicinfos file, my version of M:C is also pre-civics push, I haven't got around to updating it yet.
 
I had my idea about this. When we research the tech tree, we can have a Shaman's hut to do the Stone Age researching.
But I thought we could research by generating candles, as usual OR by using other yields cheaply, for example lumber when researching archery.
Therefore, a Civ on a desert can take 20 turns to discover it in the traditional way (with candles), or a civ in forested areas can take 10 using the wood arround.
This way, a Civ can follow and develope traits according to the terrain arround: Civs in forrested areas are beter bowmen and ship builders, or at least they mastered it earlier.

I personally would call it just a Tinker's hut as shaman seems more like a Medicine man/Spiritual person and could be good for a beginning Religious Unit. You could start out the game with few Master's or Experts if any. And then as you discover new techs you unlock the Master's and Experts. So, there wouldn't be an Prolific Inventor till say the Middle Ages. Also, we could add another level like Artisan that are better than Masters.

I like the idea of requiring other yields like lumber. I wanted to add this to M:C but the AI really isn't programed for it yet so I haven't done that it. I think they skip this part, not sure though.


I jusst need to learn where the various 'city types' are defined with what buildings they get on founding and add some new ones, it is not an issue it is just a job that needs to be done.

The only 'Real' issue with the tech tree as it is is why these arrows are being weird.

As TW said, all that has been changed is the civicinfos file, my version of M:C is also pre-civics push, I haven't got around to updating it yet.

In Professions you find the iFoundCityType, like Monks will found CITYTYPE_MONASTERY. Monks will only be allowed to found Monasteries.

Then in CIV4BuidingInfos.xml you will find iCityType. Currently BUILDING_SHRINE is set to CITYTYPE_MONASTERY. So, Shrines can only be built in this city type.

Then we have the iFreeToCityType in CIV4BuildingInfos.xml. Example: BUILDING_MONASTERY has iFreeToCityType = CITYTYPE_MONASTERY, so when you found a Monastery they receive this Building for free.

The City types are:
Code:
CITYTYPE_DEFAULT = -1,
CITYTYPE_COMMERCE,
CITYTYPE_MONASTERY,
CITYTYPE_OUTPOST,
CITYTYPE_BAILEY,
CITYTYPE_CASTLE,
CITYTYPE_MILITARY,
CITYTYPE_NONE_MILITARY,
CITYTYPE_NONE_MONASTERY,

Military units build Outposts. The other ones may not be used atm in M:C. For WHM we can add new city types to the list if need be, it is not a problem, and then you can configure the XML to add what ever buildings you like :):goodjob:


If there are any aspects to the mod you don't understand just ask:confused::)

I'll see if I can't switch back to the pre civic branch and figure out your arrow troubles.

Edit: In M:C the AI attempts to keep a balance of Commerce, Monasteries, and Outpost city types. New CityTypes would need to be added to the AI's allocation.
 
What file is the city types list in? I assume DLL, but adding to the list should be easy.

For the ancient era my current plan is to have a 'cave' building at the start of the game, that will be able to chose 1 yield of loyalty, tech, culture or hammer (probably) then in the early game, one cave man can work in the cave and produce which ever 1 is needed. I want the orginal cities to have only the starting square, and it has to grow 1 level of culture to get the 8 squares.

For early classical research I intend to have Salons or Academies (I think there is another name but it escapes me) with Philosophers as a classical tech expert, with inventors arriving in the renaissance and monks in medi.

Yeah I also thought about the idea of multiple 'higher levels' for experts, with things like a 'dynastic' level of expertise, representing a family business that has been going for generations (thus I don't have to kill people off) 1 person just represents a family dynasty!
 
I like the idea of requiring other yields like lumber. I wanted to add this to M:C but the AI really isn't programed for it yet so I haven't done that it. I think they skip this part, not sure though.
I have an idea regarding the AI and yields. The AI sets feeder service for everything. The "manually set" input (like the one human players set) will then be set to building input for X turns (3 turns?). Feeder service already has a buildin automatic increase of threshold to supply the building currently under construction meaning the AI will figure out how to move yields between cities to supply construction.

Port cities will be an issue. They shouldn't use feeder service, just input and export, but they shouldn't move yields between them (loops). I haven't figured out how to solve that one.

Priority (I think I already committed my changes for this)
Buildings gets a value bonus
Double value if importing city has feeder service

This mean the AI will then most often deliver first to construction, then to building input and after that they export to Europe.

If/once this is working, getting the AI to figure out yields for inventions shouldn't be tricky as they will "just" be viewed as input to a building.

Edit: In M:C the AI attempts to keep a balance of Commerce, Monasteries, and Outpost city types. New CityTypes would need to be added to the AI's allocation.
Maybe we could move that decision to XML. Something like adding weight to XML. Say we set weight of each city type to 5, then it will make an equal amount of each. If one is 1 and the other is 5, then it will try to match a 1:5 radio. If it knows this, from XML, then the decision in DLL should be generic based on looping XML. A more advanced step would be to not allow all city types at all time and then the AI should figure that out and not consider the unavailable types. Something like how new units are generated at the docks, except it should take existing cities into account.
 
Yes, I want to try and plan something like changing city types throughout the ages, I haven't figured it out exactly yet though, obviously medi is done, for classical I am thinking something like cities, provinces and barrack towns. Colonial would be early colonies, late colonies and cities, Industrial would be something like rural and industrial.

If we could some how make it that certain buildings would change a city type as well that would be good, so that they can change to keep up with the eras...
 
Yes, I want to try and plan something like changing city types throughout the ages,
The type is set when the city is founded and can't be changed later on. This mean if you make a "hunter camp" city, it will remain a stone age city even during the industrial revolution. For your idea to work, you will have to come up with a system, which allows changing the type. I'm not asking you to code it (don't break our DLL. It isn't FTTW :p). However you might be able to figure out an overall change city type concept.

Changing the type appears not to be tricky from a coding point of view. The type is a variable, which can be overwritten at any time. The question is how should the game treat it?

I suppose we could do something like changing the city type and then loop all buildings. Any building present in the city, which can no longer be build in the city will be removed.

Actually that would make good sense as it will allow say the stone age flint "refining" building to be placed at the same place as the armorsmith, which is then replaced later by tank factory.

Oh maybe we really should do something about moving city python code to a file of its own. If it runs init each time we open the city screen, then we can generate the building layout on the fly. We can then have say 3 luxury producing building slots, but 5 buildings to pick from. If we need a dedicated slot for each building, then we would need a lot of often empty space and a lot of really tiny buildings to make it fit. Col2071 has it bad enough with all buildings present right now. I imagine a world history setup will contain even more buildings and quite a number of those are unlikely to have at the same time. It would be rather nice if we could come up with a clever design for auto reallocation of building places on the city screen.
 
Yeah my basic 'city changing' system would probably be centred around the town hall building, so for example you start with a cave, then in the classical age you unlock a 'village hall' which changes the city type to some kind of 'classical town' which then allows you to replace your 'caves' with specific types of houses or workshops or what ever. then when new 'classical peasant' founds a city it gets the classical city type which auto builds the village hall and carpentry house (or whatever).

The other part of it is banning certain units from certain types of buildings, like a caveman can only use caves or be educated in a school.

I presume we could do something like this one of two ways, either giving them negatives to yield production, or perhaps a kind of 'stealth censure' that comes with a tech and stops X unit type from working in X buildings (like the religious units in religious buildings).

I am still fairly early in my thought process with this. I just remember you saying once upon a time that we could change city types on the fly.
 
You wouldn't have to change city types - you can create base buildings like Cave / Hunter Camp / Classical Forum / Town Center etc for the ages you want, and apply any effects or prereqs you want in their XML; and let techs/civics update or replace these using any criteria you set up. You can also use "invisible" abstract buildings to mod any special effects or prereqs you want, mods like FfH use nondisplayed Buildings all the time to represent city spell effects or statuses. The graphic appearance of cities is set in Buildings/CIV4CityLSystem.xml and can change depending on Era in EraInfos. (I think currently the Era changes based on # of turns elapsed, it might be cool to bring back Era changing based on tech progress like in Civ4.)

If you want the same building like Cave to host multiple profession options, I think multiple professions per building isn't currently in M:C, but maybe could be adopted from RaR.
 
yeah I think originally I thought, that the 'armour code' would do mutiple professions, then there was a discussion and I found out it was slightly different as it was same input different output for armour code (I still plan to use this for a smelter profession for ore to metals), then it was briefly discussed to bring it over from RaR as it would be a useful feature to just be available.

With the changing city types I feel fairly confident that it can be done and hopefully without too much extra effort on a 'new code' side, but it is so far down the list that I am not really ready to formulate the solution (I still have so much to learn about how col does things, not to mention still haveing to design let aloone implent over 100 more techs, then yields, units, professions.....)

When the moment comes I think I will do a new topic to brainstorm the ideas and methods, and from that we can then design and implement the system... That day is still a long way away though! :D
 
Ok, quick learning time question.

I did a quick 'scout' of yield code in the DLL, for the purposes of adding new yields.

CyEnumsInterface.cpp
Yields_Mod_Name.cpp

These are the two files I found with yield lists (obviously not mod name but I think you get my meaning) are there any other DLL files involved in adding a new yield?
 
Ok, quick learning time question.

I did a quick 'scout' of yield code in the DLL, for the purposes of adding new yields.

CyEnumsInterface.cpp
Yields_Mod_Name.cpp

These are the two files I found with yield lists (obviously not mod name but I think you get my meaning) are there any other DLL files involved in adding a new yield?

This would be a question for Nightinggale as he has changed up the Yields so much that I don't even know what's going on. Looks like he may have set it up so that you just need to mod those two files as before there were several places you would need to add the new Yield in order for the AI to understand it correctly but all those places seem to be commented out now.
 
You set up the enum in Yields_Mod_Name.h. Then you set up the groups in Yields_Mod_Name.cpp. The groups tells the AI how to handle the yields, like what to buy from Europe and what are supposed to be exported.

There are some other stuff, which needs to be set up, but I wrote a perl script to do that. That script is scripts\yield.pl, but it will need updating to handle more mods. In fact now that I think about it, I might rewrite it into not taking arguments at all. Instead it will find all mods based on filenames in the source code and update the code accordingly.
 
Ooh well done night!

So does the .pl script change things in the .dll or python and XML files? What's does the script do? What files does it tinker with?

Also on an unrelated note, do you think it would be possible to make a profession require a building? So example you cannot become a monk (outside) without a chapel. The real reason I ask is because I am thinking of making ships into professions, so they require a dock, etc.

Now know it can be done for built things and internal professions, I am just wondering if it can be extended to this?

It could also work for the standing army question, so for good troops you need good buildings so if you send him to a town and convert to a peasant, you won't be able to convert him back to good soldier unless you build the building there too. Therefore it is better that he remain a soldier!
 
Ooh well done night!

So does the .pl script change things in the .dll or python and XML files? What's does the script do? What files does it tinker with?

Also on an unrelated note, do you think it would be possible to make a profession require a building? So example you cannot become a monk (outside) without a chapel. The real reason I ask is because I am thinking of making ships into professions, so they require a dock, etc.

Now know it can be done for built things and internal professions, I am just wondering if it can be extended to this?

It could also work for the standing army question, so for good troops you need good buildings so if you send him to a town and convert to a peasant, you won't be able to convert him back to good soldier unless you build the building there too. Therefore it is better that he remain a soldier!

It easy to add some checks to things like "canHaveProfession" function, so it would be easy to add a check for a building type. It could be done in 5 min. The AI sometimes however, has trouble with new rules such as this. And like you say when you move to a city without the building there could be AI issues when changing professions because at that City the AI has an invalid profession, but there are work arounds if this is an issue.
 
Yeah I hope this won't be too much of an issue for the AI, as it would be external professions, and the AI tends to stick with those anyway. Maybe we could introduce some simple checks so the AI checks if a better profession (unit, vehicle or ship) is available and upgrades accordingly.

I am just thinking it would be an easier way to 'mimic' crew veterancy without having to code a whole new thing. I quite liked the idea in DoaNE, but I found it a bit clunky and frustrating at times.

The only problem I guess, is if there is a code limitation for professions carrying people?

Like a merchant (profession) can't carry people but a wagon (built vehicle) of ship (Built vehicle) can?

Would I be right in assuming that would be a small fix? Would it also be possible to limit what some professions can and can't carry?

I was thinking the idea of a boat carrying three boats (bad) or something like that..

I am just trying to think through all the possible problems and whether solutions are easy or hard...
 
Hey Night,

So I made a test version of the yield files in the .dll I have attached them, I was wondering if you could take a look and see if all is well. Also I was wondering if you had a script to 'fix' my yields list at the bottom of yieldsworldhistory.cpp

You will see what I mean if you take a look, I can add it in manually, but you seem to have a script for everything :D

Another question, when you make a .dll, do you just use both mod yield files, or do you take one or the other depending on the mod?

Will I have to have a seperate .dll from the M:C one in order for it to work, or can it just be included?

I need to get on and register my VS2010 so I can start using it again...

If possible, would you be able to do the perl script magic you talked about in your previous post and send me a package of the results?
 

Attachments

Back
Top Bottom