Showing posts with label 2D Shooter. Show all posts
Showing posts with label 2D Shooter. Show all posts

Saturday, March 20, 2010

Daily Developer: Day 67 - The Return

Things have settled down enough that I am able to return to my daily routine.  My task today was to simply get re-acclimated with the game and the code itself. What I've determined is that I really don't think that game as it currently is has much potential for ever being fun.  So, instead of slogging along, trying to force it to be something that it will never be, I think I am going to retire it.  I might post the code somewhere, in case it is interesting to anyone, but I think it is time to move on to other games.

Working on this game has sparked some other ideas for other games.  I think my goal for the next couple days is going to be try to nail down the details of how I want my new game to perform.  I might actually *gasp* write out a quick little requirements document so that I have a guideline for what I am expecting.  At the very least, I anticipate that this will help me determine what makes a requirements document into something that is truly useful, something that I think I would be able to pull over into my job.

Duration: 00:15:33

Tuesday, March 9, 2010

Daily Developer: Day 66

I added an upper limit to the number of growths that can be displayed at once.  This has highlighted that the issue seems to be that something isn't being cleaned up properly in the background, since even when it reaches a limit much lower than the 3000 I was seeing problems at, it eventually starts to lag like it had before.  I'll need to investigate further.

I also re-added the health system for the growths.  Now, when they are shot, they decrease in level until they hit zero and disappear.  However, I think the pool I created is causing troubles with this, since the growths stop spawning after enough are shot, since they are being pulled out of the pool with zero health.  This should be easy to fix.

There still might be something to this game, or maybe not.  However, I at least want to get the bugs worked out before I call it "done."  I have an idea that would use multiple avatars, but it could take advantage of all the work I've done already, so it makes sense to keep ironing out the issues.

Duration: 00:19:16

Monday, March 8, 2010

Daily Developer: Day 65

I received a response to my post from yesterday.  It suggested that I use a pool of enemies: instead of constantly creating new ones, when one is destroyed, put it into the pool and reuse it.  I gave it a shot, but was still seeing the issue.

 Something else he asked was how many items I had on the screen at once.  I guessed about 100, but after the pooling didn't help, I decided to print the growth count to the screen. 

What I had overlooked was just how quickly spawning four new growths for every existing growth would become unwieldy.  Instead of being an issue at about 100, the slow down was starting at about 3000.  I don't think that there will ever be a need to have that many items in the real game, so I think it is a non-issue.

Next on the list of things to look at is to re-enable the collision of the growths with the projectiles and then making sure that the growths revert to previous stages first instead of simply being destroyed outright.

Duration: 00:24:31

Sunday, March 7, 2010

Daily Developer: Day 64

Today was a day of exploration.  I decided that the most reasonable way to approach resolving the game freeze issue I am having is to see what others have done to avoid it.  I looked through some of the posts at the CodePlex forums for farseer and have a couple of ideas, but there is nothing definitive.  So, I registered and wrote a post asking for assistance.  Hopefully, someone who has already solved this problem will be able to guess at what is going on.

Duration: 00:21:51

Saturday, March 6, 2010

Daily Developer: Day 63

I added the check for the boundary back for the projectiles, destroying them if they cross it. I duplicated this functionality for the growths as well. I also remove the excess object from the physics engine, so it seems that things are being properly destroyed now.

I adjusted the collision detection for the growths to only cause a destruction if they bump something other than another growth. This needs to be updated further to properly use the health functionality instead of immediately destroying the growths. Also, the projectiles need to get similar collision detection, since they are not being destroyed until they reach the edge of the screen.

With too many growths on the screen at once, the game bogs down and crashes. I'll need to address this. Possibly, it will be taken care of when I add the death sequence for the player.

Duration: 00:33:48

Friday, March 5, 2010

Daily Developer: Day 62

I removed the old collision detection manager from the project and removed all references in the code. Added a quick test collision detection routine and it looks like it is in the right spot. I did notice that it doesn't complete destroy the objects with the calls I make. I think I've forgotten to remove both objects associated with each displayed object from the physics engine, instead only removing one.

Also, I noticed some odd behavior in a couple of places and made some notes in the code. I also found an issue where it crashes when it tries to create a new growth in a location that one had already been created. The way it is being stored was because I was doing all my own collision detections, so I should be able to simplify that area.

Duration: 00:31:31

Thursday, March 4, 2010

Daily Developer: Day 61

I solved the problem of the projectiles colliding with the shooter when fired by assigning a different CollisionCategory to each. Then, I set the growths to collide with everything and the shooter and projectiles to only collide with the growths. So, now that works nicely.

It took a bit longer than I expected, so I will pull out the old collision code and create the new collision code tomorrow. I also need to either create a barrier around the edge of the board, or to destroy anything that goes outside its bounds.

Duration: 00:42:46

Wednesday, March 3, 2010

Daily Developer: Day 60

Following the pattern I already established, I reworked the shooter to use the Farseer physics engine. Since I have all the objects sharing the same base, and I've already re-factored it to do most of the physics stuff, it was mostly just a matter of making sure the old things weren't being called any longer and that the new properties were being set correctly.

I still need to disable collision detection, since all the objects in the game correctly collide with one another. Because the projectiles collide with the shooter when fired, sending the shooter flying about wildly, I'll either need to recalculate where the projectiles are generated (so that they no longer originate from the center of the shooter), or just create other collision groups and make is so that the group the shooter is in doesn't collide with the group the projectiles are in. I am leaning toward the second, since it should also help with processor time.

Duration: 00:19:46

Tuesday, March 2, 2010

Daily Developer: Day 59

I progressed at moving over to using Farseer for all the game objects. I re-factored the Growth object, moving all the Farseer specific stuff into the base object that the projectiles also share. After a bit of debugging, I was able to get the projectile created and moving properly.

Next steps include porting the player controlled avatar to use Farseer. I need to disable and discard the old collision detection routines and then use the detection that Farseer is already doing. After that, I need to tweak some settings, since I notice significant slowdowns with a large number of items. Though, that may be reduced once the old collision routine is disabled.

Duration 1:00:00

Monday, March 1, 2010

Daily Developer: Day 58

It looks like the experimentation with the sample project I created paid off. I was able to get the growths to move and collide with one another. The avatar and the projectiles now need to be moved to use the physics engine. Also, the collision detection I created needs to be disabled and reworked to use the engine. This shouldn't be too tricky, since it handles most of the work and I just need to trigger on particular collisions.

I also noticed that if a large number of the growths form, it drastically lags the game. I need to put a check in to destroy anything that goes off screen, but I think that there might be some other optimizations that I'll need to look at, too.

Duration: 00:26:04

Sunday, February 28, 2010

Daily Developer: Day 57

I finally bit the bullet and created a new project to fool around with the farseer physics engine. After copying pieces of the simple game project that is provided at their site, I modified it to allow the addition of extra circles into the game. I think that this will help me get things moving in my shooter.

I believe I was neglecting to create new geoms for all the new items. Tomorrow, I'll take a look and see if I can get it working correctly.

Duration: 00:24:36

Saturday, February 27, 2010

Daily Developer: Day 56

I had company in town and took a day off from working on my game. I was also getting a little frustrated and felt I just needed some time away.

I found a much simpler example that I downloaded. After looking through the code, I tried to port some of the code over, but it didn't seem to do what I wanted. Instead, it now seems that the projectile and movement portion is flaky, since some is maintained by the physics engine and some is maintained by hand.

Not sure what I really want to do from here. I would like to try to get the physics working with my game, but I don't know that it would help make it any more fun, so I don't know that I want to spend a long time working on it.

Duration: 00:19:38

Friday, February 26, 2010

Daily Developer: Day 55

I stubbornly returned to trying to figure out why the physics engine wasn't interacting with my code. It looks like I am doing everything that I need to, but I am still missing something, since my test move doesn't seem to do anything.

I think it really might be time to try to experiment outside of the game... but it just seems like I must just be missing one little thing. We'll see.

Duration: 00:26:01

Wednesday, February 24, 2010

Daily Developer: Day 54

I moved the drawing into the Growth object. I copied over some farseer code from their examples and tried to get the growth to move, but I am not yet having success. I think I will try to create a simple project for experimenting with the farseer stuff and then use that knowledge to implement it in my game.

Duration: 01:07:57

Daily Developer: Day 53

Refactored the GrowthManager to handle the drawing of the individual growths. Added the farseer physics engine into the game screen and then spent some time thinking about how to replace what was currently being done with the farseer code.

Duration: 00:34:59

Monday, February 22, 2010

Daily Developer: Day 52

Downloaded the farseer physics engine from Codeplex. I played around with the demos provided. I copied the engine into my solution directory and added it into SVN. Then, I added it to my game solution.

I started looking through the way I've been doing things like creating new objects and collision detection and compared it to the way it could be done in farseer. It will take some re-factoring, but having a physics engine will take care of a lot of details for me, and will make modifying game-play elements much easier.

Duration: 00:37:51

Sunday, February 21, 2010

Daily Developer: Day 51

Watched the remainder of the previously mentioned video, skipping past some of the areas that I already had experience with.

Duration: 00:32:14

Saturday, February 20, 2010

Daily Developer: Day 50

Watched to time mark 35:00 of the second video. Started skipping ahead since some of it really should have just been edited out. Will try to finish the rest in the next couple days.

Duration: 00:16:11

Friday, February 19, 2010

Daily Developer: Day 49

Pretty easy again. Finished watching the first XNA video and started watching the second one. Will probably try to finish viewing tomorrow.

Duration: 00:32:43

Thursday, February 18, 2010

Daily Developer: Day 48

Continued watching the video about XNA game development. Almost completely done with the first video and am looking forward to playing around with the Farseer physics engine after I am done watching both videos.

Duration: 00:32:29