View Full Version : Vanila -> Warlords SDK


Lord Olleus
Sep 06, 2006, 01:50 PM
[Completely changed on the 10th Sep 06]

Having talked to Gerikes about this, we have come up with a new way of doing this; or rather he did and I implemented it. It is called SVN (subversion). Basicaly, it means that there is one version of the code which is being hosted on the web and everyone has there own local copy of it. Everytime you make a change you send that change to the main server, where everyone can update there version from the main server. If two people make a change at the same time, then the second person to upload it gets a screen where they can merge the two pieces of code. Luckily, there is some software which does all of the uploading, updating and sorting out for us.

This is a tutorial (https://www.projects.dev2dev.bea.com/Subversion%20Clients/TortoiseSVN.html) where you can learn how to install / use tortoise SVN (download version 1.3.5). I am using googlecode (http://code.google.com/p/civ4-wfb/) to host the file. To use it you will need a google account, but they are free and easy to make. To be able to use SVN with this I will need to add your google account username to the list of members so pm it to me and I will deal with it ASAP.

Once you have done all of the above there are just a few simple stpes you will have to go through for it to work properly.



Create a new folder where you want all of your source files to be. It must be empty.

Right click on that file and select "SVN Checkout..."

Type this in the top box: https://civ4-wfb.googlecode.com/svn/trunk/
and leave the bottom one as it is.

When it prompts you for your username and password; use your gmail username (pm me if you need an invite to create an account - I have 97 left so it should be enought) as the username and you can find your password by clicking on "SVN password" here (http://code.google.com/p/civ4-wfb/source). Note, this step will only work once I have added you to the members list, so be patient. It will now download all the files from the server to your computer. This will take several minutets but will only need to be done once.

Copy and paste all non .cpp and .h files and folders from the vanilla and Warlords SDK to their respective folders in the new directory.

Thats it, you're ready to go! Just remember to update your general folder (the one you created in step 1) every time you start coding, and to submit it every time you have finished. Read the tutorial above for guidance on how to do this and many other things


If you have any problem please pm me, I don't want this thread to become littered with problems.

El Loco Mono
Sep 07, 2006, 01:08 AM
I can begin converting the animal gold and animosity this weekend. There is very little C++ code so I imagine I only need a day or two to do it.

A bit off topic, but I might actually take out the animal gold into a python file, but I was curious if we should have a module for basic mod changes rather than a new python file for each piece (I don't want to populate the customeeventmanager file like FFH as that file is just huge now!)

Lord Olleus
Sep 07, 2006, 05:43 AM
The system we are using (thanks to TheLopez) is Dr Elmer Jiggle's CvCustomEventManager. The way it works is the the CvCustomEventMager.py file, just adds together all of the other CutomEventManager modules. All you have to do is create your own [component_name]CustomEventManager for the particular part of the mod you are doing, and then add two lines of the code in the general CvCustomEventManager.py, which will integrate it with the restof the even managers. Have a look at the mod to see how it works.
As for the animal gold, if you want to transfer it to python, then you should use the onCombatResult() function in the Event manager. But I wouldn't really bother unless it is quicker to code it in python, then transfer it to warlords.

Ploeperpengel
Sep 07, 2006, 04:28 PM
Maybe you also should wait a little longer until I polished some glitches of the warlordsversion on my system and got the files from Lopez (and afterwards tested them).
Meanwhile the vanillaversion still can use some bughunting and fixing(look at the horrible logs I uploaded). We should find the reasons why the logs are gettting so big. This won't immediatly crash(at least not allways) the game but certainly has an affect on stability.

Ploeperpengel
Sep 08, 2006, 01:39 PM
Ok I talked with Lopez. He won't be able to make the merges I requested anytime soon. So what I'll do now is post the current version I got on my comp asap so that you guys can start coding this baby. Included is the ccp initial release. I suggest we don't use later versions since Impaler is going to include more features we don't need with every new upload.
So what to do first I suggest you clear it of the code we don't need(should be much less work than adding all of that we need manually), clear it of bugs in the remaining code if there are any and then start integrating our codes and other modcomps.
Alternativly you also could use the vanilla gamecore and add everything from the ccp (or the seperate modcomps integrated into it) into the warlord gamecore. Whatever you think makes more sense and will be less work.
Check the requestlists I made for the mechanics that should be in and if anything is unclear or you're uncertain if we should include a particular mechanic or not please just ask back.

Lord Olleus
Sep 10, 2006, 09:57 AM
whole new system on first post. Make sure you read it.

El Loco Mono
Sep 13, 2006, 09:29 PM
Yay! Up and running with the source control and the new warlords code, so after the last few days delay I should be able to get a lot more productive with the merge this weekend. I'm well happy that we now have a source control, great spotting LO

Lord Olleus
Sep 14, 2006, 10:07 AM
Thank Gerikes for this, it was all his idea!
With this, we should loose a lot less time trasnfering data. I'll try to finish copying all the mod comps Ploe wanted me to add so that we can get back to the creative side of things.

Gerikes
Sep 14, 2006, 12:25 PM
Yeah, I started prodding at Lord to go with some sort of source control route, then things kinda' changed over here and I'm probably not gonna' be able to help too much anymore anyway :(

Also, I'm pretty sure that Warlords is something that would just distract me more, so I've decided not to purchase it for now, and since there's nothing keeping Civcraft from needing anything in Warlords, it'll probably stay that way for awhile. Luckily, I don't think there should be any problem in porting the Support Fire code. My apologies again.

I can still check in from time to time, and will try to check out bugs here and there, but as for new development and all that it'll probably be out of my reach.

Ploeperpengel
Sep 14, 2006, 12:36 PM
I'm sorry to read that. I would still recommend to base civcraft on Warlords since the exe seems to handle Graphicintensive stuff better than vanilla-that's the main reason we need Warlords now and my guess is your mod will probably experience similar dificulties since you also plan lot of customgfx.

Anyway will you still work on supportfire animation?

Gerikes
Sep 14, 2006, 01:40 PM
I'm sorry to read that. I would still recommend to base civcraft on Warlords since the exe seems to handle Graphicintensive stuff better than vanilla-that's the main reason we need Warlords now and my guess is your mod will probably experience similar dificulties since you also plan lot of customgfx.

Anyway will you still work on supportfire animation?

I forgot about that animation stuff. I know Dale released the sources for his mod that I was hoping to look at, and when I first did I wasn't able to get too deep into how it worked. Hopefully I'll be able to find some time for it...

Another reason not to switch to warlords is that my diff file for the SDK is currently around 520kb. That's over 300 pages in word. Since I'm probably going to make it so that unit graphics is forced as single units, I don't think the graphics are going to be my biggest concern. But, that's all for another thread :P

Ploeperpengel
Sep 15, 2006, 07:55 PM
New patch comes Mid october
http://forums.civfanatics.com/showthread.php?t=186184

So I suggest we wait till patch and go for a new release at the end of october maybe. Plenty of time for us. Good news no schema changes! Vassals will be revamped though so maybe we shouldn't mess around too much with that option until after patch.

btw: the AI would be another reason to switch to Warlords Gerikes but you're right that's better in your thread;)

Lord Olleus
Sep 16, 2006, 01:31 AM
Guys, at least try to keep this thread on topic please.

Ploeperpengel
Sep 16, 2006, 02:21 AM
I thought the question how to handle the upcoming patch would be right on topic here. (The second part of my post was already retreating so no need to scare me further:p ) Since it will probably just include SDK changes but no xml that could concern us.

Lord Olleus
Sep 16, 2006, 02:45 AM
Well I posted in that thread for furthre info and likely SDK changes, but for the moment there is nothing we can do about it.

El Loco Mono
Sep 18, 2006, 10:48 PM
FYI

I've ported the animosity and animal gold to the warlords version but don't want to merge with the main project files until I'm happy it tests out OK, because at the end of this week I will be awayfor 2 weeks and don't want to leave you guys will an unstable merge.

Ploeperpengel
Sep 19, 2006, 05:44 AM
I appreciate this. We can take all time we need. I want the warlords release as stable as possible. That is my main concern. We need feedback other than bugreports.

El Loco Mono
Sep 21, 2006, 02:56 PM
Sorry, I've had no time to test animosity properly and my flight is in 5 hours, so I going to leave it out until I return. Sorry guys I've just been too busy this week.

Lord Olleus
Sep 21, 2006, 03:01 PM
Don't worry, we have all the time in the world.

El Loco Mono
Oct 28, 2006, 04:11 PM
Animal Gold and Animosity have been uploaded. Got a chance to hear the new Orc voices in the Warlords version - muuuch better.

Ploeperpengel
Oct 29, 2006, 01:11 AM
Great! Thx Loco. Is it SDK only or have any pythonfiles been changed?

@Olleus and ELM
btw please could you tell me exactly which files you upload everytime you change files on the server? Else I allways have to update every file again just to make sure.

Lord Olleus
Oct 29, 2006, 01:45 AM
You can just install tortoise SVN, so it automaticaly knows which files are to be downloaded.

Ploeperpengel
Nov 05, 2006, 07:03 PM
Here's a useful filecomparison list for the patch:

http://forums.civfanatics.com/attachment.php?attachmentid=141564&d=1162416634

There couldn't have been a worse time for your comp crashing, Olleus:(
I asked ELM to work on the transfer but he didn't respond yet. ELM, please notify us if you want to do the conversion or not while Olleus is stuck with his machine.

El Loco Mono
Nov 08, 2006, 03:36 PM
Here's a useful filecomparison list for the patch:

http://forums.civfanatics.com/attachment.php?attachmentid=141564&d=1162416634

There couldn't have been a worse time for your comp crashing, Olleus:(
I asked ELM to work on the transfer but he didn't respond yet. ELM, please notify us if you want to do the conversion or not while Olleus is stuck with his machine.


Just checked the merged code for the warlords patch. It still needs proper testing and bug flushing. I'll work on that in the next few days. But at least it builds and runs. So far I have only had to change some route pillaging code because the patch changes a class call to a pointer to a class.

And for info, there is a heck of a lot of AI code changes from the patch, be interesting how different the game plays or wether it is all sutle changes

EDIT: I guess I was just too eager to go code hunting and just jumped into it without remembering to tell anyone :D

El Loco Mono
Nov 08, 2006, 03:45 PM
Files changed from merge - forget the dates, they where notes for me.


Files without merge dates involved so many changes so it's best to compare the version history rather than the huge post I would need to show the differences

1. cvcity.cpp – merged 07/11/06
2. cvcity.h – merged 07/11/06
3. cvcityai.cpp – merged 07/11/06
4. cvcityai.h – merged 07/11/06
5. cvdefines.h – merged 07/11/06
6. cvdllbuttonpopup.cpp – patch changes only. merged 07/11/06
7. cvdllentityifacebase.h – merged 07/11/06
8. cvdllutilityifacebase.h – merged 07/11/06
9. cvdllwidgetdata.cpp – merged 07/11/06
10. cvenums.h – merged 07/11/06
11. cvgame.cpp – merged 08/11/06
12. cvgame.h – merged 08/11/06
13. cvgamecoreutils.cpp – merged 07/11/06
14. cvgamecoreutils.h – blanks only
15. cvgametextmgr.cpp
16. cvinfos.cpp – No changes from patch, complete merge 08/11/06
17. cvinfos.h – No changes from patch, complete merge 08/11/06
18. cvplayer.cpp
19. cvplayer.h – No changes from patch, complete merge 08/11/06
20. cvplayerai.cpp – patch changes only. merged 08/11/06
21. cvplot.cpp
22. cvplot.h – merged 08/11/06
23. cvselectiongroup.cpp
24. cvteam.cpp – patch changes only. merged 08/11/06
25. cvteamai.cpp – patch changes only. merged 08/11/06
26. cvteamai.h – patch changes only. merged 08/11/06
27. cvunit.cpp
28. cvunit.h – merged 08/11/06
29. cvunitai.cpp
30. cvunitai.h – No changes from patch, complete merge 08/11/06
31. cyenumsinterface.cpp – No changes from patch, complete merge 07/11/06
32. cygame.cpp – merged 08/11/06
33. cygame.h – merged 08/11/06
34. cygameinterface.cpp – merged 07/11/06
35. cyinfointerface1.cpp – No changes from patch, complete merge 07/11/06**
36. cyinfointerface2.cpp – No changes from patch, complete merge 07/11/06
37. cyplayer.cpp – No changes from patch, complete merge 07/11/06
38. cyplayer.h – No changes from patch, complete merge 07/11/06
39. cyplayerinterface1.cpp – No changes from patch, complete merge 07/11/06
40. cyunit.cpp – No changes from patch, complete merge 07/11/06
41. cyunit.h – No changes from patch, complete merge 07/11/06
42. cyunitinterface1.cpp – No changes from patch, complete merge 07/11/06

** - trivial change, ‘def_readwrite’ changed to ‘def’

Files Changed with Custom Code - ruff guide for version history comparison

1 cvcity.cpp
Line 185:
Mongoose Floodplains fix. 1 line(s).

5 cvdefines.h
Line 111:
Lord Olleus spells interface. 3 lines(s)

9 cvdllwidgetdata.cpp
Line 1843:
Route Pillage code. 9 line(s)

Line 2464:
Lord Olleus spells code. 26 line(s)

Line 2557 (+26):
Lord Olleus spells code. 26 line(s)

10 cvenums.h
Line 218:
Lord Olleus spells code. 6 line(s)

Line 851 (+6):
Lord Olleus psychology. 5 line(s)

Line 1181 (+11):
Lord Olleus spells code. 4 line(s)

Line 1281 (+15):
Route Pillage code. 3 line(s)

Line 1281 (+18):
Lord Olleus spells code. 10 line(s)

11 cvgame.cpp
Line 410:
Water Animals code. 3 line(s)

Line 421 (+3):
Great General from Barbarian combat code. 4 line(s)

Line 4910 (+7):
AI Auto Play Mod code. 13 line(s)

Line 4924 (+20):
AI Auto Play Mod code & Water Animals. 21 line(s)

Line 5126 (+41):
Great General from Barbarian combat code. 46 line(s)

Line 6766 (+87):
Water Animals code. 11 line(s)

Line 7720 (+98):
Water Animals code. 3 line(s)

Line 7731 (+101):
Great General from Barbarian combat code. 4 line(s)

Line 7873 (+105):
Water Animals code. 3 line(s)

Line 7884 (+108):
Great General from Barbarian combat code. 4 line(s)


12 cvgame.h
Line 227:
Water Animals code. 5 line(s)

Line 262 (+5):
Great General from Barbarian combat code. 11 line(s)

Line 452 (+16):
Water Animals code. 3 line(s)

Line 463 (+19):
Great General from Barbarian combat code. 5 line(s)



13 & 14 cvgamecoreutils.cpp & h

Line 556:
Lord Olleus psychology code. 11 line(s)

Line 748 (+11):
Lord Olleus psychology code. 58 line(s)


22 cvplot.h
Line 180:
Rogerbacon flying mod. 1 line(s)

Line 182 (+1):
Rogerbacon flying mod. 1 line(s)

Line 521 (+2):
Support Fire, Gerikes. 11 line(s)


32 cygame.cpp
Line 518:
Water Animals code. 18 line(s)

Line 587 (+18):
Great General from Barbarian combat code. 51 line(s)

33 cygame.h

Line 136:
Water Animals code. 5 line(s)

Line 152 (+6):
Great General from Barbarian combat code. 11 line(s)


34 cygameinterface.cpp
Line 127:
Water Animals code. 5 line(s)

Line 143 (+5):
Great General from Barbarian combat code. 11 line(s)


Changed Functions - Altered function calls

1 & 2 cvcity.cpp & h
DoProduction – new arguments.
Prev: ()
Now: (bool bAllowNoProduction)

3 & 4 cvcityai.cpp & h
AI_bestPlotBuild – new arguments
Prev: (CvPlot* pPlot, int* piBestValue, BuildTypes* peBestBuild)
Now: (CvPlot* pPlot, int* piBestValue, BuildTypes* peBestBuild, int iFoodPriority, int iProductionPriority, int iCommercePriority);

7 cvdllentityifacebase.h
AddMission – new arguments
Prev: (const CvMissionDefinition & kDefinition)
Now: (const CvMissionDefinition* pDefinition)

8 cvdllutilityifacebase.h
sendKillDeal– new arguments
Prev: (int iDealID)
Now: (int iDealID, bool bFromDiplomacy)

11 & 12 cvgame.cpp & h
incrementProjectCreatedCount– new arguments
Prev: (ProjectTypes eIndex)
Now: (ProjectTypes eIndex, int iExtra = 1)

27 & 28 cvunit.cpp & h
canDoCommand– new arguments
Prev: (CommandTypes eCommand, int iData1, int iData2, bool bTestVisible = false)
Now: (CommandTypes eCommand, int iData1, int iData2, bool bTestVisible = false, bool bTestBusy = true)



New Functions

1 & 2 cvcity.cpp & h

bool doCheckProduction();
int getExtraProductionDifference(int iExtra, UnitTypes eUnit) const;
int getExtraProductionDifference(int iExtra, BuildingTypes eBuilding) const;
int getExtraProductionDifference(int iExtra, ProjectTypes eProject) const;
int getExtraProductionDifference(int iExtra, int iModifier) const;
int getHurryCostModifier(UnitTypes eUnit, bool bIgnoreNew) const;
int getHurryCostModifier(BuildingTypes eBuilding, bool bIgnoreNew) const;
int getHurryCostModifier(int iBaseModifier, int iProduction, bool bIgnoreNew) const;
int getHurryCost(bool bExtra, UnitTypes eUnit, bool bIgnoreNew) const;
int getHurryCost(bool bExtra, BuildingTypes eBuilding, bool bIgnoreNew) const;
int getHurryCost(bool bExtra, int iProductionLeft, int iHurryModifier, int iModifier) const;
int getHurryPopulation(HurryTypes eHurry, int iHurryCost) const;
int getHurryGold(HurryTypes eHurry, int iHurryCost) const;
bool canHurryUnit(HurryTypes eHurry, UnitTypes eUnit, bool bIgnoreNew) const;
bool canHurryBuilding(HurryTypes eHurry, BuildingTypes eBuilding, bool bIgnoreNew) const;

8 cvdllutilityifacebase.h
virtual void endMPDiplomacy() = 0;
virtual void resetStatistics() = 0;

25 & 26 cvteamai.cpp & h

bool AI_isAllyLandTarget(TeamTypes eTeam) const;

32 & 33 cygame.cpp & h

int /* EraTypes */ getCurrentEra();

Ploeperpengel
Nov 09, 2006, 04:51 PM
Just fantastic. Thx:)

Lord Olleus
Nov 10, 2006, 11:31 AM
Yeah, thanks a lot Loco.
So, what do you want me to do once I start modding again. I am first of all going to tidy up all of the psychology bits, but then what? Do you want me to improve magic, do the new commerce or something else?

Lord Olleus
Nov 11, 2006, 07:18 AM
So, what are the latest files? Is it the python and c++ from here, and the other stuff from the "Warhammer-warlords - Latest version" thread? Or am I missing something?

El Loco Mono
Nov 11, 2006, 10:44 AM
Since we got Tortise, all C++ changes and python I've done has been uploaded to google deposit. And when I try to get the latest, I just update my Tortise stream.

I hope this is the right approach, and they are the latest files

Lord Olleus
Nov 11, 2006, 11:18 AM
Good. I just wasn't sure were the latest xml/art files were. I have just updated a few c++ files by the way.

Arexack_heretic
Nov 11, 2006, 05:39 PM
Is there a 'how to use this-thread effectively' for dummies FAQ someplace?
I'd like to know how to look for the latest updates too.

Ploeperpengel
Nov 12, 2006, 06:23 AM
The latest art/xml is allways in the sticky thread. Sorry for not having updated in a while but I'm still waiting for chamaedrys' work on the buildings.
There are still some modcomps left for integration in the second post there too- don't forget those!

Afterwards we should get to Magic. No need for the new commerce until the player can cast some fun stuff with it.;)

Besides magic many other minor things are still to do. I.e. we have many many nice models for pirates now(FFH) so scripting could be done here for pirates as first seperate barb-player. The Kuriotates city system from FFH needs to be adopted for chaos. We need Great Generals be able to leave their units again(FFH). And the Undead need still to rise from the battlefield(Discussion we had in the undead thread). Of these minor issues there's no particular order of importance so whatever you codemasters like to do first - just tell about it so we can discuss the details a last time before you start.

@AH
Just download the mod and afterwards all the files in the third link of the first post in the sticky thread replacing the old ones.

Ploeperpengel
Nov 19, 2006, 05:06 AM
I just saw the gamecore.dll dates from 6.10.06(that means I think I finally figured out how to use svn...) can you guys compile the latest changes and upload them? Or am I in error?

Lord Olleus
Nov 19, 2006, 07:57 AM
According to my computer, the latest version is 11/11/2006. Try right clicking on it and select 'SVN update'.

Ploeperpengel
Nov 19, 2006, 09:39 AM
I think I'm just confused cause in the svn browser the file in the trunk is of an older date but the update check provides me with a file from 10.11.:confused:

Lord Olleus
Nov 19, 2006, 09:59 AM
No idea why thats happened. Just take the latest one and dont ask question ;).

Ploeperpengel
Nov 19, 2006, 10:27 AM
Well I dl the latest but the game doesn't start with it like it wasn't warlordpatchcompatible.:(

El Loco Mono
Nov 22, 2006, 12:05 AM
LO, did you upload your compiled dll? because if yours is 11/11 and Ploes is 10/11 it will probably be because you've made a changed on your machine/ or compiled an earlier change.

I ask this because I just realised that I uploaded all the changed source code, but not the dll. But because LO made a change after the patch migration, his compiled dll should include all the differences. Anyway, I'm going to get the warlords version from the sticky post and see whats missing from my working copy

El Loco Mono
Nov 22, 2006, 01:28 AM
Yep, the problem was the ddl from the source directory was not compiled from the latest code. I updated to the latest code, rebuilt the DLL, added it with all the files from the sticky thread and *presto*, it works. Using the dll from the sticky thread crashes the load. Also the Dll was .2mb smaller, (this is from the latest version thread and the warloads root directory from our development upload.).

I've just finished uploading the Dll - version 83. Ploe, upload this version and see if it solves your problem.

Ploeperpengel
Nov 22, 2006, 03:08 AM
Thank I'll try tonight:)