Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Friendly Fire
#1
Friendly fire:
.zip   friendlyfire.zip (Size: 1.2 MB / Downloads: 248)

How it works. There is a check which checks if you are on the same team as the object with the itr you are getting "hit" by. Pretty obvious. Assembly:

Code:
CPU Disasm
Address   Hex dump          Command                                  Comments
004177C4  |.  8B85 64030000 MOV EAX,DWORD PTR SS:[EBP+364]
004177CA  |.  3B83 64030000 CMP EAX,DWORD PTR DS:[EBX+364]
004177D0      0F85 90000000 JNE 00417866


JNE = jump if not equal. This exe replaces that JNE with a JMP, so it makes the game think all objects are always on separate teams.

Thanks to xsoameix for reverse engineering the giant "process_attack" function here: https://github.com/xsoameix/lf2/blob/mas...ss.rb#L506

And to Zort for bringing it up on IRC.


Friendly fire 2:

.zip   friendlyfire2.zip (Size: 1.2 MB / Downloads: 79)

So in the first one, you could hit yourself with your own projectiles. That was cool but kind of broke firen and freeze as they would hit them selves with the explosion and tornado which kinda made them stupidly weak. This version works by changing the comparison to check if the "owner" is the same rather than the team. i.e (notcie the 354 instead of 364 :P):

Code:
CPU Disasm
Address   Hex dump          Command                                  Comments
004177C4  |.  8B85 64030000 MOV EAX,DWORD PTR SS:[EBP+354]
004177CA  |.  3B83 64030000 CMP EAX,DWORD PTR DS:[EBX+354]
004177D0      0F85 90000000 JNE 00417866


Edit 3:

They are probably both broken in different ways. Too lazy to think about the best way of fixing them.
[Image: doty7Xn.gif]

10 ʏᴇᴀʀs sɪɴᴄᴇ ɪʀᴄ ɢᴏᴏᴅ.ɪ ᴡᴀʟᴋ ᴛʜʀᴏᴜɢʜ ᴛʜᴇ ᴇᴍᴘᴛʏ sᴛʀᴇᴇᴛs ᴛʀʏɪɴɢ ᴛᴏ ᴛʜɪɴᴋ ᴏғ sᴏᴍᴇᴛʜɪɴɢ ᴇʟsᴇ ʙᴜᴛ ᴍʏ ᴘᴀᴛʜ ᴀʟᴡᴀʏs ʟᴇᴀᴅs ᴛᴏ ᴛʜᴇ ɪʀᴄ. ɪ sᴛᴀʀᴇ ᴀᴛ ᴛʜᴇ sᴄʀᴇᴇɴ ғᴏʀ ʜᴏᴜʀs ᴀɴᴅ ᴛʀʏ ᴛᴏ sᴜᴍᴍᴏɴ ᴛʜᴇ ɢᴏᴏᴅ ɪʀᴄ. ɪ ᴡᴀᴛᴄʜ ᴏᴛʜᴇʀ ɪʀᴄ ᴄʜᴀɴɴᴇʟs ʙᴜᴛ ɪᴛ ɪs ɴᴏ ɢᴏᴏᴅ. ɪ ᴘᴇsᴛᴇʀ ᴢᴏʀᴛ ᴀɴᴅ ᴛʀʏ ᴛᴏ ʀᴇsɪsᴛ ʜɪs sᴇxɪɴᴇss ʙᴜᴛ ɪᴛ ɪs ᴀʟʟ ᴍᴇᴀɴɪɴɢʟᴇss. ᴛʜᴇ ᴇɴᴅ ɪs ɴᴇᴀʀ.ɪ ᴛʜᴇɴ ᴜsᴜᴀʟʟʏ ʀᴇᴀᴅ sᴏᴍᴇ ᴏʟᴅ ɪʀᴄ ʟᴏɢs ᴀɴᴅ ᴄʀʏ ᴍʏsᴇʟғ ᴛᴏ sʟᴇᴇᴘ.


Reply
Thanks given by: Electric2Shock , Ariyan
#2
(02-28-2015, 03:42 PM)Lord Silva Wrote:  They are probably both broken in different ways. Too lazy to think about the best way of fixing them.
Perhaps have it be an itr kind :P. Could try doing it if you won't.
[Image: signature.png]
A-Engine: A new beat em up game engine inspired by LF2. Coming soon

A-Engine Dev Blog - Update #8: Timeout

Reply
Thanks given by:
#3
(02-28-2015, 06:07 PM)Doctor A Wrote:  
(02-28-2015, 03:42 PM)Lord Silva Wrote:  They are probably both broken in different ways. Too lazy to think about the best way of fixing them.
Perhaps have it be an itr kind :P. Could try doing it if you won't.

Then you have to modify data. The goal is to make friendly fire "just work", then maybe make it toggle-able or something.
[Image: doty7Xn.gif]

10 ʏᴇᴀʀs sɪɴᴄᴇ ɪʀᴄ ɢᴏᴏᴅ.ɪ ᴡᴀʟᴋ ᴛʜʀᴏᴜɢʜ ᴛʜᴇ ᴇᴍᴘᴛʏ sᴛʀᴇᴇᴛs ᴛʀʏɪɴɢ ᴛᴏ ᴛʜɪɴᴋ ᴏғ sᴏᴍᴇᴛʜɪɴɢ ᴇʟsᴇ ʙᴜᴛ ᴍʏ ᴘᴀᴛʜ ᴀʟᴡᴀʏs ʟᴇᴀᴅs ᴛᴏ ᴛʜᴇ ɪʀᴄ. ɪ sᴛᴀʀᴇ ᴀᴛ ᴛʜᴇ sᴄʀᴇᴇɴ ғᴏʀ ʜᴏᴜʀs ᴀɴᴅ ᴛʀʏ ᴛᴏ sᴜᴍᴍᴏɴ ᴛʜᴇ ɢᴏᴏᴅ ɪʀᴄ. ɪ ᴡᴀᴛᴄʜ ᴏᴛʜᴇʀ ɪʀᴄ ᴄʜᴀɴɴᴇʟs ʙᴜᴛ ɪᴛ ɪs ɴᴏ ɢᴏᴏᴅ. ɪ ᴘᴇsᴛᴇʀ ᴢᴏʀᴛ ᴀɴᴅ ᴛʀʏ ᴛᴏ ʀᴇsɪsᴛ ʜɪs sᴇxɪɴᴇss ʙᴜᴛ ɪᴛ ɪs ᴀʟʟ ᴍᴇᴀɴɪɴɢʟᴇss. ᴛʜᴇ ᴇɴᴅ ɪs ɴᴇᴀʀ.ɪ ᴛʜᴇɴ ᴜsᴜᴀʟʟʏ ʀᴇᴀᴅ sᴏᴍᴇ ᴏʟᴅ ɪʀᴄ ʟᴏɢs ᴀɴᴅ ᴄʀʏ ᴍʏsᴇʟғ ᴛᴏ sʟᴇᴇᴘ.


Reply
Thanks given by:
#4
Oh well. The only way I can see it working flawlessly is to add these attacks' ball as exceptions in the code. How hard would it be to implement a simple fstream reading procedure with asm? I thought maybe these exception ids could be placed in a text file.
[Image: signature.png]
A-Engine: A new beat em up game engine inspired by LF2. Coming soon

A-Engine Dev Blog - Update #8: Timeout

Reply
Thanks given by:
#5
I have translated the original assembly code to C and have tested it, so you can change the logic more easily and safely.
All you need to do is that edit this line, and run it:
https://github.com/xsoameix/openlf2/blob...bal.c#L109
Decompiled functions: [documented] Functions decompiled
Decompile lf2.exe project for documentation: https://github.com/xsoameix/lf2
Decompile lf2.exe project for implementation: https://github.com/xsoameix/openlf2
Once any function fully engineer reversed in documentation project, then we implement it in implementation project.

lf2 data structure: Updated spreadsheet, many changes made by o_g349/xsoameix, I have two different nick names.

A old project: lf2-MS
Reply
Thanks given by: Boop




Users browsing this thread: 2 Guest(s)