#1 5th Dec 2018 04:39:23

Village Idiot
Reputation: 0

Registered: 5th Dec 2018
Posts: 0

Internal Game Modification & Format Deciphering (Support/Discussion)

Hello all,
Stronghold 2 is definitely an aged game, but has a flare to it I haven't been able to shake since I first played it around 2005-2006. However, after starting it back up again recently in the past month I thought it was time to dig deeper into what makes this game work and how we can get more out of it.
First, my background is a back-end low-level (closer to machine language than languages like Python - I work with C++ and such) programmer. I love binary data (especially binary files) and figuring out how things work.

So what's this about?
To begin, I'd like to say that I've already taken some cracks at analyzing the map files. I'm sure we're all aware there was an old Java program that could "unlock" maps that were created by Firefly themselves. 
Kill Barclay, Impossible Anyone?
While it may not be totally impossible, it has game breaking bugs that make it unplayable. So I wanted to edit the map. Oh no, it wasn't editable (like all Firefly authored maps). This was the map that started me on a journey to look through the file structure and really see what we can start tackling. 
This problem, however, was pretty simple (And for staff/management, I apologize for being new but I'd love to write tutorials on how to modify things like this for personal use - but I'm not entirely sure what constitutes 'quality article guidelines' to submit one). 
The map files have a "header" at the top with an author chunk. This has a certain amount of bytes in typical header format. Once removed, the game's map editor will show it when choosing a map to edit. But that isn't all. Stronghold 2 does not have proper access (or it refuses to, I'm not entirely sure yet) to the typical Program Files installation directory and cannot load the map even though it shows it as available to be loaded. You must first move this map file (or rather, make a copy of it) to the Maps folder in your Documents/My Games/Stronghold 2
I have since edited this Firefly custom War map to be bug-free and properly playable.
However, that is just a story. I would like to know of any information anyone else has gathered on Stronghold 2's internals and see where we, as a community, can go with this.
My next project is to be able to change hard-coded limits on peasants, troops, etc; and then move on to disabling features like Gong/Rats/Crime in Kingmakers.

  • 0

#2 5th Dec 2018 05:14:37

High Emperor
Reputation: 216

From: Azusa, Ca. USA
Registered: 1st Jan 2015
Posts: 8,723

Re: Internal Game Modification & Format Deciphering (Support/Discussion)

Hello, nox7 - and Welcome to Stronghold Nation!

You obviously made some important observations about SH2 which may (or may not be known). As for submitting Tutorials and related Articles, please feel free to submit these - providing you follow our Guidelines for ''Submitting Articles''. They are Posted on The Site and are quite easy to follow. Upon approval by Staff, they will be posted to our Library for everyone to enjoy and learn.

Again welcome and we look forward to your future input and participation!

Crusader 1307

Ego Sum Re Historica Meritissimus


  • 1

#3 22nd Dec 2018 12:25:40

Lord Commander
Reputation: 148

From: England, United Kingdom
Registered: 14th Aug 2013
Posts: 2,194

Re: Internal Game Modification & Format Deciphering (Support/Discussion)

Hi nox7, welcome to the site!

Yes, I've noticed before about the header of the file..... it contains basic things such as the map type, i.e. Kingmaker and a few of the more basic settings and configuration of the map. In regards to the Program Files directory the game struggles reading maps from there because it's considered a protected directory in Windows. Which is why you need admin privileges to do things there. That's why the game struggles there.

As Crusader1307 pointed out, we'd love to have some of your tutorials on the site smile If you want you can PM them to me and I'll get them up there for you. Also if you like you could upload your bug-free version to our downloads section.... I'm sure many of our members would enjoy that being there.

Finally, in relation to hard-coded limits, I'm not sure there's much that can be done on that front I'm afraid. Although you may be able to accomplish some of it as you sound more experienced in this field than myself. I've come to find that most of the configurable info (appears) to be hard-coded in the exe file.

Have a good Christmas smile

  • 0
Users in this topic: 0 guests, 0 registered users

Board footer

Powered by Aura