Accessing Stored Data from another game

Blitz3D Forums/Blitz3D Programming/Accessing Stored Data from another game

.rIKmAN.(Posted 2005) [#1]
Hi,

Firstly, if this is not the right section, I apologise, but couldn`t really see a section that it would fit into.

Ok, so...

Basically I want to write a "game" which will utilise data which is created by another (commercial) game.
The problem I have is I have no idea how to get this data out, nevcer mind in a readable format!

The data must be stored somewhere when you save your game - right?

There is also some realtime data that is created down to your play, which *may* be stored in RAM, rather than HD, but I know the final overall data I need must be stored SOMEWHERE.

Does anyone have any idea of how to go about getting to this data (hex editing or whatever) or point me in the right direction?

If any more info is needed please let me know.


big10p(Posted 2005) [#2]
Finding where the saved game file is (surely not too difficult?) will be the least of your problems. You'll need to know the format of the file in order to read/parse it in any meaningful way. It could well be encripted too, to stop people hacking them to cheat, etc.


John Blackledge(Posted 2005) [#3]
Methinks there is a slight ethical problem here.


.rIKmAN.(Posted 2005) [#4]
big10p: Yeah I understand this.
John B: How so?

Maybe I didn`t elaborate quite enough?

The game is a football game.
What I need to do is access the match data that is created after each match (goals, shots on target, possession, cards, passes, tackles etc)

Obviously this is different for every match depending on how you play, but the data, which is created real-time by yourself, must be stored somewhere - right?

I would like to be able to access this data and use it in a management game I am writing, from which you would do the usual stuff, then you could "play" the match using the commercial game, with the players, tactics, strategies etc that you defined in the management game.

After the match, the goals, injuries, assists, bookings etc would be transferred back to the management game to update tables etc etc.

I have a plan here for features and interactions etc, but the stumbling block at the moment is getting access to the data, without this I can`t do anything.


John Blackledge(Posted 2005) [#5]
And you're sure that the authors of the original game won't mind you doing that?


octothorpe(Posted 2005) [#6]
I'd like to suggest that this is a bad idea, not for legal or ethical reasons, but out of sympathy for you, the programmer - you'll be painting yourself into a corner in that a large chunk of the game won't be even slightly modifiable if you should want or need to make even a tiny modification.

That said, to find a save game file:

1. Save your progress in the game.
2. Alt-tab or kill the game program so as not to give it a chance to write anything else to disk.
3. Find the most recently modified file(s) on your hard disk.

Now comes the fun part: since the original programmers knew that they would be the only ones accessing the save game data, they had no reason to make it human-readable or even sensible. As big10p pointed out, they may have intentionally made it more difficult to crack. Save slightly different situations and compare the files to track down where things are stored: you may have won the match with 12 points, but there could be hundreds of copies of the number 12 - win again with only 11 points and determine which 12s changed to 11s. This will likely be painfully time-consuming.

With this kind of project, you need to determine if everything will be possible before you invest any time into it: will you be able to bootstrap the game into running the match you want immediately? will you be able to get the game to terminate when a match has finished? or will your players have to click through a menu system in the game to start your saved match and then remember to quit the game after the match so they return to your management game?

XCOM: UFO Defense (the bestest game ever) worked like this, in that the strategic base-management game would save to disk the details of the mission to be played, then execute the tactical part of the game. That would, in turn, write the results of the mission to disk and execute the strategic part of the game. I believe this was done so they'd have more memory to play with. I think they wrote both halves themselves, however. ;)


.rIKmAN.(Posted 2005) [#7]
John B: I fail to see how they would mind.
There is a large community of people who release "patches" to the game, all be it new kits, new pitches, edited player data, new balls, new boots etc etc

This has been happeneing for years and there has been no problem, the company has even spoke about the "support of the editing community" before in interviews.

So, no I don`t think it will be a problem, I am not releasing the game for money or gain, it will be released freeware to the community, much like mods to other popular games are.

Octothorpe:

Firstly, big thanks for the helpful reply!
No work has been done on this project yet, because as you say, I need to see what is possible before I even bother coding the framework.

You rightly predict my method for the handling of program-switching.
Once the management game saves all the data, it will either insert, or create a new data file containing all this new data.
The game will then be launched using this new data file, and the player (until a better way presents itself later) will start a normal match, choose the 2 teams and play, then save the game, and close.

back int he management game, this save file will be read, parsed and brought into the game.

Rinse and repeat.

Also, with your comment about not being able to modify even the slightest thing in the game - I don`t need to.
All I need to do is find out the format and parsing of the saved data, as all the other stuff will be done management-side, all I need the footy game to do is play the match - I can get the data in OK, its finding what it spits out thats the stumbling block.

No doubt a lot of obstacles will have to overcome, and a lot of stuff will be done differently to the basic "working outline" that I just described, but I`m sure its doable, I just need some pointers for help with getting this data, recognising encryptions and so forth.

What kind of programs?
Any tutorials?

Mods let me know if this discussion is not ok, I do not mean to offend anyone.

Cheers!