[Religion and Revolution]: Mod Development

Status
Not open for further replies.
Before you leave

Lol, seems that you did not notice that I'm already absent since some months. To be honest...I have currently no idea how to set up this environment. I haven't modded since 2.7 has been published and I set up the environment more than one year ago...
 
Lol, seems that you did not notice that I'm already absent since some months. To be honest...I have currently no idea how to set up this environment. I haven't modded since 2.7 has been published and I set up the environment more than one year ago...
Oh yes, I have noticed that with sadness.
 
Hi Schmiddie!

Before you leave perhaps you can help me to set up the development environment to compile rar.

I am using the todays holiday in austria to set up the development environment for rar. i am on win 10 and i installed the visual studio 2017 community edition. the makefile needs executables from the Microsoft Visual C++ Toolkit 2003 and the platform sdk 7.0A (lines 37,38 and 48 to 51). But i can not find or isntall them. I am googling for 3 hours now and I can feel my hair turning grey. Do you have any clues on how to handle or update these requirements?

Update:
I found out that I can get the platform SDK 7.1A onto the system by installing the component "Windows XP support for C++" via the Visual Studio 2017 installer. 7.1A is not 7.0A, but I hope the resource compiler (rc.exe) from 7.1A will serve as replacement for the 7.0A rc.exe without compatibility issues.
The 2003 SDK remains a questionmark though. Do I really need this specific SDK or do I just need any compiler, preprocessor and linker from any SDK?

Update 2 (2018-05-10, 20:34):
I discovered the Build Tools for Visual Studio 2017 ( http://landinghub.visualstudio.com/visual-cpp-build-tools ). These provided me a compiler and a linker. Now I can provide everything the makefile needs. But I am getting code errors when compiling the solution that was included with the 2.7.1.beta2. My guess as of now is, that this is because I am using a different compiler.

You definitively have to use the SDK\toolchain provided by VS2003 (v7.1). MS has the habit of breaking their ABI with almost every release unfortunately, so we're stuck with this ancient compiler. If only they had used COM :sad:

@Schmiddie : Nice to see you getting active again :goodjob: I may consider some more modding myself...
 
Last edited:
@ShadesOfTime
Is this your fork https://sourceforge.net/u/allrandom/religion-and-revolution-bugfixes/ci/master/tree/ ?

If you intend to help out with fixing bugs, that would be great :). I have a rather long list of issues that we could coordinate\work off (not published anywhere since it needs to be cleaned up), so I'm sure we won't run out of stuff to do anytime soon.
This would also allow me to use more of my time to work on the AI, which is the reason I originally joined the project.
 
Last edited:
@ShadesOfTime
Is this your fork https://sourceforge.net/u/allrandom/religion-and-revolution-bugfixes/ci/master/tree/ ?

If you intend to help out with fixing bugs, that would be great :). I have a rather long list of issues that we could coordinate\work off (not published anywhere since it needs to be cleaned up), so I'm sure we won't run out of stuff to do anytime soon.
This would also allow me to use more of my time to work on the AI, which is the reason I originally joined the project.

devolution,

this is indeed my fork. But calm the horses. As of now I just want to fix some bugs which I don't like. Like this, where I already found a solution for:
https://forums.civfanatics.com/thre...-bugs-and-todos.449958/page-121#post-15086562

and i would send you pull requests when i was able to fix something.
I do not want to commit to anything beyond that. I am working full time. If you have any internal communication, I would be interested though. I would see your issue list and progress and I would maybe pick an issue once in a while, if I have the time and knowledge resources.

Do you have any links or clues on how to get the 2003 sdk onto windows 10?
 
Are Schmiddie and devolution even aware there is a very nasty unfixed bug which is ruining 2.7?

I am referring to the bug which ShadesOfTime has found a solution for.

If you can't at least fix this one horrible bug, may I suggest you roll back the official version to 2.6 because it is a far better experience as versions stand.
 
About the 2003 SDK, I am not aware of any issues that prevents it from working on W10.
My setup for RaR/BTS modding is W10, 2003 SDK, VS2010 and VS2017 community edition.I recommend the latter for debugging and editing over 2010. I think 2010 is required for historical purposes, we should just migrate to VS2017.

@Nightinggale is the resident build system guru and would know more
 
Last edited:
I haven't found if you have already discussed what I consider an annoying bug : when you click the "end turn" button, and have ships in europe, you know about that in the next turn... so you have already lost a full turn with the ship in europe, needlessly...

I've just hacked a "solution" with python: I've changed the CvEventInterface for the keyDown event, so if the player hits "enter" it will test for the "nags" and "feats" and, if they return 1, the event for ending the turn is cancelled as well...
Code:
        if ( eventType == self.EventKeyDown ):
            theKey=int(key)
            if ( theKey == 44) : #enter key

                if ( CyInterface().shouldDisplayEndTurn() ) :
                    iPlayer = game.getActivePlayer();
                    abmpEndPlayerResult1 = CvAdvisorUtils.endTurnNags(iPlayer)
                    abmpEndPlayerResult2 = CvAdvisorUtils.endTurnFeats(iPlayer)
                    print("abmpendturnresult" + str(abmpEndPlayerResult1) + " " + str(abmpEndPlayerResult2) )
                    if ( abmpEndPlayerResult1 == 1 or abmpEndPlayerResult2 == 1) :
                        return 1
But this has a drawback: while I don't move ships out of europe, the nagging that there are ships at europe goes on forever... unless I click the end turn, since I haven't trapped the mouse button as well...

I've thought about setting somehow a global variable, but I haven't found so far anywhere where I can place it, so I can control that the player have clicked at least once on the "I know that, thank you" button, that turn.

Do you have any hints?
 
I would change it to when you end turn, instead of just ending, it should pop up a confirm window if there are ships in Europe.
Another solution would be to have an image, which is displayed when there is a ship in Europe and clicking it acts like clicking the Europe button.

I like the idea. I have forgotten about ships in Europe many times. A classic is to have one colonist in Europe, want to wait a turn to make it take two and when I start to wonder why I have no money and lots of cargo, I have 5 colonists in Europe :cry: (ok, it haven't happened often, but it has happened)
 
I doubt anyone here has ever not forgotten about ships in Europe but for me Africa and Port Royal are more likely to have a ship lingering there for many turns.
 
I doubt anyone here has ever not forgotten about ships in Europe but for me Africa and Port Royal are more likely to have a ship lingering there for many turns.
Yep, I've detected that the nag about ships at port only check europe... I'm not sure how to specify africa or port royal...

For me, I keep forgetting ships in europe because I keep switching screens to decide the cargo to place at the ship, to which indians will I trade next... city needs... and then I get distracted by something else, click end turn and BAM... "you have ships in europe"... at the wrong turn...
 
I would change it to when you end turn, instead of just ending, it should pop up a confirm window if there are ships in Europe.
Another solution would be to have an image, which is displayed when there is a ship in Europe and clicking it acts like clicking the Europe button.

I like the idea. I have forgotten about ships in Europe many times. A classic is to have one colonist in Europe, want to wait a turn to make it take two and when I start to wonder why I have no money and lots of cargo, I have 5 colonists in Europe :cry: (ok, it haven't happened often, but it has happened)

Yep, I've tried this initially... but the bug is caused just because the onEndTurn hook is a mute one: it can't be "consumed" if it is detected something wrong. But the key event is consumable... you can say the engine to stop processing that keyboard event. This way, I have nag at the same turn.

But the challenge here is that I don't want the nag dialog that "there are ships in europe" to keep popping up if the player have already clicked on the "I know that, thank you" option... The problem is that I don't know how to set a python global variable that spawns different modules...

What I would like to do is:

If there are ships in europe and the player hit "end turn", if there isn't a previous confirmation at the same turn that the player said "I know that", the popup keeps popping up. For that, the popup dialog must set a global variable telling that the player have confirmed that on turn X...
 
Python hooks are intended for mods, which for one reason or another wants to avoid modding the DLL (like making it mac compatible). If you have the option to pick between the DLL or python, pick the DLL. Not only is the compiled C++ code faster, it allows debugging and assert checks, both useful tools regarding creating a bug free mod. I think all the python hooks are in the DLL code, meaning any code using a hook can be written in the DLL. Also a lot of features are DLL exclusive. There is some python exclusive code as well, mainly GUI stuff.
You can even mix DLL and python and make a hybrid to benefit from both. The XML editor is an example of this as the data handling is in the DLL and python handles all the screen drawing.

I did overwrite the end turn button in Medieval Conquest once to do something other than end the turn if it has unanswered diplomacy (M:C specific feature). I can't remember offhand how I did it, but it worked, meaning it must be in the git log somewhere. However knowing my workflow, odds are that it was in the DLL. However I do know for certain that it can be done.
 
Python hooks are intended for mods, which for one reason or another wants to avoid modding the DLL (like making it mac compatible). If you have the option to pick between the DLL or python, pick the DLL. Not only is the compiled C++ code faster, it allows debugging and assert checks, both useful tools regarding creating a bug free mod. I think all the python hooks are in the DLL code, meaning any code using a hook can be written in the DLL. Also a lot of features are DLL exclusive. There is some python exclusive code as well, mainly GUI stuff.
You can even mix DLL and python and make a hybrid to benefit from both. The XML editor is an example of this as the data handling is in the DLL and python handles all the screen drawing.

I did overwrite the end turn button in Medieval Conquest once to do something other than end the turn if it has unanswered diplomacy (M:C specific feature). I can't remember offhand how I did it, but it worked, meaning it must be in the git log somewhere. However knowing my workflow, odds are that it was in the DLL. However I do know for certain that it can be done.

To tell you the truth, I'm avoiding going into the dll, if I can. I'm aware that Python is slower, but my previous experience is that to actually be able to compile the DLL is something that takes a significant effort, and that is also difficult to merge and distribute... You have a big package with all the code in a big "take it or leave it " state... Not mentioning all compatibility issues that you may create if you don't do it right (like make it not to work on a Mac, or create a memory leak, CTD... Does civ4col work on Mac? Didn't know that ) ...

But I'm afraid that to fix this I will really have to go there... maybe change the global context to allow for a hashmap for modders to use...
 
Compiling is an issue, but I wrote a wiki guide to tell precisely what to do.
Colonization is released for mac, but the port is bad and the DLL part is compiled into the game files themselves and it doesn't support external code. Since RaR is already using a modded DLL file, you shouldn't be concerned about mac support since it's already broken. There are some BTS mods, which are intentionally python only due to mac support, but all Colonization mods use modded DLL files.

You would have to do something really weird to cause memory leaks by modding the end turn code to add a confirm button. CTD is valid, but only if you write something, which would also break python. Besides if RaR accepts code from outsiders, it will always be reviewed for quality issues. In other words fear of possibly bugs shouldn't stop you from trying. If anything now would be a good time to try precisely because it would grant you access to a code review and feedback of same.
 
Compiling is an issue, but I wrote a wiki guide to tell precisely what to do.
Colonization is released for mac, but the port is bad and the DLL part is compiled into the game files themselves and it doesn't support external code. Since RaR is already using a modded DLL file, you shouldn't be concerned about mac support since it's already broken. There are some BTS mods, which are intentionally python only due to mac support, but all Colonization mods use modded DLL files.

You would have to do something really weird to cause memory leaks by modding the end turn code to add a confirm button. CTD is valid, but only if you write something, which would also break python. Besides if RaR accepts code from outsiders, it will always be reviewed for quality issues. In other words fear of possibly bugs shouldn't stop you from trying. If anything now would be a good time to try precisely because it would grant you access to a code review and feedback of same.

Cool the wiki guide... I'm finishing installing a git client now. One sordid detail, though: microsoft registration site is somewhat broken, and gives the impression that registration have failed. However it still emails you a registration key...
 
Status
Not open for further replies.
Top Bottom