#1 13th May 2019 03:50:10

ImTheFrostbite
Freeman
Reputation: 0

Registered: 22nd Sep 2018
Posts: 12

Color Changing Progress

Hello,

This thread is mostly for Lord Chris, but anyone can feel free to contribute.  I know on a previous thread here that there were discussions about efforts into diving into the coding of how color selection is made in Stronghold 2 and that I believe Chris was going to look into that.  Does anyone have any kind of information on if this is even possible or if there have been an efforts directed towards this?  I would love to push this however I can and am willing to help learn how to find a solution if someone would like to work with me.  There has to be a way!
Thanks for reading,

ImTheFrostbite

Last edited by ImTheFrostbite (13th May 2019 03:50:23)

Offline
  • 0

#2 24th May 2019 17:52:27

Lord_Chris
Lord Commander
Reputation: 150

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

Re: Color Changing Progress

Welcome back again ImTheFrostbite- we've missed you!

I'm honestly not sure is the truth as I just haven't been able to find anything. Hex codes, colour codes, C++ is totally not my "thing" at all. I'm much more of a PHP guy than a C++ one. However I do know that Charles of Tours is studying C++. He may be able to find something about this and how easy it is.


The fields have eyes, and the woods have ears.
— Geoffrey Chaucer, The Canterbury Tales: The Knight's Tale

Useful Articles
All Stronghold Legends Trails & Walkthroughs
Adding Units From Stronghold Legends into Stronghold 2
Extracting Audio Assets from Stronghold 3
Locking/Unlocking Stronghold Crusader 2 Maps

Offline
  • 0

#3 26th May 2019 17:02:34

Charles of Tours
Knight Banneret
Reputation: 68

From: Lovecraft Country
Registered: 16th Apr 2014
Posts: 257

Re: Color Changing Progress

Hi ImTheFrostbite. I'm not familiar with how Stronghold 2 does color selection. In SH1 and SHC, colors for players were saved as part of the map file, and could be changed in a hexadecimal editor like HexEdit, which allows you to change the RGB color scheme. HexEdit will allow you to read the binary code in hexadecimal, which is a bit easier for a human to read.

RGB is fairly standard. It allows you to pick a value between 0 and 255 for each of Red, Green, and Blue. This color picker will show you the 0-255 decimal values as well as the hexadecimal value for each color. For example, red is ff0000.

I suggest you make a blank "demo" map with some troops on it and try to open the file in HexEdit, that way nothing will go wrong with the game itself.


Mqb938i.png
Do you crave a life of adventure? Check out our Adventures in the Duchy of Riverborne and apply here to join the action!

Offline
  • 1

#4 27th May 2019 16:55:06

Lord_Chris
Lord Commander
Reputation: 150

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

Re: Color Changing Progress

I've gone ahead and briefly tried myself what Charles of Tours suggested. Though this was on a campaign map which I had already written, because I didn't actually load the game up.

I can't find any hex codes in the map relating the player colours, which to me makes sense. Speaking from a programming point of view it wouldn't make sense to store these codes in the individual saved game files, there are just too many possibilities. What id you later wanted to update the whole game and change the colours? How would you make the old maps compatible? How would you ensure new maps played on older versions? .etc. etc.

I've gone ahead and looked at the shaders folder again and I'm convinced we're onto something here. The problem is that I feel what's happening is that the game .exe file is somehow "injecting" into the relevant shader files what share colours to do. Again, this kind of makes sense to me. Let's not forget that the players in multiplayer change colours dynamically. This would be a lot of code for these shader files and I've yet to find any evidence of this (or anything similar) in the shaders files and in my opinion it doesn't really make sense putting these colours in the shaders files either; shaders should simply be rendering things, not actively telling themelves what to do. It's just basic code separation.

My money is on the .exe file. My belief is that it's somehow injecting the colour codes into the shaders, telling the shaders what to render on each unit. This makes it almost impossible to change the player colours if this theory is correct unless you start hacking the exe file, something which we cannot condone. Unless Firefly were to release the source code, I doubt we will get very far on this one.


The fields have eyes, and the woods have ears.
— Geoffrey Chaucer, The Canterbury Tales: The Knight's Tale

Useful Articles
All Stronghold Legends Trails & Walkthroughs
Adding Units From Stronghold Legends into Stronghold 2
Extracting Audio Assets from Stronghold 3
Locking/Unlocking Stronghold Crusader 2 Maps

Offline
  • 0

#5 27th May 2019 21:10:34

ImTheFrostbite
Freeman
Reputation: 0

Registered: 22nd Sep 2018
Posts: 12

Re: Color Changing Progress

Hello Lord_Chris and Charles of Tours, and thank you for all of your work and research on this!  Did Firefly Studios ever release the source code to the other SH games listed here?  Just was curious as to if that would ever be a possibility. Charles of Tours Have you been able to figure anything out with having some C++ knowledge?  Or has Lord_Chris basically summed it up nicely here?  I personally have reached out via Twitter to Nick and discussed the possibility of this, so maybe I can ask about if they would ever release the source code?

Just trying to figure out ways I can help out if possible.  Let me know if this seems to be our only option at this point.

Thanks again,

ImTheFrostbite

Last edited by ImTheFrostbite (27th May 2019 21:12:29)

Offline
  • 0

#6 30th May 2019 14:06:33

Charles of Tours
Knight Banneret
Reputation: 68

From: Lovecraft Country
Registered: 16th Apr 2014
Posts: 257

Re: Color Changing Progress

ImTheFrostbite said:

Did Firefly Studios ever release the source code to the other SH games listed here?

Everything I have read says no. Releasing the source code of a game to the public is essentially the same as releasing a game for free. While there could be a license restricting the use of the code, it's almost impossible to enforce licenses on open source material, especially on an international level.

ImTheFrostbite said:

Charles of Tours Have you been able to figure anything out with having some C++ knowledge?  Or has Lord_Chris basically summed it up nicely here?  I personally have reached out via Twitter to Nick and discussed the possibility of this, so maybe I can ask about if they would ever release the source code?

Chris seemed to sum it up quite well. In theory there are decompilers that could try to translate the compiled binary code into something human-readable, but I can't help here for legal reasons.

While searching for info about other conversations people had about the code, I stumbled across an open source reimplementation of Stronghold 1, but I would feel uncomfortable linking it here since it looks like it uses graphical assets from SH1. It isn't illegal to make a new game engine entirely from your own code, but things like graphics and audio are usually copyrighted. One open source workaround is to rely on an installation of the base game in order to actually run. See: openMW and KaM Remake. Granted, Bethesda gave their blessing to OpenMW after certain conditions were agreed to.

An open source reimplementation would be far easier to modify, but it would be like "reinventing the wheel" for something like changing colors. It's really unlikely that the source code for any of the Stronghold games will ever be released, since copies of the HD re-releases are selling on Steam.


Mqb938i.png
Do you crave a life of adventure? Check out our Adventures in the Duchy of Riverborne and apply here to join the action!

Offline
  • 0

#7 15th Sep 2019 20:59:48

ImTheFrostbite
Freeman
Reputation: 0

Registered: 22nd Sep 2018
Posts: 12

Re: Color Changing Progress

Hello All,
Considering it has been some time, just was wondering if there was any new progress on this? Hope everyone has been well smile

Offline
  • 0

#8 18th Sep 2019 14:15:06

Mathew Steel
Regent
Reputation: 133

From: Wales, United Kingdom
Registered: 27th Aug 2014
Posts: 962

Re: Color Changing Progress

Lord_Chris said:

What id you later wanted to update the whole game and change the colours?

I was just about to point out that in the campaign, units do change colour at several points. However, quickly realised that it's also a matter of just giving those units the ID of another colour, which would make far more sense. So yes, I'd have to agree with Chris here. The colours must be stored in the game files, not mission/map files.

ImTheFrostbite, I don't think there's been any major progress. If there is any major breakthrough though, you can be certain that Chris will make it into an article on the site for everyone to find! smile


"Gofyn wyf am galon hapus, calon onest, calon lân."

Offline
  • 1

#9 1st Oct 2019 04:51:37

Spy
Serf
Reputation: 1

Registered: 16th Sep 2019
Posts: 2

Re: Color Changing Progress

Hello, I'm currently working on the map format. I do C++ / reverse engenering ^^

The map files are compressed (after the header, the author: Firefly thing) I have made a little tool to export maps into a decompressed format


https://www.filehosting.org/file/detail … porter.zip I can't always post link.
(SHA-1 : 1A351DB2C2D2B428D3A2820FF6A1D759D8D60557)

In the menu => Go to "Dezip" and 4 files will be created: the header, and data that I don't know what it's. I named it A, B, and C.
If you do any modification, you can "recompress" if you didn't rename the files by clicking on "Zip" and choose A, B or C file (any of them).

Last edited by Lord_Chris (1st Oct 2019 16:50:56)

Reason for edit: Fixed link

Offline
  • 0

#10 2nd Oct 2019 10:15:58

Lord_Chris
Lord Commander
Reputation: 150

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

Re: Color Changing Progress

Hi Spy

I've fixed your link, thanks for sharing. I've also promoted you so you can post links in future- that's just protection against spammy new members. Welcome!

You are always more than welcome to submit a file to us here as well for us to host, as that way players will be able to download without needing to provide any personal information smile

I've tried downloading, but unfortunately I can't seem to get it working (Windows 8.1). Can you provide a step by step guide of how to use this file exactly?


The fields have eyes, and the woods have ears.
— Geoffrey Chaucer, The Canterbury Tales: The Knight's Tale

Useful Articles
All Stronghold Legends Trails & Walkthroughs
Adding Units From Stronghold Legends into Stronghold 2
Extracting Audio Assets from Stronghold 3
Locking/Unlocking Stronghold Crusader 2 Maps

Offline
  • 0

#11 14th Oct 2019 06:45:12

ImTheFrostbite
Freeman
Reputation: 0

Registered: 22nd Sep 2018
Posts: 12

Re: Color Changing Progress

Hi Spy,
It has been a few weeks since any update had been given, has there been any progress on this? I am very glad to see that you are working on breaking down these maps and the game itself! I would definitely be interested as well to talk off the forum in Discord or wherever as I kind of have some questions to ask and we wouldn’t have to rely on a potential slow response time. Let me know if you are interested and thanks again for working on this!

Lord Chris it is a pleasure to hear from you again as always! Hope all is well. I would be interested in connecting with you as well smile

Am I not allowed to tag usernames on mobile?

Last edited by ImTheFrostbite (14th Oct 2019 06:46:54)

Offline
  • 0

#12 14th Oct 2019 08:03:39

EaglePrince
Knez
Reputation: 156

From: Novi Sad, Serbia
Registered: 6th May 2014
Posts: 2,154
Website

Re: Color Changing Progress

Well, I truly hope that you keep your conversation here, instead of in some chat. big_smile That way others could benefit from it as well. smile

*Ehm*, this is where Tapatalk, or something similar, would be really helpful - by enabling people to visit the forum from their smartphones through an app. However, guys, if you didn't know, this forum also has a mobile friendly template. I use it, and this way it's easier read and post replies right from my bed. big_smile Cheers. big_smile

Offline
  • 0

#13 14th Oct 2019 15:12:11

ImTheFrostbite
Freeman
Reputation: 0

Registered: 22nd Sep 2018
Posts: 12

Re: Color Changing Progress

EaglePrince most certainly not! I was just wanting to potentially streamline communication for some “nitty-gritty” stuff as opposed to flooding out this forum post to try and keep it clean for primarily updates. Also to hopefully get some type of reply without having to wait a week haha.  I was going to logon via PC when I get home today and edit my post to tag them officially so that they get notified.

Hope all is well today smile

Offline
  • 0

#14 15th Oct 2019 23:26:35

ImTheFrostbite
Freeman
Reputation: 0

Registered: 22nd Sep 2018
Posts: 12

Re: Color Changing Progress

I am on my PC now and still cannot seem to figure out how to tag someone.  Also, for some reason it will not let me edit my previous replies either (from mobile)... Weird.  Looking forward to hearing some good news soon! big_smile

Last edited by ImTheFrostbite (15th Oct 2019 23:29:38)

Offline
  • 0

#15 15th Oct 2019 23:47:31

EaglePrince
Knez
Reputation: 156

From: Novi Sad, Serbia
Registered: 6th May 2014
Posts: 2,154
Website

Re: Color Changing Progress

I understand. I'm that case, I will sit, and comfortably wait for updates from you guys. big_smile

To tag someone... I'm not sure. There is a way to add somebody by bbcode, them I think the name is in the color of the member, and I think that it also serves as a link to the profile page then. But I don't think this would make this user get a notification. Maybe Chris could help us with that. smile

Offline
  • 0

#16 16th Oct 2019 12:33:49

Lord_Chris
Lord Commander
Reputation: 150

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

Re: Color Changing Progress

Hi ImTheFrostbite,

Unfortunately tagging someone doesn't provide them with any notification like on Facebook. It's simply a way of highlighting names in a thread. To do this, you use the user tags:

[user]Lord_Chris[/user]

produces Lord_Chris

YOu can find a full list of all BBCode here.


The fields have eyes, and the woods have ears.
— Geoffrey Chaucer, The Canterbury Tales: The Knight's Tale

Useful Articles
All Stronghold Legends Trails & Walkthroughs
Adding Units From Stronghold Legends into Stronghold 2
Extracting Audio Assets from Stronghold 3
Locking/Unlocking Stronghold Crusader 2 Maps

Offline
  • 0

#17 16th Oct 2019 15:19:52

Mathew Steel
Regent
Reputation: 133

From: Wales, United Kingdom
Registered: 27th Aug 2014
Posts: 962

Re: Color Changing Progress

Lord_Chris said:

Unfortunately tagging someone doesn't provide them with any notification like on Facebook. It's simply a way of highlighting names in a thread.

Although, that would be a welcomed addition smile


"Gofyn wyf am galon hapus, calon onest, calon lân."

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

Board footer

Powered by Aura

[ Generated in 0.091 seconds, 17 queries executed - Memory usage: 2.12 MiB (Peak: 4.3 MiB) ]