Sprite Editing And Frame Rects

May 27, 2008 at 3:27 AM
Luls
"Bleep, Bloop, Bleep, Bloop"
Join Date: Oct 6, 2007
Location: I dunnos
Posts: 1584
Person said:
Do tell, how do you edit the frame rects? I can do small hex edits so if that's required it won't be a problem. I just want to use character sprite only a few pixels too high, that's all.

P.S. Please don't kill me for the bump or the random first post, I decided now was the time to come out of lurking!

Lol I'm lagging...

Ehh no method has been found so far to edit frame rects and that is why our modding abilities are limited >:
 
May 27, 2008 at 11:05 AM
Hoxtilicious
"Life begins and ends with Nu."
Join Date: Dec 30, 2005
Location: Germany
Posts: 3218
Age: 32
Metalogz said:
Lol I'm lagging...

Ehh no method has been found so far to edit frame rects and that is why our modding abilities are limited >:

Lies! D:
Me edited them, Runelancer edited them, Cookie edited them.
 
May 27, 2008 at 2:43 PM
Luls
"Bleep, Bloop, Bleep, Bloop"
Join Date: Oct 6, 2007
Location: I dunnos
Posts: 1584
S. P. Gardebiter said:
Lies! D:
Me edited them, Runelancer edited them, Cookie edited them.

Ohs. Through assembly... But... not hex editor... DDDDD:

AND RELEASE TEH DAMMNED INFO (if you haven't already [lols I suck at memory])

And I would love it if you could find the Hex addresses to do so =/
 
May 27, 2008 at 5:47 PM
Hoxtilicious
"Life begins and ends with Nu."
Join Date: Dec 30, 2005
Location: Germany
Posts: 3218
Age: 32
Hexadecimal code = Assembly -_-"
So you can change it with a hex editor too D:

...

NOOB!

LOL!

I would be glad to post it, but I'm lazy D:
 
May 27, 2008 at 7:02 PM
Luls
"Bleep, Bloop, Bleep, Bloop"
Join Date: Oct 6, 2007
Location: I dunnos
Posts: 1584
S. P. Gardebiter said:
I would be glad to post it, but I'm lazy D:

@#$@ release it RuneLancer-clone-thing! D:
 
May 28, 2008 at 6:39 AM
Justin-chan
"Heavy swords for sale. Suitable for most RPG Protagonists. Apply now!"
Join Date: Oct 15, 2007
Location: Nowhere
Posts: 1921
Age: 30
Please share

Before I run out of wrists to slit and have to start slitting my own. D:
 
May 30, 2008 at 5:03 AM
The Bartender
"All your forum are belong to us!"
Join Date: Jun 18, 2006
Location: Montreal, Canada
Posts: 581
Age: 39
Why I'm here posting this is a long story. :) I probably won't be around to reply to any questions about this, so if there's something you need clarification on and SP can't clarify it, feel free to drop me an email. Shouldn't be too complicated to do though.

There isn't some kind of script file somewhere that describes how enemies react to Quote: each specific enemy and weapon is hardcoded into the game. Every enemy/weapon in the game also defines their frames in this fashion: the game literally says something to the ends of "To draw this frame, set X to this, set Y to this, set the width to this, and the height to this." So don't bother looking for a friendly list of positions because they don't exist.

Luckily all frames are grouped together, so once you find the appropriate enemy you can edit every frame without having to dig through the code and trying to make sense of what's going on. So, I guess it's ALMOST a friendly organized list of positions.

A frame looks like this...

mov [ebp-00A0],00000000
mov [ebp-009C],00000060
mov [ebp-0098],00000010
mov [ebp-0094],00000070

It helps immensely if you have an assembly dump. This particular bit of code comes from 0x0043E1E9 and is the first of a series of frames that define sprite ID 117 (dunno which one that is, I'd have to look it up.)

Once you know what the structure looks like, it'll leap right out at you. I believe there's an NPC AI pointer table sitting around somewhere - use that to look up where in the code the NPCs are handled, and then look for blocks of code like above. I believe SP has my notes anyway, so I know there's a list of offsets available somewhere. :p

Here's a hands-on example: the treasure chest. Its three frames are defined as follows...

(at 0x0429BF6) { 0x00F0, 0x0000, 0x0100, 0x0010 }
(at 0x0429C12) { 0x0100, 0x0000, 0x0110, 0x0010 }
(at 0x0429C2E) { 0x0110, 0x0000, 0x0120, 0x0010 }

In hex, it looks like this...

0x00429BF6 - C7 45 D0 F0 00 00 00: mov [ebp-0030],000000F0 ; left : 240
0x00429BFD - C7 45 D4 00 00 00 00: mov [ebp-002C],00000000 ; top : 0
0x00429C04 - C7 45 D8 00 01 00 00: mov [ebp-0028],00000100 ; right : 256
0x00429C0B - C7 45 DC 10 00 00 00: mov [ebp-0024],00000010 ; bottom: 16

0x00429C12 - C7 45 E0 00 01 00 00: mov [ebp-0020],00000100 ; left : 256
0x00429C19 - C7 45 E4 00 00 00 00: mov [ebp-001C],00000000 ; top: 0
0x00429C20 - C7 45 E8 10 01 00 00: mov [ebp-0018],00000110 ; right: 272
0x00429C27 - C7 45 EC 10 00 00 00: mov [ebp-0014],00000010 : bottom: 16

0x00429C2E - C7 45 F0 10 01 00 00: mov [ebp-0010],00000110 ; left: 272
0x00429C35 - C7 45 F4 00 00 00 00: mov [ebp-000C],00000000 ; top: 0
0x00429C3C - C7 45 F8 20 01 00 00: mov [ebp-0008],00000120 ; right: 288
0x00429C43 - C7 45 FC 10 00 00 00: mov [ebp-0004],00000010 ; bottom: 16

The first 3 bytes are used to determine the instruction (MOV) and addressing mode ([ebp-xxxx]). Because these are negative numbers, they'll sometimes be represeted in a different form. The last 4 bytes on each line is what interests us though: they're the coordinates of all 3 frames a chest can have.

It should be trivial to edit the frames a chest uses, now. :D

(While I'm at it, if you're doing a little assembly hacking, the frame is stored in [eax+0068], assuming eax is set to [ebp-0008] to point to the sprite data earlier.)
 
May 30, 2008 at 5:09 AM
Justin-chan
"Heavy swords for sale. Suitable for most RPG Protagonists. Apply now!"
Join Date: Oct 15, 2007
Location: Nowhere
Posts: 1921
Age: 30
Not really. I still don't get it. XD

Maybe I should learn Assembly.

Anyone got any assembly tutorials and programs they want to recommend?
 
May 30, 2008 at 5:58 AM
Luls
"Bleep, Bloop, Bleep, Bloop"
Join Date: Oct 6, 2007
Location: I dunnos
Posts: 1584
Yay!~

Rune lancer be teh generous!

But... I... don't really get it so...

*copies and pastes cjsy801's post*
 
May 30, 2008 at 1:42 PM
Hoxtilicious
"Life begins and ends with Nu."
Join Date: Dec 30, 2005
Location: Germany
Posts: 3218
Age: 32
Thanks Rune!
I will explain it easier for you people, because it really isn't that hard D:

RuneLancer said:
(at 0x0429BF6) { 0x00F0, 0x0000, 0x0100, 0x0010 }
(at 0x0429C12) { 0x0100, 0x0000, 0x0110, 0x0010 }
(at 0x0429C2E) { 0x0110, 0x0000, 0x0120, 0x0010 }

In hex, it looks like this...

0x00429BF6 - C7 45 D0 F0 00 00 00: mov [ebp-0030],000000F0 ; left : 240
0x00429BFD - C7 45 D4 00 00 00 00: mov [ebp-002C],00000000 ; top : 0
0x00429C04 - C7 45 D8 00 01 00 00: mov [ebp-0028],00000100 ; right : 256
0x00429C0B - C7 45 DC 10 00 00 00: mov [ebp-0024],00000010 ; bottom: 16

0x00429C12 - C7 45 E0 00 01 00 00: mov [ebp-0020],00000100 ; left : 256
0x00429C19 - C7 45 E4 00 00 00 00: mov [ebp-001C],00000000 ; top: 0
0x00429C20 - C7 45 E8 10 01 00 00: mov [ebp-0018],00000110 ; right: 272
0x00429C27 - C7 45 EC 10 00 00 00: mov [ebp-0014],00000010 : bottom: 16

0x00429C2E - C7 45 F0 10 01 00 00: mov [ebp-0010],00000110 ; left: 272
0x00429C35 - C7 45 F4 00 00 00 00: mov [ebp-000C],00000000 ; top: 0
0x00429C3C - C7 45 F8 20 01 00 00: mov [ebp-0008],00000120 ; right: 288
0x00429C43 - C7 45 FC 10 00 00 00: mov [ebp-0004],00000010 ; bottom: 16

The first Frame is:

{ 0x00F0, 0x0000, 0x0100, 0x0010 }

It's located at adress 0x0429BF6.

Look now at the quote, left is the data (hexadecimal), right is the code (assembly).
You now can easily edit the data with a hex editor.

Left is 240, meaning it starts at position 240.
Right is 256, meaning it ends at position 256.
Top is 0, meaning it starts at position 0.
Bottum is 16, meaning it ends at position 16.

So it's 16x16, starting at 240x0 and ending at 256x16. That's the framerect for the first frame. You now could easily change that.

If you don't understand this, open a hex editor and try it yourself.
 
May 31, 2008 at 9:45 AM
Justin-chan
"Heavy swords for sale. Suitable for most RPG Protagonists. Apply now!"
Join Date: Oct 15, 2007
Location: Nowhere
Posts: 1921
Age: 30
*Brain explodes*
 
May 31, 2008 at 5:12 PM
Luls
"Bleep, Bloop, Bleep, Bloop"
Join Date: Oct 6, 2007
Location: I dunnos
Posts: 1584
jcys810 said:
*Brain explodes*

Omg... That's the FREAKING EXACT THING I said to SP when he tried to explain it to me lmao!

xDDD
 
May 31, 2008 at 5:21 PM
Hoxtilicious
"Life begins and ends with Nu."
Join Date: Dec 30, 2005
Location: Germany
Posts: 3218
Age: 32
<_<

貴方わ馬鹿です。
 
Jun 1, 2008 at 9:46 AM
Justin-chan
"Heavy swords for sale. Suitable for most RPG Protagonists. Apply now!"
Join Date: Oct 15, 2007
Location: Nowhere
Posts: 1921
Age: 30
Dude, the URL is obviously that lame Taekwondo website.
 
Jun 1, 2008 at 4:11 PM
The Bartender
"All your forum are belong to us!"
Join Date: Jun 18, 2006
Location: Montreal, Canada
Posts: 581
Age: 39
Code:
NPC AI Pointer Table
0		1		2		3		4		5		6		7		8		9
00	0x0026530	0x00265B0	0x0026AF0	0x0026FD0	0x0027040	0x0027480	0x0027820	0x0027C60	0x0027F00	0x0028260
01	0x0028540	0x00289B0	0x0028B10	0x0029940	0x0029A30	0x0029BF0	0x0029E00	0x002A0B0	0x002A360	0x002A490
02	0x002A830	0x002A940	0x002A9C0	0x002AA70	0x002ABD0	0x002B280	0x002B5E0	0x002BA90	0x002BAE0	0x002C1A0
03	0x002C320	0x002C4C0	0x002CA10	0x002CAC0	0x002CC20	0x002CCB0	0x002D010	0x002D760	0x002D810	0x002D960
04	0x002D9F0	0x002DE00	0x002DE70	0x002E9F0	0x002EAB0	0x002F060	0x002F320	0x002F3F0	0x002F780	0x002F9E0
05	0x002FEC0	0x00301B0	0x0030780	0x00307D0	0x0030B00	0x0030EB0	0x00311D0	0x00315E0	0x0031C20	0x00321F0
06	0x0032460	0x0032B50	0x00334C0	0x00336C0	0x0033C00	0x0033FC0	0x00342B0	0x00345E0	0x0034D10	0x00355F0
07	0x0035AB0	0x0035BA0	0x0035DE0	0x0035FC0	0x0036180	0x0036540	0x0036650	0x0036690	0x00367E0	0x0036870
08	0x0036AE0	0x00370F0	0x00375E0	0x0037D90	0x0038250	0x00383D0	0x0038590	0x0038850	0x0038B10	0x0039580
09	0x0039B00	0x0039B50	0x0039BC0	0x0039DC0	0x003A220	0x003A680	0x003AAF0	0x003AD10	0x003AF20	0x003B140
10	0x003B350	0x003B410	0x003B4E0	0x003B5F0	0x003B7F0	0x003BD00	0x003BDB0	0x003BE00	0x003C4B0	0x003C610
11	0x003C8E0	0x003CDE0	0x003D0A0	0x003D320	0x003D860	0x003DAE0	0x003E190	0x003E1E0	0x003E9B0	0x003F230
12	0x003F280	0x003F310	0x003F4A0	0x003FC70	0x003FEF0	0x00400D0	0x00401F0	0x0040760	0x00408B0	0x0040CF0
13	0x0041000	0x0041360	0x0041440	0x00419B0	0x0041B20	0x0041EC0	0x0042340	0x0042540	0x0042590	0x0042790
14	0x0042BF0	0x0043AC0	0x0043EC0	0x0044190	0x0044230	0x0044620	0x0044780	0x0044930	0x0045050	0x0045170
15	0x0045660	0x0045E30	0x0045FA0	0x0046020	0x0046500	0x0046710	0x0046B60	0x0046CA0	0x0047180	0x00474C0
16	0x0047700	0x0047CB0	0x0047E90	0x00482A0	0x0048410	0x0048580	0x00486E0	0x00487F0	0x0048A10	0x0048BE0
17	0x00495A0	0x00498C0	0x0049C10	0x0049D70	0x004A3C0	0x004A610	0x004A7D0	0x004ABB0	0x004AEE0	0x004B080
18	0x004B210	0x004BE10	0x004C220	0x004C630	0x004C7A0	0x004CA60	0x004CBE0	0x004CDB0	0x004D070	0x004D3A0
19	0x004D5E0	0x004D740	0x004DA00	0x004DE20	0x004DEA0	0x004DF10	0x004DF60	0x004E020	0x004E260	0x004E400
20	0x004E5F0	0x004EC40	0x004ECE0	0x004EE40	0x004F1F0	0x004F3E0	0x004F6D0	0x004FB40	0x004FCB0	0x0050280
21	0x0050400	0x0050760	0x0050810	0x0050BF0	0x00512A0	0x0051430	0x00517F0	0x0051840	0x0051CA0	0x0051DA0
22	0x0051E90	0x0052000	0x0052470	0x00524E0	0x0052700	0x00528D0	0x0052A50	0x0052D10	0x0052D60	0x00530D0
23	0x0053190	0x0053260	0x00536F0	0x00539B0	0x0053E60	0x0053F20	0x0054310	0x00548B0	0x0054A00	0x0054DF0
24	0x0054F00	0x0055370	0x0055710	0x0055A10	0x0055AB0	0x0055C10	0x0055E00	0x0056110	0x0056F50	0x00570B0
25	0x0057180	0x0057470	0x0057570	0x00579D0	0x0057B00	0x0057D70	0x0058010	0x0058360	0x00585A0	0x00585F0
26	0x0058810	0x0058A70	0x0058C30	0x0058DF0	0x0059950	0x0059B30	0x0059C00	0x0059D80	0x005B3D0	0x005BCB0
27	0x005BF10	0x005C230	0x005C500	0x005C5A0	0x005C750	0x005CC80	0x005CEA0	0x005D780	0x005D930	0x005DCF0
28	0x005E110	0x005E360	0x005E4C0	0x005E950	0x005F910	0x0060910	0x0060AE0	0x0060BB0	0x0060D70	0x00610D0
29	0x00614A0	0x0061800	0x00618B0	0x00618C0	0x00619E0	0x0061B90	0x0061E40	0x0061FD0	0x0062050	0x00623D0
30	0x00624E0	0x00625A0	0x0062890	0x0062AF0	0x0062C80	0x0062E00	0x0062F60	0x00630F0	0x00632B0	0x0063710
31	0x0063AC0	0x0064090	0x0064740	0x0064BB0	0x0065CC0	0x0065F60	0x00664B0	0x0066790	0x0066B80	0x0066E50
32	0x00670C0	0x00673F0	0x00676D0	0x0067C60	0x0067F40	0x0067FE0	0x0068230	0x0068830	0x0068990	0x00689E0
33	0x0068A90	0x0068D70	0x0068F50	0x0069140	0x0069290	0x0069430	0x0069610	0x00696B0	0x0069800	0x0069AA0
34	0x0069B40	0x006B240	0x006B340	0x006BD80	0x006BE10	0x006BF00	0x006C1D0	0x006C710	0x006C9B0	0x006CAC0
35	0x006CB50	0x006D340	0x006D5D0	0x006DBE0	0x006E110	0x006E280	0x006E480	0x006E730	0x006E870	0x006E9E0
36	0x006EA90

BOSS AI Pointer Table
0		1		2		3		4		5		6		7		8		9
00	0x0072FF0	0x007B6F0	0x0079030	0x007E6F0	0x0074400	0x007A8A0	0x007D170	0x00753D0	0x007C820	0x00772F0
I figured this might come in handy.

Add 0x0400000 to get the offset in an assembly dump. Shouldn't be too hard to find the framerects with this. :confused:
 
Jun 1, 2008 at 4:28 PM
Hoxtilicious
"Life begins and ends with Nu."
Join Date: Dec 30, 2005
Location: Germany
Posts: 3218
Age: 32
Oh my god...
Runelancer, I love you! D:

This is just outstanding!
I should try to change it a bit, expirment and such, you said it is pseudo-code?
Then it should be easier for me to change it.
 
Jun 1, 2008 at 6:00 PM
Luls
"Bleep, Bloop, Bleep, Bloop"
Join Date: Oct 6, 2007
Location: I dunnos
Posts: 1584
RuneLancer said:
Code:
INSERT TEH CRAZY PRO SHT HERE OMG!
I figured this might come in handy.

Add 0x0400000 to get the offset in an assembly dump. Shouldn't be too hard to find the framerects with this. :confused:

OMG OM GOM G RUNE YOU ARE TEH POWARZ!

OMG! I DON'T UNDERSTAND A BIT OF IT LMAO!

NEVERTEHLESS IT PRO!
 
Jun 1, 2008 at 6:24 PM
Hoxtilicious
"Life begins and ends with Nu."
Join Date: Dec 30, 2005
Location: Germany
Posts: 3218
Age: 32
diph.php


This kicks ass in just so many ways.
 
Top