Jump to content
  • Advertisement
Sign in to follow this  
Mike.Popoloski

3d sidescroller

This topic is 4872 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

What is the best way to do a 3d sidescroller? As in a 2d game, but using Opengl or Directx. Just have a list of tris and render them? What about collision detection? Does anyone have any good articles on this?

Share this post


Link to post
Share on other sites
Advertisement
Building the game on OpenGL or DirectX is a personal choise. Both are powerfull API's. I suggest DirectX because it has the .X format and it has a good exporter which can export the animation or static data from any package.

Share this post


Link to post
Share on other sites
Hi, I'm working in a 3d sidescroller myself. We're using DirectX, but OpenGL is fine, too. It's more of a personal choice.

To render the map, as it's mostly a linear map, we just divide it in sectors (all with the same width) and render the visible ones. Think of it as a quadtree, just in one dimension. As the camera's orientation is probably to be fixed, that also simplifies the culling algorithms.

For collisions with the map we use a separate "collisiom mesh", less detailed than the original map to test with. Collisions amongst entities are handled separately.

Hope it helps.

Share this post


Link to post
Share on other sites
Thanks. I wasnt really looking for whether I should choose DirectX or OpenGl, i just wanted to know the best way to handle something like this. Are there any articles written on the subject?

Share this post


Link to post
Share on other sites
Quote:
Original post by ussnewjersey4
Thanks. I wasnt really looking for whether I should choose DirectX or OpenGl, i just wanted to know the best way to handle something like this. Are there any articles written on the subject?


Everyone pretty much just makes quads, aligns them with the screen, and slaps a texture on them. Since your sprites are quads, you can do fun stuff with them like rotation. Even though you said you weren't looking for what API to use, I'm going to throw in my 2 cents anyway [smile]. DirectX has a prewritten thingy for you called ID3DXSprite that takes care of making the quads for your textures and aligning them with the screen and whatnot. I hear it's not too hard to make your own, however.

Share this post


Link to post
Share on other sites
But the thing is I dont want to have them aligned like a tiled game, because that would require alot more artwork. I would rather have it like Soldat. Ever play the game? Do you know how they do it?

Share this post


Link to post
Share on other sites
Quote:
Original post by ussnewjersey4
But the thing is I dont want to have them aligned like a tiled game, because that would require alot more artwork. I would rather have it like Soldat. Ever play the game? Do you know how they do it?


? Quads don't mean that you have your graphics stuck in a "grid" or anything, it simply means that you have a rectangle polygon parallel to the screen that you texture with your sprite image. You can move quads anywhere you want.

Share this post


Link to post
Share on other sites
Quote:
Original post by Sante

To render the map, as it's mostly a linear map, we just divide it in sectors (all with the same width) and render the visible ones. Think of it as a quadtree, just in one dimension. As the camera's orientation is probably to be fixed, that also simplifies the culling algorithms.

Could you go into a little detail on your maps? Do you create the sectors manually in your editor, or does your game partition them into sectors after loading? And did you roll your own map file format, or did you use an existing file format?

yckx

Share this post


Link to post
Share on other sites
ussnewjersey4

I looked into this before and there are a few options.
You may want to look at
-Toque 2D
-Program your own engine in DirectX. Using D3DX_Sprite.
-Same thing is available in OpenGL.


Haven't seen any tutorials on the exact subject, but drop me a line on AIM: MustEatYemen and I'll send over some code I've done on that subject (DirectX)

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!