Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to: script Artificial Intelligence
#11
(06-19-2012, 04:05 PM)YinYin Wrote:  added your name to the velocity request on silvas to do list

also i am trying to make davis deflect projectiles with his bare hands right now - quite a bit more difficult than a deflect defense ...

the deflect defense isn't easy either. It does only deflect attacks in ~2 ticks and acts like a normal defense for the remaining time.
Currently Striker does reflect only a few (25%?) of shots, but he still does barely get hit by them at all (25% deflect, 70% block, 5% hit). As well he's perfectly managing his mp and using his clone move whenever nearing full mp... On low hp it's worse then any rudolph clone spam <.<


Btw, does the self.team!=target.team check also work with 2 independant AIs? Which is the "independant" team number, 0?
My Creations: (Click to View)

Return (String) System.getNewsOfTheDay();
Barely active, expect slow responses. If at all.


Greetz,
Alblaka
Reply
Thanks given by:
#12
There'll be a new version within 1-2 hours which fixes all these bugs. YinYin was away for a while I was writing this update which is why this didn't get properly tested ( I'm too lazy to test my own code).

Edit:

Independent teams are high numbers (19+?). Each independent person has his own team number, you can test this by printing(self.team) etc. So yes, that check does work :).
[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: Alblaka
#13
(06-19-2012, 04:19 PM)Alblaka Wrote:  Btw, does the self.team!=target.team check also work with 2 independant AIs? Which is the "independant" team number, 0?

independant characters get random team numbers above 5 (ther is no independant team although there may be a 'non' team 0 - just try dropping characters like weapons for that)
Reply
Thanks given by:
#14
Ow fine :3

Btw, iterating through all 400 objects appears to cause SEVERE workload... Cannot have more then one AI Striker at the field.
Are there any issues on your sides with fielding multiple instances of the same AI?

PS: Striker is getting more and more of a beast and even discovered a quite interesting combo by itself I didn't know about before. Hardcoded it into the AI.
My Creations: (Click to View)

Return (String) System.getNewsOfTheDay();
Barely active, expect slow responses. If at all.


Greetz,
Alblaka
Reply
Thanks given by:
#15
Yeah performance isn't the best. I didn't write chaiscript but all my code is efficient as possible right now, so no performance improvements anytime soon :p. I'd suggest not iterating over 400 objects :p, also don't do any division or use any fractions etc :p, and use shift ( >> <<) instead of multiplying by powers of 2.
[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:
#16
Hmmm... iterating over 100 for now. Should cover the bandwith of a normal fight.

Btw, the AI appears to be calculating even whilst being dead (judging by console prints). Probably want to fix that potential leak?

edit:
Code:
for (var i = 0; i < 100; ++i)
    {
        var t = loadTarget(i)
Lethal.
For some reason the creation of a variable appears to be EXTREMELY CPU intensive...

Could we may get a .type? Then I could iterate whilst filtering for loadTarget!=-1 and then proceed iterating through a set of target.type=* cases

editedit:
Code:
for (var i = 0; i < 100; ++i)
    {
        if (loadTarget(i) != -1)
        {
            var type = loadTarget(i)
Appears to work all fine, too. 2x loadTarget but still quite smooth, as long as the object count keeps low (<30)
Still would prefer a .type solution.


PS: Striker is making good progress. Only thing left is his Chidori move, which is complex in both DC and usage means... Not sure whether I can code the AI to use it properly. But if I succeed, I want a cookie :3
My Creations: (Click to View)

Return (String) System.getNewsOfTheDay();
Barely active, expect slow responses. If at all.


Greetz,
Alblaka
Reply
Thanks given by:
#17
Added .type to my todo list :). I'm glad you're playing with the AI as well. Hopefully with enough people we can find all these little performance tricks :). Can't wait to see the Striker AI, be sure to release it here :D.
[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: Alblaka
#18
(06-19-2012, 07:27 PM)Lord Silva Wrote:  Added .type to my todo list :). I'm glad you're playing with the AI as well. Hopefully with enough people we can find all these little performance tricks :). Can't wait to see the Striker AI, be sure to release it here :D.

In all honesty, the AI thingy is awesome. I'm looking forward to fighting through Crazy with an 8man team consisting solely of my chars :3

Or a 3man team, given CHAIs performance in this regard ^^'
Though, with the .type addition the iterator could get a significant performance boost, possibly permitting 4 or 5 man teams (witch according enemy numbers).

As well, thanks for implementing the difficulty grade (static var) already. After the AI is finished I'll add some difficulty-related tweaks, f.e. disabling stronger moves or combos.

PS:
Requesting Cookie now. AI is now capable of using every single move of Strikers potential :§ It's still doodling out upon using the DoubleChidori sometimes (f.e. because it teleports to an enemy which is not it's autoselected target), but overall a solid performance. Would dare to call it equal to the base AIs... though Striker eventually compensated lack of intelligence with a slight touch of unbalanced moves :3
Will add difficulty regulations after a night of sleep.
My Creations: (Click to View)

Return (String) System.getNewsOfTheDay();
Barely active, expect slow responses. If at all.


Greetz,
Alblaka
Reply
Thanks given by:
#19
i'll kiss you man! <3 omg, its soo fun! thanks a lot YinYin and Lord Silva :3

lucky me i know C++ and its pretty much same as C :D :D :D :D
Reply
Thanks given by:
#20
(06-19-2012, 07:27 PM)Lord Silva Wrote:  Can't wait to see the Striker AI, be sure to release it here :D.

Decided a different thread would be appropriate, don't want to fill this official thread with anything relating to specific char AI's only, do we ^^

edit:
Uhm, how do I tell the AI to WALK into a certain direction?
We can only issue left() and right()... and without globals it's hard to make the AI only press it ONCE, exspecially since the self.left readers barely work.
My Creations: (Click to View)

Return (String) System.getNewsOfTheDay();
Barely active, expect slow responses. If at all.


Greetz,
Alblaka
Reply
Thanks given by:




Users browsing this thread: 1 Guest(s)