![]() |
[2.2]Programmable AI via scripting - Printable Version +- Little Fighter Empire - Forums (https://lf-empire.de/forum) +-- Forum: Little Fighter 2 Zone (https://lf-empire.de/forum/forumdisplay.php?fid=7) +--- Forum: AI Scripting (https://lf-empire.de/forum/forumdisplay.php?fid=56) +--- Thread: [2.2]Programmable AI via scripting (/showthread.php?tid=7927) |
RE: [1.1 Update]Programmable AI via scripting - Boop - 06-21-2012 (06-21-2012, 07:42 AM)Alblaka Wrote: Isn't that sort of ludicrously inefficient? Insignificant really. You saw your self that when you declare are variable in side a for loops scope and have it allocated/destroyed the performance issues are much worse. Since the files are being accessed constantly and small, they'll be in the hard drives cache. I doubt storing them in RAM will be in any quicker(at least not quick enough to make a noticeable difference), the performance issues come from chaiscript evaluating the script, not just reading the file. RE: [1.1 Update]Programmable AI via scripting - Alblaka - 06-21-2012 (06-21-2012, 10:45 AM)Lord Silva Wrote: Insignificant really. You saw your self that when you declare are variable in side a for loops scope and have it allocated/destroyed the performance issues are much worse. Since the files are being accessed constantly and small, they'll be in the hard drives cache. I doubt storing them in RAM will be in any quicker(at least not quick enough to make a noticeable difference), the performance issues come from chaiscript evaluating the script, not just reading the file. Sounds reasonable to me. Different issue: Is it your intention to disable loadTarget (aka, returning -1 and not loading a new target) if target.hp <= 0 ? I just noticed my AI is entirely incapable of reviving teammates because of this. loadTarget(0) will return -1 if the player #1 is dead. I hope this is not an engine limitation. RE: [1.1 Update]Programmable AI via scripting - Boop - 06-21-2012 Engine limitation. I don't know how to detect if an object "exists" or not. LF2 has an array of 400 bytes, 1 byte per object with a 1 or 0 depending on if it exists or not so I just check that. I guess it sets it to 0 when characters are dead. I might look into it in the future but not any time soon. RE: [1.1 Update]Programmable AI via scripting - Alblaka - 06-21-2012 Hmmm, not much can be done about that, I guess... At least not without modifying my characters into creating trigger-objects upon death ^^' RE: [1.1 Update]Programmable AI via scripting - Som1Lse - 06-21-2012 This will probably be too much work, but AngelScript seems like a better solution than ChaiScript in this case. It compiles the script into byte code before it is run, so it runs faster (would probably require that we don't read the file every execution), and easily allows static variables so they don't have to reallocated/deallocated every time. Just a thought. RE: [1.1 Update]Programmable AI via scripting - Boop - 06-21-2012 (06-21-2012, 03:28 PM)Someone else Wrote: This will probably be too much work, but AngelScript seems like a better solution than ChaiScript in this case. I saw anglescript when looking for a solution, the implementation seemed like a pain in the a**. I got the chaiscript stuff working in less than an hour, the AngelScript stuff would take a few days. RE: [1.1 Update]Programmable AI via scripting - Som1Lse - 06-21-2012 (06-21-2012, 03:46 PM)Lord Silva Wrote: I saw anglescript when looking for a solution, the implementation seemed like a pain in the a**. I got the chaiscript stuff working in less than an hour, the AngelScript stuff would take a few days.I could try. I have some experience with it. RE: [1.1 Update]Programmable AI via scripting - Alblaka - 06-22-2012 Btw, we got weapon_type now, but I would still appreciate a weapon_id. Of course I could simple iterate through all objects scanning for the given weapon types and attempt to locate which one is linked to the AI's char... but that sounds sort of inefficient. RE: [1.1 Update]Programmable AI via scripting - YinYin - 06-22-2012 (06-21-2012, 04:49 PM)Someone else Wrote: I could try. I have some experience with it.go for it the performance leap seems quite a good reason but you've got a lot of things to do to manage all the same features RE: [1.2 Update]Programmable AI via scripting - Boop - 06-23-2012 Updated |