Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to: script Artificial Intelligence
#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:


Messages In This Thread
RE: How to: script Artificial Intelligence - by Alblaka - 06-19-2012, 06:37 PM



Users browsing this thread: 6 Guest(s)