project-navigation
Personal tools

Author Topic: Not enough TUs to do anything with new mechanism  (Read 3297 times)

Offline Charlie

  • Rookie
  • ***
  • Posts: 45
    • View Profile
Not enough TUs to do anything with new mechanism
« on: December 25, 2012, 08:01:30 pm »
I thought this was bad http://i.imgur.com/NDC1t.jpg

but then I selected my strongest guy with a 40 mission experience, and... http://i.imgur.com/2vVX5.jpg


While how loaded a soldier is should have an impact on his movement, the way the mechanism is currently tuned renders the game unplayable.

Offline Charlie

  • Rookie
  • ***
  • Posts: 45
    • View Profile
Re: Not enough TUs to do anything with new mechanism
« Reply #1 on: December 25, 2012, 08:06:26 pm »
Ah, just found this explanation
http://ufoai.org/forum/index.php/topic,6799.msg56470.html#msg56470
I hope things are well tuned once I get new soldiers. Is it possible to hack the strength value of my existing guys in the savegame file? If so, what is the hex offset?


Another issue is the appearance of that warning window. The info it contains is very useful, but it is annoying and tedious having it pop up on every single change, including on each of the two clicks required to remove a loaded weapon. Hopefully this info will be integrated into the GUI without any popups once the new GUI is implemented.

Offline DarkRain

  • Project Coder
  • Captain
  • ***
  • Posts: 746
    • View Profile
Re: Not enough TUs to do anything with new mechanism
« Reply #2 on: December 26, 2012, 04:48:40 am »
Is it possible to hack the strength value of my existing guys in the savegame file? If so, what is the hex offset?
if you really have to try this

Offline Charlie

  • Rookie
  • ***
  • Posts: 45
    • View Profile
Re: Not enough TUs to do anything with new mechanism
« Reply #3 on: December 26, 2012, 06:53:00 pm »
Thank you!

For easy reference, here are the steps to fix your soldiers if you're playing a saved game from a time before when the new weight system was implemented. I assume your saved game is slot0.savx and that you have no slot1.savx (or that if you do have a slot1.savx you can overwrite it):
  • Go to your save-game dir:
    cd ~/.ufoai/2.5-dev/base/save

  • You need to extract the XML from the binary save-game file:
    ~/ufoai/src/tools/savegametool.pl -x slot0.savx slot1.xml

  • The XML file is badly formatted and unreadable. You can easily reformat it nicely using tidy. The problem is that the save-game file starts with a 180-byte-long binary header which tidy will discard, so you will need to prepend it back into the file once you're done working on it. For now, make the XML readable, so run:
    tidy -xml -w 0 slot1.xml > slot1.tidy.xml

  • Open slot1.tidy.xml in a text editor and find the soldier section:
    <employees type="soldier">

  • Each soldier is stored in that section. Add about 15 to the initial value for each soldier in a line that looks like this for experienced soldiers:
    <skill type="power" initial="23" experience="4572" improve="9" />
    or like this for new soldiers:
    <skill type="power" initial="23" />
    Save the file, overwriting slot1.tidy.xml

  • Now you have to add back the binary header:
    head -c180 slot1.xml > slot1.savx
    cat slot1.tidy.xml >> slot1.savx

  • Remove the trash
    rm -v *.xml
Be realistic with the strength values to keep the game challenging and fun.
« Last Edit: December 27, 2012, 09:22:04 pm by Charlie »