Resource Layer Utility

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

Moderator: Phades

Re: Resource Layer Utility

Postby EnderWiggin » Wed Jul 04, 2012 9:04 am

Wow. Lisp, eh? Nice work, boshaw.
User avatar
EnderWiggin
 
Posts: 1154
Joined: Sat Mar 20, 2010 8:23 pm

Re: Resource Layer Utility

Postby boshaw » Wed Jul 04, 2012 10:40 am

EnderWiggin wrote:Wow. Lisp, eh? Nice work, boshaw.

I felt like trying something new I suppose, I figure eventually i'll translate it later into Java for easy usage with users from it's current state or take the time to make it into an executable and test that; however, I've been busy lately.

One thing that would be cool to eventually do is translate the VertexBuffer and a few other layers (which I assume to be directly related to the 3D models along with Image Layer for it's image texture) into actual 3D formats so you can edit them in blender or other programs alike.
User avatar
boshaw
 
Posts: 1589
Joined: Tue Jun 01, 2010 10:22 pm

Re: Resource Layer Utility

Postby aghmed » Fri Jan 11, 2013 10:00 am

don't know why but many, many negs are broken (contains other size that it is in real)
examples:
vilage idol
leanto
plow (don't have any neg)
cow (same as plow)
chest
80% of moutain ridges
and many others

if someone know how to read neg files i can give fixed rectangles of broken objects (rectangle(int sizex, int sizey,int offcetx, int offcety))
public static class StupidJavaCodeContainer {
/* oh, i love swing. */
class checkOutMyPathfinder{
Image
}}
User avatar
aghmed
 
Posts: 238
Joined: Fri Sep 07, 2012 7:20 pm
Location: between London and third part of LSD

Re: Resource Layer Utility

Postby boshaw » Fri Jan 11, 2013 10:23 pm

aghmed wrote:don't know why but many, many negs are broken (contains other size that it is in real)
examples:
vilage idol
leanto
plow (don't have any neg)
cow (same as plow)
chest
80% of moutain ridges
and many others

if someone know how to read neg files i can give fixed rectangles of broken objects (rectangle(int sizex, int sizey,int offcetx, int offcety))



Broken as in the they are compiled wrong by LayerUtil or that they are wrong to start with?

If it's the former then send me a file of what the output should be and i'll fix the issues with the program. If it's the latter then just decompile them, edit in the correct values and recompile.

Also HnH or Salem util?
User avatar
boshaw
 
Posts: 1589
Joined: Tue Jun 01, 2010 10:22 pm

Re: Resource Layer Utility

Postby aghmed » Sat Jan 12, 2013 11:53 pm

it's in HnH

well there are 2 types of bugs
1. zero neg
2. wrong neg size

i don't really know how it is calculated from neg into rectangle but

in case 1
plow
orginal rectangle size
(0,0)
offcet
(0,0)

proper size
size.x = 6;
size.y = 6;
offcet.x = -3;
offcet.y = -3;

case 2
orginal rectangle size
(21,9)
offcet
(-9,-5)

proper size
size.x = 21;
size.y = 10;
offcet.x = -9;
offcet.y = -5;

total broken negs i've found with my friend: 37
pm me if you can fix it having that data so i can send you all
public static class StupidJavaCodeContainer {
/* oh, i love swing. */
class checkOutMyPathfinder{
Image
}}
User avatar
aghmed
 
Posts: 238
Joined: Fri Sep 07, 2012 7:20 pm
Location: between London and third part of LSD

Re: Resource Layer Utility

Postby boshaw » Sun Jan 13, 2013 12:15 am

aghmed wrote:it's in HnH


Just find all the resources with bad negs, decompile them with LayerUtil, fix the proper values within the neg.res folder/files, then recompile and use
User avatar
boshaw
 
Posts: 1589
Joined: Tue Jun 01, 2010 10:22 pm

Re: Resource Layer Utility

Postby aghmed » Sun Jan 13, 2013 6:42 pm

i'm not so pro in that stuff
neg file contains something like that
Code: Select all
#NEG LAYER FOR RES: out///gfx\terobjs\trough.res
#Coord cc
52
47
#Coord bc
-7
-11
#Coord bs
16
20
#Coord sz
104
76
#Byte en
0

my data looks like that:
Code: Select all
size.x = 6;
size.y = 6;
offcet.x = -3;
offcet.y = -3;


if i would know how to convert one into other i would do it long time ago
public static class StupidJavaCodeContainer {
/* oh, i love swing. */
class checkOutMyPathfinder{
Image
}}
User avatar
aghmed
 
Posts: 238
Joined: Fri Sep 07, 2012 7:20 pm
Location: between London and third part of LSD

Re: Resource Layer Utility

Postby boshaw » Sun Jan 13, 2013 8:49 pm

If you refer back to the first post in the thread i posted a snipit of code relating to the Neg layer and it's relation to the game (I added comments now):

Code: Select all
if(Config.bounddb && ui.modshift) {
   g.chcolor(255, 0, 0, 128);                                                //Set color scheme
   synchronized(glob.oc) {                                                   //Synchronize the object cache
      for(Gob gob : glob.oc) {                                               // Loop for each object
         Drawable d = gob.getattr(Drawable.class);                           //get Drawable attribute
         Resource.Neg neg;                   
         if(d instanceof ResDrawable) {                                      //check if it's of type ResDrawable
            ResDrawable rd = (ResDrawable)d;
            if(rd.spr == null)                                               //Ignore if it doesn't have a sprint
               continue;
            if(rd.spr.res == null)                                           //or if it's sprints res isn't in existence
               continue;
            neg = rd.spr.res.layer(Resource.negc);                           //get the Neg otherwise
         } else if(d instanceof Layered) {                                   //If it's not ResDrawable and instead Layered
            Layered lay = (Layered)d; 
            if(lay.base.get() == null)                                       //ignore if it has no base
               continue;
            neg = lay.base.get().layer(Resource.negc);                       //get the Neg otherwise from the base layer
         } else {
            continue;                                                        //ignore Object if neither Layered or ResDrawable
         }
         if((neg.bs.x > 0) && (neg.bs.y > 0)) {                              //If the bs isn't negative
            Coord c1 = gob.getc().add(neg.bc);                               //Set the upper left?
            Coord c2 = gob.getc().add(neg.bc).add(neg.bs);                   //add the bs to right lower right?
            g.frect(m2s(c1).add(oc),                                         //render
            m2s(new Coord(c2.x, c1.y)).add(oc),                     
            m2s(c2).add(oc),
            m2s(new Coord(c1.x, c2.y)).add(oc));
         }
      }
   }
   g.chcolor();
}


I stated that the code above had something to do with drawing hitboxes of objects.

So from the looks of it the Coord BS seems to related to the SIZE, while Coord BC relates to it's position or offset.



With that being said, edit the files so BS and BC match your SIZE and OFFSET data and check ingame if it's working as you intended. If it still doesn't match up then i suggest experimenting with the values in Neg till you figure it out.
User avatar
boshaw
 
Posts: 1589
Joined: Tue Jun 01, 2010 10:22 pm

Re: Resource Layer Utility

Postby aghmed » Sun Jan 13, 2013 10:05 pm

well we've brute fixed by "if(name.equals("gfx/..."){size=....;}"
honestly i am way to lazy to decompile and check how does it working by pressing random numbers
if you want pm me i will send you whole fixed rectangles so you can fix it in your custon client
public static class StupidJavaCodeContainer {
/* oh, i love swing. */
class checkOutMyPathfinder{
Image
}}
User avatar
aghmed
 
Posts: 238
Joined: Fri Sep 07, 2012 7:20 pm
Location: between London and third part of LSD

Re: Resource Layer Utility

Postby mvgulik » Mon Jan 14, 2013 6:06 am

boshaw wrote:Coord BS seems to related to the SIZE, while Coord BC relates to it's position or offset

Mmm. Never looked at those two vars that way. But it makes more sens than what I had in my mind until now.

@aghmed:
You might like to add some info/data on 'why' do you think there is something wrong. (I, at least, don't get it.)
+ Res file source? Think that might matter to.
mvgulik
 
Posts: 3765
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 4 guests