View Full Version : SDK question


lamppost4
Apr 06, 2008, 11:03 AM
Would anyone be kind enough to merge the SDK/gamecore.dll of RevolutionDCM (http://forums.civfanatics.com/downloads.php?do=file&id=8322) and the unitfuel modcomp (http://forums.civfanatics.com/downloads.php?do=file&id=8914)?

Thanks in advance.

lamppost4
Apr 06, 2008, 03:47 PM
If no one wants to, could someone tell me how?

Refar
Apr 06, 2008, 03:57 PM
I could compile it for you, if you have the sources merged. But in the end - compiling is the easy part... - it takes some time to setup the enviroment for the first time, but once done...

The instructions for compiling the sources are here.
http://forums.civfanatics.com/showthread.php?t=196283
It's a bit hard to follow, but it does work.

I never tried those mods however, so i would not have the slightest idea how to merge the sources - like what part to take from what mod in case of conflicts or something.

lamppost4
Apr 06, 2008, 04:01 PM
Ok so it looks like a lot of windows stuff and I am on a Mac at the moment so if you could compile that would be great. As for the merging, what do I do for that?

lamppost4
Apr 06, 2008, 08:31 PM
Ok so I got the merging software and it shows me what is different in each file so now do I merge every difference or do I pick and choose the ones that should be merged?

Refar
Apr 06, 2008, 11:53 PM
Sorry, i was sleeping already when you posted the last time - the time difference :lol:

It would be best, to take ove version as base, and then move over the features you want from the other. (Ideally choose in a way that saves you work...). It's basicly similar to merging XML - you cant break syntax, blocks etc... If the changes are disjoint (do not modify the same method) it would be the safest to move the complete method/classes... Othrwise block-wise... It will bekome ugly, if both make different adjustments at the same fragmet of the code tho...

You are not a programmer aren't you ?

Refar
Apr 07, 2008, 02:05 PM
Ok, i did take a look at it. However, the Fuel Mod on itself does not compile in the first place.

So no point merging it, as it wont compile either.

I guess the Author forgot to include a header file in the download.

ripple01
Apr 07, 2008, 03:47 PM
Winmerge will make any SDK merging infinitely easier. It allows you to compare two files and instantly shows you the differences...

www.winmerge.org

Cheers,
ripple01

Refar
Apr 07, 2008, 04:53 PM
He runs a mac^^

Anyway, after GreyFox uploaded the missing file, i merged them myself - seem pretty straight-forward, as the changes are disjoint. It compiled without errors, i did not run it in game however - would need some XML work first.

lamppost4
Apr 07, 2008, 06:46 PM
He runs a mac^^

Anyway, after GreyFox uploaded the missing file, i merged them myself - seem pretty straight-forward, as the changes are disjoint. It compiled without errors, i did not run it in game however - would need some XML work first.

Did you merg the RevolutionDCM and Fuel mods together or compiled the fuel mod? I don't quite understand what you are saying.
Anyway, if you mean you merged them both together, thanks a lot. I already figured out how to do it but haven't finished because I did it wrong at first.
And no I am not a programmer so this is a good learning experience for me.:D
And for the record, I did find a merger that works on Mac.

Refar
Apr 07, 2008, 11:13 PM
I merged them together. Took Revolutions as base (It's the bigger one) and moved the fuel stuff over. The merged sources are within the archive as well.

lamppost4
Apr 08, 2008, 04:16 PM
Alright thanks a lot. The only problem is that he just made an update. I will merge the new stuff together and post it here for you to compile again. Is that ok?

Refar
Apr 08, 2008, 04:48 PM
ok. i will remove the previous attachment then.

lamppost4
Apr 08, 2008, 10:46 PM
Hey thanks for doing this.:goodjob::D
I got it all merged and I added another mod comp (the vicinity resources one). I do have a question though. Since the vicinity mod conflicted w/ Dale's battle effects, I erased part of the code for Dale's. Do I now have to get rid of the rest of the code for that or is it ok w/ only partial (I already am assuming it will not work).

Refar
Apr 09, 2008, 12:06 AM
You might not need to remove Dales code completely. However, if there are other parts of the code referencing the thing you removed, they must to go as well... Having no idea what the 'vicinity ressource' does, and what part of dales cde is gone... I can't tell.

lamppost4
Apr 09, 2008, 08:19 PM
You might not need to remove Dales code completely. However, if there are other parts of the code referencing the thing you removed, they must to go as well... Having no idea what the 'vicinity ressource' does, and what part of dales cde is gone... I can't tell.

Ok well could I just turn off that feature in the global defines in order to refrain from removing the rest of the code?

Refar
Apr 10, 2008, 01:23 AM
I tried it.

There were some small mistakes in CvInfos.H / CPP where you missed out some of the fuel mods code (Grey Fox tagged it different in comments with the new version: "Unit Fuel" rather than "UnitFuel"). Those i fixed (Attachment).

However, it still does not build properly, bailing out on a linker error.

CvPlot::SetBattleFeature(bool) called from CvUnit::rangeSrtike(int,int)
CvPlot::ChangeBattleCountdown(int) called fromCvPlot::doFeature(void)

The 2 "missed" methods seem to be from Dale's combat mod, so i suspect it;s caused by overwriting something with the new mod. Note, that it might also be just the top of the heap - after a couple of fatal errors the linker might have stoped, witout displaying the rest.

By GlobalDefines you mean GlobalDefines.XML ? Deaktivating a feature there will most probably not be enought.
At any rate, nothing you might try on the XML files will help get past those liker errors.

Perhaps it would be better, to leave out that 3-rd mod (Where i can get it to take a look btw ?)

lamppost4
Apr 10, 2008, 05:09 PM
Well I will look through the cvplot part and take out all the stuff I don't want. Maybe that will work.
The other mod is here:http://forums.civfanatics.com/showthread.php?t=270539

lamppost4
Apr 10, 2008, 05:36 PM
Ok lets try this again.

Refar
Apr 11, 2008, 02:25 AM
It got rather worse than better. The compiler would have slapped me, if it had hands. :lol:

Anyway... I merged all 3 together.
Turns out the huge conflict in the end of CvPlot.cpp wasn't one - the merger programs will get confused if there are too many differences on the same location in code. It just needed to paste the new (Vicinity) method at the end, after Dales code.

Removing parts of the code is tricky - it causes errors in places you expect it the least, because of cross references to the now missing code... If you want some parts of Dales or Revolutions gone, it would be esier to turn them off from XML - i think you mentioned that beeing possible.

It compiled, but i dont have the XML to try it. I think there should be no problems as the mods affect different aspects of the game and do not interact. Can't guarantee that however, as i didn't actually looked at what the code does, just put it together without breaking the syntax...

lamppost4
Apr 11, 2008, 05:19 PM
Alright I will try it tonight for the first time.
The thing w/ dale's mod is that he marks everything w/ the specific component of his mod. This way I can just get rid of the component I don't want. Hopefully it should work.
Just wondering, how much time does it take to do all of this compiling stuff?

Refar
Apr 12, 2008, 05:55 AM
The build itself takes 15 to 20 minutes with no user interaction needed. So thats not a big deal on itself, if the sources are ok. Looking for / fixing the problems if the build fails is the time consuming part.

lamppost4
Apr 12, 2008, 10:41 AM
I was getting some weird xml errors in my mod so I posted it hoping someone would look at it. Would you have time to do that?
the link is here:http://forums.civfanatics.com/showthread.php?t=271214

lamppost4
Apr 18, 2008, 09:04 PM
My mod keeps crashing. Could you possibly help with this?

Refar
Apr 19, 2008, 04:16 AM
I will take a look - sorry the reports i seen there so far seemd to suggest XML trouble, so i kept out of it - not sure if i can help.