Jump to content
ImTheFrostbite

Color Changing Progress

Recommended Posts

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

Edited by ImTheFrostbite

Share this post


Link to post
Share on other sites

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.


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

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!

Share this post


Link to post
Share on other sites

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.


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?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

Edited by ImTheFrostbite

Share this post


Link to post
Share on other sites
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.

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!

Share this post


Link to post
Share on other sites
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! :)


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

Share this post


Link to post
Share on other sites

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/details/824510/SiegeExporter.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).

Edited by Lord_Chris
Fixed link

Share this post


Link to post
Share on other sites

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 :)

 

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?


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

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 :)

 

Am I not allowed to tag usernames on mobile?

Edited by ImTheFrostbite

Share this post


Link to post
Share on other sites

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

 

*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. :D Cheers. :D

Share this post


Link to post
Share on other sites

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 :)

Share this post


Link to post
Share on other sites

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! :D

Edited by ImTheFrostbite

Share this post


Link to post
Share on other sites

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

 

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. :)

Share this post


Link to post
Share on other sites

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:

 

[member=Lord_Chris[/user]

produces [user]Lord_Chris]

 

YOu can find a full list of all BBCode here.


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
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 :)


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

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

    • New map in progress - Free Build

      I don't usually announce a new map being created, but given that I've recently got back into Crusader 2, I've noticed one massive gripe...   SIEGES FOR FREE BUILD SPAWN IN THE MOST RIDICULOUS SPOTS EVER AND RUIN THE FUN!   Therefore, I am making a free build map with sensible siege spawns, to allow you to defend sensibly against a realistic enemy attack! Keep your eyes peeled! :P

      in Stronghold Crusader 2

    • Changing the default keep

      Changing the Default Keep Type   Since I know a lot of people have wanted to change their keep from the default square keep, I have found a way to do it. Remember to backup your files in case something goes wrong.   First, you will want to go to the directory where Stronghold 2 is saved and then enter your meshes folder and then your buildings folder: C:\Program Files (x86)\Firefly Studios\Stronghold 2\meshes\Buildings (Note that the directory path may be variable for some, due to different sav

      in Stronghold 2

    • Stronghold changing starting keep in kingmaker mode to wooden keep

      Hey guys I know this has been addressed before and I made a back up of the medium keep files the gr2 and dds and change and made copies of the wooden files and changed them all from "wooden" to "medium". The wooden keep appears and it appears to work however my lord cant stand in the wooden keep tower which is very frustrating can anyone help me to correct this. would be very much appreciated!!!

      in Stronghold 2

    • Changing Boot Drive

      I've recently installed my SSD and I want to set it as my boot drive. Currently, it's empty. Let's say I cloned my files from my old HDD onto my new SSD, what else would need to be done?   Would I have to remove the OS from my old HDD?   I'm aware I can change the boot order of drives but from what I've heard it isn't as simple as that, since my SSD isn't the C drive. What else would have to be done?   Thank you! :)

      in Computer Support

    • Map in progress: "A Lord in a Canyon"

      The map is "Large" and set to the game type "Military". I won't show any screenshots yet, as there is still a lot of work to be done. There will be more as I get closer to uploading the map.   The Story: You awaken. You don't feel any pain, but the beaming sun burns your eyes. You sit yourself up and look around you. Remembering nothing, you stand up. You feel unbalanced, you must have been lying down for some time. Situated in a deep canyon. Few vegetation, lots of stone.   The sandstorm pass

      in Stronghold Crusader 2

×
×
  • Create New...