awesomeness fails

Published April 18, 2007
Advertisement
This was going to be such an awesome post...
Over the last couple day's I've been working on adding wreckage to my engine. Today I finished up the rest of the base code, and made a "wrecked" model for one of the spaceships. I was ready to compile it, take some videos, and make a cool journal post.

Instead here's what happened.
1. making the model took 3 hours, because it failed to save the first time i made it.

2. I remembered that ships stop firing when their target is disabled, not blown up, therefore i was having trouble triggering the transition to the wreckage.

3. I added a couple lines of code to fix a bug where ships wouldn't fire on a ship that was already being attacked

4. the code fix failed to work at all. It was a really simple 3 line fix, but it took about a 1/2 hour to figure out the problem.. see 5.

5. there is a huge problem with my fleet code. The fleet keeps track of two lists of enemy ships. The first is simply a list of all the enemy ships in the area, and the second is a list of enemy ships that are not currently being engaged. When the fleet assigns a target to one of it's ships, the target is removed from the "unengaged" list.

The problem is for some stupid friggin reason the lists are both just references (pointers??) to a list in another class. This list is the master list of enemy ships in the area, and the two lists in the fleet class are just supposed to be copies of it. Instead they are referencing it, so everytime a ship is removed from the "untargeted" list, it is removed from the larger enemy list and can never be targeted again. GRRRRRRRRRRRRRRRRRRRRRRRRRRR

Its things like this that remind me just how little I actually know about c#. I thought that I had gotten this stuff figured out... I guess not. Now I am going to have to hunt through the remaining 26 classes in the project and try and figure out if i did this anywhere else. the worst thing about it is that it is virtually undetectable unless if I am paying very close attention to details. sigh.

If anybody has any insight that they want to share, I posted a question about this in the .net forum (its a c# question, but also kind of a beginner question, and also general programming. I never know where to go with my questions, and end up posting in the .net forum usually)
Previous Entry ho hum
Next Entry skybox..
0 likes 0 comments

Comments

Nobody has left a comment. You can be the first!
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Advertisement
Advertisement