• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.
Sign in to follow this  
Followers 0
DmitryNik

Moving on surface

11 posts in this topic

Hello!

I can bet, there are a lot of questions about how to do it. But due to the lack of skills "how to google right" I cannot find anything which could be useful for beginners in games programming. I've created a terrain from the height map and now I would like to create some strange creatures(like me =) ), which are moving around the surface. How can I make them move on surface according to the heights(y -coordinate): if there is a kind of hill, then creature is about to move on that hill smoothly, not just through this hill. At this moment my camera can move easily through the hills and surely surface itself. So surface only looks solid. So, my question is, how can I make the terrain really(as much as it possible in games world) solid that all creatures are able to move along all curves, hills and will not be able to go through those hills? Is there any specific algorithms and theories? Is it only about collision detection with the surface?

Thank you for your answers beforehand. Edited by DmitryNik
0

Share this post


Link to post
Share on other sites
p.s. in Attachments could be found a figure that demonstrates, what did I mean=) Real surface is a bit more complicated.
[attachment=12427:justincase.png]
0

Share this post


Link to post
Share on other sites
If you don't need stuff jumping, flying, falling off cliffs etc., you could move your characters as if they are still moving on flat plane and just draw them to the height of the surface.
1

Share this post


Link to post
Share on other sites
[quote name='Stroppy Katamari' timestamp='1353674710' post='5003474']
If you don't need stuff jumping, flying, falling off cliffs etc., you could move your characters as if they are still moving on flat plane and just draw them to the height of the surface.
[/quote]

Thank you for your answer. So, as I understood, I only have to translate creatures according to y-coordinate, when it's moving? OK, I thought it would be more difficult, but it seems that the easiest way is the right one always. OK.
But what about flying and falling off the cliffs etc.?
0

Share this post


Link to post
Share on other sites
Maybe use D3DXIntersect() to determine the distance between the entity and the ground?

What it does is to take a Mesh and two vectors. It loops through the mesh (terrain) and checks if any of the triangles in the mesh collides with your vector. The results are in the out parameters.

Have your Entity position be the *pRayPos paramter, and the D3DXVECTOR3(0,-1,0) as the direction vector (straight down).

Or if you want to know the distance to translate your entity up and down. Use a distance from a plane much lower then the terrain and you can get the exact height of the terrain based on your entity planar position Edited by Tispe
0

Share this post


Link to post
Share on other sites
[quote name='DmitryNik' timestamp='1353677719' post='5003489']
But what about flying and falling off the cliffs etc.?
[/quote]What about them?

If you need stuff like that, some of it can be "faked" in simple ways (that are competely legit to use as long as their limitations aren't critical for your game). For instance, you could have a helicopter always fly at a certain height above the terrain, in which case it would be no harder to do technically than other characters; many AAA RTS games do just that. Similar technique would handle characters jumping, and it would look OK as long as the terrain doesn't have steep slopes. The more sophisticated behaviors you need, the more stuff you have to implement.

One easy thing you might want to do with the terrain is to scale characters' movement speed according to whether they are going uphill; without that, their movement will seem very unnatural near steeper slopes. If you detected a very steep slope, you could also put the character in a "falling" state and handle that differently than normal movement. But if you increase complexity with special cases like that, at some point it'll becomes too much to hold together and you start needing actual collision detection and/or physics engines.
1

Share this post


Link to post
Share on other sites
[quote name='Tispe' timestamp='1353678786' post='5003493']
Maybe use D3DXIntersect() to determine the distance between the entity and the ground?

What it does is to take a Mesh and two vectors. It loops through the mesh (terrain) and checks if any of the triangles in the mesh collides with your vector. The results are in the out parameters.

Have your Entity position be the *pRayPos paramter, and the D3DXVECTOR3(0,-1,0) as the direction vector (straight down).

Or if you want to know the distance to translate your entity up and down. Use a distance from a plane much lower then the terrain and you can get the exact height of the terrain based on your entity planar position
[/quote]

Will it a bit slow? For instance, if I take a simple height map 128x128, then in this case there are about 16384 vertices and let's say 5461 triangles. it will definitely take too much time for checking. Is there another way? Will be position tracking for each character a good idea? How it was done earlier? Edited by DmitryNik
0

Share this post


Link to post
Share on other sites
[quote name='Stroppy Katamari' timestamp='1353679415' post='5003498']
[quote name='DmitryNik' timestamp='1353677719' post='5003489']
But what about flying and falling off the cliffs etc.?
[/quote]What about them?

If you need stuff like that, some of it can be "faked" in simple ways (that are competely legit to use as long as their limitations aren't critical for your game). For instance, you could have a helicopter always fly at a certain height above the terrain, in which case it would be no harder to do technically than other characters; many AAA RTS games do just that. Similar technique would handle characters jumping, and it would look OK as long as the terrain doesn't have steep slopes. The more sophisticated behaviors you need, the more stuff you have to implement.

One easy thing you might want to do with the terrain is to scale characters' movement speed according to whether they are going uphill; without that, their movement will seem very unnatural near steeper slopes. If you detected a very steep slope, you could also put the character in a "falling" state and handle that differently than normal movement. But if you increase complexity with special cases like that, at some point it'll becomes too much to hold together and you start needing actual collision detection and/or physics engines.
[/quote]

That one is a good answer.Yeah, I thought of using collision detection. That's actually nice, if I have to implement my own physics engine. Only in this case I can learn at least something.
0

Share this post


Link to post
Share on other sites
Something like doing a swept ellipsoid collision detection/response might work:

[url="http://www.peroxide.dk/download/tutorials/tut10/pxdtut10.html"]http://www.peroxide....0/pxdtut10.html[/url]
[url="http://www.three14.demon.nl/sweptellipsoid/SweptEllipsoid.pdf"]http://www.three14.demon.nl/sweptellipsoid/SweptEllipsoid.pdf[/url]

Although an easier way would be to use an existing physics engine such as ODE, Bullet, or PhysX. Edited by shadowisadog
1

Share this post


Link to post
Share on other sites
[quote name='shadowisadog' timestamp='1353698746' post='5003565']
Something like doing a swept ellipsoid collision detection/response might work:

[url="http://www.peroxide.dk/download/tutorials/tut10/pxdtut10.html"]http://www.peroxide....0/pxdtut10.html[/url]
[url="http://www.three14.demon.nl/sweptellipsoid/SweptEllipsoid.pdf"]http://www.three14.d...ptEllipsoid.pdf[/url]

Although an easier way would be to use an existing physics engine such as ODE, Bullet, or PhysX.
[/quote]

Thank you for the links. Ready engines, in my opinion(I could be wrong), are not a good starting point, if I'd like to learn something. By making my own(buggy[img]http://public.gamedev.net//public/style_emoticons/default/rolleyes.gif[/img] ) engine, I'll learn things faster =)
0

Share this post


Link to post
Share on other sites
I view existing engines as an excellent starting point.

Technology progresses when we build off of the work of others. Constantly reinventing wheels can teach a lot, but in the terms of actually accomplishing greater things, what does it really do?

In a number of cases these engines are the products of years or even decades of work...

In the end the question must be what do you hope to accomplish? If it is to learn how to do collision detection and response then by all means implement it yourself, but if you wish to make games then using existing technology is a fantastic idea.

If nothing else in several years or with time why not contribute to an open source existing physics engine? That way you could advance the technology and not start from scratch.

Just my two cents. Edited by shadowisadog
0

Share this post


Link to post
Share on other sites
[quote name='shadowisadog' timestamp='1353707961' post='5003588']
I view existing engines as an excellent starting point.

Technology progresses when we build off of the work of others. Constantly reinventing wheels can teach a lot, but in the terms of actually accomplishing greater things, what does it really do?

In a number of cases these engines are the products of years or even decades of work...

In the end the question must be what do you hope to accomplish? If it is to learn how to do collision detection and response then by all means implement it yourself, but if you wish to make games then using existing technology is a fantastic idea.

If nothing else in several years or with time why not contribute to an open source existing physics engine? That way you could advance the technology and not start from scratch.

Just my two cents.
[/quote]

That is true too.
0

Share this post


Link to post
Share on other sites

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
Sign in to follow this  
Followers 0