SimCutie
Warlord
- Joined
- Dec 10, 2005
- Messages
- 197
I think that we will need some guide line or discussion on how to integrate multiple source code into single set of files. Let's discuss that before it become too big and too late.
This thead will not discuss topic of specific individual mod, but general and overall topic that will affect all SDK mod's.
My Suggestion:
1) Minimize impact on original source file?
We should make least modification to existing source file and least unit of code block. This will make it easy to integrate multiple SDK MOD's and easy to upgrade our project to next Civ4 patch version or next expansion (with next version of SDK release). I think that using separate source file for SDK mod ( or multiple mod) will minimize impact on existing source code. ( except few lines for hooking from existing code/source file.)
2) Use conditional #ifdef as much as possible.
Whenever we add or modify original source code, we should use #ifdef to conditionally include the modification. If we undefine all #ifdef condition, then the compiled DLL should work as equivalent as possible to original unmodded DLL. This may not practical on some times or even impossible, but we should try to do it. This condition can be little relaxed on mod that does not change behavior of existing code. The added part will be just sitting there as dead/unused code in that case.
Or we may include runtime flag that will direct wherther the mod will be activated or not. If the flag is deactivated, then the modded part will behave just same way as original DLL behavior.
Add your idea and suggetion in this thread...
This thead will not discuss topic of specific individual mod, but general and overall topic that will affect all SDK mod's.
My Suggestion:
1) Minimize impact on original source file?
We should make least modification to existing source file and least unit of code block. This will make it easy to integrate multiple SDK MOD's and easy to upgrade our project to next Civ4 patch version or next expansion (with next version of SDK release). I think that using separate source file for SDK mod ( or multiple mod) will minimize impact on existing source code. ( except few lines for hooking from existing code/source file.)
2) Use conditional #ifdef as much as possible.
Whenever we add or modify original source code, we should use #ifdef to conditionally include the modification. If we undefine all #ifdef condition, then the compiled DLL should work as equivalent as possible to original unmodded DLL. This may not practical on some times or even impossible, but we should try to do it. This condition can be little relaxed on mod that does not change behavior of existing code. The added part will be just sitting there as dead/unused code in that case.
Or we may include runtime flag that will direct wherther the mod will be activated or not. If the flag is deactivated, then the modded part will behave just same way as original DLL behavior.
Add your idea and suggetion in this thread...