SDK Discussion/Question/Help/Tip Thread

SimCutie

Warlord
Joined
Dec 10, 2005
Messages
197
For the time being, let's discuss about SDK in this thread...
Any Discussion/Help/Question/Tip on SDK is welcomed...
 
First thing :
If you have some difficulty in compiling "CvGameTextMgr.cpp" around line 1178, Use this :
Code:
	szString = L"!\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[?^_`abcdefghijklmnopqrstuvwxyz\n";
//	szString += L"{}~\\&#20687;&#51340;&#52432;&#53484;&#54589;&#57385;&#30422;&#35493;&#22283;&#21931;&#25095;&#20486;&#22969;&#33162;&#35206;?&#21959;&#39137;&#23480;&#33222;&#38928;&#38533;&#33210;&#63994;&#31357;&#22686;&#24425;&#20805;&#22338;&#27782;&#27194;&#35440;&#63735;&#50640;&#12475;&#52959;&#46665;&#49804;&#50707;&#359;&#8364;&#65282;&#48462;&#48223;?;
	szString += L"{}~\\\xdf\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf" 
		L"\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd8\xd9\xda\xdb\xdc\xdd\xde\x9f\xdf" 
		L"\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef" 
		L"\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff" 
		L"\xbf\xa1\xab\xbb\xb0\x8a\x8c\x8e\x9a\x9c\x9e\x99\xa9\xae\x80\xa3\xa2\x94\x91\x93\x85\x92";
 
One basic question while I download the files necessary. Is there a way to achieve compatibility between different mods that modify the same SDK files?
 
Teg_Navanis said:
One basic question while I download the files necessary. Is there a way to achieve compatibility between different mods that modify the same SDK files?
If they release the source you can manually do it :p

smjjames said:
I know this is a noob question of me, but whats SDK? they are files I guess.
Software Developer Kit. C++ source code for CvGameCoreDLL. If you don't know (or plan on learning) programming it's of no use to you other than downloading the mods others make with it.
 
If they release the source you can manually do it

Alright then, I'll just add the uncompiled file to the zips. Sounds like a reasonable way to do it.
 
Teg_Navanis said:
Alright then, I'll just add the uncompiled file to the zips. Sounds like a reasonable way to do it.


Basically what I am planning to do is go through each one of my mod components and move as much of the code that I can to C++. I will then provide two downloads for my components one that is the DLL, python, XML, etc. and one that is only the modified C++ files. How does that sound to everyone?
 
TheLopez said:
Basically what I am planning to do is go through each one of my mod components and move as much of the code that I can to C++. I will then provide two downloads for my components one that is the DLL, python, XML, etc. and one that is only the modified C++ files. How does that sound to everyone?
Depending on what exactly you move to C++. I think there are things that should stay in Python, even if they can be moved to C++, because they might be easier to understand and modify in python. People can use that to learn or adapt your mod to their needs. Just my two cents. :)
 
Rabbit said:
Depending on what exactly you move to C++. I think there are things that should stay in Python, even if they can be moved to C++, because they might be easier to understand and modify in python. People can use that to learn or adapt your mod to their needs. Just my two cents. :)

Hmmm... that is a very good point... that's why I will probably end up spending about a month going though all of my components, released or not (yes, I have about 4 mod components I was going to release today but I might hold off now till I can update them to the new patch), and update them accordingly. I know for a fact that there are several areas in the components that should be moved into C++ for efficiency.
 
smjjames said:
I'm not planning on using the SDK, I was just wondering what SDK meant.

SDK = Software Development Kit
It most commonly refers to a set of source files or api's (application programming interface) used to develop applications compatible with some specific target. In this case the target is the civ IV engine.
 
The Great Apple said:
Most things don't really need porting across do they? Surely just things which run slow really need to be moved over?
That's why I might need to put off all new development and go through my components and make that decision. I know I will need to update a few things. For instance I have already developed code allowing for new yield types which is needed for the doctor specialists and super specialists.

The biggest thing to check is the mercenary mod and see how it is affected by the patch.
 
I successfully build RELEASE built and run it. No problem.
And I can successfully build DEBUG build but can not run it.
It generates few assert errors in Civilization.exe like...
"ASSERT failure in File dbgdel.cpp Line 52"
"Expression: _BLOCK_TYPE_IS_VALID(pHead->nBlockUse...)"
This is error from C runtime library (CRT library) ( "Vc7/crt/src/dbgdel.cpp" )
Other subsequent assert failure is all from similar CRT memory library.
Ignoring the assert failure or retray to call up Debugger won't help.
This is caused because Civilization.exe binary is not debug build.
So it does not init and use proper memory routine from debug CRT (MSVCRTD.DLL).
How can I run Civ4.exe with debug-build CvGameCoreDLL.dll load and linked?
Or how to prevent using Debug CRTLIB memory check on DEBUG build?
Has anyone built custom special MSVCRTD.DLL without/dummy memory checking?

Any one succeded in it?
 
I will be fiddling around with the SDK as well. As for what can/should be done in C++ I say keep it in Python/XML if possible (aka its not ugly/slow when done thier). Because its going to be a BIG hurdle for the average user to use modified DLL files (their going to be harder to combine, run, trouble shoot ect ect). I predict we will see much fewer combo SDK based mod packs unless developers realy make an effort to integrate their code to the greatest extent possible.

A lot of work should focus on just expanding the number of API calls we can make with Python, I myself have been infuriated by the fact theirs no call to remove the HolyCity tag, you can only move it another city. Clearly this is an example of Firaxis puting desisions about game play into the games core code rather then Python ware it belongs. Breaking down such barriers by simply creating new calls wont break any existing mod. Non C programers can then start playing with these new tools to enhance and diversify their mods.
 
I cant compile, it says its missing windows.h.

Is it because I havnt rebooted after installing Microsoft Platform SDK or doesnt it find the directory or is windows.h a part of the compiler lib?

Or what?


EDIT; solved it
 
SimCutie said:
I successfully build RELEASE built and run it. No problem.
And I can successfully build DEBUG build but can not run it.
It generates few assert errors in Civilization.exe like...
"ASSERT failure in File dbgdel.cpp Line 52"
"Expression: _BLOCK_TYPE_IS_VALID(pHead->nBlockUse...)"
This is error from C runtime library (CRT library) ( "Vc7/crt/src/dbgdel.cpp" )
Other subsequent assert failure is all from similar CRT memory library.
Ignoring the assert failure or retray to call up Debugger won't help.
This is caused because Civilization.exe binary is not debug build.
So it does not init and use proper memory routine from debug CRT (MSVCRTD.DLL).
How can I run Civ4.exe with debug-build CvGameCoreDLL.dll load and linked?
Or how to prevent using Debug CRTLIB memory check on DEBUG build?
Has anyone built custom special MSVCRTD.DLL without/dummy memory checking?

Any one succeded in it?

Try this (I assume you're using VC++ 2003):

Go to the project properties, C++ Folder, Code Generation Page. Change the Runtime library from Multi-threaded Debug DLL to Multi-threaded DLL.

I think this might help. I can't test it now though. Please let me know if it works or not.

Thanks,
Daniel
 
Rabbit said:
Depending on what exactly you move to C++. I think there are things that should stay in Python, even if they can be moved to C++, because they might be easier to understand and modify in python. People can use that to learn or adapt your mod to their needs. Just my two cents. :)

There's more than a few things that should stay. Please please PLEASE people don't go nuts with the SDK. It's highly unlikely you're going to see a significant, if any, performance increase moving stuff into the SDK.

If it's doable with the current mod system, keep it there. Junking up the SDK needlessly is horribly poor design. There's a reason a scripting language was built in, the same reason it's in most modern games.

Also keep in mind that changing the DLL is going to be much more of a chore than loading a mod, and much more of a pain that it's worth just to play someone's mod.

Just because you CAN do something doesn't mean you should.
 
jgerman said:
...

Also keep in mind that changing the DLL is going to be much more of a chore than loading a mod, and much more of a pain that it's worth just to play someone's mod.
You are correct that in general you should do stuff in python if you can, if only because its generally far easier to see what you are doing. However, loading a different DLL is just as easy as loading a mod - if a mod has a CvGameCoreDLL.dll in Mods/<ModName>/Assets then the game will load that rather than the normal CvGameCoreDLL.dll
 
jgerman said:
There's more than a few things that should stay. Please please PLEASE people don't go nuts with the SDK. It's highly unlikely you're going to see a significant, if any, performance increase moving stuff into the SDK.

If it's doable with the current mod system, keep it there. Junking up the SDK needlessly is horribly poor design. There's a reason a scripting language was built in, the same reason it's in most modern games.

Also keep in mind that changing the DLL is going to be much more of a chore than loading a mod, and much more of a pain that it's worth just to play someone's mod.

Just because you CAN do something doesn't mean you should.

I agree, but there is some missing functionality that I would like to include in some of my mod components that cannot be done in just python, for instance having specialist and super specialist doctors give :health: and RogerBacons bad people give :yuck: cities.
 
Back
Top Bottom