This past few days, I’ve been stuck with this problem in my game. Whenever I move my mouse over the render window, the framerate becomes inconsistent and kinetic items in my scene “tears” visually. Even when I remove my mouse detection code, it still happens. I printed out every elapsed time frame and it shows that even frames render at around 0.03 seconds and odd frames render at around 0.0016 seconds. I’m not sure if the problem lies in GLUT or what…
Not much done today. I got mouse detection working with a few simple lines of code using GLUT callbacks. Next thing is to implement the hud system and collision detection so that I can get a targeting system up and running.
During my CS499 video game development class, I was clueless as to how to approach game timers. For those who aren’t sure what they are used for, game timers are used so that no matter what machine you are on, you want the game to behave constantly. For example, if you were to build a game on your machine now without any timers, your game might run differently on better machines and on older machines.
So far I’ve come across two types of game timers. The first timer goes for full frame-by-frame rendering. This means that no matter what, frames will never be skipped and all machines will render the same amount of frames. This is useful for games that require fast reaction times such as shoot’em up sidescrollers. The downside of this type of timer is that players can run the game on a slower machine and have the advantage of the game render slower so that their character can dodge bullets easier. The second timer allows for constant game timing which I currently have implemented. Since my game requires that the visuals be synchronized with the music, I want my virtual world to be in constant time even if the computer can’t render fast enough. What my game does is that the visual objects’ movement adjusts to the timing in between frames. For example, let’s say I want a cube to move 100 pixels to the right in 10 seconds. If my computer renders at 1 frame per second, the cube will be moving 10 pixels to the right every second. Let’s say that on a slower computer, on frame 6, the computer hiccups and renders at 0.5 frames per second, or 1 frame every 2 seconds. That means on frame 7, my box will be behind by 10 pixels. Since I have my timer implemented, at frame 7 will render just like frame 8 on computer 1 without the hiccups, meaning the box had moved 20 pixels to the right on frame 7. Then at frame 9, my box will be at the destination at the same time as computer 1 with a net drop of 1 frame.
My game codenamed: “project eyght” is so far going along nicely. The big problem at the moment is trying to use the least amount of windows exclusive libraries as possible, rather, trying to use the most cross platform libraries available. The iPhone is still a relatively new platform, so there is still work going on at the moment with porting libraries (such as the SDL). For now, I have Opengl + GLUT + FMOD, only GLUT isn’t compatible with the iPhone. The reason why I haven’t used SDL is that I’ve been taught and have more experience with GLUT so I know how to get things up and running much quicker. I’ve also couldn’t get a simple SDL Opengl window working, which makes me a lame coder. Anyways even if I got SDL working on my PC, I’ll still have to rewrite the touch screen controls for the iPhone, so it doesn’t matter much to me at the moment.
Since my game will have some sort of “synaesthesia”, I got an audio beat detection working. Well it’s not really beat detection, it’s really just rhythm function. I took an audio track and imported to ableton live for sample correcting. There I took the amount of samples a track has and divided it to beats. For example, I have a track by Josh Gabriel called “Azora” which has about 18668160 samples with 896 beats. Dividing those two numbers give 20835 which means every beat has that many samples. Now if you want to figure out how long is each beat in seconds, assuming you have a .wav with a sample rate of 44.1khz, all you need to do is divide 20835 / 44100 and you’ll get around 0.4724 seconds.
As I mentioned, I’m currently using FMOD audio library. To get a sort of a rhythm action in the game, all you need to do is create FMOD::Channel *channel, link it to a sound object, and use the channel->getPosition with timeunits FMOD_TIMEUNIT_PCM to get the current sample position of the audio track(remember to -1 since the sound starts at sample 0). Now all you need to do is check the sample position against a multiple of the beat length (multiple meaning as to which beat you are on. Here’s a sample of my code:
FMOD::Channel *channel;
system->playSound(FMOD_CHANNEL_FREE, sound, false, &channel);
//begin some sort of game loop
unsigned int pos = 0;
channel->getPosition(&pos, FMOD_TIMEUNIT_PCM);
if(pos >= (unsigned)20835*beatCount-1)
{
//do beat stuff here…
}
Next, I’m going to try and get some visual stuff up.
i remember dave posting this small 10 second sample, now it’s the full track!
open the dark side of me
find what your faith needs to be
help me gain focus on you
(heart bleeds and know what to do?)
so turn up the sound now
make it feel louder
who is it playing
are you still here?
who’s all around now
are you still listening
what are they saying
was it clear?
turn up the sound now
lost in the crowd and
i haven’t heard this one before
turn up the sound now
what are you saying
no i’m not listening anymore
please don’t confess to the sin
unless you said to begin
(fallout?) seems more than just trust
walls down now dive in to us
so turn up the sound now
make it feel louder
who is it playing
are you still here?
who’s all around now
are you still listening
what are they saying
was it clear?
turn up the sound now
lost in the crowd and
i haven’t heard this one before
turn up the sound now
what are you saying
no i’m not listening anymore
so turn up the sound now
make it feel louder
who is it playing
are you still here?
who’s all around now
are you still listening
what are they saying
was it clear?
turn up the sound now
lost in the crowd and
i haven’t heard this one before
turn up the sound now
what are you saying
no i’m not listening anymore
turn up the sound now
what are you saying
no i’m not listening anymore
turn up the sound now
what are you saying
no i’m not listening anymore
turn up the sound now
what are you saying
no i’m not listening anymore
I was browsing around the Gears of War 2 DLC on the xbox store. I noticed that there’s several map packs available for download. I’m glad that they don’t force us to buy the map packs but the consequence of that would be the dividing of the communities. Imagine a crowd of players purchase map pack #1 and #3 while another group purchases #2 and #4 map packs. Then there are those who refuses to download any map packs at all. We now have 3 groups trying to find each other on Xbox Live but it is now more difficult to find people to play with in the pool of players. Not to mention the amount of levels to select from. Imagine a population of 100 people playing a single game. That game contains about 100 maps. Dividing it among the players, there’s a possibility that there is 1 person for each level waiting forever for someone to play with. It doesn’t make sense.
I’m planning out my “Rez” type game for the iPhone/iPod. I’ve been looking around for some audio libraries that’ll help me sync up the beats of the music with the visual world of my game. I’m currently looking at FMOD library and it seems to be the best choice for now. Shelling out $500 for a small iPhone game is going to be a bit hard for me to do, but it’ll have to do.
So far we have heard the following new songs:
Infusion – Dogtown
Infusion – 2 Player Game
Infusion – So Soon
Infusion – Memory Cheats
Infusion – (unknown Id, lyrics go Sometime tonight, hope that you will see what i’ve gone through to get where I want to be…)
One source said the album is releasing as soon as this friday, but Infusion’s official facebook says July 2009
Then there’s these 2 videos of new tracks:
I really like the last video a lot! It’s turning out to be a great album!
I started a new site about this upcoming system! Go check out http://www.pspgofan.com !
