terça-feira, 12 de junho de 2012

7DFps - End of Day 3


This is a daily diary I will keep for my "7 Day First Person Shooter" challenge entry.

This is the current state for the end of Day 3:



Since the last post, I worked on adding player collision against the world. I initially choose to integrate a java physics library.

Since I wasn't familiar with the Bullet physics library, I didn't know how to integrate it nor did I know how it would perform in the kind of environment I'm aiming to create (a procedural level that will have dynamic loading and unloading of geometry). I realized that it wouldn't be a good idea to have to deal with learning the library's api, implementing and debugging in such a short time. I briefly considered implementing a simple collision system using swept spheres, but that would also take considerable time and energy debugging. I finally decided to leave Java and Lwjgl, and go back to one of the solutions I've considered before (between Unity and Blender Game Engine, I chose to go with Unity, since I already had a prototype working before the challenge began), thus ditching shadows and visual effects (since I'm working with Unity free).

In that prototype I had Unity's default first person controller, to which I added a general shooting mechanic (raycasting, adding randomness to shots and a delay between shots), logic for a machine gun, rendering a mesh to show the shot tracers, a weapon position to fire from and a cylinder to visually show it, and a particle system that spawns where each shot hits.

From that, I added code to dynamically generate a room mesh (now, simply a cube, with corresponding physics, created in Javascript code using a new GameObject, and adding the MeshFilter, MeshRenderer and MeshCollider components, and setting the MeshCollider and MeshFilter's Mesh to the one I created, by setting its "vertices", "triangles" and "uv", and the meshFilter's "material" variables).

Today I'll add enemy logic: generation, spawning, and attacking the player.

Sem comentários: