Thursday, January 27, 2011
Lasers and post processing
I've started doing some experiments with post processing and I've begun creating a system to apply those effects to our game. I've also been trying different ways to redo the laser system, since the old system was very expensive to draw and update each laser. I've been trying to find out if it would be better to use a billboarded sprite or an invisible 3D model (a locator basically) with post processing blur. I haven't been able to find much documentation on 2D post processing, so I'm leaning toward the latter but haven't yet implemented it.
Tuesday, January 25, 2011
4.0 Conversion
We're now converting our project over to XNA 4.0. This also entails restructuring and cleaning up the code. I had to fix a few glitches with how the AI enemies were updating their direction. With the player, the controller determines their rotation, but with the AI, their direction is determined by actually changing it to point toward the player. Because the model's "forward" vector was being updated but the "up" and "right" vectors were remaining the same, the draw function was skewing the models and they eventually disappeared entirely. The world matrix was getting updated with every call, but for some reason, calling "Direction.Normalize()" wasn't actually normalizing the direction vector. I finally tried "Direction = Vector3.Normalize(Direction)" and that seemed to work. I still don't know why the other call wasn't acting like it's supposed to. It was probably silently failing for some reason.
I also got a few of the HUD elements back into place, although they're still not fully functional and I still need to clean up some of that code to adjust for the "title safe" area.
I also got a few of the HUD elements back into place, although they're still not fully functional and I still need to clean up some of that code to adjust for the "title safe" area.
Thursday, January 20, 2011
Busy busy
I've done quite a bit since the last time I posted. I put the HUD elements that Brandon designed into the game. I created a system where enemies spawn at intervals at random positions around the player for survival mode. I did lots of AI work and made them do fly-by passes at the player.
I also used what I learned for the radar with the viewport transformation matrix in several other aspects of the game. For the targeting, I calculate where the enemy will be by the time the laser gets to it and draw a "lead target" for the player to shoot at. I also draw a square around the currently selected target and an arrow pointing to the direction you should fly to get to the enemy quickest. I used the same ideas to make the AI aim better.
The same principles fixed the position of the crosshairs in the third person view. They adjust their position according to how far away the target is.
I also used what I learned for the radar with the viewport transformation matrix in several other aspects of the game. For the targeting, I calculate where the enemy will be by the time the laser gets to it and draw a "lead target" for the player to shoot at. I also draw a square around the currently selected target and an arrow pointing to the direction you should fly to get to the enemy quickest. I used the same ideas to make the AI aim better.
The same principles fixed the position of the crosshairs in the third person view. They adjust their position according to how far away the target is.
Tuesday, January 11, 2011
Back in the saddle
Over the break I did a few things to the project. I revamped the texture for the lasers a little to make them look a little better, I set up a way to draw the crosshairs accurately in third person view, and I finished the functionality of the radar!
The radar was a huge thorn in my side and a problem almost everyone on the team had tried to figure out with no success. In the end, I found out from my graphics class textbook that there was one more transformation matrix that none of us had known about - the viewport transformation matrix. It translates the final coordinates (after they go through world, view, and projection transformation matrices) to screen coordinates. This solved our problem of trying to project a 3d point on to a 2d plane.
I also used the same idea for the crosshairs and told Wilson about it so he can use it on the targeting reticule.
The radar was a huge thorn in my side and a problem almost everyone on the team had tried to figure out with no success. In the end, I found out from my graphics class textbook that there was one more transformation matrix that none of us had known about - the viewport transformation matrix. It translates the final coordinates (after they go through world, view, and projection transformation matrices) to screen coordinates. This solved our problem of trying to project a 3d point on to a 2d plane.
I also used the same idea for the crosshairs and told Wilson about it so he can use it on the targeting reticule.
Subscribe to:
Comments (Atom)