Page 4 of 10 FirstFirst 12345678910 LastLast
Results 61 to 80 of 194

Thread: Modding game mechanics in DB files

  1. #61

    Default Re: Modding game mechanics in DB files

    I haven't been able to get an answer to this question: Is there a way to change the flag of France in the late-era custom battle menu to be the same as the Royal flag in the early-era? Thanks

  2. #62

    Default Re: Modding game mechanics in DB files

    Quote Originally Posted by Porphyr View Post
    I'm currently analysing the db files' general structure as a first step towards an editor.

    So far I found that every file's first byte is 01. The next four bytes give the number of data sets in this file (e.g. there are 113 entries in unit_stats_naval).

    My problem is that I didn't find the delimiter yet. In units, the entries end with 8, 7, 6, or 5 zero bytes. In unit_stats_naval, there seems to be no such delimiter. In building_levels, entries end with a significantly larger number of zero bytes. However in building_levels, the number of bytes following the 4 bytes value for costs is always 41.

    If one of you knows more about this, I'm happy to hear from you.




    I think you've got something wrong. In "building_levels", all the costs are stored as 2 byte short integers. The only real structure i could figure out from that file is that all the turns it takes to build a building are stored exactly 3 null bytes before the money cost. This is how i was able to use the search/replace tool to change all the values quickly without ing something up. I simply searched for something like "02000000E803" for example, where the first byte is the turns it takes to build it, in this case 2.


    The last 2 bytes are a short int that stores the cost, in this case 1000. So i simply searched for that and replaced all those entries with "01000000E803". That would make every building that costs 1000 and takes 2 turns to build now only take 1 turn to build. Then i simply went one increment higher with the turn number and searched for "03000000E803" which is all the buildings that cost 1000 and takes 3 turns to build. Then, once i couldn't find any more values for that string, i increased the cost by a few increments (usually 250, but sometimes as low as 50) and did the same thing again. Anyway, i've all done with my mod now.


    I've implemented ALL my changes now, and everything seems to be working. So i'll just upload my modified patch.pack somewhere.

  3. #63

    Default Re: Modding game mechanics in DB files

    Serben how do repack the files into patch.pack? I used alpacas little guide but i didnt work.
    Don't smoke the seed

  4. #64

    Default Re: Modding game mechanics in DB files

    Yeah, I'm using the repacker, to. I can't get it to work.

    It says, 'Changing pack to patch.pack_old' (what I named it), but it doesn't pack anything, nor does it create a new patch.pack.

    No idea why. Did you have to do anything funky? What does your repack.xml look like?

  5. #65

    Default Re: Modding game mechanics in DB files

    Well Serben, given that there are exactly three zero bytes between time and costs and that basically every other value stored in these files (other db files) is followed by two or three zero bytes (depending on its size), I believe that these are not unsigned short integer but rather unsigned integer.

    But I can tell you that there is a very clear structure (especially in this file).
    In general the structure of each entry follows the following pattern:
    Building Identifier [String] "admiralty"
    Building Slot [String] "navy-admin" (On the building screen you see only a limited amount of building slots; navy-admin is the identifier of one of them)
    Condition [String] "inFactionCapital()" (Building only available if city is capital) "IF isCulture(middle_east) { hasRegionBuilding(jesuit_college) }" (another example)
    Time to build [Unsigned Integer] "0x02000000" (Could also be byte "0x02")
    Purchase Price [Unsigned Integer] "0xE8030000" (Could also be ushort "0xE803")

    This structure applies to all buildings in building_levels. But still, I cannot find a delimiter other than a large amount of zero bytes...

  6. #66
    Megasalexandros's Avatar Campidoctor
    Join Date
    Sep 2006
    Location
    Northern Greece(Macedonia)
    Posts
    1,828

    Default Re: Modding game mechanics in DB files

    iam confused what file i have to OPEN with HEX to find the STATS FOR THE UNITS?

  7. #67

    Default Re: Modding game mechanics in DB files

    Where do I have to look for just changing the unit sizes?

  8. #68

    Default Re: Modding game mechanics in DB files

    chrisxpred - If you are using Vista, go to C:\Users\Your User Name\AppData\Roaming\The Creative Assembly\Empire\scripts. If you are using XP, it is C:\Documents and Settings\Your User Name\Application Data\The Creative Assembly\Empire\scripts. Be sure to have "Show Hidden Files and Folders" on. The file you want is called preferences.empire_script.txt.

    Coder on Dark Ages: Roman Revival, the alternate history mod for BI.

    Under the Patronage of Augustus Lucifer, member of the House of Ward.

  9. #69
    Megasalexandros's Avatar Campidoctor
    Join Date
    Sep 2006
    Location
    Northern Greece(Macedonia)
    Posts
    1,828

    Default Re: Modding game mechanics in DB files

    Thank you for your answer but i knew that, i was looking for the file that i have to open with hex so that i can change the numbers of ONE unit and not overall.
    Thats what iam searching for

  10. #70

    Default Re: Modding game mechanics in DB files

    The file is ./data/db/unit_stats_land_tables/unit_stats_land, as was said in the OP.

    Coder on Dark Ages: Roman Revival, the alternate history mod for BI.

    Under the Patronage of Augustus Lucifer, member of the House of Ward.

  11. #71
    Megasalexandros's Avatar Campidoctor
    Join Date
    Sep 2006
    Location
    Northern Greece(Macedonia)
    Posts
    1,828

    Default Re: Modding game mechanics in DB files

    Rep to you, thank you very much
    but i got in steammaps etc etc, i go to my data folder, and there is not such a file or folder called db...i even search my c: to find such files but there are none...:hmmm:
    Last edited by Megasalexandros; March 09, 2009 at 04:22 AM.

  12. #72

    Default Re: Modding game mechanics in DB files

    Megasalexandros, you can't see this folder if you didn't unpack the .pack files. See this post for an unpacker: http://www.twcenter.net/forums/showthread.php?t=234546

  13. #73

    Default Re: Modding game mechanics in DB files

    Has anyone found where the cost to purchase and upkeep land units is stored? I've been working at it for a couple hours but havne't been able to eperically identify it.

  14. #74

    Default Re: Modding game mechanics in DB files

    Unit costs and upkeep costs are stored in db\units_tables\units
    Code:
    Offset      0  1  2  3  4  5  6  7   8  9  A  B  C  D  E  F
    
    00000000                  10 00 31  00 32 00 5F 00 6C 00 62        ..1.2._.l.b
    00000010   00 65 00 72 00 5F 00 68  00 6F 00 77 00 69 00 74   .e.r._.h.o.w.i.t
    00000020   00 7A 00 65 00 72 00 1F  00 31 00 32 00 2D 00 6C   .z.e.r...1.2.-.l
    00000030   00 62 00 65 00 72 00 20  00 48 00 6F 00 77 00 69   .b.e.r. .H.o.w.i
    00000040   00 74 00 7A 00 65 00 72  00 20 00 46 00 6F 00 6F   .t.z.e.r. .F.o.o
    00000050   00 74 00 20 00 41 00 72  00 74 00 69 00 6C 00 6C   .t. .A.r.t.i.l.l
    00000060   00 65 00 72 00 79 00 09  00 61 00 72 00 74 00 69   .e.r.y...a.r.t.i
    00000070   00 6C 00 6C 00 65 00 72  00 79 00 0E 00 61 00 72   .l.l.e.r.y...a.r
    00000080   00 74 00 69 00 6C 00 6C  00 65 00 72 00 79 00 5F   .t.i.l.l.e.r.y._
    00000090   00 66 00 6F 00 6F 00 74  00 8A 02 00 00 01 00 00   .f.o.o.t.Š......
    000000A0   00 8A 02 00 00 04 01 00  00 16 00 00 00 01 19 00   .Š..............
    000000B0   61 00 72 00 74 00 69 00  6C 00 6C 00 65 00 72 00   a.r.t.i.l.l.e.r.
    000000C0   79 00 5F 00 6D 00 65 00  64 00 69 00 75 00 6D 00   y._.m.e.d.i.u.m.
    000000D0   5F 00 68 00 6F 00 77 00  69 00 74 00 7A 00 65 00   _.h.o.w.i.t.z.e.
    000000E0   72 00 15 00 65 00 75 00  72 00 6F 00 5F 00 68 00   r...e.u.r.o._.h.
    000000F0   6F 00 77 00 69 00 74 00  7A 00 65 00 72 00 5F 00   o.w.i.t.z.e.r._.
    00000100   31 00 32 00 5F 00 69 00  63 00 6F 00 6E 00 10 00   1.2._.i.c.o.n...
    00000110   31 00 32 00 5F 00 6C 00  62 00 65 00 72 00 5F 00   1.2._.l.b.e.r._.
    00000120   68 00 6F 00 77 00 69 00  74 00 7A 00 65 00 72 00   h.o.w.i.t.z.e.r.
    00000130   10 00 31 00 32 00 5F 00  6C 00 62 00 65 00 72 00   ..1.2._.l.b.e.r.
    00000140   5F 00 68 00 6F 00 77 00  69 00 74 00 7A 00 65 00   _.h.o.w.i.t.z.e.
    00000150   72 00 01 06 00 67 00 6C  00 6F 00 62 00 61 00 6C   r....g.l.o.b.a.l
    00000160   00 00 00 00 00 0C 00 6D  00 70 00 5F 00 61 00 72   .......m.p._.a.r
    00000170   00 74 00 69 00 6C 00 6C  00 65 00 72 00 79 00 01   .t.i.l.l.e.r.y..
    00000180   01                                                 .
    The red bytes should be the recruiting costs and the blue bytes the upkeep costs.

  15. #75

    Default Re: Modding game mechanics in DB files

    You is hero!

    I spent two hours in there sequentially changing values, but with no luck. Thank you!

  16. #76
    izanagi11's Avatar Semisalis
    Join Date
    Jul 2006
    Location
    Chicago, IL
    Posts
    417

    Default Re: Modding game mechanics in DB files

    Quote Originally Posted by Porphyr View Post
    Unit costs and upkeep costs are stored in db\units_tables\units
    Code:
    Offset      0  1  2  3  4  5  6  7   8  9  A  B  C  D  E  F
    
    00000000                  10 00 31  00 32 00 5F 00 6C 00 62        ..1.2._.l.b
    00000010   00 65 00 72 00 5F 00 68  00 6F 00 77 00 69 00 74   .e.r._.h.o.w.i.t
    00000020   00 7A 00 65 00 72 00 1F  00 31 00 32 00 2D 00 6C   .z.e.r...1.2.-.l
    00000030   00 62 00 65 00 72 00 20  00 48 00 6F 00 77 00 69   .b.e.r. .H.o.w.i
    00000040   00 74 00 7A 00 65 00 72  00 20 00 46 00 6F 00 6F   .t.z.e.r. .F.o.o
    00000050   00 74 00 20 00 41 00 72  00 74 00 69 00 6C 00 6C   .t. .A.r.t.i.l.l
    00000060   00 65 00 72 00 79 00 09  00 61 00 72 00 74 00 69   .e.r.y...a.r.t.i
    00000070   00 6C 00 6C 00 65 00 72  00 79 00 0E 00 61 00 72   .l.l.e.r.y...a.r
    00000080   00 74 00 69 00 6C 00 6C  00 65 00 72 00 79 00 5F   .t.i.l.l.e.r.y._
    00000090   00 66 00 6F 00 6F 00 74  00 8A 02 00 00 01 00 00   .f.o.o.t.Š......
    000000A0   00 8A 02 00 00 04 01 00  00 16 00 00 00 01 19 00   .Š..............
    000000B0   61 00 72 00 74 00 69 00  6C 00 6C 00 65 00 72 00   a.r.t.i.l.l.e.r.
    000000C0   79 00 5F 00 6D 00 65 00  64 00 69 00 75 00 6D 00   y._.m.e.d.i.u.m.
    000000D0   5F 00 68 00 6F 00 77 00  69 00 74 00 7A 00 65 00   _.h.o.w.i.t.z.e.
    000000E0   72 00 15 00 65 00 75 00  72 00 6F 00 5F 00 68 00   r...e.u.r.o._.h.
    000000F0   6F 00 77 00 69 00 74 00  7A 00 65 00 72 00 5F 00   o.w.i.t.z.e.r._.
    00000100   31 00 32 00 5F 00 69 00  63 00 6F 00 6E 00 10 00   1.2._.i.c.o.n...
    00000110   31 00 32 00 5F 00 6C 00  62 00 65 00 72 00 5F 00   1.2._.l.b.e.r._.
    00000120   68 00 6F 00 77 00 69 00  74 00 7A 00 65 00 72 00   h.o.w.i.t.z.e.r.
    00000130   10 00 31 00 32 00 5F 00  6C 00 62 00 65 00 72 00   ..1.2._.l.b.e.r.
    00000140   5F 00 68 00 6F 00 77 00  69 00 74 00 7A 00 65 00   _.h.o.w.i.t.z.e.
    00000150   72 00 01 06 00 67 00 6C  00 6F 00 62 00 61 00 6C   r....g.l.o.b.a.l
    00000160   00 00 00 00 00 0C 00 6D  00 70 00 5F 00 61 00 72   .......m.p._.a.r
    00000170   00 74 00 69 00 6C 00 6C  00 65 00 72 00 79 00 01   .t.i.l.l.e.r.y..
    00000180   01                                                 .
    The red bytes should be the recruiting costs and the blue bytes the upkeep costs.
    In front of the red, the 4 bytes( 01 00 00 00) is the build time of the unit.
    "The shape of you, the shape of me, the shape of everything I see.."

  17. #77
    Megasalexandros's Avatar Campidoctor
    Join Date
    Sep 2006
    Location
    Northern Greece(Macedonia)
    Posts
    1,828

    Default Re: Modding game mechanics in DB files

    Thanks for the answer!

  18. #78
    Megasalexandros's Avatar Campidoctor
    Join Date
    Sep 2006
    Location
    Northern Greece(Macedonia)
    Posts
    1,828

    Default Re: Modding game mechanics in DB files

    Whait ive oppened the files and now what??
    I will have to search EVERY SINGLE UNIT to find what i want?
    Why CA destroyed the old good way of moding things?WHY!

  19. #79

    Default Re: Modding game mechanics in DB files

    Quote Originally Posted by Mythic_Commodore View Post
    chrisxpred - If you are using Vista, go to C:\Users\Your User Name\AppData\Roaming\The Creative Assembly\Empire\scripts. If you are using XP, it is C:\Documents and Settings\Your User Name\Application Data\The Creative Assembly\Empire\scripts. Be sure to have "Show Hidden Files and Folders" on. The file you want is called preferences.empire_script.txt.

    Ive heard changing this also s up something about ancillaries. I thought you can change the unit size somewhere in the db-files, as Serbens mod only contains a new patch.pack, doesnt it?

  20. #80

    Default Re: Modding game mechanics in DB files

    how do you modify british line infantry to have 73 range and 48 accuracy
    [SIGPIC][/SIGPIC]

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •