Jump to content
Lord_Chris

Modifying Stronghold 3

Recommended Posts

I've posted a tutorial which tells you how to unarchive the game files from the '.v' format which they are in. This now means that modifying Stronghold 3 is finally possible.

 

To do so, you must download the following modding utility:

 

http://www.strongholdnation.co.uk/downloads/file/349-modifying-utility/

 

Here is the tutorial: http://www.strongholdnation.co.uk/article/195-unarchiving-stronghold-3-files

 

Let me know if anyone has any issues :)


Quote

The fields have eyes, and the woods have ears.

⁠— Geoffrey Chaucer, The Canterbury Tales: The Knight's Tale

Useful Articles

Share this post


Link to post
Share on other sites

Stronghold 3 crashes after starting with a converted file.

I dont changed anything and also converted it back to .v.

Share this post


Link to post
Share on other sites

What's your game version? I'm not quite sure why this could be happening if you followed the tutorial correctly, as every time I attempted to do that it worked perfectly.


Quote

The fields have eyes, and the woods have ears.

⁠— Geoffrey Chaucer, The Canterbury Tales: The Knight's Tale

Useful Articles

Share this post


Link to post
Share on other sites

Hello!

I know this thread is pretty old, so I am sorry if I should have started a new one, but it would be the same topic, so I didn't know what to do.

I am revisting Stronghold 3 after quite a while, because I was thinking of modifying it this time to try and fix some (many if I manage to...) of the issues it has, because I always wanted a 3D version of the first game and just improved on all of its aspects + new features. I also like the high-res heighmap system the game has on the terrain, because I like palying with those.

I followed your tutorial with success so far. I haven't tried to replace the re-archived files back to the game yet (I haven't done anything yet anyway), but I am concerned with how this will work, in case I have merged the files from the core and the update archives together, because the game has them separated. I merged them because it would be painful to see which stuff are updated from the core, to not edit those, and which I should edit from each update archive. 

So, if I replace all the different .v files with one that has everything (overwritten where needed), back in the game, how would this work?

EDIT: I noticed I can't open the .model files... Are they corrupt? I tried importing them into an AutoCAD drawing (since it supports .model files), but it says they are invalid/unsupported... 😐

Edited by Lord Aquila

Share this post


Link to post
Share on other sites

No matter! Seems to work fine with the merged files. I basically replaced core.v, update.v, loc.v, update2.v and update3.v, with just a core.v file that has everything from these archives merged into it. I tested the game and it works just fine without losing any of the updated features, or dlc.

However, the problem with the .model files still stands. 😐

Anyway, in the meantime I messed around with the water system, changing its textures, as well as modifying it in the editor, to see if everything works fine after applying my changes using your method, which it does. So, I feel confident to proceed to other modifications I wish to make. 🙂

 

sea_test.jpg

Edited by Lord Aquila

Share this post


Link to post
Share on other sites
On 13/04/2017 at 19:57, Wi3s3l said:

Stronghold 3 crashes after starting with a converted file.

I dont changed anything and also converted it back to .v.

Did you change the .v file's name? It has to be the same as the original is. I noticed that myself after changing it's name for some reason, and the game wouldn't run. 

Share this post


Link to post
Share on other sites

Greetings @Lord Aquila, welcome to the Nation!

Sorry for my slow reply. I've been very busy lately. That looks like a very nice modification! You may wish to upload it to our downloads section when you are done so other map makers can find it too :classic_smile:

On ‎09‎/‎11‎/‎2020 at 15:14, Lord Aquila said:

No matter! Seems to work fine with the merged files. I basically replaced core.v, update.v, loc.v, update2.v and update3.v, with just a core.v file that has everything from these archives merged into it. I tested the game and it works just fine without losing any of the updated features, or dlc.

I can't remember which way it is off-hand, but the game will automatically look for files within the directory or files within the archive, and load one of those first. I think it will look for files within the archive and if that doesn't exist fall back to any folders that may exist. You might want to make sure that the files are only in one of those formats first to ensure the game is loading the correct files.

In terms of the .model files, I'm not really sure what software will actually open them. They definitely are not corrupt, though. It's just a case of the software not recognising the format of the file so it wrongly assumes they are corrupt. I suspect they're kind of like a hybrid file of some kind where Firefly have simply changed the file extension but are using a different type of file (such as gr2). They aren't gr2 though, I've checked. Don't forget that in earlier Stronghold games, they used .uni files. To this date there's still nobody who really knows how to open those either, although we do know they are compiled with information on how to load the model. It's my suspicion that .model files are something similar for Stronghold 3, with the extra addition of having a data folder containing resources and materials XML files to load the relevant shading and graphics file for the model.

So in summary the model file is probably just a similar variation to the old .uni files built in a different format for the newer game engine used in Stronghold 3. We know that this engine is used again in Stronghold Crusader 2, and again in the upcoming Stronghold Warlords, and I know that the file formats for all three of these games are the same in terms of how the models are structured.

If you're actually looking to modify the model, I'd recommend taking a look at the DDS files, because you'll have far more luck with changing the skin of a unit than the actual structure of a unit, and changing a DDS file is very easy in today's age and can be done in free programs such as Photoshop or personally I use Paint.net (software, not website).


Quote

The fields have eyes, and the woods have ears.

⁠— Geoffrey Chaucer, The Canterbury Tales: The Knight's Tale

Useful Articles

Share this post


Link to post
Share on other sites

Thank you! I will upload when I have something ready. 🙂 And no problem for the late reply. I am a busy man too and I understand. 😀

12 hours ago, Lord_Chris said:

I can't remember which way it is off-hand, but the game will automatically look for files within the directory or files within the archive, and load one of those first. I think it will look for files within the archive and if that doesn't exist fall back to any folders that may exist. You might want to make sure that the files are only in one of those formats first to ensure the game is loading the correct files.

I tried pasting all the files back to the game uncompressed with the folders, to see if the game works. However, it didn't. I am guessing all the files within the .v archives are hardwired to be read this way and not uncompressed. So the game doesn't always fall back to any folders that may exist when it can't find a specific file inside a .v format? Too bad, because that would make my trial&error part of the moding process much faster and easier.

Of course the .model files can't be corrupt, what was I saying, dumb me, otherwise they would not work ingame, lol. 🥴 What you say make sense. How didn't I think of it. They might have renamed the files extension from i.e. '.obj' to '.model' just like that. Have you tried every mesh format to see if it is imported on any program? Because I am thinking of going super nerd mode and try importing the files in each and every mesh format in MeshLab, to see which one works.

12 hours ago, Lord_Chris said:

If you're actually looking to modify the model, I'd recommend taking a look at the DDS files, because you'll have far more luck with changing the skin of a unit than the actual structure of a unit, and changing a DDS file is very easy in today's age and can be done in free programs such as Photoshop or personally I use Paint.net (software, not website).

Yeah, probably that's my only bet.. I use photoshop fairly often in architecture school and other hobbies, so I know my way around. I also use the Nvidia tools for editing dds formats, so I am all well-equiped. 😁

Lastly, I would really like to check if it is possible to add additional models to the game (units or buildings for example), that can also be functional, and how much modable the game is, in general. If I know correctly, in Stronghold 2 that is not possible? All in all, first thing I have to do before moding, is to understand how the structure of Stronghold 3 works, the programming language (I think it's lua?) and how every part of it is related to each other.

EDIT: Oh I forgot to ask. I can't seem to be able to open the game's original maps in the Editor, as they are locked. Is there a way to unlock them? I would really like to make some changes, as well as copy the water properties I just modified, because I have to do it for every single map file that has water. Only the its textures automatically change everywhere.

Edited by Lord Aquila

Share this post


Link to post
Share on other sites
2 hours ago, Lord Aquila said:

I tried pasting all the files back to the game uncompressed with the folders, to see if the game works. However, it didn't. I am guessing all the files within the .v archives are hardwired to be read this way and not uncompressed. So the game doesn't always fall back to any folders that may exist when it can't find a specific file inside a .v format? Too bad, because that would make my trial&error part of the moding process much faster and easier.

I must be thinking of a different game then in that regard. I'm not sure which one.

2 hours ago, Lord Aquila said:

Lastly, I would really like to check if it is possible to add additional models to the game (units or buildings for example), that can also be functional, and how much modable the game is, in general. If I know correctly, in Stronghold 2 that is not possible? All in all, first thing I have to do before moding, is to understand how the structure of Stronghold 3 works, the programming language (I think it's lua?) and how every part of it is related to each other.

LUA files are a part of the game structure, but there's a lot more going on than just those. The game LUA files are mainly for behaviours and the mannerisms of the various units in the game. But it also controls things such as starting goods in multiplayer games. Firefly first used LUA scripts in CivCity Rome, and they've been re-used again in Stronghold 3, Crusader 2 and now in Warlords as well. In my opinion they're a really neat way of being able to control aspects of the game and make them more flexible. It's also great for us modders who can finally get to some things. I keep meaning to do an article on them actually, but I haven't ever been able to look into them in enough detail, or know the language well enough, to properly know how this would be best written yet.

Given the way Stronghold 3 is so different to the earlier games and how flexible it is, I'd be surprised if you couldn't add in new units so some degree. There's certainly the functionality to do some of this. However, this isn't ever something I've really looked into, and it's probably a pretty complicated process. I would certainly be open to working with you on this and exploring it in more detail though if it's something you're interested in pursuing. Feel free to shoot me a PM if you'd like to talk a bit more about your project in person, or you could create a new topic on the forum if you'd like a more public audience.

Once you understand how the game is structured, that's most of the battle and most things are just a case of renaming or altering.

Quote

EDIT: Oh I forgot to ask. I can't seem to be able to open the game's original maps in the Editor, as they are locked. Is there a way to unlock them? I would really like to make some changes, as well as copy the water properties I just modified, because I have to do it for every single map file that has water. Only the its textures automatically change everywhere.

Yes, you can unlock the maps using the following tutorial. It's written for Stronghold Crusader 2 but it also works with Stronghold 3: https://www.strongholdnation.co.uk/article/244-lockingunlocking-stronghold-crusader-2-maps


Quote

The fields have eyes, and the woods have ears.

⁠— Geoffrey Chaucer, The Canterbury Tales: The Knight's Tale

Useful Articles

Share this post


Link to post
Share on other sites

I seem to be having an issue trying to submit my sea water mod, I get this error after completing all the requirements and hitting submit.. Also, it took quite a while before getting this message.

Also, is there a thread about the download section, so as not to bump this one with any future issues I might have? I didn't seem to find one after a first search.

error.jpg

Share this post


Link to post
Share on other sites

Apologies @Lord Aquila - this is a known issue as I'm currently in the process of updating the downloads section. It should be done within the next few days (I didn't think you'd be ready to submit quite yet :classic_smile:). If you want, send it to me in an email or via the PM as an attachment, and I will upload it for you (under your own account)in a few days when the downloads update is totally complete. Or, I can let you know when the update is complete so you can upload it again then.

In terms of the downloads section, try our Site Questions/Support forum- you should be able to create a new topic in there to discuss any site issues you might have :classic_smile:


Quote

The fields have eyes, and the woods have ears.

⁠— Geoffrey Chaucer, The Canterbury Tales: The Knight's Tale

Useful Articles

Share this post


Link to post
Share on other sites

Oh, ok, no problem! I thought I was doing something wrong. 😛

It was quite fast indeed. However the mod doesn't have many actions behind it, so it was complete in quite a short time. I wanted to make some terrain fixes also on the original maps before submiting, but I thought it best to get something already done out there, since it can stand as a simple mod by itself. 🙂

I will send it to you via PM, I just hope I am not adding another task to you, if you are busy. 

Many thanks for the reply and your interest overall! 😁

Also, I have some strange news about the .model files of the game. I did a little research. First, I tried renaming a file's extension to every format MeshLab supports, and tried importing each and every one to see if the software recognises any. I didn't have a good result, but the closest I got to an actual result, is the .xyz format, which is a type of point cloud information (strange for such a file), that the software didn't give me an error and at least recognised the model's vertices, though it showed nothing in the viewport. (see image 1.jpg)

After that I thought of something I should have done first, actually. Checking the file's signature. So, I used a hex editor to open it and searched for it's signature on the most complete list I could find on the internet, but the weird thing was, that it was not listed... (see image 2, 3) The closest values (56 43 ...) are those of a pch format, which I doubt is anything close to what we are looking for. What sort of rare type of format did they use? I don't know what else to try, so I will leave the models as they are for now and play with other things.

Also, the geometry is not the most important thing for me now to mod, as I can at least do so with the textures, like you mentioned, and I have other priorities that have to do with the game funtionality and mechanics, as well as environment graphics (which at current state do not quite compliment the capabilities of the engine). The only thing I wanted to know is which formats work with the game if I want to add some models in the future.

1.jpg

2.jpg

3.jpg

Edited by Lord Aquila

Share this post


Link to post
Share on other sites
22 hours ago, Lord Aquila said:

It was quite fast indeed. However the mod doesn't have many actions behind it, so it was complete in quite a short time. I wanted to make some terrain fixes also on the original maps before submiting, but I thought it best to get something already done out there, since it can stand as a simple mod by itself. 🙂

Yeah that's a nice addition to the downloads section as a stand-alone mod. If you have any others, please do consider doing the same! Users tend to download files more easily if they're small rather than packaged together, so don't feel that any one file or mod is too small to upload.

22 hours ago, Lord Aquila said:

After that I thought of something I should have done first, actually. Checking the file's signature. So, I used a hex editor to open it and searched for it's signature on the most complete list I could find on the internet, but the weird thing was, that it was not listed... (see image 2, 3) The closest values (56 43 ...) are those of a pch format, which I doubt is anything close to what we are looking for. What sort of rare type of format did they use? I don't know what else to try, so I will leave the models as they are for now and play with other things.

Unfortunately, I'm not really sure what format they used to create it. But I would say we're on the right track in finding out. The description there of a pch file actually sounds pretty accurate to me, because we know that this is compiled code and not readable code. And we also know that Firefly have used variations of C in the past, on Stronghold 2 for example they use what I believe is some form of C or C++ in the shading.

You inspired me to take a look if this is some kind of archive knowing how they do this with other files, so I attempted to open this file as a zip and a rar, but this doesn't work. So it's compiled code, not an archive containing other files. This makes it trickier to edit, but not impossible.

I definitely think that we will be able to find out what this file format is, but it'll probably take a bit of work to do. It may be worth using the game engine website to take a look and see if anything is on there. Firefly originally used the Trinigy Vision engine, but in 2011 Havock bought this out and it has since been rebranded to the Havok Vision Engine instead. I have a feeling that while some things have clearly been customised (i.e. the shmap extension for maps) a lot of what Firefly are doing is 'out of the box' stuff in terms of the file formats. I could be wrong, but that's just a strong instinct I have with certain things.

From the image in the following article you can clearly see that there are similarities between what you are using to try and open the software, and what is shown here: https://www.cgw.com/Press-Center/GDC/2011/Vision-Game-Engine-Goes-Mobile.aspx

22 hours ago, Lord Aquila said:

The only thing I wanted to know is which formats work with the game if I want to add some models in the future.

If you want to add models, you would have to use the same formats as exactly are there already for the game right now. So dds files for skins, model files, materials.xml, resources.xml etc. It's probably worth choosing a unit that is already pretty close to what you want to achieve, and then duplicate it and try to adapt it first, rather than completely create a one from scratch.


Quote

The fields have eyes, and the woods have ears.

⁠— Geoffrey Chaucer, The Canterbury Tales: The Knight's Tale

Useful Articles

Share this post


Link to post
Share on other sites
1 hour ago, Lord_Chris said:

If you have any others, please do consider doing the same!

Not yet. I wish I had. 😃

1 hour ago, Lord_Chris said:

The description there of a pch file actually sounds pretty accurate to me, because we know that this is compiled code and not readable code. And we also know that Firefly have used variations of C in the past, on Stronghold 2 for example they use what I believe is some form of C or C++ in the shading.

And here I thought it wasn't likely to be a pch for some reason... Way to go with my programming knowledge. 😁 It seems we are getting there then.

I am glad I helped a little bit. Hopefully, this research will get us similar results for SC 2 and upcoming Warlords, since they use the same engine. Also, see what type of files the latter comes out with.

2 hours ago, Lord_Chris said:

I have a feeling that while some things have clearly been customised (i.e. the shmap extension for maps) a lot of what Firefly are doing is 'out of the box' stuff in terms of the file formats. I could be wrong, but that's just a strong instinct I have with certain things.

Don't think you are wrong, since the file's signature is nowhere to be found! (at least with current research). I just hope they don't get too chaotic.

2 hours ago, Lord_Chris said:

If you want to add models, you would have to use the same formats as exactly are there already for the game right now. So dds files for skins, model files, materials.xml, resources.xml etc. It's probably worth choosing a unit that is already pretty close to what you want to achieve, and then duplicate it and try to adapt it first, rather than completely create a one from scratch.

I agree. Duplicating and getting it from there is the best way to go. If we find out the models' format and I can start doing such a task, that's how I will proceed.

Share this post


Link to post
Share on other sites
Quote

I am glad I helped a little bit. Hopefully, this research will get us similar results for SC 2 and upcoming Warlords, since they use the same engine. Also, see what type of files the latter comes out with.

Crusader 2 (and from what I've seen of Warlords) also use the .model extensions, and use the same kind of file data for them too. If we find out the correct file format and how to open/modify it, this will work on all three games.

I will continue looking and see if I can find anything on this.


Quote

The fields have eyes, and the woods have ears.

⁠— Geoffrey Chaucer, The Canterbury Tales: The Knight's Tale

Useful Articles

Share this post


Link to post
Share on other sites

I think I have a little helpful information (I hope). It seems that the shader files of the game (.vshaderbin) have also the same file signature, which implies same format as the .model ones...! I am starting to think this is something unconventional like you said, and more specific, an unconventional archive format (since a 3D model can't be the same as a shader I guess?). I think it makes sense now. I only don't understand why they used different archive formats on the .v and .shmap files than the .model and .vshaderbin. Maybe they just thought, why not getting even more security measures?. I don't know...

Edited by Lord Aquila

Share this post


Link to post
Share on other sites

Now that is interesting, particularly as I'd already thought it may have been an archive and tried to open it as a .zip and .rar. That means that if it is an archive, it's a pretty uncommon format. My instinct would be that a lot of this is down to the game engine. I don't really think Firefly will have customised some of this. The .v files are obviously done to stop people from being able to easily change things, almost like a protection. The .model file is obviously the same, because it's sensitive data and Firefly wouldn't really want people being able to get a hold of what they're doing easily.

The .shmap file doesn't really matter, because it's only a saved map file with textures etc that are already existing within the game. So, it doesn't really matter if somebody gets a hold of the textures and saved map data.


Quote

The fields have eyes, and the woods have ears.

⁠— Geoffrey Chaucer, The Canterbury Tales: The Knight's Tale

Useful Articles

Share this post


Link to post
Share on other sites
On 14/11/2020 at 19:09, Crusader1307 said:

I too would really like to see an Article as well. Permitting your Personal schedule that is. I am sure it will be well received.

It is under way. Slowly that is, but I am getting there. 🙂 Thanks by the way!

@Lord_Chris, I would like to share a little detail that might help as well. I didn't realise up until now, that the "56 42" file signature, refers to "VBIN", or "V BIN", which translates to something like "v binary", ...in other words..., vision binary file (like the game .v archives, probably because they come from vision engine as well?). So it is a Vision Engine specific file format that probably is the C++ compiled binary result of both shaders and models from the engine, as they have the same signature. (do models get compiled?) I think you are definitely right that it is not an archive anyway.

P.S. All this might have been obvious to you since the beginning, so I am not sure I am providing anything new here, but thought sharing nevertheless. 🙂 It seems that, at least to me, I didn't realise it up until now.

Edited by Lord Aquila

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Similar Topics

    • Stronghold Warlords Competition- Results!

      Well, after an intense competition which spanned over many months, we can now FINALLY reveal who has won our contest to win Stronghold Warlords for FREE! Thanks goes to everyone who participated in our contest this year. I have to say that when checking the entries, @EaglePrince and I were completely blown away by the quality of the submissions. It's clear that substantial effort has been put into every single one of the entries, and we're really grateful for the submissions members have ma

      in The Town Crier

    • Win a Free Copy of Stronghold Warlords Upon Release!

      Stronghold Nation Summer Contest 2020 The admin team are delighted to announce our latest competition for 2020, working in partnership with Firefly Studios to provide a free Steam code for Stronghold Warlords, upon release, for the winner of our competition. Welcome, Lords and Ladies, to the Stronghold Nation Summer Contest 2020! Prizes 1st place: Free copy of Stronghold Warlords upon release and the Stronghold Kingdoms Starter Pack 2nd place: Free copy of Stronghold Crusa

      in Competitions

    • Problems with links to Stronghold Nation

      Hi, I have seen before that I have some issues with Stronghold Nation links, but I wasn't sure was it about SHN or about the browser or email client. Now I figured out what was the issue. When you give us a link like this:   www.strongholdnation.co.uk/downloads/file/367-a-kings-game/   sometimes it loads the link without "/" at the end (like this: www.strongholdnation.co.uk/downloads/file/367-a-kings-game ). When the page loads without the "/" symbol, error 404 shows up.   I still don't know if

      in Site Questions and Support

    • Need Help Running Stronghold 2: Deluxe Version 1.31

      As some of you may know, there are two versions of Stronghold 2: the Standard edition and the Deluxe edition. The standard edition patches to version 1.4.1, however, the Deluxe edition patches to version 1.31; and it requires a special Deluxe patch. The good news is that this patch was included on the DVD disc itself of late releases of this game (I have a late release which includes a 1.31 patch right on the disc; alternatively, the patch can also be downloaded here: https://www.patches-scrolls

      in Stronghold 2

    • Stronghold 1 Multiplayer Discord Server

      Hello, this is a message for anyone interested with Stronghold HD(Not Crusader) multiplayer scene specifically.We are a group of passionate Stronghold players each of us having likely sinked over 10 thousands of hours into playing the old game, and have mastered almost every inch of it, be that economics or arts of warfare. Some of us came back from the past days from the early times of this game's youth, there where it all began, on Gamespy Arcade having great legacy to this day, and others bec

      in Stronghold 1

×
×
  • Create New...