Reply
 
Thread Tools Display Modes   
 
Finding Path Penemuanku
 
Old 22/02/2008, 16:25 Reply With Quote   #1
alijaya
GDI Power Users
 
alijaya's Avatar
 
Join Date: Dec 2007
Location: Pangkalpinang
Posts: 3,003
alijaya is on a distinguished road
Send a message via Yahoo to alijaya alijaya is online now
Finding Path Penemuanku

ah lega akhirnya nemuin finding path buatan sendiri.
dan kayaknya nih finding path gak musingin banget.
tapi nih masih percobaan.
kalo ada yang mau ditanyakan tanya ajah.
ok ini dia di klik ajah.
http://www.geocities.com/alijayameilio/PathFinding.swf
__________________
tobat ngejunk. tobat nyepam. tobat bikin yang gak bener. tobat kasih komen gak jelas. tobat buang-buang ikon. tobat jadi orang jelek. tobat maen komputer sambil belajar. tobat banget kalo ngomong gak bertanggung jawab. tobat banget untuk kesalahan laennya.
"siapa yang mau ikut2an tobat??"
blog : http://alijaya.wordpress.com/, http://bothaxe.wordpress.com/

Last edited by alijaya : 22/02/2008 at 16:45.
   
 
 
Old 22/02/2008, 16:37 Reply With Quote   #2
Renkouya
Member
 
Renkouya's Avatar
 
Join Date: Oct 2007
Location: Jogja
Posts: 214
Renkouya is on a distinguished road
Renkouya is offline
yang mana yang di klik??
__________________
"Creative"
   
 
 
Old 22/02/2008, 16:40 Reply With Quote   #3
Ultraman_Bastard
Ultraman Bekas
 
Ultraman_Bastard's Avatar
 
Join Date: Jul 2006
Location: ndenpasar..
Posts: 2,860
Ultraman_Bastard is on a distinguished road
Send a message via ICQ to Ultraman_Bastard Send a message via AIM to Ultraman_Bastard Send a message via MSN to Ultraman_Bastard Send a message via Yahoo to Ultraman_Bastard Send a message via Skype™ to Ultraman_Bastard Ultraman_Bastard is offline
yang ini ren >> klik disini
__________________
1 - 2 - 3 - 4 - 5 - 6
   
 
 
Old 22/02/2008, 16:46 Reply With Quote   #4
alijaya
GDI Power Users
 
alijaya's Avatar
 
Join Date: Dec 2007
Location: Pangkalpinang
Posts: 3,003
alijaya is on a distinguished road
Send a message via Yahoo to alijaya alijaya is online now
tadi link nya rusak.
nah silahken diklik ulang.
silahken.
__________________
tobat ngejunk. tobat nyepam. tobat bikin yang gak bener. tobat kasih komen gak jelas. tobat buang-buang ikon. tobat jadi orang jelek. tobat maen komputer sambil belajar. tobat banget kalo ngomong gak bertanggung jawab. tobat banget untuk kesalahan laennya.
"siapa yang mau ikut2an tobat??"
blog : http://alijaya.wordpress.com/, http://bothaxe.wordpress.com/
   
 
 
Old 22/02/2008, 17:05 Reply With Quote   #5
lynxluna
Exavoltism Prophet
 
lynxluna's Avatar
 
Join Date: Dec 2004
Location: Djakarta
Posts: 648
lynxluna is on a distinguished road
Send a message via MSN to lynxluna Send a message via Yahoo to lynxluna Send a message via Skype™ to lynxluna lynxluna is offline
Pake apa neh? Djikstra? Breadth First? Depth First? A*?
__________________
The Mighty Coding Cat
   
 
 
Old 22/02/2008, 17:10 Reply With Quote   #6
alijaya
GDI Power Users
 
alijaya's Avatar
 
Join Date: Dec 2007
Location: Pangkalpinang
Posts: 3,003
alijaya is on a distinguished road
Send a message via Yahoo to alijaya alijaya is online now
bukan semuanya.
kayaknya sih.
dan aku blom pernah baca artikelnya satu2.
kecuali A* tapi itu juga aku baca tak dimengerti.
jadi asli buatan sendiri.
selama 3 hari kalo gak salah.
tapi konsepnya udah lama sekitar 10 hari kalo gak salah.
__________________
tobat ngejunk. tobat nyepam. tobat bikin yang gak bener. tobat kasih komen gak jelas. tobat buang-buang ikon. tobat jadi orang jelek. tobat maen komputer sambil belajar. tobat banget kalo ngomong gak bertanggung jawab. tobat banget untuk kesalahan laennya.
"siapa yang mau ikut2an tobat??"
blog : http://alijaya.wordpress.com/, http://bothaxe.wordpress.com/
   
 
 
Old 22/02/2008, 17:14 Reply With Quote   #7
wandah_w
Dumb Flash Scripter
 
wandah_w's Avatar
 
Join Date: Apr 2005
Location: malang
Posts: 1,380
wandah_w is on a distinguished road
Send a message via Yahoo to wandah_w wandah_w is offline
Serius ini kamu yang mbuat sendiri???
__________________
http://wandah.com
   
 
 
Old 22/02/2008, 17:15 Reply With Quote   #8
exavolt
god admin monyet
Twisted minded coder!
 
exavolt's Avatar
 
Join Date: Oct 2003
Location: JakJog~
Posts: 1,853
exavolt has disabled reputation
Send a message via Yahoo to exavolt exavolt is offline
Quote:
Originally Posted by alijaya View Post
bukan semuanya.
kayaknya sih.
dan aku blom pernah baca artikelnya satu2.
kecuali A* tapi itu juga aku baca tak dimengerti.
jadi asli buatan sendiri.
selama 3 hari kalo gak salah.
tapi konsepnya udah lama sekitar 10 hari kalo gak salah.
bagaimanapun, pasti masuk salah satu algoritma yg disebutkan di atas.


jelasin donk algo-nya. jgn pelit2. nggak deh kalo gw patenin.
__________________
exavoltism on how to be a Game Developer:
1:1 - Know English
1:2 - Know what is Google and Wikipedia and know how to use them
Please respect Netiquette within this forum.
   
 
 
Old 22/02/2008, 17:21 Reply With Quote   #9
alijaya
GDI Power Users
 
alijaya's Avatar
 
Join Date: Dec 2007
Location: Pangkalpinang
Posts: 3,003
alijaya is on a distinguished road
Send a message via Yahoo to alijaya alijaya is online now
pokok ne nih algoritmanya lambet di awal cepet di akhir.
dengan pengindeksan atu2 di awal baru nanti dicari di akhir.
bisa di liat di thread ini:
http://www.gamedevid.org/forum/showt...?t=5796&page=7
__________________
tobat ngejunk. tobat nyepam. tobat bikin yang gak bener. tobat kasih komen gak jelas. tobat buang-buang ikon. tobat jadi orang jelek. tobat maen komputer sambil belajar. tobat banget kalo ngomong gak bertanggung jawab. tobat banget untuk kesalahan laennya.
"siapa yang mau ikut2an tobat??"
blog : http://alijaya.wordpress.com/, http://bothaxe.wordpress.com/
   
 
 
Old 22/02/2008, 17:24 Reply With Quote   #10
alijaya
GDI Power Users
 
alijaya's Avatar
 
Join Date: Dec 2007
Location: Pangkalpinang
Posts: 3,003
alijaya is on a distinguished road
Send a message via Yahoo to alijaya alijaya is online now
berhubungan lagi baek nih, aku kasih code na:
Code:
tile_1= { walkable:true, frame:1}; tile_2= { walkable:false, frame:2}; map1= [ [1,1,1,1,1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,1,1,2,2,1,1,1,1,1,1,2,1,1,1,1,1,1,1], [1,1,1,1,1,1,2,1,1,1,1,1,2,1,1,2,1,1,1,1,2,1,1,1,1], [1,1,1,1,1,1,1,1,1,1,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1], [1,1,1,1,1,1,1,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,1,1], [1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,1,1,1,1,1,1,1,1,1,1] ] map2= [ [1,1,1,1,1,1,1,1,1,1], [1,2,1,1,1,1,2,1,1,1], [2,2,1,1,1,1,2,1,1,1], [1,1,1,1,2,1,2,2,1,1], [1,1,2,1,1,1,1,1,1,1], [1,1,1,1,1,1,1,1,1,1], [1,1,1,1,2,1,1,1,1,1], [1,1,2,1,1,1,2,2,2,1], [1,1,2,2,1,1,1,1,1,1], [1,1,1,1,1,2,1,1,1,1] ] dep=0; game=new Object(); char=new Object(); cursor=new Object(); function buatMap(map){ _root.attachMovie("empty","penampung",100); _root.penampung._x=0; _root.penampung._y=0; var panjang=map[0].length; var lebar=map.length; for(i=0;i<lebar;i++){ for(j=0;j<panjang;j++){ var nama="t_"+i+"_"+j; _root.penampung.attachMovie("tile",nama,dep++); game[nama]={dep:_root.dep , walkable:_root["tile_"+map[i][j]].walkable , frame:_root["tile_"+map[i][j]].frame}; game[nama].clip=_root.penampung[nama]; game[nama].clip.gotoAndStop(game[nama].frame); game[nama].clip._x=j*20; game[nama].clip._y=i*20; } } _root.penampung.attachMovie("char","char",dep++); char.clip=_root.penampung.char; char.X=0; char.Y=0; char.Xtile=Math.floor(char.X/20); char.Ytile=Math.floor(char.Y/20); char.clip._x=char.X; char.clip._y=char.Y; _root.penampung.attachMovie("cursor","cursor",dep+10); cursor.clip=_root.penampung.cursor; cursor.Xtile=0; cursor.Ytile=0; cursor.X=cursor.X*20; cursor.Y=cursor.Y*20; cursor.clip._x=cursor.X; cursor.clip._y=cursor.Y; setIndex(char,map); } buatMap(map1); onMouseMove = function(){ if((_xmouse+_root.penampung._x)<500 && (_xmouse+_root.penampung._x)>0 && (_ymouse+_root.penampung._y)<500 && (_ymouse+_root.penampung._y)>0){ cursor.Xtile=Math.floor((_xmouse+_root.penampung._x)/20); cursor.Ytile=Math.floor((_ymouse+_root.penampung._y)/20); cursor.X=cursor.Xtile*20; cursor.Y=cursor.Ytile*20; cursor.clip._x=cursor.X; cursor.clip._y=cursor.Y; } } onMouseDown = function(){ if((_xmouse+_root.penampung._x)<500 && (_xmouse+_root.penampung._x)>0 && (_ymouse+_root.penampung._y)<500 && (_ymouse+_root.penampung._y)>0){ if(char.index["t_"+cursor.Ytile+"_"+cursor.Xtile].shortPath!=undefined){ makePath(char,cursor.Xtile,cursor.Ytile); goalPoint.text="("+cursor.Ytile+","+cursor.Xtile+")"; shortPath.text=char.index["t_"+cursor.Ytile+"_"+cursor.Xtile].shortPath; maxPossible.text=char.index["t_"+cursor.Ytile+"_"+cursor.Xtile].maxPossible; }else{ goalPoint.text=""; shortPath.text=""; maxPossible.text=""; } } } function setIndex(ob,map){ ob.index=new Object(); var panjang=map[0].length; var lebar=map.length; for(i=0;i<lebar;i++){ for(j=0;j<panjang;j++){ var nama="t_"+i+"_"+j; ob.index[nama]=new Object(); ob.index[nama].shortPath=undefined; ob.index[nama].maxPossible=0; ob.index[nama].source=new Array(); ob.index[nama].destiny=new Array(); } } ob.index["t_"+ob.Ytile+"_"+ob.Xtile].shortPath=0; ob.index["t_"+ob.Ytile+"_"+ob.Xtile].maxPossible=1; var dicari=[]; var mencari=[{Ytile:(ob.Ytile),Xtile:(ob.Xtile)}]; while(mencari.length!=0){ dicari=mencari; mencari=[]; for(n=0;n<dicari.length;n++){ var nama="t_"+(dicari[n].Ytile)+"_"+(dicari[n].Xtile); var nama_atas="t_"+(dicari[n].Ytile-1)+"_"+(dicari[n].Xtile); var nama_bawah="t_"+(dicari[n].Ytile+1)+"_"+(dicari[n].Xtile); var nama_kiri="t_"+(dicari[n].Ytile)+"_"+(dicari[n].Xtile-1); var nama_kanan="t_"+(dicari[n].Ytile)+"_"+(dicari[n].Xtile+1); if(game[nama_atas].walkable==true){ if(ob.index[nama_atas].shortPath==undefined){ ob.index[nama_atas].shortPath=ob.index[nama].shortPath+1; ob.index[nama_atas].maxPossible+=ob.index[nama].maxPossible; ob.index[nama].destiny.push({Ytile:(dicari[n].Ytile-1),Xtile:(dicari[n].Xtile)}); ob.index[nama_atas].source.push({Ytile:(dicari[n].Ytile),Xtile:(dicari[n].Xtile)}); mencari.push({Ytile:(dicari[n].Ytile-1),Xtile:(dicari[n].Xtile)}); } else if(ob.index[nama_atas].shortPath==ob.index[nama].shortPath+1){ ob.index[nama_atas].maxPossible+=ob.index[nama].maxPossible; ob.index[nama].destiny.push({Ytile:(dicari[n].Ytile-1),Xtile:(dicari[n].Xtile)}); ob.index[nama_atas].source.push({Ytile:(dicari[n].Ytile),Xtile:(dicari[n].Xtile)}); } } if(game[nama_bawah].walkable==true){ if(ob.index[nama_bawah].shortPath==undefined){ ob.index[nama_bawah].shortPath=ob.index[nama].shortPath+1; ob.index[nama_bawah].maxPossible+=ob.index[nama].maxPossible; ob.index[nama].destiny.push({Ytile:(dicari[n].Ytile+1),Xtile:(dicari[n].Xtile)}); ob.index[nama_bawah].source.push({Ytile:(dicari[n].Ytile),Xtile:(dicari[n].Xtile)}); mencari.push({Ytile:(dicari[n].Ytile+1),Xtile:(dicari[n].Xtile)}); }else if(ob.index[nama_bawah].shortPath==ob.index[nama].shortPath+1){ ob.index[nama_bawah].maxPossible+=ob.index[nama].maxPossible; ob.index[nama].destiny.push({Ytile:(dicari[n].Ytile+1),Xtile:(dicari[n].Xtile)}); ob.index[nama_bawah].source.push({Ytile:(dicari[n].Ytile),Xtile:(dicari[n].Xtile)}); } } if(game[nama_kiri].walkable==true){ if(ob.index[nama_kiri].shortPath==undefined){ ob.index[nama_kiri].shortPath=ob.index[nama].shortPath+1; ob.index[nama_kiri].maxPossible+=ob.index[nama].maxPossible; ob.index[nama].destiny.push({Ytile:(dicari[n].Ytile),Xtile:(dicari[n].Xtile-1)}); ob.index[nama_kiri].source.push({Ytile:(dicari[n].Ytile),Xtile:(dicari[n].Xtile)}); mencari.push({Ytile:(dicari[n].Ytile),Xtile:(dicari[n].Xtile-1)}); }else if(ob.index[nama_kiri].shortPath==ob.index[nama].shortPath+1){ ob.index[nama_kiri].maxPossible+=ob.index[nama].maxPossible; ob.index[nama].destiny.push({Ytile:(dicari[n].Ytile),Xtile:(dicari[n].Xtile-1)}); ob.index[nama_kiri].source.push({Ytile:(dicari[n].Ytile),Xtile:(dicari[n].Xtile)}); } } if(game[nama_kanan].walkable==true){ if(ob.index[nama_kanan].shortPath==undefined){ ob.index[nama_kanan].shortPath=ob.index[nama].shortPath+1; ob.index[nama_kanan].maxPossible+=ob.index[nama].maxPossible; ob.index[nama].destiny.push({Ytile:(dicari[n].Ytile),Xtile:(dicari[n].Xtile+1)}); ob.index[nama_kanan].source.push({Ytile:(dicari[n].Ytile),Xtile:(dicari[n].Xtile)}); mencari.push({Ytile:(dicari[n].Ytile),Xtile:(dicari[n].Xtile+1)}); }else if(ob.index[nama_kanan].shortPath==ob.index[nama].shortPath+1){ ob.index[nama_kanan].maxPossible+=ob.index[nama].maxPossible; ob.index[nama].destiny.push({Ytile:(dicari[n].Ytile),Xtile:(dicari[n].Xtile+1)}); ob.index[nama_kanan].source.push({Ytile:(dicari[n].Ytile),Xtile:(dicari[n].Xtile)}); } } } } } function makePath(ob,Xgoal,Ygoal){ var nama_goal="t_"+Ygoal+"_"+Xgoal; ob.path=[{Ytile:Ygoal,Xtile:Xgoal}]; while(ob.path.length<ob.index[nama_goal].shortPath){ var nama_akhir="t_"+(ob.path[ob.path.length-1].Ytile)+"_"+(ob.path[ob.path.length-1].Xtile); ob.path.push(ob.index[nama_akhir].source[random(ob.index[nama_akhir].source.length)]); } var pathCad=new Array(); for(n=0;n<ob.path.length;n++){ pathCad[n]=ob.path[ob.path.length-n-1]; } ob.path=pathCad; makeArea(ob); } function makeArea(ob){ _root.penampung.attachMovie("goal","goal",(ob.clip.getDepth()+1)); _root.penampung.goal._x=ob.path[ob.path.length-1].Xtile*20; _root.penampung.goal._y=ob.path[ob.path.length-1].Ytile*20; _root.penampung.attachMovie("empty","path",(ob.clip.getDepth()+2)); var dep=0; for(n=0;n<ob.path.length;n++){ var Ytile=ob.path[n].Ytile; var Xtile=ob.path[n].Xtile; var nama="a_"+Ytile+"_"+Xtile; _root.penampung.path.attachMovie("area",nama,dep++); _root.penampung.path[nama]._y=Ytile*20; _root.penampung.path[nama]._x=Xtile*20; } } function traceArrayObject(array){ var tulisan=new String(); tulisan+="["; for(n=0;n<array.length;n++){ tulisan+="[{Xtile:"+array[n].Xtile+",Ytile:"+array[n].Ytile+"}]"; } tulisan+="]"; trace (tulisan); };





ada beberapa yang gak diperlukan seh.
hanya untuk percobaan.
__________________
tobat ngejunk. tobat nyepam. tobat bikin yang gak bener. tobat kasih komen gak jelas. tobat buang-buang ikon. tobat jadi orang jelek. tobat maen komputer sambil belajar. tobat banget kalo ngomong gak bertanggung jawab. tobat banget untuk kesalahan laennya.
"siapa yang mau ikut2an tobat??"
blog : http://alijaya.wordpress.com/, http://bothaxe.wordpress.com/
   
   Reply « Previous Thread| Next Thread »     


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off


All times are GMT +7. The time now is 18:20.


skin developed by: uray
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.