#ifdef standards

Impaler[WrG]

Civ4:Col UI programmer
Joined
Dec 5, 2005
Messages
1,750
Location
Vallejo, California
We have a nice comenting style layed out but their are still some issues I would like to see resolved. SimCutie has recomended use of #ifdef, their are also some sugjectsions of if(ComunityEnhancmentsOn) or if(ModEnabled) type activations for each individual mod with some form of Options menu exposed to Python. Lastly theirs still some lingering doubt for me as to what the nature of any special header file or files and what we should be putting on that file. Lets discuss and deside these things.

I'm getting itchy to release my code though I know Spoiled Fruits server is not yet up and running. Is it possible for some provisional versions of the commonly moded files to be keept on the forum or should we use the SF untill then? Is their an ETA on Fruits Server?
 
As an excersise, I played a bit with CVS at SF and uploaded the sources of CvGameCoreDLL. If you like you can use this till SpiledFruits server is up and running.
 
I don't see why we shouldn't use SF for keeping the code until we get the server. As I understand it everybody who wants to submit stuff on there needs to register on SF, and then PM me/12monkeys with your username so that we can add you.

As for the #ifdef stuff - does this sound good?
SimCutie said:
In separate header file ( I named it "CvGameCoreDLLExt.h" which is, in turn, included by global "CvGameCoreDLL.h" header), there will be lines like this.
Code:
#ifndef NO_GAMECOREDLL_EXTENTION
#define SIMCUTIE                   // base extension
#define SIMCUTIE_WIDGET       // custom widget
#define SIMCUTIE_EVENTEXT    // event extenstion
....
#define TGA_TALKINGAI
....
#endif // NO_GAMECOREDLL_EXTENTION
If we define or undefine specific Mod identifier, the DLL will be compiled with or without the mod feature.
Now I don't claim to be great at C++, but I didn't think stuff like that could be changed easily during runtime, so if you want a enable/disable feature on your specifc mod you might have to use an if (<some global variable>) clause, and then patch it into the options menu (when we get the code for the options menu).
 
You can't change any #ifdef stuff during runtime. Its a compiler switch and it does ONLY effect when the sources are compiled/linked. IMO there is not a big use for use in it, because we should head for switching during runtime.

So I would prefer that anything which alters gameplay MUST be switchable with a boolean like :

Code:
if (bCPPFeatureXY) 
{
  .. code ..
}

In this case we need an page in the game options, to enable/disable those features.

This leads me to another question. We (or me) just though about putting C++ code in the CVS or SVN or whatever. But we also need to put parts of the Python API in there, because we will get changed Python code or changed XMLs as well. So best is, that I will start to upload the standard Python API on SF as well.
 
12monkeys said:
You can't change any #ifdef stuff during runtime. Its a compiler switch and it does ONLY effect when the sources are compiled/linked. IMO there is not a big use for use in it, because we should head for switching during runtime.

So I would prefer that anything which alters gameplay MUST be switchable with a boolean like :

Code:
if (bCPPFeatureXY) 
{
  .. code ..
}

In this case we need an page in the game options, to enable/disable those features.
Global bools it is then. As for where the bools are defined - it'll have to be a file imported into CvGameCoreDLL.h so that it gets inlcuded in all the files. When the options screen is up and running this should all be alot clearer. I suggest you just define you're own bools somewhere, and then when we have the screen we can delete them.

SpoiledFruit - is this all OK?
12monkeys said:
This leads me to another question. We (or me) just though about putting C++ code in the CVS or SVN or whatever. But we also need to put parts of the Python API in there, because we will get changed Python code or changed XMLs as well. So best is, that I will start to upload the standard Python API on SF as well.
Probably will want the XML schemas as well. How are we going to keep the API up to date?
 
Following Status in CVS at Source Forge :

1.) CvGameCoreDLL_v161 :
all files from SDK, except the subdirs "Boost-1.32.0" and "Python24". I don't think we'll need them, because we problably will not change them.

2.) Assets_v161 :
contains files from standard Civ4 "Assets" folder. Following folders have been uploaded :
- complete XML folder incl. subdirs.
- complete Python folder incl. all subdirs, except the "system" folder (is also not needed, I think).

12m
 
Sounds good, runtime switching ability definatly sounds better for us (alows a much wider range of Mods to be included under our mission statment). I will go register right and start getting ready for upload.
 
I agree with the more mods bit - it means we can include little tweaks, which while a purist might not want, but most are agreed make the game better - something like an era-specific interface, or an improved culture model.

For interface changes, I suggest we have only one new version of each screen included, and have a switch for each screen.
 
When it comes to switches there might be a difference between small features that any player could switch on or off from larger feature changes that will be required when you build a mod.
I think that there should be an option for any modmaker to very easy force a mod to include a certain feature where the player may not set the switch manually without go into the mod and change a parameter in an XML or INI file or something.

What do you think?
 
I dont seem to be able to view or access anything off our SF CVS, it may be that I havent configured the CVS client right (the SSH key is tricky and the documentation is rather poor if you ask me). But I cant even do the web viewing which should be noob proof. Are you shure it was properly uploaded, are their any restrictions I dont know about?
 
Impaler[WrG] said:
I dont seem to be able to view or access anything off our SF CVS, it may be that I havent configured the CVS client right (the SSH key is tricky and the documentation is rather poor if you ask me). But I cant even do the web viewing which should be noob proof. Are you shure it was properly uploaded, are their any restrictions I dont know about?
The web view isn't working for me either. Have no clue why. I always get an error about "proxy loops".
I'm not sure if set up CVS right, but it works for me. It is the first time I did that, so its possbile that I mixed something up.

But what is your problem in detail? Can't you connect, or do you see no sources? I use WinCVS together with PuTTY and the PuTTY Pageant (wich is important!). What did you use? What is the CVSROOT you're connecting too?
Regarding the SSH key, there is a quite good documentation here http://sourceforge.net/docs/F02/en/#top .

Let me know some details and I will try to help where I can.

12m
 
12monkeys said:
The web view isn't working for me either. Have no clue why. I always get an error about "proxy loops".
I'm not sure if set up CVS right, but it works for me. It is the first time I did that, so its possbile that I mixed something up.

But what is your problem in detail? Can't you connect, or do you see no sources? I use WinCVS together with PuTTY and the PuTTY Pageant (wich is important!). What did you use? What is the CVSROOT you're connecting too?
Regarding the SSH key, there is a quite good documentation here http://sourceforge.net/docs/F02/en/#top .

Let me know some details and I will try to help where I can.

12m
Hmm.. I can not access CVS via web, too... It seems that CVS is malfunctioning and need re-configuration or set up again... I can access it via ssh & command line but it is too awkawrd... It should be fixed as soon as possible..
Without stable CVS, we can not start stable work..
 
SimCutie said:
Hmm.. I can not access CVS via web, too... It seems that CVS is malfunctioning and need re-configuration or set up again... I can access it via ssh & command line but it is too awkawrd... It should be fixed as soon as possible..
Without stable CVS, we can not start stable work..

If you have access through SSH your should install WinCVS. This is a grahical UI for CVS. It is a bit similar to Source Safe, but much more complex.

Meanwhile I will try to find the reason for this web problem. Didn't took much care about it, because I planned to use WinCVS anyway.

12m
 
Just did some quick checks. To use CVS via browser, you have to install ViewCVS (a cgi application). To run ViewCVSyou need Python, gnudiff and RCS installed, where the last two are some unix-guys-who-dont-like-windows-stuff. So CVS via bowser is even harder to install than WinCVS. I will give it a try anyway, but I highly recommend the WinCVS solution.

12m
 
12monkeys said:
Just did some quick checks. To use CVS via browser, you have to install ViewCVS (a cgi application). To run ViewCVSyou need Python, gnudiff and RCS installed, where the last two are some unix-guys-who-dont-like-windows-stuff. So CVS via bowser is even harder to install than WinCVS. I will give it a try anyway, but I highly recommend the WinCVS solution.

12m
I downed and tested WinCVS and concluded that it is not my type of application. It is too complex and has inconsistent UI and unstable (stuck or crash frequently). very cranky application, it seems not for production use quality. I give up on WinCVS and stick to old-but-proven comamnd line version.
 
Well, I don't like WinCVS as well. Tonight I gave TurtoiseCVS a try and its kind of better than WinCVS, at least if you are only useing checkin/out add/remove stuff. You may try that one if you like.

12m
 
I am able to web view the CVS repositories of other projects on SF so the problem is definatly with our project.
 
Ok, I did try to fix this WebView problem but failed. I also failed to fix some issues at the CVS root at SF. I'm not able to retrieve a module list which is quite unusual, as far as I understood all this stuff.
Somehow I mixed this completly up, but I have no clue how I did that.

I will now contact the SF admins and ask them for help. Maybe we have to reset our CVS there completely. If you have anything there please save it (if you haven't already).

12m
 
OK. SF staff is informed. When looking on the support request lists, there are lot of other people having problems with CVS and web view.

I don't know, how long it will take that this request will be handled, but we should calculate with 3-8 days.

If anybody has an alternative for source control it would be the right moment to come up with it.

12m
 
Sugjest we use cattle prods on Spoiled Fruit to accelerate his server coming online. Other then that we should all work on getting our codes ready for merging (proper commenting, debugging ect ect).

As for CVS I think it may have been a problem with Modual names, what was its name? When I tried the Tortise "fetch list" tool it would always fail saying the server didn't support it.

OK FINALY got it working checked out a copy, and yes it was a modual name problem, it seems that you didn't create any moduals for the project rather everything was included under the CVSROOT pathway which on every other projects is used only for keeping the chang logs for the project and other CVS type files. The Assets and CoreDll folders should be planced under a new modual which for simplicity should be civ4ccp (again the standard practice on other SF projects). I am not shure but would suspect that the current configuration is un-tenable because anyone comiting to the modual will also alter the changelogs themselves resulting in some kind of weird snake-eating-its-own-tail kind of behavior on the changelogs as they atempt to log changes to themselves!

P.S. I noticed a number of alterations from the original code mostly some coments on header files by 12monkeys, I din't see the purpose for most of these but I think on principle we should have a completely unaltered set of "as Firaxis made it" data used as the base for the project, all out changes being infact recorded as changes. As were likly going to need to do this ALL over again so lets use the completley blank files this time.
 
Back
Top Bottom