• 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
white_waluigi

2d Physics

7 posts in this topic

i started to make a 2d game a while ago and i encountered a lot of Problem with movment and gravitation.

I managed to make sure, that stuff can't get through walls (Line-Collision System, with the Separating axis T.) But after that the Problems started and i desparating right now. first i had the Problem with tzhe Gravitation, that when you stand on a inclined line and Gravity is on, the Player slowly slides of the surfaces. also  if you move on an inclined line you are slower than you were on even surface. next Problem is, that if you move in the opposite direction of an inclined line, you just fly in the air for a brief second. There are a lot of other Problems but i don't wanna list them all here.

 

Does someone have a few links for me?

0

Share this post


Link to post
Share on other sites

OK, now I've looked through that stuff and it didn't really solve my Problem.

Maybe i should have mentioned that i wasn't searching for real physics like stuff rotating and rag-dolls and such, just Physics like in Super Mario for example (I know it says a lot, if i can't even get that right) just instead of simple Block-Worlds Worlds that are Physical build out of Simple Lines.

But the Problems are still with Gravitation.

Does maybe someone have some Tips or an OpenS Game to check how they solved it?

0

Share this post


Link to post
Share on other sites

You might be better off implementing this yourself if you are looking for simple physics with no advanced features and existing tools are too hard to integrate in your game. Though for that you'll need at least some working knowledge about Newtonian mechanics (just translation, since you said you don't need rotation). Can you describe why someone standing on a frictionless slope will slowly slide down due to gravity?


For your first problem, if you want to prevent the player from sliding off a slope, you need to add friction. As I said, you would slide down a slope in real life if it were frictionless (think an icy slope). The most basic implementation is simply as follows (this is called static friction, there are other types of friction):

 

1. calculate the force the player exerts to move, call if F

2. calculate the force exerted by the player on the surface on which he is standing (gravity), call it N

3. if F > N * c, move the player, else, don't move the player, where c is some constant between 0 and 1 (called the friction coefficient)

 

This way, if a player simply stands on a slope, he won't move. And if he wants to move, he will be able to.

 

For your second problem, this isn't really a problem per se. If you walked straight off a slope in real life, you would fall and tumble as well. But what we do in real life is we follow the slope, that is, we incline ourselves so that we don't walk off the slope horizontally, but instead move diagonally along the slope. To do this, you can look at what the player is currently standing on, calculate the gradient at that position, and make the player move according to that gradient. This will make him "slide" down the slope nicely instead of moving in a staircase pattern.

0

Share this post


Link to post
Share on other sites

k, didn't think i'd have to go so far for a 2d game, but ok, thanks. So ill have to implement a system, that gets the surface(s) the player is standing on.

0

Share this post


Link to post
Share on other sites

k, didn't think i'd have to go so far for a 2d game, but ok, thanks. So ill have to implement a system, that gets the surface(s) the player is standing on.

 

Well there are always ways to fake it. But if you want to make sure everything works as planned, it's best to have some code that can handle anything you throw at it (within the limits of your game). Otherwise you'll be piling hack on hack, adding one special case after another, and it gets ugly really quickly.

0

Share this post


Link to post
Share on other sites

Otherwise you'll be piling hack on hack, adding one special case after another, and it gets ugly really quickly.

yeah been there already. Lost a lot of time. Now i wanna do it right.

 

So what do you think of that:

 

-a friction System like the one from Bacterius

-When a collision gets solved, that collision gets stored in the Units collision List. If the collsion was not too steep, the Player is allowed to jump.

 

I just wanna ask before i loose more time.

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