First release

The Great Apple said:
Well A isn't really an option.

Could B be implemented on the files after SF has merged them, and then recompiled?
OK. In versionI posted, it DO has backward compatibility facility.
In CvExtension module, ExtLoadAction has value indicating current save file version, which is one of four possible values.
EXTLOAD_NONE - original firaxis save,
EXTLOAD_OK - current modded savefile,
EXTLOAD_OLD - modded davedfile of previous version.
EXTLOAD_ERROR - error, should generate FAssert failure.
Check this value and do appropiate action when reading save file.
If ExtLoadAction is EXTLOAD_NONE, read only original firaxis data, nothing more.
Include file for this is "CvExtGlobal.h"
See CvExtension.cpp/CvExt_read() and PlayerOptionReadAdjust() (Commented out)
potion on how to use it right.
 
I will be out of town for remainder of the week and then busy till atleast Wednsday, Fruit has not yet (to my knowlage) finished merging so I figured I would do as much as I could and provide it too yall to use when I am away.

I have created a new branch on the CVS "impaler" (sugjest other folks start making their own branches as well). And have uploaded by most resent materials (more up to date and debugged then my forum upload). I merged 12Monkeys content with my own and it compiles/runs fine, a few small popular mods off the forum were included as well, see the Mod list for information. I could not get SimCuties changes to compile, I get an "int should be proceeded by ';' " and "unexpected end of file marker" in C:\Program Files\Microsoft Visual C++ Toolkit 2003\include\excpt.h both line 36. I checked this file and it looks fine. It seems he did something with the CodeBlocks project as that file has incressed substantialy in size, could it have anything to do with the new header files?
 
Good to hear.

SimCutie - can you suggest something to fix those compiler errors, just in case SpoiledFruit runs in to them as well?
 
Merging complete but I'm having trouble compiling. Impaler, I am getting your GAMEOPTION_GREAT_PEOPLE_POINT_POOLING as undefined. Where was this definition added? If you forgot, do you want me to add it?

Also, SimCutie, I see a lot of ifdef statements with your code, I don't know if it will work with them or do you want me to comment them out?

Also some of yours and 12Monkey's code clashed and seeing no clear definition on your code or how it interacts between the two functions I commented it out so both of you need to take a look at that, especially in the CvUnit.cpp and CvUnit.h files. The big one was the canMoveInto_Python function. That was a big conflict (that I can see after looking at it only 5 minutes).

-------------------------------------------------

Update:

OK, I was able to compile a dll without any compiler or linker errors. I loaded to the main screen jsut fine, however, when I try to start a new game the game crashes. You 3 really will need to take a look at that commented out code. (all of Impalers additions in the CvCity.cpp and Sim and 12Monkeys in the CvUnit files)

I am uploading it onto my FTP server and it is now on sourceforge as well.
 
One of the troubles may be that some people have conducted partial merges by themselves. Impaler's changes uploaded to Sourceforge also include changes by 12monkeys, I think - and he also mentioned that the ones on SF had no bugs.

I think where 12M and SimCutie's changes bump into each other you should use SimCutie's code instead, but put it in the same place as 12M has put his - I think what he did in his set of updated files is take 12M's changes, and add a few things to make them run better.

I would try merging SimCutie's changes with the changes on SourceForge submitted by Impaler, given they seem to be the latest versions.

I also can't see your upload on SourceForge, and I'm having trouble connecting to the FTP server again... but that's another issue.




A more general comment now.

Could we please try to keep our coding looking like Firaxis code, rather than coding in our own styles? I have noticed, for example, that SimCutie tends to put the includes just before they are used, rather than at the top of the file with the rest of them. Firaxis has put them at the top, so we should too. It just makes life alot easier. We have to remember that these files may go through lots of revisions, and there is no reason to leave them any messier than we found them.

There's also the whole commenting style thing, which I hate to drag out again, but I'm going to anyway. Of the three people who have submitted changes, only one is using the commenting style set out in the guidelines. While this may be fine now, where everything is still quite simple, things are going to get more problematic, we are going to get overlapping comments, and to save confusion we should all use the same commenting style.

Also, while there are only 3 or 4 people actively changing the code at the moment, there may be many more at a later date.
 
I say that we should sticky a thread with the commenting style. This is what I use, but will change if it is not good:
Code:
...
//Lord Olleus / [Mod Name] / 3rd June 06
...
...
//Lord Olleus / End
 
I just saw this line in Civ4.ini

Code:
; Game Options
GameOptions = 0000000000000000

Could this have anything to do with the new game options not working?
 
SpoiledFruit said:
Also, SimCutie, I see a lot of ifdef statements with your code, I don't know if it will work with them or do you want me to comment them out?
.......
OK, I was able to compile a dll without any compiler or linker errors. I loaded to the main screen jsut fine, however, when I try to start a new game the game crashes. You 3 really will need to take a look at that commented out code. (all of Impalers additions in the CvCity.cpp and Sim and 12Monkeys in the CvUnit files)
This is why I put #ifdef SIMCUTIE_XXX thing. Just undefine all SIMCUTIE_XXX in CvExtGlobal.h, then all my codes become commented out by #ifdef and it will work same as oriiginal code. So you can test the crash is caused by my code or not. Or you can disable my code selectively, feature by feature.

I recommend that all developer should provide modder means to selectively disable specific features: For example, 12Monkey's Python hook incurs quite big overhead in runtime even if modder/player does not use the feature. So other SDK modder should be able to completely disable this feature with no or minimal overhead.
I expected he will modify his code to use #define or at leat run-time configure switch to remove the overhead, but he didn't do it so far.

I think that we should NOT try to our code looks like Firaxis's.
We are not maintaining Firaxis's code. We are patching on it. Our source code it self will never make into Firaxis's code archive. So our code shouled be distinctive from Friraxis and we should always be prepared to move our code to SDK sorce of next expansion.
That is why I put horizontal ruler (-------) to distinguish my potion and original potion. I use #ifdef to minimize impact on original source code.
I put #include where before code that uses it in same reason.
I generally put my code to end of source file and put #include in start of my potions. It is better than scattering our changes all over the source code.

On Impaler's comment style:
He comment outs original line with precedding // in same line with original code line.
It is not so visually distinctive to code reader. Please make it more visually distinctive for easier identification.
It does not looks good when I compare his code with orihginal source with diff tool like WinMege or Windiff. Such diff tools does not understands C++ syntax and confused by line preceeded by //. Please leave original line as it was, line by line. You may put /* */ comment line before and after original code or use #ifdef.
 
Lord Olleus said:
I just saw this line in Civ4.ini

Code:
; Game Options
GameOptions = 0000000000000000

Could this have anything to do with the new game options not working?
This is overwritten each time we start/exit Civ4.exe, So if we adjust NUM_GAME_OPTION_TYPES, it should also extend and contract (padded with zero), if it was done right.
 
@SpoiledFruit - are you having another attempt at merging the files together given what I suggested, or do you want it cleaned up first?

@SimCutie - I quite like Firaxis' style as it allows other users to dive in and quickly and easily see what is going on. It is designed how it is for a reason, be it so that the Firaxis coders could see what was going on, or so that people who downloaded the SDK could see what was going on. Either way, it is what, in their opinion, is clear to read.

@Everybody - Any other opinions on this? It's definatly not to late to change over to a more distinctive style like SimCutie suggests, and he certainly makes some good points. Good that we have these discussions earlier rather than later. We really need to all be doing the same thing.
 
I don't seem to be able to recompile it. I coppied the standard project, removed all of the .cpp and .h files, added all of your files, made them part of the project and then tried to compile. This is what my log said:
Code:
Switching to target: Final Release
Civ4ccp_Tools.cpp
CvArea.cpp
CvArtFileMgr.cpp
CvCity.cpp
CvCityAI.cpp
CvDLLButtonPopup.cpp
CvDLLEntity.cpp
CvDLLPython.cpp
CvDLLWidgetData.cpp
CvDeal.cpp
CvDiploParameters.cpp
CvExtension.cpp
C:\Program Files\Microsoft Visual C++ Toolkit 2003\include\excpt.h(36) : error C2144: syntax error : 'int' should be preceded by ';'
C:\Program Files\Microsoft Visual C++ Toolkit 2003\include\excpt.h(36) : fatal error C1004: unexpected end of file found
Process terminated with status 1 (0 minutes, 58 seconds)
 
I am going to try and remerg the files tonight, hopefully it works. I placed a link to the files in the CCP Download thread. They should also be available in the Files tab of our project site on SourceForge.

I am going to try and get the debug code I see within the source working again so we can see what is going wrong and where. This should help for future debugging.

I like the way Firaxis wrote there code because it is the correct way to write code as well as it is readable. We should keep there coding style because it will allow people to understand better what is going on and the interaction between the new and old code.

I think that you can put in the new python calls inside the original functions just at the end before the return without needing to add 2 new functions (this is part of where the problem is).
 
I asked someone who does a lot of C++ what they thought and was wrong and they told me that it is probably a problem with a macro which is defined for you not for anyone else.

I have no idea what that means.
 
any sucsess?
 
Top Bottom