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

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

Moderator: Phades

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

Postby Xcom » Thu May 23, 2013 3:31 am

Wait. What an idiot.

I forgot I am using custom images for walls / cubs / cheese racks. Ofc it would mess up cause the custom res for these items haven't had a neg fix.

Sorry for false alarm.

Small update:

I used the script to edit the costum res files. Oddly they should have ended up

Code: Select all
Size bs   (10, 10)
Offset bc (-5, -5)


But instead they ended up with
Code: Select all
Size bs   (11, 11)
Offset bc (-6, -6)
User avatar
Xcom
 
Posts: 1105
Joined: Wed Dec 14, 2011 1:43 pm

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

Postby Xcom » Thu May 23, 2013 3:45 am

I had a suspicion that rounding were made differently.

Bumping around "gfx/terobjs/pow" and "gfx/terobjs/furniture/table" are also rounded up instead of down.

Code: Select all
Name      gfx/terobjs/pow
Size bs   (10, 10)
Offset bc (-5, -5)


should be
Code: Select all
Size bs   (9, 9)
Offset bc (-4, -4)


Currently
Code: Select all
Name      gfx/terobjs/furniture/table
Size bs   (11, 11)
Offset bc (-6, -6)


should be
Code: Select all
Size bs   (10, 10)
Offset bc (-5, -5)


Does the s2m conversion use a int rounding? That must be the reason why they come out differently as it should round down all numbers.
User avatar
Xcom
 
Posts: 1105
Joined: Wed Dec 14, 2011 1:43 pm

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

Postby boshaw » Thu May 23, 2013 5:05 am

Xcom wrote:Does the s2m conversion use a int rounding? That must be the reason why they come out differently as it should round down all numbers.


It floors all numbers, so they should be rounded down
User avatar
boshaw
 
Posts: 1538
Joined: Tue Jun 01, 2010 10:22 pm

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

Postby Xcom » Thu May 23, 2013 5:54 am

boshaw wrote:
Xcom wrote:Does the s2m conversion use a int rounding? That must be the reason why they come out differently as it should round down all numbers.


It floors all numbers, so they should be rounded down


Very strange. The roundings must be different as about 25% of the converted s2m objects are over sized.
User avatar
Xcom
 
Posts: 1105
Joined: Wed Dec 14, 2011 1:43 pm

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

Postby Xcom » Fri May 24, 2013 3:05 am

I had a thorrow look through the numbers.

The s2m conversion should go through this calculation.

x = rounddown(c.x / 4) + rounddown(c.y / 2)

y = rounddown(c.y / 2) - rounddown(c.x / 4)

But the script must be doing this and throws off the sizes of some objects

x = rounddown( (c.x / 4) + (c.y / 2) )

y = rounddown( (c.y / 2) - (c.x / 4) )

Another thing to note. Most errors happen in BC and not in BS.
User avatar
Xcom
 
Posts: 1105
Joined: Wed Dec 14, 2011 1:43 pm

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

Postby boshaw » Fri May 24, 2013 3:39 am

Xcom wrote:I had a thorrow look through the numbers.

The s2m conversion should go through this calculation.

x = rounddown(c.x / 4) + rounddown(c.y / 2)

y = rounddown(c.y / 2) - rounddown(c.x / 4)

But the script must be doing this and throws off the sizes of some objects

x = rounddown( (c.x / 4) + (c.y / 2) )

y = rounddown( (c.y / 2) - (c.x / 4) )

Another thing to note. Most errors happen in BC and not in BS.


You're right, i overlooked that. I update the source to do the truncation properly for that: https://github.com/boshaw/salem-layer-u ... master.zip
User avatar
boshaw
 
Posts: 1538
Joined: Tue Jun 01, 2010 10:22 pm

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

Postby Xcom » Fri May 24, 2013 4:20 am

Just did all the updates and tested it. Looks perfect now. :)

Thanks again for all the help. Filter should edit all hit-boxes correctly except for the few listed objects:

These should have a smaller hit-box then currently
Chicken
Hen
Cock
Rabbits

These shouldn't have a hit-box when they do.
Moth
Dragonfly
Log on ground - fixable, but left in for there red outline when hiding trees.
User avatar
Xcom
 
Posts: 1105
Joined: Wed Dec 14, 2011 1:43 pm

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

Postby Oddity » Thu Jun 20, 2013 7:16 am

I would like a list of all the objects and their hitbox dimensions. <3
jadamkaz wrote:ah i remember my run in with odditown they are good ppl im sure the only reason they killed ME is because they are troll hunters and i was a troll
User avatar
Oddity
 
Posts: 1948
Joined: Sun Jun 20, 2010 12:04 am
Location: BC, Canadia

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

Postby Xcom » Sat Jun 29, 2013 6:11 pm

Alot of new objects with hitboxes have been added. But I could make a haven-res.jar out of the new ones and the old ones and somehow upload it and link. Dono how to upload though.
User avatar
Xcom
 
Posts: 1105
Joined: Wed Dec 14, 2011 1:43 pm

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

Postby mvgulik » Sun Jul 07, 2013 6:36 am

I have always been kinda mystified about the general conclusion that "bc(Y)" is a(and only a) "offset" and "bs(Y)" is a(and only a) size.
Is that conclusion still uphold ?

Looking at the new Yew tree res data ... I think that conclusion is wrong (at least for tree's that is).

Code: Select all
01.res\neg   #bc(Y)    0   #bs(Y)   0
02.res\neg   #bc(Y)   -4   #bs(Y)   4
03.res\neg   #bc(Y)   -4   #bs(Y)   5
04.res\neg   #bc(Y)   -5   #bs(Y)   5
05.res\neg   #bc(Y)   -9   #bs(Y)   9
06.res\neg   #bc(Y)   -9   #bs(Y)   9

The data change from res "03" to res "04" would mean that only the "offset"/position of the tree hitbox is changed. Which seems to have no good reason for doing that.

I think ... that bc(Y) is the size(or point-offset if you like) of the Top (triangle)part of the hitbox diamond. And "bs(Y)" is used for the size of the bottom part. (Size being here the distance of the Top/Bottom corner of the hitbox diamond from the objects center point.)
Looking at the (auto generated it seems) changes between res "03", "04" and "05" this system makes more sense to me. CQ: The Tree hitbox is growing one unit in size, but as the hitbox is a mirror like shape, its done by just increasing one side(triangle) of the hitbox when needed.
mvgulik
 
Posts: 3742
Joined: Fri May 21, 2010 2:29 am

PreviousNext

Return to The Wizards' Tower

Who is online

Users browsing this forum: No registered users and 1 guest