research

Maailman generointi ja elämän simulointi Unity Enginellä

Abstract

Työn tavoitteena oli tutkia ja toteuttaa maailman simulointia Unity-pelimoottorilla niin maaston kuin elämän osalta. Tämä sisälsi maastogeneraatiota noise-funktioiden avulla, maaston dynaamista teksturointia sekä eläinten simulointia laumoina sekä luonnon kiertokulun jäseninä. Tuotteeksi tehtävä työkalu on suunnattu pelinkehittäjille ja sillä voi generoida ja teksturoida maastoa nopeasti moniin eri käyttötarkoituksiin. Toteutuksessa tutkittiin eri tapoja esittää suuri maailma samalla suorituskykyä tarkkaillen. Ensimmäinen versio, planeettamainen pyöreä muoto, osoittautui liian raskaaksi tavalliselle kotitietokoneelle. Tämän optimointi vaati monimutkaisia ratkaisuja ja vaikka suorituskyky parantuikin, se todettiin silti liian heikoksi. Uudeksi esitystavaksi valittiin perinteisempi karttamainen muoto, taso. Maastonmuotojen luominen ei tuottanut suuria ongelmia. Myös maailmat pysyivät suurina (n. 50km2) ilman suorituskykyongelmia. Maaston teksturointiin toteutettiin oma työkalu, joka ottaa huomioon niin maastonkorkeudet kuin sen kaltevuudet. Tämä kehittyi monipuoliseksi ja helppokäyttöiseksi, ja se sisällytettiin maailmanmuodostukseen. Elämän simulointi oli projektin monimutkaisin vaihe, ja sitä pitikin yksinkertaistaa huomattavasti, jotta projekti valmistuisi suunnitellun ajan sisällä. Eläimen luonti sekä tämän laumakäyttäytyminen ja saalistaminen saatiin toteutetuksi, mutta monimutkaisemmat ominaisuudet karsiut uivat pois. Maastogeneraatiosta sekä teksturointityökalusta tuli oma kokonaisuutensa, joka lopulta julkaistiin yleiseen käyttöön Unityn verkkokaupassa. Elämän simulointiosuus jäi vaiheeseen jossa se toimi, mutta ei ollut tarpeeksi hyödyllinen tai monipuolinen julkaistavaksi.Opinnäytetyö toteutui odotusten mukaisesti. Joistakin ominaisuuksista täytyi kehityksen aikana luopua, mutta tämä olikin odotettavissa. Verkkokauppaan julkaistua työkalua on ladattu jo yli 1000 kertaa, ja arvostelut ovat olleet positiivisia.The aim of this project was to study and implement a world simulation with the Unity game engine, including the terrain and the animal life on it. This involved terrain generation with noise functions, dynamic texturing of the terrain, and the simulation of animals as packs and as a part of the biological cycle. Different ways of representing a large world with performance in mind were studied. The first version, a planetary shape, proved to be too much for a regular home computer to handle. Complex optimizing was performed; however, it did not help enough. The new representation was a more basic one, a plane. Shaping the terrain was relatively simple and the performance was not an issue even in large (50km2) scales. For the texturing a tool was made to take into account the heights and angles of the terrain. It became easy to use and still versatile, and it was included in the world generation. Life simulation was the most complex part of the project. It needed to be simplified considerably for the project to finish on time. The creation of an animal, its pack behaviorand hunting and survival elements were carried out, the rest; however, was left out. The terrain generation and texturing were compiled in a single package and released for public use in the Unity Asset Store. Life simulation was not complete enough to be published. The thesis was completed in line with the expectations. Some features were dropped during the development, which was to be expected. The tool has now been downloaded over 1,000 times and the reviews are generally positive

    Similar works