Jump to content
  • Advertisement
Sign in to follow this  
  • entries
  • comments
  • views

Target Practice update, Managed DirectSound

Sign in to follow this  


[journal dump]


in addition to actually finishing the project up, i want to make a few changes to see if a slightly different control setup appeals to jenn any better. the most important change i want to make is to have the crosshairs be positioned by the move analog if the aim analog is dead-zoned. one of the things jenn has a problem with is operating the two analogs at the same time.

in an effort to help the bullet speed get fixed up - right now its speed is dependant on how far from center the aiming analog is pressed - i say we get a DistanceFromDeadzone() or something and divide each component by that to always have the maximum distance. another way would be to get the angle and compute it manually, but i say this is the easier route. [working]

i've worked in a bool function called Deadzoned() that gives back whether or not an analog stick is near the center position. because of the problem we had before where the face was sliding slowly when you weren't pressing on the stick, we needed to add in that little bit of functionality. i wanted to make a note of it because atm the deadzone is hard-coded to be 1/3 (.333) of the max radius (which happens to be 1.0) [working]

hmm. looks like 1/3radius is too much. lets go with 1/5 instead. [working] 1/8? [working] yeah, that works pretty well. we'll go with 1/8.

now, for some odd reason, the changes i made to the sytem slowed it way down. i honestly don't know why its so much slower, but its going to need to be investigated. we got some kinda speed hit there from something i'm doing differently (wrong?) and its gonna need to be fixed. [researching]

wow! the Unplugged() function is killing the framerate hardcore.. i wonder why its killing it worse now than it was before? i know we were only hitting 30fps or so before with the test - what's different? [looking] not sure if anything's really that different, but its really hitting us hard to test for the unplugged situation. i knew it before though, that it would be a little tough on the system. oh well.

another thing to make note of is that the fps isn't actually the real fps, its the logic count. every time the logic portion fires, it updates the fps, not every time the thing is drawn. i could probably add an event handler for Paint so that we can properly report the fps. [working] now that the fps is being updated in Paint, it doesn't update unless something's happening. oh well. at least its more accurate as an fps tracker now.

anyways, lets try to have the move analog direct the crosshairs if the aim analog is deadzoned. [working] there we go. i also made it so you have to release the buttons before you can fire again. i was having a bit of a problem with when the target lands right on you and you shoot it, you'd usually shoot another bullet right away, throwing your accuracy off unfairly.

the only Real Important Things (tm) left to do now are the highscore table and title screen.


i want to play a single sound. maybe have a sound loader or something, whatever. just load and play a sound. not hard. [researching]

actually playing small sounds looks real simple. i'm not sure what the limit to the length should be for a static secondary sound buffer.. when should i be trying to stream them, i wonder.. i haven't figured out how to play mp3s, but i did see an audio/video player in the dx9 sample browser for c# under miscellaneous. gotta remember that.

wow! playing mp3s is going to be fscking simple! Ms.DX.AudioVideoPlayback has what i need. i use the class Ms.DX.AVPlayback.Audio - its constructor takes the mp3, and use its Play(), Pause() and Stop() functions to do those things. they added an event handler to the Ending event that Stop()s and then re-Play()s it to force endless looping. damn easy.

lets try to add the shoot noise to the target practice sample. [working] well the only thing i had to figure out on my own was that if you're in the middle of playing the sample still, you have to SetCurrentPosition() back to 0 instead of Stop()ping.. it won't let you Stop() on a dime like i want. oh well, i got it going. now its time to add an explosion sound. [working]

so simple. unoccasionally, a sound will miss on its Play() and no sound happens. but i'm happy with the results for now.
Sign in to follow this  


Recommended Comments

There are no comments to display.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!