Duplicating a simplified version of resources

Thunderbrd

C2C War Dog
Joined
Jan 2, 2010
Messages
29,819
Location
Las Vegas
I'm looking to create a duplication of the resources code minus any need for map references. The intention is to make a 'Goods' category of bonuses that interacts with coroporations and prerequisites and trade, much like resources do, but that do not have any application on maps. This can certainly be done as it is already, by adding them in to the resources list. BUT we're pressing the limitations of that list with too many and as a result, I'd like to create a whole nother category of objects.

I figure I can go through and mostly copy the coding where resources are concerned, but I thought I'd first ask the community for some advice and guidance. Maybe we can pool our experiences to make sure no missteps are made in this process.
 
When you say "we're pressing the limitations of that list with too many", what do you mean specifically? Creating a new object type is a pretty big undertaking which involves many changes in xml, python and sdk. If you have not done sdk modding before, this may not be the right project to start with. It is much easier to create new resources, and not add them to any mapscript. This ensures that no new mechanics are needed.
 
Civ engine has a hard coded support for up to 64 resources after that any new resources will screw up all the fonts all over the place. Even if the new resource uses an existing graphic. This even meant that a single word in the pedia may have differing fonts for each letter!

(Afforess and others attempted to fix the problem awhile back and came to the conclusion that it was the exe.)
 
Can you link to the threads where the hardcoded limit was established? I agree that editing the font file can be a big pain, but I thought some mods already had large numbers of resources or other icon items such as religions.
 
The limit can't be 64 for the simple reason that the Rise of Mankind: A New Dawn mod has 72 defined bonuses...

Rise of Mankind was where this limit was found. Thread Resource Limit Notice

Edit: you are right the limit is 75 or 76. C2C has 74 resources and I could add SaibotLieh's Sea lions OK but things went wrong when I added the rabbits.
 
I've done some SDK modding so I'm not completely lost here. I'm just not sure how to start the process is all. I would imagine it would amount to setting up references to a new xml file and this is where I may need some guidance - even if its to just point me in the direction of some pertinent existing tutorials.

I was thinking of eliminating the use of icons and references to the font file altogether for such 'goods' so as to be a little gentler on the processing - keep it all text based.
 
I read the linked thread but I did not dig further. In post #1 last edited in Feb 2010, Afforess says there is a hard coded limit as of beta 4. But then in post #112 he says Sephi may have fixed the hard coded limit as of beta 6.

Anyway, as a player, trying to understand the tradeoffs between > 60 items seems too complex. If the items do not have a lot of tradeoffs then there is no reason to have so many. Is it going to be interesting / playable to have so many items even if it is possible?
 
Having goods enhances our capacity to create a more realistic model of trade and allows us to deepen the corporation based strategies. This deepening complexity is something those of us who are getting into the C2C mod are loving it for. Sure, it wouldn't be desireable to all but some neat things can be done if we can get this sorted out.
 
OK, so I've been doing some reading in the Idiots Guide to the dll and much of it seems to apply here.

What I don't understand yet, and maybe could use some help with, is initiating a whole new XML page. Not so hard to work out how to add lines of XML into consideration in the dll but a new page entirely? Has anyone laid out details on how to do this?
 
I couldn't find any existing tutorial, but it's not much more complicated than modifying an existing XML.

I just answered a similar question for Jamie.

In very general terms, this is what you need to do:

XML-wise:
You need to design your XML structure, add a schema file or update an existing schema, and link the new XML file to this schema (at the top of the file, look at other files for that).

C++-wise:
You need to create the info structure for your new data (CvInfos.h, CvInfos.cpp), add its vector and exposed methods to CvGlobals, define the new enum in CvEnums.h, and add a call in CvXMLLoadUtilitySet.cpp to load these files (probably in CvXMLLoadUtility::LoadPreMenuGlobals() or CvXMLLoadUtility::LoadPostMenuGlobals()).

I might have skipped a few things, and didn't give you any details at all, but the best way to do so is to look how an existing file is read and defined and use this to write your code.
 
Thanks Asaf! I can always count on you! That was exactly what I needed. I figured it would be as simple as that. I was theorizing much of what you expressed would be involved but you did fill in some critical gaps there. I'm sure more will come into it down the road once the basics are in place but since I'm largely copying what's being done with existing resources, I think I can pretty much parallel clone everything I need.

I'll be posting here to express my progress at various junctures and may have more questions to come but that's the seed I needed... again... thank you!

This, however, is definately a project to back up before working! ;)

I had a question for you about the backup program you were showing me... but I'll address that there in a bit.
 
Top Bottom