SDK Help Needed

This is very cool Asaf- I look forward to the mod comp.

Concerning what Baldyr said- people have more skill because they worked for it. So while Asaf is still a God around these parts, his skills are't beyond the reach of anyone who really works for it. Programming shouldn't be thought of as an exclusive art.
 
Here's the updated version.
I intend to make a mod component out of it (once I add a few things) - 'Enhanced Resource Converter', since I rewrote most of TheLopez code and it behaves differently in many ways.

Now the calculations are done in the plot group level instead of the city level, since that's actually the influence in the game. It saves a lot of re-calculations (in addition to the fact that it should work correctly now ;) ).

I attached all the relevant C++ source files - both the ones I changed and the ones TheLopez did.

I still want to add some AI changes - so the AI can appreciate the resources and buildings according to their potential conversions. After I do that - I'll release it as a mod comp.
Not sure when I'll get around to it though, so I wanted you to have a working version.

I hope it works fine. I made some testing, but you should keep testing it and let me know if you find any problems.

I added backward compatibility for saved games to the previous version I sent you so you can test it on the saved game you gave me. After you save with it, however, it cannot be loaded by the old version.

Let me know how it goes.

Thanks alot. :D
I think its working. I loaded an old savegame, and after ending turn all the converted resources came back. Will test it further, but so far so good :goodjob:

I really appreciate the help
 
There seem to be a bug in the dll. Whenever I make changes to, afaik, any file and a game is running, it says : Reloading python modules, twice, and strange things occur. Like this :
attachment.php
 
Seems more like a Python bug to me. Do you have Python exceptions enabled?

And AFAIK there are cases where you can't simply edit the python file while the game is running.
 
And AFAIK there are cases where you can't simply edit the python file while the game is running.

:yup: that's pretty normal. In some cases, reloading a save or beginning a new game will fix enough stuff to test it, but in all the other cases you have to start the game totally new, else you'll partially lose your interface.
 
But thats the thing. I didnt edit Python files. Just an XML int. from 4 to 6.
And it didnt usually do this without a .dll file in the mod.
IIRC it didnt usually do this with RoM either, but it might be a ini setting somewhere.
The python changes in my mod is very limited, and I havent changed anything there for months.

I'll try to do a reinstall of Civ4, as when I put the files I wanted to compile, I accidently put it in the original CvGameCoreDLL folder. (...and the winner of this years noob mistake award goes to .... Vincentz!!!)
 
But thats the thing. I didnt edit Python files. Just an XML int. from 4 to 6.
And it didnt usually do this without a .dll file in the mod.
IIRC it didnt usually do this with RoM either, but it might be a ini setting somewhere.
The python changes in my mod is very limited, and I havent changed anything there for months.

Some of the XML files are loaded at startup, and some are loaded when a game is started (or loaded). I don't think they're meant to be edited while the game is running in any case, and I have no idea why a different DLL would matter in this regard...

I'll try to do a reinstall of Civ4, as when I put the files I wanted to compile, I accidently put it in the original CvGameCoreDLL folder. (...and the winner of this years noob mistake award goes to .... Vincentz!!!)

You can download the original code files from my tutorial (well, they're almost exactly the same as the original). It has no effect on the game (they're only there for modding purposes).
 
Some of the XML files are loaded at startup, and some are loaded when a game is started (or loaded). I don't think they're meant to be edited while the game is running in any case, and I have no idea why a different DLL would matter in this regard...

You can download the original code files from my tutorial (well, they're almost exactly the same as the original). It has no effect on the game (they're only there for modding purposes).

I downloaded the sourcefiles and merged them with some other modcomps. I also implemented the modcomps xml and python so its ready for testing.
I really hope we can make the converter work. Let me know if there is other stuff I can do to help.

The files mentioned are here :
http://forums.civfanatics.com/showpost.php?p=10801266&postcount=343
 
Congrats on compiling :goodjob:

I'm sorry I wasn't very responsive lately. There are a lot of real life things to take care of, and it will go on for the next few weeks, but I'll try to do as much as I can. I like to finish what I started.

I made progress last week - I found the problem: not really an infinite loop, but more a calculation which happens many times and gets longer every time. So it takes a really long time.
I also found a solution, but I'm not finished with it, and I still don't know if it solves it completely. So I'll keep you posted.

Once I complete this, I'll send you the files and we'll see about the merging (that is, if you'll need me for this ;) ).
 
thanks. It felt like a huge accomplishment, yet it also felt too simple to be true. I honestly didnt think it was going to work the first time I loaded the game, but when I checked some of the features and they worked I was a happy man :D

I think I can compile it (thanks to a great tutorial ;)) and merge it shouldnt be a problem either. The dll I compiled is actually with the latest enhanced resource converter, and it does seem like its "adding" to every turn. I'm around 1 AD on a Large+map with 15 AI's and a Debug dll, and so far no errors or bugs, but the turn times are starting to be very long.
 
I got this message 230 AD.
Is it of any importance?

Assert Failed

File: cvplayer.cpp
Line: 12609
Expression: isHuman() || isBarbarian() || ((getGold() + iGoldChange) >= 0) || isAnarchy()
Message:

----------------------------------------------------------
 
It looks like an AI player (not barbarian) which ran out of gold and is about to go on a strike. Not sure why it's in an assert - probably was added to help developing the AI, but it's only a guess.
 
4 months have passed... :eek:

Sorry for not returning earlier. I'm not sure it's even relevant anymore, but just in case...

I did this work months ago, but then my PC went offline for a long time, and when I got it back online I completely forgot about that.

Anyway, I rewrote a large part of this mod, and it is now optimized and runs really fast, and now really no recalculations are done. I had a crash when I used the saved game after a turn or two (can't really remember), and I spent a long time tracking it but it kept eluding me. So now I removed the debugging code and recompiled it. I hope it still works...
I think it won't crash on a game that was started with this DLL, but it requires some testing.

Anyway, sorry again about the long time, and I hope you'd still find some use for this.
 

Attachments

Back
Top Bottom