RPGDot Network    
   

 
 
Crusaders of Might & Magic
Display full image
Pic of the moment
More
pics from the gallery
 
 
Site Navigation

Main
   News
   Forums

Games
   Games Database
   Top 100
   Release List
   Support Files

Features
   Reviews
   Previews
   Interviews
   Editorials
   Diaries
   Misc

Download
   Gallery
   Music
   Screenshots
   Videos

Miscellaneous
   Staff Members
   Privacy Statement

FAQ
Members
Usergroups
HELP! Does anyone know where the Monster data is stored?
  View previous topic :: View next topic
RPGDot Forums > Gothic 2 Spoilers

Author Thread
Xerxes712
High Emperor
High Emperor




Joined: 01 Nov 2002
Posts: 605
Location: Uber die Welt
HELP! Does anyone know where the Monster data is stored?
   

Does anyone know where or how monster data is stored?

I can not find it in the game.dat file. I only find monster_ID and the Guild stat number which I can change; is the data hardcoded in the EXE?

According to the Gothic 1 Mod Kit, the monster.MDS string is there in ANIM folder. It lists the AI monster behavior which can be tweaked .

BUT there is no Script.D file for the monster attributes, like in Gothic 1 Mod Kit.

I wonder if that data is hardcoded in EXE according to the Monster ID.

Anyone with more programing experience know where this data is? It will take me forever to find it in the EXE since it is compiled and is a jumble of numbers. Thank for any help. Even a good guess is welcomed.
_________________
Wo ist mein Sumpfkraut?
Post Mon Jul 21, 2003 6:36 pm
 View user's profile
elkston
High Emperor
High Emperor




Joined: 21 Sep 2002
Posts: 691
Location: North Carolina, USA
Re: HELP! Does anyone know where the Monster data is stored?
   

I write code for a living. But of course, that doesn't provide me with the magic ability of decoding how PB internally stores their game data!

I will give it a shot though.

I doubt that the monster data is hardcoded into the EXE. Lack of flexibility would be the main reason. With that being said, I see two possibilities:

1. The "monster id" field you see is actually used as a key to index into a table that is encoded (read: stored in binary somewhere) in one of the game data files. The table is probably read into memory at startup and accessed whenever the game is creating NPC "objects" (monsters, people). Finding where the table is stored would be difficult without custom tools or knowing their data storage format. It could be compressed, encrypted, or both.

2. The monster data is bound at runtime when the game accesses that monster's "create" script. I've found that lots of modren games are really just sophisticated interpreters. The executable has all the specifics of communicating with the graphics engine, handling timers, and sending events. The actual game logic is coded at a higher level in a scripting language. The scripts handle everything from conversations, quests, to defining the properties of NPCs.

It's possible that every type of NPC has a creation script that binds attributes such as max hit points, resistance, etc. The script is run whenver the game engine determines that NPC or montster needs to be rendered. So, where are these scripts stored?

My guess is that they are compressed and stored somewhere either in the VDF volume or some other large game data file. When the game needs a script, it probably decompresses the script on the fly, and then interprets it. Originally the scripts are probably in plain text so they would compress quite well.

The other option is that the scripts do not actually ship in plain text, but are compiled into the "native language" of the game engine before shipping -- and then packed into an archive.

In either approach, there is no way to actually get at the scripts and edit their data without using specific game tools (since the structure of the data files is unknown).

Now, this could ALL BE WRONG. I am just thinking about the most likely scenarios.
_________________
All shall hear the words of Karras...the words of Karras
Post Tue Jul 22, 2003 4:14 pm
 View user's profile
Xerxes712
High Emperor
High Emperor




Joined: 01 Nov 2002
Posts: 605
Location: Uber die Welt
   

Thanks Elkston, it probably is not in the EXE I agree. It will take a bug hunt to find this one trial and error. This game is an optimized version of the orignal Gothic1 game and you can see left over code in the game.dat file. I assume the structure is similar; that one had a G2 MOD develoment Kit with the tools for it. Each animated thing in the game had two files, an person.MDS for the behaviour and person.D for specific attributes and skills.

The person.MDS files are readily available in the ANIM folder but has no script.D data associated with it there. Must be in the game.dat as that look up table at the start. Since it is compiled; it is not sitting down and read it like a news paper. I do not have a tool to decompile it like given to us for Gothic1. That tool you could make new NPC, monsters, etc and give them attributes and behaviour scripts. G2 is has alot in common, but is not going to work for it. G1 script tool would allow you to even create new quest which I was looking forward to. It was in German, but a translation tutorial is still there at Gothic1 files section under Modding.

The start of the file game.dat has 4 hex numbers which are the key typically for archives like this to decompress it. I saw an example simple program written in C++ for a game Freelancer called Binique and a tutorial on how to write your own to decompress these types of binary/hex data files.

Looks the same to me. I think I could modify that tool to work for this file game.dat and would make it so much more readable to find the data, then go back and hex edit in the releveant data in the correct spot.

I will try to change some of the numbers in that game.dat look up table. I hope they kept it in hex original value instead of doing something like adding an offset or using the inverse number, etc. The FireWaran has 210 unique hitpoint number and is big enough to test, along with some other above 256 to look for 3 hex 'double number' string (written typically back wards 300 value decimal= 12C hex = 2C 01 format, used for other values such as Gold Chalice worth 1500 gold is stored in this format) to cut it down to about a hundred locations. let the hunt begin.
_________________
Wo ist mein Sumpfkraut?
Post Tue Jul 22, 2003 6:43 pm
 View user's profile
elkston
High Emperor
High Emperor




Joined: 21 Sep 2002
Posts: 691
Location: North Carolina, USA
   

Xerxes,

Sounds like you are doing the best you can do without having the right tools.

With the hex editor you can find specific values in this "game.dat" file, but then how do you know the context of those values -- perhaps it doesn't even realte to monster hit points. I guess one way is to find out
the HP(or some other value) of a specific monster that is somewhat unique.. I dunno like 9999 or something. Then look for that value in the file. If you find it, you can maybe do some reverse engineering and figure out of how a "monster" record is stored. Maybe it is fixed-sized and you can then write a program to pull out data from the file based on the record size.

Of course, if the values are encoded in some weird way (like you mentioned) this is all for naught. I don't see any reason they would do that though. Usually you would only choose to do something like that if you wanted to save space (or hide your secrets! ).

Good luck.
_________________
All shall hear the words of Karras...the words of Karras
Post Tue Jul 22, 2003 10:31 pm
 View user's profile
Xerxes712
High Emperor
High Emperor




Joined: 01 Nov 2002
Posts: 605
Location: Uber die Welt
SUCCESS! I can MODify ALL Monsters, Animals and NPC!
   

After staring at this game.dat file for a week straight, I finially saw the pattern used for the encodeing. It may be a bit ackward to tell you how it is done, but I can show you for a specific example.

The data is compressed. I have not written a tool yet to uncompress it to read it better yet. The file store data with on offset adress to where you can find a monster ALL STATS file array string. It is not obvious but the method works. I can change all aspect of anything in the game. I made a sheep into a very tough fire breathing tough monsters with huge stats; I made a Demon Lord into a low level, weak demon. I can even change what the monster even looks like; If I had Studio Max 3 , I could make new art work for anything in game texture onto meshes (make more cool armor and weapons).

I am not well versed in C++ language but I can show someone swho is interested how to go about editing the game.dat file to change stats from hitpoints, level, exp, LP, Skills, Mana, STR, DEX, ALL ARMOR protection values, Cost, Monster fighting tactic, AI VAR array (make them smarter but a drain on th CPU a bit). I saw a tutorial on one from Freelancer called Binique at I think it can be done even by someone like me, but other programers here should be able to whip this editor tool out in a faster mannner than me.

Now I can make monster and animals, or NPC tougher in anyway you want. I want to make them tougher (Dragons and their minions) for more challenge in G2Hard MOD. Gee, too Hard MOD Want a real challenge now?

I need input on where to make things tougher and I can alter weapons to do better things to help make up for some balance like upping some 2h a little more, and crossbows.

later I want to add in more animals and monsters, plus more QUEST! The tool and editing is not hat much different as was for Gothic1, but let me do one thing first at a time. Please comments, I can and want to make this a more fun game.

How should I modify what monsters, animals, and NPC to be tougher and exactly in what way? Give wolf a pierce damage to go through your armor like arrows easier? Make dragons more health points or armor, or Fight technique, Mana and spells use? Ice Dragon spit out Wave of Ice and frozen i nspot is tougher to beat, change the animation call and damage type assiged to it. I already made a good G2text MOD ready to go. This one will be call G2Hard MOD.

I want to make some of the worthless spells and weapons a bit more important in use to deal with these more tough monsters in a fun, more intelligent way. Also alter Blade, Blunt, and Axe class weapons more pronounced in use and effect according to your style.

I talk alot but this game really got me. I can make it even more fun. Any feedback to what you want? When this hits US Market, thousands more will play and the more fun MOD out there; the more units will get sold for an encore for G3 and and our Expansion Raven.
_________________
Wo ist mein Sumpfkraut?
Post Wed Jul 23, 2003 4:30 am
 View user's profile



All times are GMT.
The time now is Tue Apr 16, 2019 2:23 pm



Powered by phpBB © 2001 phpBB Group
 
 
 
All original content of this site is copyrighted by RPGWatch. Copying or reproducing of any part of this site is strictly prohibited. Taking anything from this site without authorisation will be considered stealing and we'll be forced to visit you and jump on your legs until you give it back.