Academia.eduAcademia.edu

Neural Networks for Real-time Pathfinding in Computer Games

2004, The ITB Journal

One of the greatest challenges in the design of realistic Artificial Intelligence (AI) in computer games is agent movement. Pathfinding strategies are usually employed as the core of any AI movement system. The two main components for basic real-time pathfinding are (i) travelling towards a specified goal and (ii) avoiding dynamic and static obstacles that may litter the path to this goal. The focus of this paper is how machine learning techniques, such as Artificial Neural Networks and Genetic Algorithms, can be used to enhance an AI agent’s ability to handle pathfinding in real-time by giving them an awareness of the virtual world around them through sensors. Thus the agents should be able to react in real-time to any dynamic changes that may occur in the game.

The ITB Journal Volume 5 Issue 1 Article 21 2004 Neural Networks for Real-time Pathfinding in Computer Games Ross Graham School oflnformatics and Engineering, Institute of Technology at Blanchardstown, Dublin l5., [email protected] Hugh McCabe School oflnformatics and Engineering, Institute of Technology at Blanchardstown, Dublin l5. Stephen Sheridan School oflnformatics and Engineering, Institute of Technology at Blanchardstown, Dublin l5. Follow this and additional works at: https://arrow.tudublin.ie/itbj Part of the Software Engineering Commons Recommended Citation Graham, Ross; McCabe, Hugh; and Sheridan, Stephen (2004) "Neural Networks for Real-time Pathfinding in Computer Games," The ITB Journal: Vol. 5: Iss. 1, Article 21. doi:10.21427/D71Q95 Available at: https://arrow.tudublin.ie/itbj/vol5/iss1/21 This Article is brought to you for free and open access by the Ceased publication at ARROW@TU Dublin. It has been accepted for inclusion in The ITB Journal by an authorized administrator of ARROW@TU Dublin. For more information, please contact [email protected], [email protected]. This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 4.0 License D % AB % , 0 , %E F AB* $ 2A F'AB&B3 F" #&F B $F BE F7F% -& CD E CBA B B B B D D D , BDCED C F0 5 . . 5A$ F%& A B E B F CD FCBE C A D CYD B D D 3 A E E E BB E D A B E 'E B F E BB 8'F9 E !A ! E ( E D E E BB ! BA D E A A E ! E A ! A! A E A B"E ! E D 89 E D A B D8 9 AD D ! D E E A E B E E ! B EE E E A A E A ! B E , % 'E B ? E 'B A E ! % D EA 'F E; B E EA DB E E ! A E E B A BD A D E ! E A A A BD B EA E B"E ! EA D ! E E! A E 7 03 # E A& D E - CF 3 D BD BD . BE D A BC * K B DE F B D E CFF B E B BCD C C AAF A E C B BD B B D B A BC CE D CD C C D DD C D D A EE B C CD D D CD C B D D C CF&D FF F B D E D D * ECB F C B D #FD D B CB A B CB D B D CF&D #C E CF&D CD D CF D CD :+ BA C < BA D CD FF D B A E CD CD BA B FA D C D CD BA B C E # DCEF -. D CD D CF CA B B C F DD ED D E DB BA B BA B CBA CF&D # E B A D # FA E D DCD E CBA A BC #C E D CD C C F D B F D BE E CD C D C B B CF&D * A BDCD B B BD CF B D C E C D E CF BD FF E C + BA CFF BD ECB E CB B D CFF CD C #C E F B B CF D E A B C D A BC B A B B B B C DCD E CF CBA - . C CF B E # EC F CF&D ED B C A BA A B C A! E ! 'F !A ! E BB EA D EA E A B B E A+ D D B"E ! E E ! BA B BD AAF B D CD BE D 9CD E FD CBA 4C * :4C *< F D CD D E CFF B C B / #F B D F C B CF DC* B D A D BA B CBA D B CBA E B FD ##F 5 CA D BCFF D BE D CF D CF ? E # CB D C FA D CD D C FA D C D D ECD B A D A B BD D BCF ?FDC F D DE DE* CD E D C D Y AB CDE F * C C BEF A B D * D CD CFF B C DCD E ECF A A B C D CF&D D 4 E D CD C A B BD DD C BA B E D B F DDF EC B BDCD B B E CB D C BD F B B B C F D A C BF A # B # FD B AAF C B E B B :4C *< $ AAF D D # BD C CD A BD C C D D D D C D C A F !D FF" D * DD B Y E A D C CF&D A BC CD F A BA B D D ECB BA E E B CD BD D E CD B EDB C E E A BC D # E BA D CD C FF C F D BDCD B CBAF D D # B D D CF B C CAA B C D D A A # D CA D BCF C E #) ED D CD ECB # CAA A D B &D B A D #F C D CD D D A B BD BA B D CD F BD D C CFF D CB C BD D C C B FA D ? B E CFF D D * C #' A B DE B D CF CF B D D CD C D C B A 3 BE BD A :, C E B A C#F C CF 3 D CB A C D :=C DD B"< B CD B E FD D F B D C BD C E CD A D CBAC A !"< C DCD BCFF E B F C * CBA D AC #F E D BD CF CD B C CED CEE A B F D E B B B CF& D E CF B CF F D BD D D CF B D #F D C FCE # E CB B D C D CD C E DC B * :=C DI D B DDB"< D B D BD C CB D B CF CBE CE C CF D C D * BD B D CD B D CD D C B C D E FC F CF B D CF 3 D F D BD D D E B FF C C B CD D CD C# CF&D AB CDE F D D FA BA B D D CD #F D E F D F D B B D E D D CF FA B B D BD D D ==33 B D CBA D B D D ACDC A E E FF D C B D F C CF&D E DCB A D C BD B C A BC C CD B 5D ==33Y D AD A D ECB ACDC D D #CE* C D E FC F C ==33 E FA # E D A D B CDDCE A D CB ==33 D FF # * # DD * -==33. A D # F CB AD B D :, C C D A D CD ECB #DC B B B * -33. C D C# F D D CA 3 B D CBA D C B D D CF& DE DE* ECF B B D FA # E BD E A D # F C D E C D CD CD B& BD D BD A D D CD A B D B D D CA D BCF B D CB B D B D DC CD B D # E E B = A = B F B D A CBAC A !"< D A BC D D * BA C DCB FA C CE B * @ C B B DC* FA D CD ?FDC C D D # 5 B E E C C FC#F D D E B? * D D A E CF B D B C C F D " E C CED C F FF C FF *B B C D E CF B BA B F B DD B C CD C A BC BA B CF C BD A E B D B BD CD C BD D B B B BA B C* B D D F BC BB B D D C# D D ED C E ED A BD F C B B B D E CF !D FF D D -K . : E*FCBA ! < D E ED CE CD A E C BD D D D CB* B C BD A# BD D CB F # , 3/ /DE* CF D BCD D 6 D* DC D D CE A CF FB A A # D ED D B A ED B A C BD CF B D D D D BCFF F C B # D BD E C D E CF CD D D FA D CD D D BA B C C FC CBA CB D # D C BD C D A D B D E CF D B C B B ;; D BA CB D ED E B E CD C B D E CF D A BD D CF&D FF # D A F BD ? CBB A D D F CB D -. # DCEF 33 ECB F C B D E D CD D D F DD DC * CA B D CD C CD F CBA D B #B A B D D# A D BA B CF CBA D B D - . BC D BD CF F A # C BD D / #C E DD D CA B CFF D B D D # * D # BD B C BA D CD ## DC C D D D F " E A # B CB C C BA 'F * C D AC A CF B D CA B D CE C B B CB* A CEE A B D D D CF 1D*A BE A B FF C BD C DD B C Y C C BD BD CB* B C BD CBCF F A CAB D BD C BD ECB BF D C # BAC D AB D A C D AB CDE F C C DA BA D CBA C F " / B B E B BD - A ? C E B E FF D D A D A A D CD D C 'D D D B E FF . B E BD F ECD B D " A FF D A !D FF8 B D D D D C BD A D D DD D C BD CB BDF EE D D # A CF ECB # #C E A B CF&D 33 C CD K B DE F D CB D A CF&D F D B BD CBA E CB B A 5#) ED ECB CF D CF B BA B D -K . D E B D C* B B D E CF D CF BD F C B B A F D D D F # A AB D A E D D D CC D E DC D D BD D F C B D C A B BD A # CAA A D D AD A ECD B D D F D B B CF&D D AD D ED CFF D C BD D D D D D# A FF # D CB C BD D D CD B BD E D B BD FF # E BA ED A D BE C B A E FDF D CD BD D CD B K A BAC + CF&D , BD F K , BD F 5 1D*A AB CDE F 33 B FF D '# !D FF+ C BD D 1D*A '' ' # - * ;E DC E A -C. C 9 ACD k9 FCD D B D 3 B CF 3 D * B CD B ! E J&D9 ACD 33 D CD E B ' ' ' ' ' D BCF C D CE F ED A 4 AA B @C C D 33 D 3 CA C CF BA CB # DCEF C C 33 D CD DC* D D B B= ( :4 D C D 33 CA D B F C 5 D D -". >! #7, /)= C D D A B C D C# F D D F BDF FF A E A # DCEF D - . ( D $ ! D B D 3 B DD D E&D9 ACD D AC D ! E C D B C ( D $ ! D D B D CD D D D E BC D D CE FCD #F A C D D B D ECB D C C* D D D B D B -% E. ',9 # #+# (, 0 $$ 0 #9# $ ' , + 0 K B CD B #,(9 (+$ 09# 0$4 ## + 9 FCD B % N '9 '9 '9 '9 '9 F B '# C#F F D CD ; D C CD D F B D CED CBA D F D BD D AA B FC BB B D D FD D AB CDE F E B # C F A# FCD B D B D # B CD B D D * ? DD B D CE A D A C C D BD B D AA B FC D # C CD E B ACD D B B B CED FD CD B !D FF; D F D A B DC#F ; B F A ? E* D D D % BE D CF B D D C CD B CBA K 33 C :=C CF E B EF C CBA DD B"< C CD B CBA K # D K A D B B D AA B FC B C C F D B #) ED 9 ACD 19 * D D DC * CA D # B B D CD A D CD D ? F D D C CF&D #F D D C B D F CB A E CD B F 33 CA B D BD C ? E*F A EDC#F #F F C B B D CD B #CE* D #CE* F D B CA B D F A ED B C BA B ''- * F DC E = A -#. C 9 ACD k9 B D D D D E BC 33 D D + FCD CFF # DCEF D B CBA D C E BD BD B B D BA B E FF 3 B D -E. ( D $ ! ! E ( D $ ! ! E 2 . $ 2 2 / 2 ( B D DC C CBA D D D D CE D A CD D * B CD B 5 D D -". >! #7, E&D9 J&D9 /)= ( :4 D D ACD D BA B D CD BA ECD A CF 3 D B ECB C A # DCEF D CD F DD D CD # D B D ACD 33 C B B D C D B D C# BD * D F D ACD C B B B B D E FF B CE D #F A ED B D BD F ECD B D C # D ED A DC * C F C B A ? E*F D N D ACD # DCEF AAB D C B FC B D B C CD B CBA K D CB D D B E FF C CA CB #CE* 1B #F D CD ECB E FF D 9 ACD CD B D C A FC E CD D #F # DCEF D D E* # DCEF D D CB B E FF B CE A D D E FF B BA ECD A D CD D C D E FA BF ACD B FA B A F B & ED B ',- * F DC = A ED BCF E A -E. B B C 9 ACD 19 D D D 33 D CD ECB F * C CA AB CDE F D E BC D FCD D FC D B # DCEF D C CBA D CB B E FF !D FF3 B B D D 3 B D -E. ! E ! E >! #7, /)= ( :4 ( D $ ! ( D $ ! ' ' ' ' 9 ACD CE B CF B D * E 33 E FA * DD E E* CD B 5 D D -". >! #7, /)= ( :4 D CE B A D # DC * E #B A A E A 5B C D CD B B A * B E&D9 J&D9 E FA B D F C B D D CF 3 D CE CF B D ED B D D C F D D CB CF B D *# B CA FD D FA # D AD F CF CBA D B B D D C D # A #F BD CB D C 33 D CD # DCEF '+- * 1 A DC CE A E A ED B C 9 ACD # DCEF C D ACBE C 3 B ' ' ' C D E FA F C B D D D B CF C C D D 6 " = D * FF B F 5 B #F CF D E * B BD BD B CD B D C A EA AD CFF # DCEF B D D ACD F CB AD ? D BD B D D BA B D CD BD CBA C# F D D CE E C D B F B & CB CF&D CD CF B D FC BA B DCBB E A CE CBA # BE R CBA / )* D C :K C C !"< CBAF A BC E B B BD 33 B CBA CFF C CD F D D CD D ECB * :$C D A EB D BD >/ C D FD D + B FA # DCEF BD BD D B BD D CBA D D CD FC C C # AB E B BF #C E D CD B D D BD AB CDE F BA B D C#D BD C C B D D CA D BCF CD A CBA C 33 ECB F C B D # D CB AD A # D #F CD 9 ACD , 1A A -E. D -". >! #7, /)= ( :4 BA FC D B D CD D CB B E FF C CA B 5 D 33 D CF 3 D CF&D C BC#F C F # C* B B= :+ B FA BB< B D D D C CD D D D CD ECB F * D -". >! #7, /)= ( :4 ' % BE D B B>< D CD CE FF D C*D D D >/ !D FFA FF FD CAD FA D B D# E E B B D C E CFF B D 33 D C BD D C / FCB D D CD C CD & FCBB B E CBAF C D B BD D CD ECB C D E B DCB B B D A D D B D C BD D C BD # FF CE D F * F B DA BD CF D D -. F B C DCD E C # # A BF * ,# E& A D E D CB BDCD B #F D C ? E A B BD % BE C B B CF B A BC #FD FF # * D CD D BACD B CF&D E D C B BD B 5 D CD #F BD FF B * -33. ECB F C B D BA B C CD F C 33 D F C B D BA B D FF DC* B D CD FC F ECD B 9 C C BA B AAF BD C E D CD D CB E D A E B BD 33 BD FA CF B D CBB B BD B B B FA CFF B D CE C E A BC D E D CD B D CD D A A B D BE BD E CD B C CD CF B D B D CF B D CF&D BA B C A B CF D E BA F D D BCB D DCBB # C#F D D D CA D BCF CD FA CBA - . C C #C E F BB D E CD A D CF B &D B A B AAF C D FA CE - 9 . #C A CF&D B D E CD B CD B A EDC#F CBA E CFF B B C E& T A&" E 9'U E*FCBA $CD 6 E B? KC 9 C B 7 9 9 !! T C E 9+U , C CBAC A F 6 KC / F BD7 3 + A 9 #F B !!" T1 A $+U =C DD @C B 6= BAC BDCF 3 CF 3 D * E D ED F D CBA F ECD B 7 9 BD E &4CFF BE ;BB" T. C9+U K C C + 69CD BA B B , D KC 7 B E AB BCF 3 # C !!" 9C DE&C! T) / "U C *E T $,U $C D D 69 CED ECF 3 CF 3 D * + E B ,887 D B0 ECA E 9 ;BB> T5 E U BA C E T5 E $$U + B FA , ' 6 %D B C = D B , C CED 7 B E AB KC / F , B BE ;BBB FA B %CB ,CF B C $ FF = CB KC K %CB = CBE E ,CF B C 9C FE>&FC T5A /D*$0U + F %D C D 3 9 D _ D E CF BD FF BE $ A B CE _ 9 BD E &4CFF BE ;BBD AB CDE F !D F"