Quick Modding Questions Thread

Maybe theres something in asafs gamefont editor what im missing..
The editor is a very simple application. It only alters the file when you save. The game loads the file from the disk, meaning if it shows up ingame, then you saved the file and the editor is done. The editor is too simple to be able to save old versions of the file meaning it can't revert tga files.

its ROM-AND launcher. If I load mod via bts my changes stays there.
The fact that ignoring the launcher fixes the problem strongly indicates that the problem is the launcher and not the editor. You need to look into what that launcher does.
 
Hi does anyone know how to keep the background music playing when entering city screens? it switches to that city screen song by default which I don't want.
 
The fact that ignoring the launcher fixes the problem strongly indicates that the problem is the launcher and not the editor. You need to look into what that launcher does.
Yes, it IS the launcher. I solved that by replacing gamefont_asian.tar and gamefont_latin.tar by 0byte dummy files in assets/res/fonts.
 
Hello,

Could someone point me in the right direction please: I'd like to have units get an attack bonus when attacking from certain terrain. I've looked through the xml files, which are the only thing I've modded so far, but didn't find anything relevant there.

If anyone could tell me where to start I'd be very grateful.

Best,

Neil
 
Hello,

Could someone point me in the right direction please: I'd like to have units get an attack bonus when attacking from certain terrain. I've looked through the xml files, which are the only thing I've modded so far, but didn't find anything relevant there.

If anyone could tell me where to start I'd be very grateful.

Best,

Neil
I do not believe this is possible, bonus can only be applied to the destination tile where the battle takes place.
 
It is certainly possible, but not with XML only. You would have to recompile the DLL, and even then it's quite a bit of work (adding a new unit XML property, adding the new unit attribute, add it to the combat resolution code etc.). But if you are willing to put in that much work and can compile the DLL, let me know and I can give you some pointers.
 
I am still struggling in my AND2 modmod with infinite loop issues and clueless.
Could someone experienced take a look at the log files? Maybe he can see immediately what I don't and give me a clue about my issues.
THX!

Settings, in case you want to know it:
upload_2019-8-22_19-34-5.png
 

Attachments

@Zeta Nexus:
Whole lotta logs. It seems to me – and I think that's been your conclusion as well – that the last entry in any of the logs of the first game is
Code:
[184.159] Player Queendom of Francja switches from Monarchy to Empire
[184.174] Player Queendom of Francja switches from Warlords to Theocracy
[184.174] Player Queendom of Francja switches from Clans to Caste
I've only briefly looked at those from game 2, but, apparently, it's almost the same situation:
Code:
[439.532] Player Rzád Tymczasowy Tajów switches from City-state to Empire
[439.532] Player Rzád Tymczasowy Tajów switches from Warlords to Theocracy
[439.532] Player Rzád Tymczasowy Tajów switches from Clans to Caste
While there could, in theory, be problems with the civics evaluation (like picking an illegal combination of civics), that's not where the game gets stuck, it's something in the aftermath of the revolution, and it could well be due to this particular combination of civics (even the old civics are almost the same in both cases).

In CvPlayerAI::AI_doTurnPre and CvPlayer::doTurn, I don't see any logger calls after AI_doCivics, at least not in the next 10 or so functions, so it's difficult to narrow the problem down. :( With a debugger, things should be quite easy from here: set a breakpoint in CvPlayer::revolution and press F10 until the game freezes.
 
With a debugger
If you are skilled enough to use fancy stuff like debuggers, then I would recommend starting out with profiling. Just let the game freeze, start profiling and then 100% of the CPU time will be spend in the loop. You can then start over with a debug build, let it get stuck again and add a breakpoint in that loop to walk through what happens there.

Yes I know it requires a bit of knowledge of debuggers and profilers to do this, but if you can do it, then it's the best way to identify the cause of any freezing game.
 
The biggest hurdle here is probably to compile the code. After that, attaching the debugger shouldn't be a big deal. Neither is installing a profiler probably (the internal one is no help). I know you've been recommending Very Sleepy and I intend to give that a try sometime.
 
Thank you guys so much. I was suspecting that it is something with the civics but my changes dind't solve the issue and I became so confused that I just gave up and cried for help.
Now I'll try again.
Thx!
 
Thank you guys so much. I was suspecting that it is something with the civics but my changes dind't solve the issue and I became so confused that I just gave up and cried for help.
Now I'll try again.
Thx!
In retrospect, I think you you were close to fixing the problem on your own, but, since you had been at it for quite some time, I've gone ahead, set up my development environment for Chronicles of Mankind and debugged @ablackshoe's save. The infinite loop started directly in CvPlayer:: processCivics; so, with the work that you and the (other) Chronicles players had already done, a profiler run really wasn't needed anymore. I've posted some specifics in the Chronicles thread.
 
Quick resource question, where and how do I change the small ( ) icon for a resource? I have got the button and resource itself images working but i can’t figure out how to modify the icon that is used in trade screens etc.
 
Quick resource question, where and how do I change the small ( ) icon for a resource? I have got the button and resource itself images working but i can’t figure out how to modify the icon that is used in trade screens etc.
You should look into GameFont. There is a thread about GameFont issues with explanations and stuff. The editor mentioned is GameFontEditor, which is a must have for anybody doing anything with GameFont.
 
If you are skilled enough to use fancy stuff like debuggers, then I would recommend starting out with profiling. [...]
Just a brief addendum: I've tried out Very Sleepy now because I just had another infinite loop in my own code – and it's really extremely easy to use, at least together with the profile configuration in your makefile. I didn't have to read a single line of documentation. :thumbsup:
 
Just a brief addendum: I've tried out Very Sleepy now because I just had another infinite loop in my own code – and it's really extremely easy to use, at least together with the profile configuration in your makefile. I didn't have to read a single line of documentation. :thumbsup:
Remember it's equally simple to use when your goal is to identify slow parts of the code. I managed to reduce the AI waiting time by around 40% in Religion and Revolution (later We The People) simply by using Very Sleepy to identify slow parts and then replace function calls with cached values (particularly GC.getDefineINT, which is actually rather slow). Identifying stuck loops is just a bonus.
 
Back
Top Bottom