Sunday, April 24, 2011

Week 3 Advanced Game Prototyping

This week, I had to continue working on my particles code, and start working on the games interface. I finally worked out on making the particles spawn once as intended and looking better. The next new bug I opened was when the victim asteriod died, instead of its own particle going off, the particle on another went off. So far I believe one or both of these 2 reasons are why it is happening. The first, and what I beleive it is, is that I am using a randomly generated interger when told to generate one and whatever it is will spawn one of 3 particles. And I am using a gameobject find to find the named particle attached to the asteriod, but since the particles on one asteriod is the same name as another Unity just picks 1 random one. But as I was writing this, when I turn on the asteriod spawn portion again, the victim asteriod will still spawn them and the particle is called upon at the same time, so the theory that the specific asteriod and not some other one is doing what it should be, dying and giving birth theory is working as intended. But the 2nd reason, is the the destroy game object happens right afterwards is that unity most likely didnt keep up and picked some random to do particlemitter.emit on some other same name particle. Or I`m wrong and the way it is coded is wrong. It took me almost 3 hours to work all this out.

The interface on the otherhand, I didn`t expect a big challenege of a keyboard only manual interface on a PC game for the player. I know I spent half a day looking at 1 interface button, trying to get it to do what I wanted to do. After 14+ hours, with input gui`s I learned it is really important to first keep what buttons are used in point A and what buttons later used in say point F must go from A-Z, or F will cut into A and unity will think yourat point F when your at point A. Though I did use an interger for the arrow keys and booleans for which point I was at, that I learned also I had to at some point stop reseting the interger and instead make it equal a higher value then the previous point to make the buttons work. Cause the main issues I had where was I could use the arrow to navigate my interface, but the buttons would not go off when return was pressed. At the point I`m at now, the player will have 7 weapons and he has to chose 3 to use before starting the level. 1-3 and 5-7 weapon selection buttons worked, and I could start the game if I selected 3 of those, but weapon selector # just wont work. Other then that, with what was discussed in class, and how I coded this I could in theory still use a radial for the interface buttons, but kinda hard till I make the animation or something that looks like a spinning wheel of buttons cause my coding does support the theory I believe.

Week 2 Advanced Game Prototyping

For this week I got to look forward to the next week of showing off an interface I had done for the Interface Design class. The feedback for why I didn`t do so well for it was making it look like a 90`s style game, which is what most of my PC gaming experience is from. I also had to set up the dust particles for when the asteriods were destoryed. Since some randomness was called for, I decided to make 3 5 by 1 textures differently sized for the asteriods. Since the example on the unity site used meshes for them, I used the instantiate coding to make my particles and ran into issues like you cant destory an object with particles going on it, or the part where even an IF or FOR would not spawn the particles form spawning again and again past 1 time. But thanks to using differently sized particles, I did notice something was up and say a small asteriod died and the big asteriod particles went off, well went off for every destroyed asteriod. I found out I coded the big asteriod hp onto the small and medium ones, and quickly fixxed it. Guess I didn`t catch it the previous week. I spent around 6 hours bitting my fingers trying to figure out how to work the particles from theory to working as intended.

Week 1 Advanced Game Prototyping

This week, I had to continue working out the asteriod code. Besides additional coding, the frame work of the previous coding was left alone. I changed the HP check code on the asteriods from a called function to fixedupdate and added a tag check and the new asteriods to spawn from the destroyed ones worked. What I spent most of my 5+ hours on was the movement issues, nothing was mentioned about a Constant Force component with using the constant force physics vs addforce physics. I learned that addforce diffenently needed a Rigidbody component to run, but with how my movement code is done I believe for the constant forces both Rigidbody and Constant Force components are needed. Though the way Constant Force is worded as a one time force vs addforce which is added ever frame, I had to add a code that would zero out the random constant force after 5 seconds to prevent the asteriods form jerking around.

Week 11/School break

For School break, I was tasked with making textures for my 11 asteriods and make a code that would spawn 3 medium asteriods when a big one breaks, and 3 small ones when a medium one breaks. For the texturing, and decided to learn Max and spent some time making the most usable UV mapping I could. With the actual texture, for the most part I could have just added a simple brown towards a grayscale color. But being a rock, and what I`ve seen of past examples even from movies thats all it is. And being an object the player will differenelty be around alot, and be looking at alot I didn`t want to make them look boring. So I started with making a bump mapping, which depending on lighting would add a good vib to it and based my texture around the bump map. Spent 3-5 hours working out the asteriod textures. For the programming portion, well the only part the worked was teh asteriods destroyed each other when called to do so. Problem was that was all it did. Also was able to get a movemenet code to work on them, but wasn`t able to figure out immediatly how to deal with the ones that moved in circles. Spent maybe 5+ hours with trying to trubleshoot the coding.