Salem Layer Util

Forum for game modifications and custom clients.

Re: Salem Layer Util

Postby boshaw » Mon Apr 01, 2013 5:48 am

Hans_Lemurson wrote:What do you need to do to actually get your modified graphics recognized by Ender's client?

I have been playing around with beach.res for my testing, and I found that no graphical change I made showed up on the beaches when I loaded the game. I also investigated Chiprel's LowGFX pack and found that it's beach textures didn't work either. In fact, about half of the textures in his pack are non-functional and display the default instead.

UserNM's 11x11 texture pack does however work for all tiles. Replacing it's beach texture with an 8x8 test pattern worked perfectly without problem.

I cannot for the life of me figure out what the difference is between these, why the client accepts Usernm's .res files but rejects most of those provided by Chiprel. The biggest obvious difference is that UserNM's stuff uses single image tilesets, but would that really make so huge a difference?

Do I need to modify the "tileset" data somehow?
What about the META INF files?

Also, what do you do about all the textures that are NOT in salem-res.jar? The current Dirt and Clay textures, among others, are nowhere to be found. Usernm was able to include a dirt.res which worked, but Chiprel did not include anything, presumably because he couldn't find the existing texture to reduce.



Well, i'm unsure exactly about the Ender issue, but here's what i could do:

open up salem-res.jar, remove the META folder thing, and insert your resource files directly in there in their proper places. I would imagine this is the first place it looks for resource files

As for missing textures, go to `~/.salem/cache/' and within there all the resource files not in salem-res that you've encounter in game will be there ending with .cache
Last edited by boshaw on Mon Apr 01, 2013 6:39 am, edited 1 time in total.
boshaw
 
Posts: 8
Joined: Mon Aug 20, 2012 5:51 am

Re: Salem Layer Util

Postby bmer » Mon Apr 01, 2013 5:52 am

This thread is becoming more and more interesting. ;) good questions lemurson
Landlords, like all other men, love to reap where they never sowed. -- K.M.
User avatar
bmer
 
Posts: 49
Joined: Sat Mar 09, 2013 8:11 am

Re: Salem Layer Util

Postby Hans_Lemurson » Mon Apr 01, 2013 6:55 am

boshaw wrote:Well, i'm unsure exactly about the Ender issue, but here's what i could do:

open up salem-res.jar, remove the META folder thing, and insert your resource files directly in there in their proper places. I would imagine this is the first place it looks for resource files

As for missing textures, go to `~/.salem/cache/' and within there all the resource files not in salem-res that you've encounter in game will be there ending with .cache

My raw data is from a fresh salem-res.jar file downloaded from http://plymouth.seatribe.se/java/salem-res.jar
I wasn't sure where to find the cached files that I knew had to exist somewhere. Thanks!

For now I will post information about my first success in getting the beach tiles in from a modified salem-res.jar to display.

Within each decoded .res folder, there is a "meta" file. Editing it in Notepad++ I saw a value which was 3 and changed it to a 4. (4 is the value I saw in Usernm's operational tiles, so I just copied this magic number in and now I can see red mspaint-style 0's 1's and 2's scrawled on the beach tiles just like on my debug textures. Success for unknown reasons!!! :D )

I suspect that if I copy all of the 'meta' values from the cached tile folders to my edited ones that everything will probably work.
Cargo-cult programming ftw! ¦]

******
Oh, are the .cache files treated the same way as .res files? Are there any differences in format or usage?
More specifically:If I renamed a .cache file to a .res file, would anything bad happen?

******
Oh wow! ALL of the missing resources I couldn't find are in the cached resources. Although not surprising, it makes me happy that they are all there for tweaking.
Low FPS? Love Pixels? Try my new graphics pack! It's Pixelicious. :)
Compost Bin purity formula: Now doing science to earthworms
User avatar
Hans_Lemurson
 
Posts: 555
Joined: Thu Feb 07, 2013 8:04 am

Re: Salem Layer Util

Postby bmer » Mon Apr 01, 2013 8:06 am

Hans_Lemurson wrote:Within each decoded .res folder, there is a "meta" file. Editing it in Notepad++ I saw a value which was 3 and changed it to a 4. (4 is the value I saw in Usernm's operational tiles, so I just copied this magic number in and now I can see red mspaint-style 0's 1's and 2's scrawled on the beach tiles just like on my debug textures. Success for unknown reasons!!! :D )


Could boshaw perhaps incorporate this in his utility so that it wouldn't have to be done manually?
Landlords, like all other men, love to reap where they never sowed. -- K.M.
User avatar
bmer
 
Posts: 49
Joined: Sat Mar 09, 2013 8:11 am

Re: Salem Layer Util

Postby EnderWiggin » Mon Apr 01, 2013 3:49 pm

Hans_Lemurson wrote:Within each decoded .res folder, there is a "meta" file. Editing it in Notepad++ I saw a value which was 3 and changed it to a 4. (4 is the value I saw in Usernm's operational tiles, so I just copied this magic number in and now I can see red mspaint-style 0's 1's and 2's scrawled on the beach tiles just like on my debug textures. Success for unknown reasons!!! :D )
Reasons are well known - that magical number is resource version number. Client looks for specific resource version that is sent from server, and if it can't find it locally, it downloads it from server. Thing is - in salem-res.jar not all resources are up-to-date. For newest files you either look into cache folder (%USER%/.salem), or download files from server (http://plymouth.seatribe.se/res/%path to res file%, like http://plymouth.seatribe.se/res/gfx/ter ... ng-granite)
User avatar
EnderWiggin
 
Posts: 339
Joined: Wed Aug 01, 2012 9:12 am
Location: Ukraine

Re: Salem Layer Util

Postby Hans_Lemurson » Mon Apr 01, 2013 6:45 pm

Yeah, I was thinking that it was probably a version number, but does this mean that brush2.res has gone through 22 revisions?

Anyways, all of the problems seem to be solved by using the resources from [username].salem/cache/

I did run into an issue though that although .cache files seem to be identical in every way to .res files, it seems they have to be renamed to .res before they can be used in your client's custom_res folder. After tediously renaming all of the .cache files to .res before merging them in to the folder containing all the files I'm tweaking for my graphics set, I felt that this was a task best suited to automation.

I have 3 questions:
--You said that the client downloads any files that it can't find the current version for. Is there any way to get ALL of the resource files to appear in the cache? This would certainly make things simpler to have everything obtainable in a single location. Is there another way to get all the up-to-date resources in one place?
--Is there any way to convert .cache files to .res files en masse? This seems rather essential for working with reliably up-to-date graphics.
--Am I a fool and .cache files already be used interchangeably with .res without the need to rename them? It would sure be convenient, although inconsistent and with the potential for much confusion.
Low FPS? Love Pixels? Try my new graphics pack! It's Pixelicious. :)
Compost Bin purity formula: Now doing science to earthworms
User avatar
Hans_Lemurson
 
Posts: 555
Joined: Thu Feb 07, 2013 8:04 am

Re: Salem Layer Util

Postby boshaw » Mon Apr 01, 2013 8:31 pm

Hans_Lemurson wrote:I did run into an issue though that although .cache files seem to be identical in every way to .res files, it seems they have to be renamed to .res before they can be used in your client's custom_res folder. After tediously renaming all of the .cache files to .res before merging them in to the folder containing all the files I'm tweaking for my graphics set, I felt that this was a task best suited to automation.

Technically you should be able to just reinsert the modified .cache files back into the .salem/cache folder, but yeah if you want to put them in salem-res or some custom_res folder you'll have to rename. It's probably easier though to make a small script that automatically goes through your output folders and renames .cache to .res if you want to be .res.

Hans_Lemurson wrote:I have 3 questions:
--You said that the client downloads any files that it can't find the current version for. Is there any way to get ALL of the resource files to appear in the cache? This would certainly make things simpler to have everything obtainable in a single location. Is there another way to get all the up-to-date resources in one place?
--Is there any way to convert .cache files to .res files en masse? This seems rather essential for working with reliably up-to-date graphics.
--Am I a fool and .cache files already be used interchangeably with .res without the need to rename them? It would sure be convenient, although inconsistent and with the potential for much confusion.



1)delete everything from inside salem-res.jar and any other resource locations, that'll force the client to download the resources from the server. Do note you're going to see a delay though since it's going to be slow downloading them all at once. Also I'm fairly certain it'll only download resources you need/encounter in game so not everything gets downloaded instantly. You'll have to discover it or see it.
2) As stated previously, a good way to solve this is to simply make some sort of script that goes through a folder and renames anything of *.cache to *.res
3) .cache files are only recognized within .salem/cache I think. Stuff in salem-res.jar or custom folders need to be *.res I think
boshaw
 
Posts: 8
Joined: Mon Aug 20, 2012 5:51 am

Re: Salem Layer Util

Postby Hans_Lemurson » Tue Apr 02, 2013 2:38 am

boshaw wrote:Technically you should be able to just reinsert the modified .cache files back into the .salem/cache folder, but yeah if you want to put them in salem-res or some custom_res folder you'll have to rename. It's probably easier though to make a small script that automatically goes through your output folders and renames .cache to .res if you want to be .res.

I have little to no familiarity with file manipulation in any scripting language, and so it was "easier" to spend 20 minutes doing it manually than spend 2-3 hours reading tutorials and hacking out crude code.

You on the other hand are already fully immersed in the world of coding and manipulating haven's files. I think you see where I'm going here. ;)
(feature request!!!)

boshaw wrote:1)delete everything from inside salem-res.jar and any other resource locations, that'll force the client to download the resources from the server. Do note you're going to see a delay though since it's going to be slow downloading them all at once. Also I'm fairly certain it'll only download resources you need/encounter in game so not everything gets downloaded instantly. You'll have to discover it or see it.

Hmm...this is probably what causes the extended "black screen" that often happens after an update. Lots of people all needing up to date copies of modified resources.
Low FPS? Love Pixels? Try my new graphics pack! It's Pixelicious. :)
Compost Bin purity formula: Now doing science to earthworms
User avatar
Hans_Lemurson
 
Posts: 555
Joined: Thu Feb 07, 2013 8:04 am

Re: Salem Layer Util

Postby bmer » Tue Apr 02, 2013 3:57 am

Hans_Lemurson wrote:
boshaw wrote:Technically you should be able to just reinsert the modified .cache files back into the .salem/cache folder, but yeah if you want to put them in salem-res or some custom_res folder you'll have to rename. It's probably easier though to make a small script that automatically goes through your output folders and renames .cache to .res if you want to be .res.

I have little to no familiarity with file manipulation in any scripting language, and so it was "easier" to spend 20 minutes doing it manually than spend 2-3 hours reading tutorials and hacking out crude code.

You on the other hand are already fully immersed in the world of coding and manipulating haven's files. I think you see where I'm going here. ;)
(feature request!!!)


+1 feature request! I like using other people's code.
Landlords, like all other men, love to reap where they never sowed. -- K.M.
User avatar
bmer
 
Posts: 49
Joined: Sat Mar 09, 2013 8:11 am

Re: Salem Layer Util

Postby boshaw » Tue Apr 02, 2013 5:07 am

Hans_Lemurson wrote:
boshaw wrote:Technically you should be able to just reinsert the modified .cache files back into the .salem/cache folder, but yeah if you want to put them in salem-res or some custom_res folder you'll have to rename. It's probably easier though to make a small script that automatically goes through your output folders and renames .cache to .res if you want to be .res.

I have little to no familiarity with file manipulation in any scripting language, and so it was "easier" to spend 20 minutes doing it manually than spend 2-3 hours reading tutorials and hacking out crude code.

You on the other hand are already fully immersed in the world of coding and manipulating haven's files. I think you see where I'm going here. ;)
(feature request!!!)


bmer wrote:+1 feature request! I like using other people's code.


Download salem-layer-util.lisp, it's been updated with a new :mode => :cache->res . The :args for it takes a list with the first element being the path to the folder (ie: '(input-folder-path))
input-folder-path follows all the same rules as :da and :ea so it can be absolute or relative and missing the ending "/"

Example:
Code: Select all
(slu:run :mode :cache->res
         :args '(".test/salem/cache/res/"))


transforms all the files within ".test/salem/cache/res/" ending with *.cached to *.res

things to new note:
Occasional you'll find files within cache/ folder named *.cached.new . Just ignore these, all of them that i've seen are broken anyway compared to *.cached counterpart.
boshaw
 
Posts: 8
Joined: Mon Aug 20, 2012 5:51 am

PreviousNext

Return to Artifice & Arcana

Who is online

Users browsing this forum: Majestic-12 [Bot] and 4 guests