Jump to content
  • Advertisement
Sign in to follow this  
suliman

Topdown arcade cargame - Walls etc

This topic is 3608 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi Im working on a topdown arcade racer game like supercars 2 http://pagesperso-orange.fr/dazeland/Super_Cars2-2.png I have driving up and running, and cars can hit other cars and small objects like rocks using collision circles and impulses to bounce away. This works fairly well, but how do i do barriers like walls, houses and large objects? Do i need to create numerous wall-objects that i check collision with or do i use some kind of colormap or something? I wanna use both city-maps where you race around blocks of houses and more open maps like deserts. Also, what would be the best way to make jumps (simplified like in supercars 2 if you know it.) Add "hight" somehow relative too speed to an objects position when it passes over a "jump"/ramp? This could maybe also be used to make overpasses? Im not looking for a realistic physics model (unless its veery easy to implement) rather somthing to solve this arcade game. I already got a system for friction and sliding when turning. Thanks a lot Erik

Share this post


Link to post
Share on other sites
Advertisement
Use an attribute layer. "0" = "clear", "1" = "obstacle", etc.

(You could probably combine direction data too, for the AI cars. Just use a simple "Go that way" number corresponding to a direction the AI should attempt to travel in.)


Share this post


Link to post
Share on other sites
???
Are you talking about a tiled-based world to restrict movement? I was asking about how to handle collision with rectangles (not necessarily axis aligned boxes like in a grid)

E

Share this post


Link to post
Share on other sites
Quote:
Original post by suliman
???
Are you talking about a tiled-based world to restrict movement? I was asking about how to handle collision with rectangles (not necessarily axis aligned boxes like in a grid)

E


Oops, sorry; yes. (I work mainly in 2D, so I tend to think in terms of sprites and tiles, not models.)

However, you can apply a similar technique even using a fully 3D engine...

One trick is to tag obstacles with a flag you can check at runtime -- "if (isObstacle == true)" sort of thing. This is a popular technique as models often have some form of metadata attached.

Alternatively, you could overlay invisible objects for collisions and other attributes (such as AI flags). For example, you could plonk some invisible cubes along the sides of the road and check if you've collided with them. Other cubes could be used to trigger a 'jump' sequence, or the track's start or finishing line. This has some advantages in modelling: if you don't want to go to the effort of creating a full trackside fence model, you can use textures to fake most of it and use the collision boxes to take care of the collisions.

A final technique is to build a 'collision' model which is used solely for collision tests. This doesn't need to be especially detailed as you're not going to render the thing; it only needs just enough information for the collision tests to look right.

I'm sure there are other options, such as working with splines or bounding box data, but those three are the ones I've seen most often. The first and second are probably the easiest to code, while the third is probably more artist-friendly.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!