Skip to content

Commit

Permalink
Tried capturing info as defined by disassembled header files. No luck
Browse files Browse the repository at this point in the history
There are more data fields defined, but I dn't know if any of them
are valid, and they don't seem to end in a useful place
  • Loading branch information
JimOfLeisure committed Jan 8, 2015
1 parent 148e79e commit e41fc9f
Showing 1 changed file with 19 additions and 7 deletions.
26 changes: 19 additions & 7 deletions civ3.py
Expand Up @@ -196,17 +196,29 @@ def __init__(self, saveStream):
# GAME
# Trying to figure it out based on https://github.com/Antal1987/C3CPatchFramework/blob/master/Civ3/Game.h
# Looks like a bunch of integers
# SKIPPING over GAME section since I haven't figured it out yet
#self.gameLength = horspool.boyermoore_horspool(saveStream, "DATE")
#print 'GAME section length: {0}'.format(self.gameLength)

#self.game = struct.unpack('46i', saveStream.read(46*4))
#self.game = struct.unpack('74i', saveStream.read(74*4))
#self.game = struct.unpack('96i', saveStream.read(96*4))
#self.game = struct.unpack('263i', saveStream.read(263*4))
self.game = struct.unpack('263i', saveStream.read(263*4))
#print len(self.game)
#print self.game

# GAME / default game settings
(self.top_menu, self.preferences, self.difficulty, self.rules) = struct.unpack('4i', saveStream.read(4*4))
self.factions = struct.unpack('31i', saveStream.read(31*4))
self.gamelimits = struct.unpack('14i', saveStream.read(14*4))
self.moregamesettings = struct.unpack('8i', saveStream.read(8*4))
(self.custom_leader_name, self.custom_leader_title, self.custom_formal_name, self.custom_noun, self.custom_adjective) = struct.unpack('32s24s40s40s40s', saveStream.read(32+24+40*3))
self.moregamesettings2 = struct.unpack('10i', saveStream.read(10*4))
(self.world_seed_name,) = struct.unpack('12s', saveStream.read(12))
self.moregamesettings3 = struct.unpack('7i', saveStream.read(7*4))
self.actual_civ_array = struct.unpack('31i', saveStream.read(31*4))
(self.seafaring,) = struct.unpack('4s', saveStream.read(4))

#print self.__dict__

# SKIPPING over GAME section since I haven't figured it out yet
self.gameLength = horspool.boyermoore_horspool(saveStream, "DATE")
print 'GAME section length: {0}'.format(self.gameLength)

print "\nWhat's Next:"
self.whatsnext = hexdump(saveStream.read(263*4))
print self.whatsnext
Expand Down

0 comments on commit e41fc9f

Please sign in to comment.