Haven-res.jar hit-box fix. Fixed after multiple attempts.

Forum for alternative clients, mods & discussions on the same.

Moderator: Phades

Re: Assistance needed to fix hit-box data in haven-res.jar

Postby Xcom » Tue May 21, 2013 1:14 am

Wait no I got it working :)

This is amazing. Thank you so much boshaw. I will try and finish that filter file and post it in here.

Some small details regarding the filter. Does the string of the name search for an exact match? By that I mean does "gfx/terobjs/ridges/grass/ee" need to be exactly the same for it to do edits?

If it does a contains() check it would work out much better in some instances. For example a simple "/tiles/" could edit all res names with the name containing "/tiles/" instead of finding each and every one and adding it to that list.

Edit: crap stoped working again :( I dont seem to have a handle of how it works.

Edit 2 : I think the crashes were due to shortened filter paths. It seams its doesn't like when I give general res names. Have to be specific.
User avatar
Xcom
 
Posts: 1105
Joined: Wed Dec 14, 2011 1:43 pm

Re: Assistance needed to fix hit-box data in haven-res.jar

Postby boshaw » Tue May 21, 2013 2:11 am

Xcom wrote:Wait no I got it working :)

This is amazing. Thank you so much boshaw. I will try and finish that filter file and post it in here.

Some small details regarding the filter. Does the string of the name search for an exact match? By that I mean does "gfx/terobjs/ridges/grass/ee" need to be exactly the same for it to do edits?

If it does a contains() check it would work out much better in some instances. For example a simple "/tiles/" could edit all res names with the name containing "/tiles/" instead of finding each and every one and adding it to that list.

Edit: crap stoped working again :( I dont seem to have a handle of how it works.

Edit 2 : I think the crashes were due to shortened filter paths. It seams its doesn't like when I give general res names. Have to be specific.

Right now the name of the file in the filter has to be exact and it's based on the res-folder itself.
So for example if you gave it "res/" then it would just append the name in the filter file onto "res/"
ie: if in the filter file you had "gfx/tiles/sometile" then it would look for the file "res/gfx/tiles/sometile"

I can work on changing it so it does how you say with the contains

The extension on the filter file doesn't matter either btw.


Also on another side note, you don't need to use LayerUtil anymore now that you have that. It can also extract haven resource files like LayerUtil did.
In order to use that to extract haven resource files do:
1) use the run-abcl.{bat,sh}
2) wait for "CL-USER>" to appear
3) type
Code: Select all
(slu:run :mode :da :layers "layers/hnh" :args '("path-to-resource-folder" "path-to-wanted-extraction-folder"))

where "path-to-resource-folder" is the relative or absolute path to a folder with .res/.cache files
and "path-to-wanted-extraction-folder" is the relative/absolute path to the folder where you want the files extracted

that'll extract the files just like LayerUtil used to, i just haven't bothered to update my resource utility topic yet.
Last edited by boshaw on Tue May 21, 2013 3:57 am, edited 1 time in total.
User avatar
boshaw
 
Posts: 1538
Joined: Tue Jun 01, 2010 10:22 pm

Re: Assistance needed to fix hit-box data in haven-res.jar

Postby Xcom » Tue May 21, 2013 3:19 am

I get this when trying to extract it as explained above.

Code: Select all
[3] SLU(4): (slu:run :mode :da :layers "layers/hnh" :args ("res/" "out/"))
#<THREAD "interpreter" {66915855}>: Debugger invoked on condition of type PROGRA
M-ERROR
  Illegal function object: res/
Restarts:
  0: ABORT        Return to debug level 3.
  1: ABORT        Return to debug level 2.
  2: ABORT        Return to debug level 1.
  3: CONTINUE     Try again.
  4: USE-VALUE    Specify a function to call instead.
  5: RETURN-VALUE Return one or more values from the call to UBARR->INT.
  6: TOP-LEVEL    Return to top level.
[4] SLU(5):
User avatar
Xcom
 
Posts: 1105
Joined: Wed Dec 14, 2011 1:43 pm

Re: Assistance needed to fix hit-box data in haven-res.jar

Postby Xcom » Tue May 21, 2013 3:36 am

If I didn't do any mistakes then this is the new filter with the Gobs of wrong hitbox data. If I made a mistake would be nice if someone else checked it to.

Code: Select all
gfx/terobjs/blood
off=0,0
sz=0,0
gfx/terobjs/herbs/chantrelle
off=0,0
sz=0,0
gfx/tiles/wald/flavobjs/f1
off=0,0
sz=0,0
gfx/tiles/fen/flavobjs/f10
off=0,0
sz=0,0
gfx/tiles/moor/flavobjs/f1
off=0,0
sz=0,0
gfx/tiles/moor/flavobjs/f2
off=0,0
sz=0,0
gfx/tiles/moor/flavobjs/temp/f3
off=0,0
sz=0,0
gfx/tiles/moor/flavobjs/temp/f4
off=0,0
sz=0,0
gfx/tiles/heath/flavobjs/f1
off=0,0
sz=0,0
gfx/tiles/heath/flavobjs/f2
off=0,0
sz=0,0

gfx/terobjs/ridges/grass/ss
off=-10,-4
sz=14,7
gfx/terobjs/ridges/grass/e
off=-2,-11
sz=5,21
gfx/terobjs/ridges/grass/e2s
off=0,-21
sz=23,22
gfx/terobjs/ridges/grass/es
off=-5,-6
sz=7,16
gfx/terobjs/ridges/grass/ee
off=-4,-10
sz=7,14

gfx/terobjs/ridges/mountain/we
off=-11,0
sz=22,11
gfx/terobjs/ridges/mountain/ws
off=-11,-11
sz=22,11
gfx/terobjs/ridges/mountain/ne
off=-11,-11
sz=11,22
gfx/terobjs/ridges/mountain/ns
off=0,-11
sz=11,22
gfx/terobjs/ridges/mountain/ss
off=-10,0
sz=10,11
gfx/terobjs/ridges/mountain/ee
off=0,-10
sz=11,10

gfx/terobjs/furniture/coffer
off=-5,-4
sz=10,8
gfx/terobjs/furniture/leanto
off=-9,-5
sz=21,10
gfx/terobjs/furniture/wardrobe
off=-8,-3
sz=20,9
gfx/terobjs/furniture/bed-sturdy
off=-8,-5
sz=18,13
gfx/terobjs/furniture/cclosed
off=-3,-3
sz=7,4
gfx/terobjs/furniture/copen
off=-3,-3
sz=7,4

gfx/terobjs/vclaim
off=-12,-4
sz=27,8
gfx/terobjs/htable
off=-2,-5
sz=7,12
gfx/terobjs/crate
off=-6,-3
sz=14,7
gfx/terobjs/trough
off=-7,-4
sz=21,10
gfx/terobjs/dframe2
off=-3,-8
sz=4,18
gfx/terobjs/mining/ladder
off=-4,-1
sz=9,2
gfx/terobjs/lbox
off=-6,-7
sz=10,15

gfx/arch/gates/brick-ns
off=-5,-11
sz=10,21
gfx/arch/gates/fence-ns
off=-5,-11
sz=10,21
gfx/arch/gates/palisade-ns
off=-5,-11
sz=10,21
gfx/arch/gates/brick-we
off=-11,-5
sz=21,10
gfx/arch/gates/fence-we
off=-11,-5
sz=21,10
gfx/arch/gates/palisade-we
off=-11,-5
sz=21,10
gfx/arch/stairs-inn
off=-7,-11
sz=12,23
gfx/arch/door-inn
off=-11,-2
sz=19,5

gfx/kritter/plow/s
off=-3,-3
sz=6,6
gfx/kritter/cow/s
off=-4,-4
sz=11,11
gfx/kritter/cart/s
off=-5,-5
sz=10,10
gfx/kritter/rat/s
off=0,0
sz=1,1
gfx/kritter/deer/s
off=-4,-4
sz=11,11
gfx/kritter/bear/s
off=-8,-8
sz=16,16
gfx/kritter/fox/s
off=-3,-3
sz=7,7
gfx/kritter/troll/s
off=-8,-8
sz=16,16
User avatar
Xcom
 
Posts: 1105
Joined: Wed Dec 14, 2011 1:43 pm

Re: Assistance needed to fix hit-box data in haven-res.jar

Postby boshaw » Tue May 21, 2013 3:48 am

Xcom wrote:I get this when trying to extract it as explained above.

Code: Select all
[3] SLU(4): (slu:run :mode :da :layers "layers/hnh" :args ("res/" "out/"))
#<THREAD "interpreter" {66915855}>: Debugger invoked on condition of type PROGRA
M-ERROR
  Illegal function object: res/
Restarts:
  0: ABORT        Return to debug level 3.
  1: ABORT        Return to debug level 2.
  2: ABORT        Return to debug level 1.
  3: CONTINUE     Try again.
  4: USE-VALUE    Specify a function to call instead.
  5: RETURN-VALUE Return one or more values from the call to UBARR->INT.
  6: TOP-LEVEL    Return to top level.
[4] SLU(5):



Ooops, it should be:
Code: Select all
(slu:run :mode :da :layers "layers/hnh" :args '("res/" "out/"))


I forgot the quote before the list, sorry about that
User avatar
boshaw
 
Posts: 1538
Joined: Tue Jun 01, 2010 10:22 pm

Re: Assistance needed to fix hit-box data in haven-res.jar

Postby Xcom » Tue May 21, 2013 4:57 am

The res extractor works but very slowly compared to the haven layer util. Might be all the printouts.

But unfortunately after using the neg editor and alot of headaches I discoverd that its not doing the m2s edit on the neg numbers :(. Only the res names inside the neg filter file gets edited. The rest are unaffected.

I'm not sure what I'm doing wrong.
User avatar
Xcom
 
Posts: 1105
Joined: Wed Dec 14, 2011 1:43 pm

Re: Assistance needed to fix hit-box data in haven-res.jar

Postby boshaw » Tue May 21, 2013 5:04 am

Xcom wrote:The res extractor works but very slowly compared to the haven layer util. Might be all the printouts.

In that case you need to turn verbose off so:
Code: Select all
    (slu:run :mode :da :verbose nil :layers "layers/hnh" :args '("res/" "out/"))

That'll make all the printouts not be there for the most part

Xcom wrote:But unfortunately after using the neg editor and alot of headaches I discoverd that its not doing the m2s edit on the neg numbers :(. Only the res names inside the neg filter file gets edited. The rest are unaffected.

I'm not sure what I'm doing wrong.


When you run the :hnh-neg-fix one are all the files within "res/" or only the ones you want to filter edit?
The way I have it setup, it should:
1) do all the filter edits first based on filter file
2) run through all resource files within res-folder input and do the m2s on the BS and BC locations of data
User avatar
boshaw
 
Posts: 1538
Joined: Tue Jun 01, 2010 10:22 pm

Re: Assistance needed to fix hit-box data in haven-res.jar

Postby Xcom » Tue May 21, 2013 5:15 am

Ya all the files that needs editing. Basically all files extracted from haven-res.jar are in "res/".

But I'm unsure what you mean. Does it do the m2s edits on all neg files inside the "res/". By m2s I mean it goes in and reads the BS and BC and edits them using that function. Except for the filter folder res names, those it edits using the manually inputted data.

What I mean by that.
Read all res files one by one
1. If name is found in filter folder. Edit manually. Then go to next.
2. If not found in filter folder. Use m2s to edit its BS and BC. Then go to next.

The big issue is that there are over 1000 neg files. Editing them one by one, by hand is impossible. The m2s edit is the more important part.

The renaming 50 or so negs that are inside the filter file could be done by hand but it would be nice if the script would do it.
User avatar
Xcom
 
Posts: 1105
Joined: Wed Dec 14, 2011 1:43 pm

Re: Assistance needed to fix hit-box data in haven-res.jar

Postby Xcom » Tue May 21, 2013 6:50 am

Omg what a huge mistake. Its the wrong function.

m2s is the wrong function.

s2m is the correct one.

That might be the reason why everything was going berzerk.
User avatar
Xcom
 
Posts: 1105
Joined: Wed Dec 14, 2011 1:43 pm

Re: Assistance needed to fix hit-box data in haven-res.jar

Postby boshaw » Tue May 21, 2013 7:36 am

Xcom wrote:Omg what a huge mistake. Its the wrong function.

m2s is the wrong function.

s2m is the correct one.

That might be the reason why everything was going berzerk.


Yeah, that would be a big problem

Xcom wrote:Ya all the files that needs editing. Basically all files extracted from haven-res.jar are in "res/".

But I'm unsure what you mean. Does it do the m2s edits on all neg files inside the "res/". By m2s I mean it goes in and reads the BS and BC and edits them using that function. Except for the filter folder res names, those it edits using the manually inputted data.


Also I was using the m2s function on the filter resource ones too so that would be an issue, i'll fix both issues and repost once i get them done.


Also this is the right s2m function from MapView.java right?:
Code: Select all
    public static Coord s2m(Coord c) {
return(new Coord((c.x / 4) + (c.y / 2), (c.y / 2) - (c.x / 4)));
    }
User avatar
boshaw
 
Posts: 1538
Joined: Tue Jun 01, 2010 10:22 pm

PreviousNext

Return to The Wizards' Tower

Who is online

Users browsing this forum: No registered users and 2 guests