Hi, i want to apologize if i mess up something with my english, while im writing this, so with that out of the way. I want to share to the community this project i have been working on for the last few months as part of my thesis, its my first game using 3D graphics and my first time using three.js so there is a lot of junk in the code, BUT its pretty much done(am at the last days of developing it actively , i will just be adding some extra signs and features which are easy tbh also i will try follow the standards for the code and translate to english the comments). I want to make this code open source so everyone take a look of how i did some of the stuff.
The game is a traffic serious game, not really that specific BUT if i follow the definition of serious game is just a game that you give some serious objective like learn or develop an already known skill.
So with that in mind i develop city, a dynamic city, this city is different everytime the game is loaded, the maps are kinda similar but they aren’t the same. Which make everything really random, so to build it i made a matrix where i store the positions of the objects i wanted to render. I made few mistakes here, but it work most of the times, the algorithm took me too long to develop and understand, so its fine, probably i will change some stuff in the future.
Once everything is created i start importing the models, which are really simple, i optimize them the most i could in blender, and bake the texture some AO so it doesnt look that bad, and i could turn off all the shadows to get a better performance. I also merge the most geometries i could, this part was kinda hard, there is no example i could find (probably i miss one, i don’t know, i tried to understand how i could do it by myself) where someone merge multiple GLTF geometries with the material of the imported model, were each geometry have different positions, but i made it so if someone want to check out how i did it, there is the code. I wanted to do some instancing with the geometries, but was really hard to understand at least for me, i will tho, but probably for another project.
The car animations were done with Tween.js because i fail trying to do those myself, xD.
I use some code from some examples i think, i don’t remember properly but not a lot tbh. Was a good experience tho, i will just finish adding some extras traffics signs in the next couple of weeks, and some other collision stuff,also sound i forget about sound…
If you find any bug or something tell me so i can try to fix it, i also accept suggestions. Sorry again if i mess up something.
Here is the live game:
and the repository: