Author Topic: Location of unit stats within game?  (Read 1740 times)

Offline chemical_art

  • Core Member Mark IV
  • *****
  • Posts: 3,952
  • Fabulous
Location of unit stats within game?
« on: January 26, 2011, 05:19:14 pm »
[If this personal use of game files frowned upon I apologize]

I was wondering where in the AI War folder are the unit statistics held?I want to try a hot-fix so I can continue my game which is stalled due to a balance issue. I used to edit game files long ago for all my games and I would like to try that here while the game is in beta. The stats in question are the AI zombie guardian attack which I want to reduce somewhat.
Life is short. Have fun.

Offline TechSY730

  • Core Member Mark V
  • *****
  • Posts: 4,570
Re: Location of unit stats within game?
« Reply #1 on: January 26, 2011, 06:22:16 pm »
I don't know the specific file format for save games and other misc. data. However, I do know that save games are by default saved in a pretty well compressed format, so looking at the saves won't do you a lot of good. In debug mode though, there is an option to save a game in a non-compressed format. That should be much easier to hex-edit. Press F3 to get into debug mode, go into the save box, and press dump (or whatever) instead of save. That will give you the uncompressed version.

EDIT: Oh the unit stat themselves. Completely misread that. IIRC, currently the stats are hard coded into the program, so you would need to hex-edit the exe itself, a VERY tough problem to tackle. Also IIRC, getting a more modular system that is more friendly to modding is very low on the dev's priority list right now.
« Last Edit: January 26, 2011, 06:32:04 pm by techsy730 »

Offline chemical_art

  • Core Member Mark IV
  • *****
  • Posts: 3,952
  • Fabulous
Re: Location of unit stats within game?
« Reply #2 on: January 26, 2011, 07:46:19 pm »
Hard coded? Gotcha, I guess I was spoiled in that all my other strategy games kept the data on the hard-drive and thus more easily accessible. But it also explains how you can be so efficient with all your data.
Life is short. Have fun.

Offline keith.lamothe

  • Arcen Games Staff
  • Arcen Staff
  • Zenith Council Member Mark III
  • *****
  • Posts: 19,505
Re: Location of unit stats within game?
« Reply #3 on: January 27, 2011, 04:40:36 pm »
Yea, it's hardcoded.

If you want to try to find it, doesn't bother us ;) Just don't try multiplayer with modified files, that would be a mess.

It's not in the .exe, though, that's a generic Unity player app.  I think all the stuff you'd be interested in would be in the AIWar_Data\Managed\Assembly-CSharp.dll file.  Even there, you're not likely to find it as many of the actual numbers you see in the game are based off formulas which in turn read from the "raw" stats.

I recommend playing the game instead, as a more productive use of time ;)
Have ideas or bug reports for one of our games? Mantis for Suggestions and Bug Reports. Thanks for helping to make our games better!

Offline TechSY730

  • Core Member Mark V
  • *****
  • Posts: 4,570
Re: Location of unit stats within game?
« Reply #4 on: January 27, 2011, 08:55:24 pm »
Thanks for the tip. Thanks to an assembly viewer, I can now see the structure of the game's API and the decompiled forms of functions. (Granted, some of the functions are so complex that it is crashing the decompiler I am using :o)

However, looks pretty well structured. It should help me out when you start tossing around class names in various discussions.

It will be fun to try to compile a program against the dll, and see if it works at all. ;)

EDIT: I just thought of something. Although you seem to have given the thumbs up on checking out the assembly, is decompiling and linking against the dll forbidden by the EULA?

EDIT2: Cheats.CheckCheat(string)...Good night! Either Mono is compiling whatever your wrote there strangely, or you guys really like nested if statements.  ::)
« Last Edit: January 27, 2011, 09:30:45 pm by techsy730 »

Offline chemical_art

  • Core Member Mark IV
  • *****
  • Posts: 3,952
  • Fabulous
Re: Location of unit stats within game?
« Reply #5 on: January 27, 2011, 09:30:52 pm »
Thanks for the detailed location! Examining the code is a hobby in itself, not just a mean to an end. I am sure I'll have to scrounge up some programs to make use of the data, but it is nice to have such rapid feedback.
Life is short. Have fun.