Unity 3d oyun ortamında akıllı ajanlar ile kaçma-kovalama oyun tasarımı
Design of a pursuit-evasion game with intelligent agents in the unity 3d game-environment
- Tez No: 633598
- Danışmanlar: DOÇ. DR. TUFAN KUMBASAR
- Tez Türü: Yüksek Lisans
- Konular: Mekatronik Mühendisliği, Mechatronics Engineering
- Anahtar Kelimeler: Belirtilmemiş.
- Yıl: 2020
- Dil: Türkçe
- Üniversite: İstanbul Teknik Üniversitesi
- Enstitü: Fen Bilimleri Enstitüsü
- Ana Bilim Dalı: Mekatronik Mühendisliği Ana Bilim Dalı
- Bilim Dalı: Belirtilmemiş.
- Sayfa Sayısı: 85
Özet
Kaçma-kovalama oyunları, engelden kaçma, kaçan ajan takibi ve yol takibi gibi diğer birçok problemi kapsayan bir problem olarak görüldüğü için çeşitli çalışmalarda tercih edilmektedir. Kaçma-kovalama oyunlarında temel amaç bir veya birden fazla sayıdaki kovalayan ajanın bir veya birden fazla sayıdaki kaçan ajanı en kısa sürede yakalamasıdır. Araştırmacılar, kaçma-kovalama oyunlarını genellikle karmaşık ve dinamik ortamlarda kaçan ajanı yakalamak için ortaya çıkan yol bulma probleminde kullanmaktadır. Kaçma-kovalama oyunundaki bu tür problemi çözmek için çeşitli yöntemler önermişlerdir; bu yöntemler arasında dinamik programlama, oyun teorisi, bulanık mantık ve yapay sinir ağları sayılabilir. Bu tez çalışmasında, Unity 3D oyun motorunda kaçma-kovalama oyunu tasarlanmıştır. Bu oyun motorunun tercih edilme sebebi ise kolay kullanımı ve fizik motoruna sahip olmasıdır. Kaçma-kovalama oyunu için oyun motorunda kontrol araç kutusu ve navigasyon araç kutusu kullanıldı. Kontrol araç kutusunda navigasyon ağ ajan elemanı, dönüşüm elemanı, sert gövde elemanı, çarpışma elemanı ve kod elemanı oyun tasarımı için tercih edildi. Navigasyon ağ ajan elemanı, ajanlara oyun alanı içerisinde otonom hareket etmesi, engellerden kaçınması ve hedef takip etmesi için çizgisel ve açısal hız sağlamaktadır. Sert gövde elemanı fizik motorunu kullanmaktadır. Bu eleman ile oyun alanına yer çekimi ve ajanlara kütle eklenmektedir. Ayrıca sert gövde elemanı ajanlara kuvvet ve tork uygulayarak hareket ettirmektedir. Çarpışma elemanı da fizik motorunu kullanmaktadır. Bu eleman ile ajanlar ve oyun alanı fiziksel çarpışma özelliği kazanmaktadır. Kontrol araç kutusunda kullandığımız son eleman olan kod elemanı ile ajanların hareketleri kontrol edilip, yapay zekâ sistemi oluşturulmakta ve ajanlar arasında haberleşme sağlanmaktadır. Navigasyon araç kutusu ile oyun alanında navigasyon ağları oluşturuldu. Bu ağlar ile ajanlar oyun alanında otonom hareket edebilmekte, engellerden kaçabilmektedir. Navigasyon ağları yapısında A* algoritması bulunmaktadır. Bu algoritma sayesinde ajanlar hedef takibi için en kısa yolu hesaplayabilmektedir. Bu tez kapsamında, Unity 3D oyun motorunda kullanılan araç kutularının özellikleri ve oyun objeleri ile kaçma-kovalama oyun tasarımı yapıldı. Öncelikle oyun alanı için zemin, duvar ve engeller tasarlandı. Oyunun amacı doğrultusunda kaçan ajan tarafından toplanması gereken kâğıtlar oyun alanına eklendi. Daha sonrasında oyuna bir adet kaçan ajan ve dört adet kovalayan ajan yerleştirildi. Kırmızı, mavi, turuncu ve pembe ajanlar kovalayan ajanlar, sarı ajan ise kaçan ajandır. Kaçan ajan insan kullanıcı tarafından kontrol edilirken, kovalayan ajanlar geliştirilen stratejiye göre kaçan ajanı yakalamaya çalışır. Kovalayan ajanların oyunda devriye hareketi için dinamik yol nokta yapısı oluşturuldu. Dinamik yol nokta yapısı ile kovalayan ajanlar oyun alanın tüm bölgelerine gitme olasılığı kazanmıştır. Ayrıca kovalayan ajanlara oyun içerisinde görüş menzili oluşturmak için görüş hattı yapısı eklendi. Bu sayede kovalayan ajanların görüş hattı içerisinde kaçan ajan bulunduğunda yakalamaya çalışır. Kaçan ajan görüş hattında olmadığı durumda kovalayan ajanlar oyun içerisinde devriye olarak hareket edecektir. Tasarlanan dinamik yol nokta yapısı ve görüş hattı yapısı tüm kovalayan ajanlarda bulunmaktadır. Kaçma-kovalama oyun modelinde kovalayan ajanların çizgisel hızı kaçan ajandan büyük ve kovalayan ajanların yön açısı kaçan ajanın yön açısından küçük olacak şekilde oluşturuldu. Ayrıca tasarlanan modelde yakalanma tanımı kaçan ajan ile kovalayan ajanların yüzey teması olarak belirlendi. Bu modelde kaçan ajan ile kovalayan ajan arasındaki Öklid mesafesini hata sinyali olarak düşünülebilir. Bu hata sinyalini minimize etmek ve kaçan ajanı yakalamak için kovalayan ajanlara çeşitli kontrolör tasarımı yapıldı. Bu kontrolörler ile kovalayan ajanların çizgisel hızları kontrol edildi. Kovalama sırasında kovalayan ajanlara yön açıları ise oyun motorunda gerekli hesaplama yapılarak sağlandı. Kırmızı ajanda Öklid mesafesini azaltması için PD kontrolör tasarımı yapıldı. Böylece kaçan ajan kırmızı ajanın görüş hattına girdiğinde, kırmızı ajan kaçan ajanı aralarındaki mesafe değişimine göre çizgisel hızını kontrol edecektir. Ayrıca oyunda kâğıt sayısı azaldıkça kırmızı ajanın çizgisel hızı artmaktadır. Kırmızı ajan görüş hattında kaçan ajan olmadığında oyun alanında devriye olarak gezinmektedir. Mavi ve turuncu ajan Öklid mesafesini azaltmak için P kontrolör tasarımı yapıldı. Böylece kaçan ajanı mavi ve turuncu ajan sabit hızla kovalamaya çalışacaktır. Ayrıca bu iki ajana, kırmızı ajan ile haberleşme özelliği sağlanmıştır. Bu sayede mavi ve turuncu ajan oyun içerisinde kırmızı ajanın konumu hakkında bilgi sahibi olmaktadır. Kaçan ajan ile kırmızı ajan arasındaki Öklid mesafesi azaldığında mavi ajan sol taraftan, turuncu sağ taraftan yakalamaya çalışacaktır. Oyunda kâğıt sayısı azaldıkça mavi ajanın açısal hızı ve turuncu ajanın görüş hattı açısında artış meydana gelmektedir. Mavi ve turuncu ajan da görüş hattında kaçan ajan olmadığı durumlarda oyun alanında devreyi gezmektedir. Pembe ajana strateji geliştirmek için bulanık mantık kullanılmıştır. Bulanık mantık tercih edilme sebebi bulanık mantık tabanlı sistemlerin doğrusal olmayan etkenler ve bilinmeyen sistem dinamikleri karışışında başarılı bir şekilde cevap vermesidir. Bu bağlamda, pembe ajana yakalama stratejileri tanımlamak için“Takagi-Sugeno-Kang”tipi iki adet bulanık sistem tasarlanmıştır. Bu sistemler pembe ajanın görüş hattında kullanılmıştır. Bulanık sistemler iki giriş, bir çıkışa sahiptir. Sistemin girişleri ise kaçan ajan ile pembe ajan arasındaki mesafe ve bu mesafenin birim zamandaki değişimidir. Birinci bulanık sistem fizik motorunun pembe ajana uygulaması gereken kuvvet değerini hesaplamaktadır. Bu kuvvet ile pembe ajanın kaçan ajanı yakalaması gereken çizgisel hız oluşur. Böylelikle pembe ajan, kaçan ajanla arasındaki değişim gösteren mesafeye göre çizgisel hızını ayarlamaktadır. Tasarlanan ikinci bulanık sistem ise pembe ajanın kaçan ajanı yakalaması için gitmesi gereken konumu hesaplamaktadır. Böylece iki adet bulanık sistem ile akıllı bir kovalama stratejisi geliştirildi. Kovalayan ajanlar için tasarlanan kontrolör yapılarını karşılaştırmak için Unity 3D oyun ortamında çalışmalar yapılmıştır. Tüm kovalayan ajanlar oyun alanında devriye gezerken sabit hızlarla hareket etmektedir. Kovalayan ajanların görüş hattına kaçan ajan girdiğinde ise yakalamak için yapılarında bulunan kontrolör devreye girecektir. Kırmızı ajan yapısında bulundurduğu PD kontrolör ile kaçan ajanı görüş hattı içerisinde yakalamaya çalışacaktır. Değişim gösteren mesafeye göre kırmızı ajan çizgisel hızını ayarlamaktadır. Ancak kırmızı ajan kaçan ajanla yüzey teması sağlayamadığı için kaçan ajanı yakalayamamıştır. Mavi ve turuncu ajan ise P kontrolör ile kaçan ajanı değişim gösteren mesafede sabit hızla kovalamıştır. Bu iki ajanda kırmızı ajan gibi kaçan ajanla yüzey teması sağlayamadığı için kaçan ajanı yakalayamamıştır. Pembe ajan için tasarladığımız bulanık sistemler ile kaçan ajanı yakalaması için gerekli olan çizgisel hız ve gitmesi gereken konum bilgisi hesaplanmıştır. Pembe ajan tasarladığımız iki adet bulanık sistem sayesinde kaçan ajan ile yüzey teması sağlayıp yakalamış oldu. Böylece tasarladığımız bulanık sistemler ile tatmin edici kovalama performansı sağlanmış ve akıllı kovalama stratejisinin diğerlerine göre üstün olduğu görülmüştür. Ayrıca kaçan ajan tarafından toplanan kâğıtların kırmızı ajanın çizgisel hızına, mavi ajanın açısal hızına ve turuncu ajanın görüş hattı açısına olan etkisi gösterilmiştir.
Özet (Çeviri)
Pursuit-evasion games are favored in a variety of studies as they are seen as a problem covering many other problems such as obstacle evading, evader agent tracking, and road tracks. In pursuit-evasion games, the main goal is for one or more pursuer agents to capture one or more evader agents as soon as possible. Researchers often work pursuit-evasion games in the resulting path-finding problem to capture the evader agent in complex and dynamic environments. They have proposed several methods to solve this type of problem in pursuit-evasion gameplay; these methods include dynamic programming, game theory, fuzzy logic, and artificial neural networks. In this thesis work, a pursuit-evasion game has been designed in the Unity 3D game engine. The reason for choosing this game engine is that it is easy to use and has a physics engine. The control toolbox and navigation toolbox have been used in the game engine for the pursuit-evasion game. Navmesh agent component, transform component, rigid body component, collider component, and script component in the control toolbox have preferred for game design. Navmesh agent component allows to linear and angular speed for pursuer agents to move autonomously within the game environment, avoid obstacles, and follow targets. Rigid body component uses the physics engine. In this way, this component adds gravity to the playing field and mass to the agents. Also, the rigid body component moves the agents by applying force and torque. The collider component also uses the physics engine. With this component, agents and playground gain physical collision features. The script component, which is the last element we use in the control toolbox, controls the movements of the agents, creates an artificial intelligence system, and provides communication between the agents. Navigation meshes are created in the game environment with the navigation toolbox. With these meshes, agents can move autonomously and avoid obstacles in the playground. There is an A * algorithm in the navigation networks mesh. Thanks to this algorithm, agents calculate the shortest path for target tracking. The pursuit-evasion game design has made with the toolboxes features and game objects in the Unity 3D game engine. The floor, walls, and barriers were designed primarily for the playground. Ground, walls, and obstacles have been designed with cube game objects for the game-environment. For the aim of the game, the papers to be collected by the evader agent added to the game area. Then, one evader agent and four pursuer agents are placed in the game. Red, blue, orange, and pink agents are the pursuer agents, and the yellow agent is the evader agent. While the evader agent is controlled by the human user, the pursuer agents try to catch the evader agent according to the developed strategy. A dynamic waypoint structure has been created for the patrolling movement of the pursuer agents in the game-environment. With the dynamic path point structure, pursuer agents have gained the possibility of going to the entire section of the playing field. Also, the line of sight structure has been added to pursuer agents to create a viewing range within the game. In this way, pursuer agents try to catch the evader agent in the line of sight. When the evader agent is not in the line of sight, the pursuer agents move patrol mode within the game. The designed dynamic waypoint structure and line of sight structure are in found all pursuer agents. In the pursuit-evasion game, the game model is designed so that the linear speed of the pursuer agents is greater than the evader agent, and the direction angle of the pursuer agents is smaller than the direction of the evader agent. Also in the designed model, the definition of capture has been determined to be surface contact of pursuer agents with the evader agent. In this model, the Euclidean distance between the evader agent and the pursuer agent can be considered an error signal. In order to minimize the signal of this error, various controller designs have made for the pursuer agents. Linear speeds of the pursuer agents are controlled with these controllers. During the chase, the direction angles of the pursuer agents are provided by making the necessary calculation in the game engine. The PD controller is designed to reduce the Euclidean distance of the red agent. Thus, when the evader agent enters the line of sight of the red agent, the red agent controls its linear velocity according to the distance change between them. Also, as the number of papers decreases in the game, the linear speed of the red agent increases. The red agent navigates as a patrol in the playground when there is no evader agent in the line of sight. P controller has been designed to reduce Euclidean distance in the blue and orange agents. Thus, blue and orange agents try to chase the evader agent at a constant speed. Also, these two agents have been provided with the communication feature with the red agent. In this way, blue and orange agents have information about the location of the red agent in the game-field. When the Euclidean distance between the evader agent and the red agent decreases, the blue agent tries to catch it from the left side and the orange tries to catch it from the right side. As the number of papers decreases in the game, the angular speed of the blue agent and the angle of view of the orange agent increase. Blue and orange agents move autonomously in the playing field when there is no evader agent in their line of sight. Fuzzy logic has been used to develop a strategy for the pink agent. Fuzzy logic is preferred since fuzzy logic-based systems successfully respond in the confusion of nonlinear factors and unknown system dynamics. For this reason, two fuzzy systems have designed with the“Takagi-Sugeno-Kang”fuzzy model for a pink agent. These systems were used in the pink agent's line of sight. Fuzzy Systems have two inputs and one output. The inputs of the system are the distance between the evader agent and pink agent, and the change of that distance in unit time. The distance, which is the first input, has three membership functions. These are“Close”,“Middle”, and“Far”membership functions according to the distance of the pink agent with the evader agent. The membership functions of the second input are called“Positive”,“Zero”and“Negative”according to the change of distance in unit time. Nine rules have been constructed in fuzzy systems with two inputs that are defined with three antecedent membership functions. The first fuzzy system calculates the force value required to apply the physics engine to the pink agent. With this force, the linear velocity occurs, which pink agent must catch the evader agent. Thus, the pink agent adjusts the linear velocity according to the distance that changes between the evader agent. The second fuzzy system is designed to calculate the position where the pink agent must go to catch the evader agent, thus developing an intelligent chase strategy with two fuzzy systems. In order to compare controller structures designed for pursuit agents, simulation studies have been conducted in the Unity 3D game-environment. All pursuit agents are moving at constant speeds while patrolling the playground. When the evader agent enters the line of sight of the pursuit agents, the controller in their structure will be activated to capture it. The red agent tries to capture the evader agent within the line of sight with the PD controller. According to the changing distance, the red agent adjusts its linear velocity. Since there was no surface contact with the evader agent, the red agent has not been caught the evader agent. Blue and orange agents chase the evader agent with the P controller at a constant speed at a changing distance. These two agents were unable to catch the evader agent because they could not make surface contact with it, such as the red agent. With the fuzzy systems we designed, the pink agent provided the necessary linear speed and location information to catch the evader agent. Thanks to the two fuzzy systems we have designed, the pink agent has caught the surface contact with the evader agent. Thus, we have designed two fuzzy systems that provide satisfactory pursuit performance and intelligent pursuit strategy is seen to be superior to others. Furthermore, the effect of the papers collected by the evader agent on the linear velocity of the red agent, the angular velocity of the blue agent, and the angle of the orange agent's line of sight structure are shown.
Benzer Tezler
- Designing and testing a virtual reality online shopping application
Sanal gerçeklik ortamında bir e-alışveriş uygulamasının tasarlanması ve test edilmesi
EKİN KILIÇ
Yüksek Lisans
İngilizce
2021
Bilim ve Teknolojiİstanbul Teknik ÜniversitesiBilişim Ana Bilim Dalı
PROF. DR. LEMAN FİGEN GÜL
- Ambulanslar için sanal gerçeklik uygulaması ile risk farkındalığı eğitimi
Risk awareness training with virtual reality application for ambulances
ESRA AKTAŞ
Yüksek Lisans
Türkçe
2021
Endüstri ve Endüstri MühendisliğiOndokuz Mayıs ÜniversitesiAkıllı Sistemler Mühendisliği Ana Bilim Dalı
PROF. DR. SERMİN ELEVLİ
- Artırılmış gerçeklik ile vücut sistemleri üzerinde öğrenmeyi sağlayan bir yazılımın gerçekleştirilmesi
Implementation of a software enabling learning on body systems through augmented reality
YUSUF SEZİKLİ
Yüksek Lisans
Türkçe
2023
Bilim ve Teknolojiİstanbul Gelişim ÜniversitesiMekatronik Mühendisliği Ana Bilim Dalı
DR. ÖĞR. ÜYESİ SERKAN GÖNEN
- Ciddi oyunların ilkokul 4.sınıf öğrencilerinin Fen Bilimleri dersi akademik başarılarına, derse yönelik motivasyonlarına ve problem çözme becerilerine etkisi
The impact of serious games on science course academic achievement, motivation and problem-solving skills of primary school 4th grade students
FATİH ÖZER
Yüksek Lisans
Türkçe
2017
Eğitim ve ÖğretimAnadolu Üniversitesiİlköğretim Ana Bilim Dalı
YRD. DOÇ. DR. E. AYSIN KÜCÜKYILMAZ
- Unity oyun motoru ile simülatör tasarımı
Simulator design with Unity game engine
CİHAD DOĞAN
Yüksek Lisans
Türkçe
2019
Bilgisayar Mühendisliği Bilimleri-Bilgisayar ve Kontrolİstanbul Teknik ÜniversitesiKontrol ve Otomasyon Mühendisliği Ana Bilim Dalı
PROF. DR. AFİFE LEYLA GÖREN