Little Fighter EMPIRE - Forums

Full Version: [Info] Procedure which creates object
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
This isn't a tutorial, just me posting some findings and what not so all of this stuff is archived for the future =]

At 4061E0 (addressing might vary):
    ASM Programming
  1. sub_4061E0 proc near ; CODE XREF: sub_4064E0+3C9p
  2. ; sub_406A30+75p ...
  3. fld ds:dbl_447918
  4. push ebx
  5. push esi
  6. mov esi, ecx
  7. fst qword ptr [esi+50h]
  8. or eax, 0FFFFFFFFh
  9. xor ebx, ebx
  10. fst qword ptr [esi+48h]
  11. fst qword ptr [esi+40h]
  12. mov [esi+3F8h], eax
  13. fst qword ptr [esi+38h]
  14. mov [esi+4], ebx
  15. fst qword ptr [esi+30h]
  16. mov [esi], ebx
  17. fstp qword ptr [esi+28h]
  18. mov [esi+0BCh], bl
  19. fldz
  20. mov [esi+0B0h], ebx
  21. fst qword ptr [esi+68h]
  22. mov [esi+98h], ebx
  23. fst qword ptr [esi+60h]
  24. mov [esi+94h], ebx
  25. fstp qword ptr [esi+58h]
  26. mov [esi+90h], ebx
  27. mov [esi+8Ch], ebx
  28. mov [esi+88h], ebx
  29. mov [esi+84h], ebx
  30. mov [esi+80h], bl
  31. mov [esi+78h], ebx
  32. mov [esi+74h], ebx
  33. mov [esi+7Ch], ebx
  34. mov [esi+70h], ebx
  35. mov [esi+18h], ebx
  36. mov [esi+14h], ebx
  37. mov [esi+10h], ebx
  38. mov [esi+0Ch], ebx
  39. mov [esi+0EBh], bl
  40. mov [esi+0A0h], ebx
  41. mov [esi+9Ch], ebx
  42. mov [esi+364h], ebx
  43. mov [esi+0ACh], ebx
  44. mov [esi+0A8h], ebx
  45. mov [esi+0A4h], ebx
  46. mov [esi+8], ebx
  47. mov [esi+1Ch], ebx
  48. mov [esi+0D3h], bl
  49. mov [esi+0D2h], bl
  50. mov [esi+0D1h], bl
  51. mov [esi+0D0h], bl
  52. mov [esi+0CFh], bl
  53. mov [esi+0CEh], bl
  54. mov [esi+0CDh], bl
  55. mov [esi+0CCh], bl
  56. mov [esi+0CBh], bl
  57. mov [esi+0CAh], bl
  58. mov [esi+0C9h], bl
  59. mov [esi+0C8h], bl
  60. mov [esi+0C7h], bl
  61. mov [esi+0C6h], bl
  62. mov [esi+0C1h], bl
  63. mov [esi+0C0h], bl
  64. mov [esi+0BFh], bl
  65. mov [esi+0BEh], bl
  66. mov [esi+0C5h], bl
  67. mov [esi+0C3h], bl
  68. mov [esi+0C4h], bl
  69. mov [esi+0C2h], bl
  70. mov [esi+0DCh], bl
  71. mov [esi+0DBh], bl
  72. mov [esi+0DAh], bl
  73. mov [esi+0D9h], bl
  74. mov [esi+0D8h], bl
  75. mov [esi+0D7h], bl
  76. mov [esi+0D6h], bl
  77. mov [esi+0D5h], bl
  78. mov [esi+0D4h], bl
  79. mov [esi+0E0h], ebx
  80. mov [esi+0E4h], ebx
  81. mov [esi+0B8h], ebx
  82. mov [esi+0B4h], ebx
  83. mov [esi+0EAh], bl
  84. mov [esi+2F4h], eax
  85. mov [esi+2F8h], eax
  86. mov [esi+0E9h], bl
  87. mov [esi+0E8h], bl
  88. mov [esi+2E8h], ebx
  89. mov [esi+0ECh], ebx
  90. mov [esi+320h], ebx
  91. mov [esi+20h], ebx
  92. mov [esi+318h], ebx
  93. mov [esi+314h], ebx
  94. mov [esi+310h], ebx
  95. mov [esi+30Ch], ebx
  96. mov [esi+348h], ebx
  97. mov [esi+34Ch], ebx
  98. mov [esi+350h], ebx
  99. mov [esi+358h], ebx
  100. mov [esi+35Ch], ebx
  101. mov dword ptr [esi+354h], 63h
  102. mov ecx, 1F4h
  103. mov [esi+2FCh], ecx
  104. mov [esi+304h], ecx
  105. mov [esi+300h], ecx
  106. mov [esi+308h], ecx
  107. mov [esi+360h], eax
  108. mov [esi+3F4h], ebx
  109. mov [esi+3F0h], ebx
  110. mov [esi+3ECh], ebx
  111. mov [esi+3E8h], ebx
  112. mov [esi+324h], eax
  113. mov [esi+328h], eax
  114. mov [esi+32Ch], eax
  115. mov [esi+338h], ebx
  116. mov [esi+330h], ebx
  117. mov [esi+334h], ebx
  118. mov [esi+33Ch], eax
  119. push 190h
  120. lea eax, [esi+0F0h]
  121. push ebx
  122. push eax
  123. mov [esi+36Ch], ebx
  124. call j_memset
  125. add esp, 0Ch
  126. xor eax, eax
  127. lea ecx, [esi+280h]
  128.  
  129. loc_406462: ; CODE XREF: sub_4061E0+294j
  130. mov [esi+eax+2D0h], bl
  131. mov [ecx], ebx
  132. add eax, 1
  133. add ecx, 4
  134. cmp eax, 14h
  135. jl short loc_406462
  136. mov eax, 3E8h
  137. mov [esi+2E8h], eax
  138. mov [esi+2ECh], eax
  139. mov [esi+2F0h], eax
  140. mov [esi+2E4h], ebx
  141. mov [esi+0EBh], bl
  142. mov eax, 0FFFFFC18h
  143. mov [esi+400h], eax
  144. mov [esi+3FCh], eax
  145. mov [esi+404h], ebx
  146. mov [esi+418h], ebx
  147. mov [esi+414h], ebx
  148. mov [esi+410h], ebx
  149. mov [esi+40Ch], ebx
  150. mov [esi+408h], ebx
  151. mov [esi+340h], ebx
  152. mov [esi+344h], ebx
  153. pop esi
  154. pop ebx
  155. retn
  156. sub_4061E0 endp



As you can see, this is the procedure which creates an object in lf2. It sets up all the addresses, this makes it easy to find all the variables associated with characters. This should be a place to document them :D.


How to test stuff:
Get cheat engine, get it "hooked" to lf2(little computer icon at the top left corner flashing, lf2 should already be running).

Then press the add address button, check the pointer box.
For the pointer(put the appropriate address depending on the player you are using):

Player 1:458C94
Player 2:458C98
Player 3:458C9C
Player 4:458CA0

For the offset, put the thingy after the esi+. So if you are testing :
esi+2FCh . You put 2FC (no H). That is health.


List:
  • 2FC = Red Health
  • 300 = Dark Read
  • 308 = MP

Hopefully some people will contribute, the more we know about the lf2 engine the easier it will be to code features!
well im not going to learn hex at the moment first of all i want to learn how to dc perfect but silva great job as always
Awesome silva u rocks! I wish i could hex as good as u
(04-29-2009 05:55 PM)Lord Silva Wrote: [ -> ]As you can see, this is the procedure which creates an object in lf2.
I had to lol at this part. I didn't see it :p

Good job for finding, tho, maybe there are some people out there who can actually "use" the stuff intelligently and not follow step-by-step instructions.... =P
I need people who can follow step by step instructions to figure out what each variable is. I don't know much about LF2 DCing and what not. I might not recognize some things...

All you really have to do is sit and watch values change as you test different things :D.

If everything is documented, then it will be possible to create a LF2 Data Debugger. You'll get to see all the debug info about your character (positions,health,frame etc etc). Then I just need to figure out how the frames are used/stored and it will be possible to edit frames IN REAL TIME!(basically edit data while lf2 is running).
I read this thread 2 days ago after Silva post it, but not on my computer, because there were some hardware problem occurred on my computer. Whoa it taked me a great effort... (Til now, the Windows have just been reinstalled by me for 30 minutes..)

I was looking the same code with you at that time, Silva! :D (Before the harware problem)
And I have made a list for it in a spreadsheet:
http://www.mediafire.com/?3reztdwlyka
Take a look on it ;)
(.ods file type. Tell me if you don't know what it is. )

There are 3 pages about different address:
The 1st page is the individual information (HP, postion and etc. )
The 2nd page is the ID information (type, headpic and etc. )
The 3rd page is the frame information (pic no., state, hit tags and etc. )

It is not completed, I was checking some unknown value of the blanks in the spreadsheet.
Hope people can join this fill_in_the_blank_game. :p
http://spreadsheets.google.com/ccc?key=r...TUlwfdZHYQ

I uploaded to Google Docs. I set it up so everyone can edit it. Hopefully people won't mess it up:p.
(05-01-2009 09:47 AM)Lord Silva Wrote: [ -> ]http://spreadsheets.google.com/ccc?key=r...TUlwfdZHYQ

I uploaded to Google Docs. I set it up so everyone can edit it. Hopefully people won't mess it up:p.
:p
I am now testing the variables, and I see you keep looking at page 3.
Is it you have already started making the debugger tool? :O
Trying to... Quite hard plotting pixels to the screen because it is 2d with 3 axis :p. Plus the X cord is the one relative to the BG, not the X cord of where he is REALLY drawn in the 800x640 space(or what ever size the window is).

BTW, mind explaining how you are organizing it? Why are there 3 usage tables, which one do I write in?:p

Itrs:
x: 8DC
y: 8E0
w: 8E4
h: 8E8

Not exactly sure how to add the info :p.
Look at the cpoint part:
Only when kind=1, the program will load the injury, cover, vaction, action, jaction, daction, throwx, throwy, hurtable, taction, throwinjury and throwz.
Only when kind=2, the program will load the fronthurtact and backhurtact
For all values of the kind tag in cpoint, the program will load the kind, x, y, decrease and control.

So, fill in the first col if there is no such constraits.

The y and z axis is quite easy... You can simply use y+z to obtain the vertical position on the screen. -- There is no sheering in LF2 display, unlike other 2D game program. (Well, I see sheering in opointing with facing tag of value x0 though, but that is a trick on change the x position, to make the opointed objects form a slanted line on the screen. )
Pages: 1 2
Reference URL's