GP2X Re:... Drawing The Road On A Top Down 2d Racer


Unfathomable Depths said:
If you mean pitch shift the wav file, yes it can.

How I did it was -
Get the lowest sound. Pitch shift by some small amount. Save it. Undo pitch shift. Pitch shift by some small amount x 2. Save it. Undo. Pitch x 3 etc etc

Pretty boring but it didnt take that long (I had 16 to do).
cool...thanks chap. I'm just having a bash now :) ...(just saved 06.wav) with 20 to do.
 
Last edited by a moderator:
Unfathomable Depths said:
hehehe - good luck with the game - looking forward to this one.
Me to :)

It's coming along 2jame.

Will you have the night time section , or was it when you r going through the tunnel the cars lights come on?

I see you have an image of it up already ,
 
Last edited by a moderator:
Animotion said:
Unfathomable Depths said:
hehehe - good luck with the game - looking forward to this one.
Me to :)

It's coming along 2jame.

Will you have the night time section , or was it when you r going through the tunnel the cars lights come on?

I see you have an image of it up already ,


Hi there,

yeah it will have the night time section just like the arcade, ....that'll be my next job after i've done the sound. The only thing is i'm not sure how to fully implement the head light yet. The headlight will show only what's within it... i.e. part of the enemy car....

I'm thinking of making the car graphic smaller also...

J
 
Last edited by a moderator:
prairiefire said:
Unfathomable Depths said:
hehehe - good luck with the game - looking forward to this one.
yes good luck with this game twojame! looks fantastic :)


thanks chap... I love the arcade game and i'm determined to finish this project.

I'm off sick at home at the moment so i've got bugger all else to do anyway :D
 
Last edited by a moderator:
twojame said:
The only thing is i'm not sure how to fully implement the head light yet. The headlight will show only what's within it... i.e. part of the enemy car....
One possible solution would be to make a mask using the headlight effect graphic and draw that 2nd last.

So you would draw everything as normal then blit the headlight effect over everything, then the players car. You would need a pretty big mask bitmap but just blit the bit you need from that.
 
Last edited by a moderator:
Unfathomable Depths said:
twojame said:
The only thing is i'm not sure how to fully implement the head light yet. The headlight will show only what's within it... i.e. part of the enemy car....
One possible solution would be to make a mask using the headlight effect graphic and draw that 2nd last.

So you would draw everything as normal then blit the headlight effect over everything, then the players car. You would need a pretty big mask bitmap but just blit the bit you need from that.


ahh right... I think I get you here. I'll have a bash with this in the morning.

I've still some work todo on the engine sounds. The approach that you mentioned has worked. I've got 20 individual wav files that are mapped to the speed of the car. I.e. if speed = 20 then 20.wav. I just need to put some logic in to allow it to loop the sound effect.

Many thanks for you're help...

J
 
Last edited by a moderator:
remember that your wav files may not loop properly unless you clip them at zero crossings (where the wave hits the x axis).

you might want to look into generating the sounds using a software synth. grab vsthost and some simple vst synths (plenty to choose from). or an sdl software synth, or csound, puredata, etc. lots of options.*

* technical details: you want to generate a fundamental pitch and a few overtones on top of it (the engine strokes). add some pink or brown noise (everything else). run that through an eq, with a couple places slightly boosted and a couple places slightly cut (the muffler). check out this page for more info.

like he says on that page, the link between rpms and pitch you hear is rpm = Hz * 15. this is because Hz deals with seconds while rpms is per minute, and it's a 4-stroke engine (pretty sure F1 races are 4-stroke too).


or just do the pitch shift thing like UD says since ztunnel engine sounds fine to me :)


also, you might be able to squeeze all those files into one and just load the section you need...don't know squat about sdl_audio though.
 
rokdcasbah said:
remember that your wav files may not loop properly unless you clip them at zero crossings (where the wave hits the x axis).
snip...
Many thanks for this help. This is just where I've been struggling. The original arcade sounds need cleaning up since there is some popping on the audio. I'm even thinking of swapping them out for something else as they've not got the same impact on the gp2x as they did in the arcade cabinet with the volume turned right up. Anyway I'll be studing the details of you're post today (the audio side is over my bonce :D )...


J
 
Last edited by a moderator:
well if the pops happen within the wav, you can use audacity or whatever to clean them up. i use cool edit and haven't checked out audacity recently, but it probably has or has support for some sort of click/pop eliminator.

if the pops happen right when they start playing, then you need to find a better place to clip. besides zero crossing, you should also pay attention to the direction of the sound wave. for instance, if the clip starts with rising from zero, it should end by rising TO zero. paste the clip next to itself, and inspect the seams.
 
rokdcasbah said:
well if the pops happen within the wav, you can use audacity or whatever to clean them up. i use cool edit and haven't checked out audacity recently, but it probably has or has support for some sort of click/pop eliminator.

if the pops happen right when they start playing, then you need to find a better place to clip. besides zero crossing, you should also pay attention to the direction of the sound wave. for instance, if the clip starts with rising from zero, it should end by rising TO zero. paste the clip next to itself, and inspect the seams.
Hi there...

I've now got a set of 20 wav's that I’m much more happy with. They are close to the arcade... There a port from Grand Prix Legends Ferrari which is close to the Monaco GP 1989 actual arcade.....

Well all is good, but I’ve noticed some popping and clicking on a few of the lower note wav's when played on the gp2x. On the PC there is no popping or clicking. The wav's are mono 22050hz. I'm not certain if that's fully compatible with the GP2x.

The clicking occurs when the car begins to accelerate so it could be the code which kicks off the wav sound.

<edit>
i've just checked and the mixer is set to 22050hz so that should be ok.

I use the below to say if you're going at 9 pixels per second then if the sound isn't playing go and play it, but there could be a sound playing on that channel so maybe I should stop that first...hmm

CODE

case 9 :
//Dev Note:...if sound is not playing then play it for this speed of 9 px per second
if (arrSndHeld[9] == false)
{
//...play it
arrSndHeld[9] = true;
fnResetSndButIn(9, arrSndHeld);
intChannel = Mix_PlayChannel(1, mcPropENG_09, -1);
}
else
{
//...No Operation
}
break;



I've updated the download link monaco download. It now includes the latest sound stuff and volume controls.,...thank god for that.

Just found a video of the actual arcade game in full swing. It'll give you chaps an idea of what i'm trying to achieve on the gp2x.
Monaco GP Youtube

J
 
Last edited by a moderator:
twojame said:
rokdcasbah said:
well if the pops happen within the wav, you can use audacity or whatever to clean them up. i use cool edit and haven't checked out audacity recently, but it probably has or has support for some sort of click/pop eliminator.

if the pops happen right when they start playing, then you need to find a better place to clip. besides zero crossing, you should also pay attention to the direction of the sound wave. for instance, if the clip starts with rising from zero, it should end by rising TO zero. paste the clip next to itself, and inspect the seams.
Hi there...

I've now got a set of 20 wav's that I’m much more happy with. They are close to the arcade... There a port from Grand Prix Legends Ferrari which is close to the Monaco GP 1989 actual arcade.....

Well all is good, but I’ve noticed some popping and clicking on a few of the lower note wav's when played on the gp2x. On the PC there is no popping or clicking. The wav's are mono 22050hz. I'm not certain if that's fully compatible with the GP2x.

The clicking occurs when the car begins to accelerate so it could be the code which kicks off the wav sound.

<edit>
i've just checked and the mixer is set to 22050hz so that should be ok.

I use the below to say if you're going at 9 pixels per second then if the sound isn't playing go and play it, but there could be a sound playing on that channel so maybe I should stop that first...hmm

CODE

case 9 :
//Dev Note:...if sound is not playing then play it for this speed of 9 px per second
if (arrSndHeld[9] == false)
{
//...play it
arrSndHeld[9] = true;
fnResetSndButIn(9, arrSndHeld);
intChannel = Mix_PlayChannel(1, mcPropENG_09, -1);
}
else
{
//...No Operation
}
break;



I've updated the download link monaco download. It now includes the latest sound stuff and volume controls.,...thank god for that.

Just found a video of the actual arcade game in full swing. It'll give you chaps an idea of what i'm trying to achieve on the gp2x.
Monaco GP Youtube

J


there's nothing like the sound of a roarin ferrari :D music to me earS haha, I'm wonderin how one would develop the black or the tunnel parts.

like in this vid when it goes dark and the headlights come on, so u would have to program the game to only show the area of the head lights at this point.

A video of arcade for reference

http://www.youtube.com/watch?v=_lGUFQ6_I6c

ah i see you already posted the video 2jame :D
 
Last edited by a moderator:
Animotion said:
there's nothing like the sound of a roarin ferrari :D music to me earS haha, I'm wonderin how one would develop the black or the tunnel parts.

like in this vid when it goes dark and the headlights come on, so u would have to program the game to only show the area of the head lights at this point.

A video of arcade for reference

http://www.youtube.com/watch?v=_lGUFQ6_I6c

ah i see you already posted the video 2jame :D

snip...



There is a new build up now which has got the headlight on when in the tunnel... The program checks what tile is in front of the road and if it's XX then it puts on the headlight.

I think next i'll do the collision detection between the car and countryside. At the moment you can go full whack through a brick wall. I've got the car wheels animating and some other stuff going on now like alpha blending on the headlight. See the download link...

demo10.gif

demo20.gif


WIP:
collision detection
enemy cars pattern
game loop with timer and scoring system

NEW:
as of 11/12/2007... still working on the enemy car AI driving patterns... I've got the resources into the game now.
lots of fun being had....
I've had a play with alpha blending, but it don't half slow it down so that may have to go...
I've also tried to implement a LED type font, but it crashes on the gp2x...Not sure why that is will have to look into it.
There's some collision detection in there now so if you go on the grass etc it will slow you down. It don't sound like much, but it will form as a basis for other related stuff.
 
Last edited by a moderator:
Hey TwoJame,

Have you implemented your car enemy AI yet?. I was thinking about how you could maybe go about it. If your interested here goes. This is just an idea about "dumb" AI, its nothing sophisticated. What I would do here is pick a point that is just above the screen (out of eye shot). Then workout where the player is relative to the enemy position. Then set the enemy car off at the applicable speed and direction. How often you do this is entirely up to you. Maybe once every 5 seconds? or something. You could make it a little more "intelligent" by allowing the enemy to "swerve" in the direction of the player when the enemy car is "near" the player. Hope that helps.
 
netwalker said:
Hey TwoJame,

Have you implemented your car enemy AI yet?. I was thinking about how you could maybe go about it. If your interested here goes. This is just an idea about "dumb" AI, its nothing sophisticated. What I would do here is pick a point that is just above the screen (out of eye shot). Then workout where the player is relative to the enemy position. Then set the enemy car off at the applicable speed and direction. How often you do this is entirely up to you. Maybe once every 5 seconds? or something. You could make it a little more "intelligent" by allowing the enemy to "swerve" in the direction of the player when the enemy car is "near" the player. Hope that helps.
hi there,


Originally I was toying with giving my car class some intelligence so that when its an enemy car it can give you a competitive drive, but this would involve things like inputs/middle layer/outputs.... err

Then I knocked that down to giving my tile class another bit of information. This acts as a path allowing the enemy to follow it. This has it's own complexities during the file read into tile array process.

However I think you're approach above could be even simpler so I might give that a shot.

I don't want to go that crazy with the ai.... As long as it's close to the arcade in the youtube vid. They bounce the ai from left to right... I'm finding the AI part the hardest to implement. RE; good news, then i've managed to get the speed of the enemy movement in relation to the players speed. I.e.... enemy has speed of 18, 2 slower than player.., but they are moved in relation to the players pov.

Anyway enough rambling.... :D



Thanks

J
 
Last edited by a moderator:
twojame said:
Originally I was toying with giving my car class some intelligence so that when its an enemy car it can give you a competitive drive, but this would involve things like inputs/middle layer/outputs.... err

Then I knocked that down to giving my tile class another bit of information. This acts as a path allowing the enemy to follow it. This has it's own complexities during the file read into tile array process.
Hey TJ,

I think that is maybe a little more complex than I would have had it. I wouldn't really allow the enemy cars AI to process tile information. With the exception of dealing with collisions. As far as the AI goes, it maybe beneficial to have something different other than whats already been done. By all means if you want to implement an AI mechanism that is the same as in that YouTube video go ahead and do it :). However since you mention classes, I'm assuming here that your doing your game in C++. What you could do for the car class is maybe implement a virtual AI function in the cars base class and implement different types of AI for each car. Some cars are easier to pass than others for example. How you do this is again up to you.

Hope that helps.
 
Last edited by a moderator:
netwalker said:
twojame said:
Originally I was toying with giving my car class some intelligence so that when its an enemy car it can give you a competitive drive, but this would involve things like inputs/middle layer/outputs.... err

Then I knocked that down to giving my tile class another bit of information. This acts as a path allowing the enemy to follow it. This has it's own complexities during the file read into tile array process.
Hey TJ,

I think that is maybe a little more complex than I would have had it. I wouldn't really allow the enemy cars AI to process tile information. With the exception of dealing with collisions. As far as the AI goes, it maybe beneficial to have something different other than whats already been done. By all means if you want to implement an AI mechanism that is the same as in that YouTube video go ahead and do it :). However since you mention classes, I'm assuming here that your doing your game in C++. What you could do for the car class is maybe implement a virtual AI function in the cars base class and implement different types of AI for each car. Some cars are easier to pass than others for example. How you do this is again up to you.

Hope that helps.


hi there,

many thanks for this :) . How would you then deal with setting up the initial position of the AI? When my ai moves off the screen I change the car colour and reset its position. This gives the illusion of a different car. What I was then intending on doing is making random the x coord of the car. So its left wheel is on the left or right whilst being on the road. So I was thinking that the enemy car may need to check the tiles on the left and right. The only thing is there is some overhead in doing this...

Regards...

edit...I'm still working on this chaps. The AI is tough.... Trying to boost the fps on the gp2x...

edit...Has anyone else had this problem with drawTextInt? The score appears when run on the PC, yet when running the same code on the gp2x it only appears when the car is at full speed. Yet this is not conditional code...It's the same code on the PC and it works there?!? I'm going out of my mind with it :) You can see the problem with the pc and gp2x download...

edit...FIXED IT!!! :-D... had a small logic error in my class definition.

edit...Put some tunnel echo effects in today. Only abit more to go now...Like levels, game timer, collision detection
 
Last edited by a moderator:
I've put the latest version up. Done a simple menu screen like the arcade, hit start/enter to begin. My final 2 tasks will be a game timer and making the ai dart in various directions.... Unfortunately I've had to drop any transparency effects It kept drowing out the cpu on the gp2x...


demo28.gif


link

J

edit: oh and collision detection. Kind of quite important for a video game...

edit: i'm on a roll, i've just done the game timer...
 
Back
Top