Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
AI Copying Error
#1
I've been successful in copying AI's from one character to another on many occasions. I use Lord Silva's AI copying technique and I have never had problems before.

Yesterday using the same techniques I copied the AI of ID: 4 to ID's 60-66 when I ran into a problem. The new ID's now properly use their new AI with no problems, but now characters with ID's 1 and 2 (there might be more as well) crash the game when they are put as computer controlled.

I really don't know exactly why this happened, but I do have a theory.

I noticed this while modifying the exe in ollydebug.

I replaced the line that determines the start of the AI for ID: 4

Code:
004041F1   . 83B8 F4060000 >CMP DWORD PTR DS:[EAX+6F4],4

with this

Code:
004041F1   . E9 94230400    JMP lf2.0044658A

just like Lord Silva's guide describes.

For some reason, once I do that, two extra lines of code come out of nowhere and appear right after the changed line, making it all look like this:

Code:
004041F1   . E9 94230400    JMP lf2_erro.0044658A
004041F6     90             NOP
004041F7     90             NOP
004041F8   . 0F85 63010000  JNZ lf2_erro.00404361
004041FE   > 81B9 08030000 >CMP DWORD PTR DS:[ECX+308],168

What does NOP mean? could that be causing an error leading to ID's 1 and 2 not being 'read'?

If anyone needs further clarification, I can try to add more info.
Any help would be greatly appreciated. :D

Reply
Thanks given by:
#2
i can't help you with your problem in detail, but nop means No operation and does effectively exactly that. Nothing.
(I hope i am not mixing it up though)
[sig placeholder until my new sig is finished]
should totally allow people to be all trolley on their birthday :D
Reply
Thanks given by:
#3
No, those 2 lines don't change anything. Upload your exe? ID 1 and 2 are not related to this at all. I think it's something else you changed, unrelated to this change.
[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
(04-18-2012, 06:14 PM)Lord Silva Wrote:  No, those 2 lines don't change anything. Upload your exe? ID 1 and 2 are not related to this at all. I think it's something else you changed, unrelated to this change.

My exe has a lot of other modifications (visual and code) because its part of a mod I'm making. I hope that doesn't cause problems.

http://www.filehosting.org/file/details/..._s_lf2.zip
Reply
Thanks given by:
#5
The original line was CMP DWORD PTR DS:[EAX+6F4],4
you put 0044658A > 83BA F4060000>CMP DWORD PTR DS:[EDX+6F4],4

enjoy :) (so use eax instead of edx for those ones). Basically look at what the CMP thingy uses, and use that. Sorry if that wasn't clear in the guide, it was written for 1.9c when all the AI's used the same register. In the newer option the compiler did different optimisations and stuff.
[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: vonfrank
#6
(04-18-2012, 07:06 PM)Lord Silva Wrote:  The original line was CMP DWORD PTR DS:[EAX+6F4],4
you put 0044658A > 83BA F4060000>CMP DWORD PTR DS:[EDX+6F4],4

enjoy :) (so use eax instead of edx for those ones). Basically look at what the CMP thingy uses, and use that. Sorry if that wasn't clear in the guide, it was written for 1.9c when all the AI's used the same register. In the newer option the compiler did different optimisations and stuff.


SWEET! that was obviously the problem! Thank you very much!
I would not have even noticed that if you didn't point it out. Many other AI's are EDX. I didn't know some were also EAX.
Perhaps I celebrated too quickly.

The problem regarding ID's 1 and 2 is gone, however it now seems like the characters with IDs 60 - 66 do not in fact use the new AI.
It is fairly obvious to tell if a character is using AI or not because if they are not they will rarely (if ever) use their special attacks.
Those characters seem to, once again, be stupid, despite copying the AI. Is the ID: 4 AI simply un-copyable, or have I done something else wrong here?

Thanks in advance.
Reply
Thanks given by:
#7
Well, (I am mostly referring to the DLL-framework here) Henry does have an AI but there are also 4, I believe, more that deal with ranged stuff. Henry is the only one that utilized those. Might be worth a try to test that out ;)

Don't have the time to post the exact names right now
Silverthorn / Blue Phoenix
~ Breaking LFE since 2008 ~

"Freeze, you're under vrest!" - Mark, probably.

» Gallery | » Sprites | » DeviantArt
Reply
Thanks given by:
#8
Yeah, AI is split up. The range part is different. D>A is different. I'm pretty sure it's working.
[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:




Users browsing this thread: 1 Guest(s)