Page 1 of 2 12 LastLast
Results 1 to 15 of 17

Thread: Optimisasi AI

http://idgs.in/404626
  1. #1
    chukky-jr's Avatar
    Join Date
    Jan 2010
    Posts
    453
    Points
    965.60
    Thanks: 20 / 19 / 17

    Default Optimisasi AI

    kalo mau kasih perintah2 otomatis gitu ke AI, mendingan pakai Periodic Event atau apa ya kalo di GUI? (blom ngerti JASS , sementara tolong kasih jawaban di GUI ya..)

    ada contoh mapnya kalo mau diliat, yang buatanku bagian AI Blue sama AI Teal (nggak di protect kok)

    http://www.mediafire.com/?hn29djmytnobs68

    btw tadi ku test di LAN walau main sendiri doang jadi delay banget, kalo bisa dikasih tau yak penyebabnya...

    versi sementara : http://www.mediafire.com/?gof2ghmbcssm8ry
    Last edited by chukky-jr; 02-06-11 at 21:48.

  2. Hot Ad
  3. #2
    Section's Avatar
    Join Date
    Nov 2006
    Location
    about.me/SECTION
    Posts
    2,095
    Points
    11,041.04
    Thanks: 45 / 112 / 98

    Default

    duh sori neh kemaren gw udah liat, tapi postingan gw gagal... jadi baru sekarang replynya...

    btw gw udah liat AI lu... dan ternyata AInya ada sedikit kesalahan... AInya terlalu banyak action dalam setiap kurun waktu *******.. dia jadi bingung dan akhirnya jadi ngedelay... lag dan ada acara bengong dah... jadi lu mesti klasifikasikan mana aja kegiatan yang bisa diinterupsi, mana yang enggak. dan order untuk AI diusahakan harus bisa diqueue, artinya ketika ada kejadian yang harusnya terjadi bersamaan di trigger, harus bisa diantrikan... ini yang paling susah...

  4. #3
    NodiX's Avatar
    Join Date
    Dec 2010
    Location
    The Dark Side of the Moon
    Posts
    459
    Points
    897.80
    Thanks: 22 / 21 / 20

    Default

    doh pada udah bisa bwt AI smua nih,,,,

    telat sy belajar AI, tutor yg dari Blade.dk dah jamuran....
    (^^^ada yg maw bg yg 1.24 ke atas?)

    INFP / Enneagram 4w5
    What exactly is a dream? And what exactly is a joke?

  5. #4
    Section's Avatar
    Join Date
    Nov 2006
    Location
    about.me/SECTION
    Posts
    2,095
    Points
    11,041.04
    Thanks: 45 / 112 / 98

    Default

    wogh... gw bikin AI selalu bikin sendiri... emang sih masih "****** poll"... cuman setidaknya sudah menambah environment permainan dan terkadang sudah cukup ngeselin...

  6. #5
    NodiX's Avatar
    Join Date
    Dec 2010
    Location
    The Dark Side of the Moon
    Posts
    459
    Points
    897.80
    Thanks: 22 / 21 / 20

    Default

    klo AI biasa sih bisa-bisa aja sy kk
    tpi klo yg kompleks bwt Hero Arena
    lom terlalu ngerti

    Sy pernah baca di the helper
    ada 2 metode bwt AI
    1. Pke timer
    2. OrderQueue

    Tapi dah keliling nyari gak ada satu2 tutor tentang AI yg d update
    Last edited by NodiX; 02-06-11 at 20:37. Reason: ZZZ

    INFP / Enneagram 4w5
    What exactly is a dream? And what exactly is a joke?

  7. #6
    chukky-jr's Avatar
    Join Date
    Jan 2010
    Posts
    453
    Points
    965.60
    Thanks: 20 / 19 / 17

    Default

    kalo yg ini bagaimana?? beberapa event gw ganti.

    http://www.mediafire.com/?gof2ghmbcssm8ry

    btw itu kalo ada 3 event, triggernya jalan kalau 3 3 nya terpenuhi atau salah satu event terpenuhi ya??

    kalau ada event (player1 gold becomes greater than 30), itu jadinya cuman dicek sekali (saat naik dari 30 ke 30++) atau dicek terus2an (setiap nambah resources, event nya di cek lagi)??

  8. #7
    NodiX's Avatar
    Join Date
    Dec 2010
    Location
    The Dark Side of the Moon
    Posts
    459
    Points
    897.80
    Thanks: 22 / 21 / 20

    Default

    btw itu kalo ada 3 event, triggernya jalan kalau 3 3 nya terpenuhi atau salah satu event terpenuhi ya??
    Klo ada event yang terpenuhi triggernya langsung jalan kk

    kalau ada event (player1 gold becomes greater than 30), itu jadinya cuman dicek sekali (saat naik dari 30 ke 30++) atau dicek terus2an (setiap nambah resources, event nya di cek lagi)??
    Setau saya cuman sekali, tapi klo turun kurang dari 30 terus naek lagi lebih dari 30 triggernya jalan lagi

    INFP / Enneagram 4w5
    What exactly is a dream? And what exactly is a joke?

  9. #8
    Section's Avatar
    Join Date
    Nov 2006
    Location
    about.me/SECTION
    Posts
    2,095
    Points
    11,041.04
    Thanks: 45 / 112 / 98

    Default

    @nodix... kan waktu itu gw ud pernah bikin logika AI sederhana kan yang buat casting spells... (itu sebenernya juga masih cupu karena belon ditambah kondisi apapun)...
    liat-liat lagi aja...


    kalo becomes ya ketika mencapai di atas 30... artinya kalo emang awalnya udah di atas 30, ni trigger ga bakal jalan-jalan... karena becomes itu proses dari yang belum 30 jadi 30... itu yang dia detect...

  10. #9
    NodiX's Avatar
    Join Date
    Dec 2010
    Location
    The Dark Side of the Moon
    Posts
    459
    Points
    897.80
    Thanks: 22 / 21 / 20

    Default

    Baca2 di the helper katanya ada 2 metode bwt ai

    Quote Originally Posted by kingkingyyk3
    Method 1
    -Use a timer.
    -Check the condition around and do actions.

    Method 2 (Advanced, but more efficient)
    - Use OrderQueue.
    - Check the condition around and do actions.
    Last edited by NodiX; 04-06-11 at 07:49.

    INFP / Enneagram 4w5
    What exactly is a dream? And what exactly is a joke?

  11. #10
    Section's Avatar
    Join Date
    Nov 2006
    Location
    about.me/SECTION
    Posts
    2,095
    Points
    11,041.04
    Thanks: 45 / 112 / 98

    Default

    itu dia..persis ama yang gw bilang pas pertama (antrian / queueing)...

    alasan AI susah buat diajarin karena tiap map kan beda-beda... akhirnya yang bermunculan ya cuman teori-teori aja...

  12. #11
    NodiX's Avatar
    Join Date
    Dec 2010
    Location
    The Dark Side of the Moon
    Posts
    459
    Points
    897.80
    Thanks: 22 / 21 / 20

    Default

    ntar misalnya klo AInya nyerah karna darahnya dikit, terus order yang ngantri di hapus ato apa?

    masih bingung...

    INFP / Enneagram 4w5
    What exactly is a dream? And what exactly is a joke?

  13. #12
    Section's Avatar
    Join Date
    Nov 2006
    Location
    about.me/SECTION
    Posts
    2,095
    Points
    11,041.04
    Thanks: 45 / 112 / 98

    Default

    kan dibilang aktivitas AI itu ada dua, yang queued sama interrupted... yang queued itu lebih ke arah strategikal seperti ********, masang tower, gap, mass attack dan combo. kalo yang interrupted itu lebih ke arah fast action kayak lagi war tiba2 ada yg sekarat, Aid dan lainnya...

    dulu gw pernah post algoritma pembuatan AI disini, cuman entah sepertinya udah terkubur dah... coba aja via search...

    EDIT :

    ketemu neh : http://www.indogamers.com/showthread...=ai+discussion
    Last edited by Section; 04-06-11 at 14:22.

  14. #13
    NodiX's Avatar
    Join Date
    Dec 2010
    Location
    The Dark Side of the Moon
    Posts
    459
    Points
    897.80
    Thanks: 22 / 21 / 20

    Default

    ya tadi juga dah nyari sy, tpi kompiny di pke ama kakak sy bntar

    lumayan ngerti sy skrng kk, coba bwt AI sederhana pke bahasa zinc...

    EDIT:
    buset pke zinc ribet amet,,, buanyak errornya T_T
    Last edited by NodiX; 05-06-11 at 12:08.

    INFP / Enneagram 4w5
    What exactly is a dream? And what exactly is a joke?

  15. #14
    Section's Avatar
    Join Date
    Nov 2006
    Location
    about.me/SECTION
    Posts
    2,095
    Points
    11,041.04
    Thanks: 45 / 112 / 98

    Default

    apa lagi itu zinc... kayak shampoo...

  16. #15
    NodiX's Avatar
    Join Date
    Dec 2010
    Location
    The Dark Side of the Moon
    Posts
    459
    Points
    897.80
    Thanks: 22 / 21 / 20

    Default

    hahahahah gk tau y???
    sy coba post code zinc sy

    klo bwt kk Section cocokan pke zinc dri pd pke vJASS, soalnya zinc mirip2 sma C
    Spoiler untuk Code shampoo :

    Code:
    //! zinc
    library LibraryAI requires TimerUtils{
    
    real X;
    real Y;
    
    function getRandomMap(){
        if (GetRandomInt(0,1)==0){
            X=GetRandomReal(GetRectMinX(gg_rct_Map_1),GetRectMaxX(gg_rct_Map_1));
            Y=GetRandomReal(GetRectMinY(gg_rct_Map_1),GetRectMaxY(gg_rct_Map_1));
        }
        else{
            X=GetRandomReal(GetRectMinX(gg_rct_Map_2),GetRectMaxX(gg_rct_Map_2));
            Y=GetRandomReal(GetRectMinY(gg_rct_Map_2),GetRectMaxY(gg_rct_Map_2));
        }
    }
    
    struct CarryAI{
        static constant integer IDLE=0;
        static constant integer FLEE=1;
        static constant integer ENGANGE=2;
        static constant integer SUPPORT=3;
        static constant integer AID=4;
        static constant integer HEALING=5;
        static constant integer ATTACK=6;
    
        integer status;
        unit hero;
        hashtable table;
        
        real Vsurrunder=0.3;
        
        static method onLoop(){
            CarryAI dat=GetTimerData(GetExpiredTimer());
            
            if (dat.status==IDLE){
                dat.status=ATTACK;
                debug{
                    BJDebugMsg(GetPlayerName(GetOwningPlayer(dat.hero))+" is changing state to ATTACK");
                }
            }
            if (dat.status==ATTACK){
                if (GetUnitState(dat.hero,UNIT_STATE_LIFE)<GetUnitState(dat.hero,UNIT_STATE_MAX_LIFE)*dat.Vsurrunder){
                    IssueTargetOrder(dat.hero,"holybolt",dat.hero);
                    if (GetUnitCurrentOrder(dat.hero)!=OrderId("holybolt")){
                        dat.status=FLEE;
                        debug{
                            BJDebugMsg(GetPlayerName(GetOwningPlayer(dat.hero))+" is changing state to FLEE");
                        }
                    }
                }
            }
            if (dat.status==HEALING){
                if (GetUnitState(dat.hero,UNIT_STATE_LIFE)>GetUnitState(dat.hero,UNIT_STATE_MAX_LIFE)*0.85){
                    dat.status=ATTACK;
                    debug{
                        BJDebugMsg(GetPlayerName(GetOwningPlayer(dat.hero))+" is changing state to ATTACK");
                    }
                }
            }
            if (dat.status==ATTACK){
                getRandomMap();
                if (GetUnitCurrentOrder(dat.hero)==0){
                    IssuePointOrder(dat.hero,"attack",X,Y);
                }
                
            }
            else if(dat.status==FLEE){
                if(RectContainsCoords(gg_rct_HEALING_GREEN,GetUnitX(dat.hero),GetUnitY(dat.hero))){
                    dat.status=HEALING;
                debug{
                    BJDebugMsg(GetPlayerName(GetOwningPlayer(dat.hero))+" is changing state to HEALING");
                }
                }
                else{
                    IssuePointOrder(dat.hero,"move",GetRandomReal(GetRectMinX(gg_rct_HEALING_GREEN),GetRectMaxX(gg_rct_HEALING_GREEN)),GetRandomReal(GetRectMinY(gg_rct_HEALING_GREEN),GetRectMaxY(gg_rct_HEALING_GREEN)));
                }
            }
        }
        
        static method create(unit u) -> thistype{
            CarryAI dat=CarryAI.allocate();
            timer time=NewTimer();
            
            SetTimerData(time,integer(dat));
            dat.table=InitHashtable();
    
            TimerStart(time,.5,true, function CarryAI.onLoop);
            dat.hero=u;
            
            time=null;
            return dat;
        }
    }
    
    function onInit(){
        trigger q=CreateTrigger();
        unit w;
        CarryAI dat;
        
        w=CreateUnit(Player(1),'Hpal',GetStartLocationX(GetPlayerStartLocation(Player(1))),GetStartLocationY(GetPlayerStartLocation(Player(1))),0.1);
        SelectHeroSkill(w,'AHhb');
        
        dat=CarryAI.create(w);
        
        q=null;
        w=null;
    }
    }
    //! endzinc

    ntar bermunculan bahasa Pantene, Rejoice, sunsilk dll

    INFP / Enneagram 4w5
    What exactly is a dream? And what exactly is a joke?

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •