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

I need help with a side scroller beat em all

7 posts in this topic

Hi, I'm a newbie programmer who tries to make his own streets of rage / final fight like side scroller game.

As you know it, that kind of game has a pseudo 3D setting, with X and Y movement. So other than the X and Y variables that I use to move, I created a ground position hitbox (a rectangle), and an air position hitbox.

When you press the jump button, there is an initial velocity, a negative acceleration which is added to the jump velocity at each frame, and a condition that tells to land if the Y coordinate of the air position is lower than the Y coordinate of the ground position.

I hope I have been clear up to now...


Up to now, what I did successfully is running, jumping and walking in a limited area.

what I want to do next is to make my character jump between platforms like this:
[media]http://www.youtube.com/watch?feature=player_detailpage&v=tXtNmRmiYC8#t=55s[/media]

I tried many things, but every time when I did one aspect of the issue successfully, it turned out that I messed up another aspect.

do you have any idea how this can be solved? after this I think everything will be easier (putting aside the AI) Edited by tashaklikedi
0

Share this post


Link to post
Share on other sites
Can you describe the kind of problem you actually ran into? There are many ways that this can go wrong, but without knowing which issues you were specifically having, it's hard to know how to advise you :-)
0

Share this post


Link to post
Share on other sites
Sure!

I tried to make my character jump to a higher platform than the ground.

I created some rectangles to draw the map: some "ground" rectangles, in which you movement is allowed, and block rectangles, that block movement.

one of many approaches that I tried is that each ground rectangle has a int called "platform heigth". so if the value of our guy's ground Y position + the platform heigth is bigger than the Y value of the lower edge of the platform to reach, and smaller than it's Y value of the higher edge, the ground position would be equal to the air position. With this, the character was able to jump to the higher platform, but then he wouldn't jump anymore. And a weirder thing, at the lower end of the first platform if I jumped towards the lower end of the screen, the character will go through the allowed area, but only if I implement the function above.

another approach was to create another type of rectangle called "air". when the air position of the character was in that rectangle, he would be able to move in the air , and land once that he ran in a ground rectangle. Once again, he landed before he met that ground rectangle, and ended up in weird places.

I can't think of a simple and effective method to solve this problem...
0

Share this post


Link to post
Share on other sites
I did a game once that solved this problem similar to your method where you keep track of the reference ground point the player jumped from. I had to track this point anyway in order to plot a shadow sprite i.e. I moved the shadow and tracked the reference point even when the player was jumping and moving through the air.

In order to detect whether the player had jumped up and was to land on a higher platform I simply checked to see if the reference point had collided with a block that represented the ledge. If so, I moved the reference point up based on the height of that ledge, which can usually be calculated by interrogating the map data. This moved the shadow up too.

In order to jump off a ledge I'd do the opposite of course...looking for the first floor block down from thin air, but adjusting the Y position according to the width of the path I'd just jumped from. This would allow me to retain what I called the depth position - how far into the background the character was and prevented the character from just simply landing on top of a 2D block and ruining the illusion.

I should add that I rarely only need to calculate the depth in these circumstances so it wasn't 3D in the sense I wasn't tracking 3 co-ordinates. It wasn't isometric either, so we just used to refer to this as 2.5D which really meant most collision detection and movement was 2D and the depth was just figured out whenever it was needed for the sake of maintaining the illusion.

Most of the collision detection was based on the shadow actually. If the shadow came up against a wall, then I knew the player had too. I would only really detect collision on the player to look for cases where he was jumping and his head would hit a block or other special cases.
0

Share this post


Link to post
Share on other sites
Thank you for your replies.

[quote name='freakchild' timestamp='1338867566' post='4946289']
In order to detect whether the player had jumped up and was to land on a higher platform I simply checked to see if the reference point had collided with a block that represented the ledge. If so, I moved the reference point up based on the height of that ledge, which can usually be calculated by interrogating the map data. This moved the shadow up too.

In order to jump off a ledge I'd do the opposite of course...looking for the first floor block down from thin air, but adjusting the Y position according to the width of the path I'd just jumped from. This would allow me to retain what I called the depth position - how far into the background the character was and prevented the character from just simply landing on top of a 2D block and ruining the illusion.

[/quote]

My problem is that I can't even jump to another platform because my system doesnt allow me to do so. My character's ground position can not get out from the ground rectangles, and if he tries to jump off the ground rectangle, he can't because his ground position has to be in the rectangle. This works perfectly when on a single platform. But with mulitple platforms, I need additional rectangle types like the "air" type which says that your position is valid if your air position is in this rectangle. But that created very weird issues, like my character going out of the ground rectangle at unexpected positions.

I first tried to do it with the y axis: if my character's air position is inside the higher platform's limits, and if its value is lower than ground position + area heigth ,he would land to the higher platform, and then his ground position would be equal to his air position. With this, the character was able to jump to the roof, but then he wasn't able to jump at all because his air position was always smaller than the ground position + the area Heigth. I need to somehow offset the area heigth, but whatever I tried( I tried a lot of things, and it turned out to a spider web, since after a while I kind of stopped thinking and just tried random stuff) there was always a problem. I don't know if I can be clear enough since english is my third best language, so I'm sorry if this is hard to follow.
0

Share this post


Link to post
Share on other sites
I wonder why nobody ever makes actual 3D worlds for isometric side scrolling games.

It only makes sense to have a 3D representation if your world is 3D.

It also allows to use any image for floors and platforms and such, without the need to draw them with an orientation.
0

Share this post


Link to post
Share on other sites
I replied to a question like this, except he used Golden Axe as the reference [url="http://www.gamedev.net/topic/618396-implementing-a-2d-side-scrolling-perspective-like-in-golden-axestreets-of-rage/"]http://www.gamedev.net/topic/618396-implementing-a-2d-side-scrolling-perspective-like-in-golden-axestreets-of-rage/[/url]

I'd suggest you send a message to Sean_Seanston and see if he got it working, and what he did for it.

My reply was:

[left][background=rgb(250, 251, 252)][color=#282828][font=helvetica, arial, verdana, tahoma, sans-serif][size=3]
I haven't done anything like this before, but I would suggest adding a z component to your players and your tiles.
So, your player has an x (horizontal) y (vertical on the 2d plane), and z (height). You use x and y for just moving a player around with the joystick.

When a player is just walking on the lowest level (ie, not on the cliff), they are at z of 0. When they jump, you increase the Z value, which, for screen coordinates drawing purposes matches the screen's Y value.

Your tiles would also have a z component, where the "lowest" would have 0, and the cliffs might have a z of 60 (I just picked some number). Again, in screen coordinates, it'd match Y of 60. When a player tries to walk over that cliff, you could check he's feet's y coordinates against the tile, and if the tiles have a higher z, then thet cannot walk on it; however, if the player jumps towards the cliff, and you increase the z, you would check if z >= cliffs z (60), and if so, you stop him ther, and draw him on the cliff, with his feet's z of 60.

Just a thought on how I'd probably do it.[/size][/font][/color][/background][/left]
0

Share this post


Link to post
Share on other sites
thanks all.

Beernuts: actually I was doing pretty much what you suggested. My "air position rectangle" is similar to your z idea. The reason of the problem was in fact that I didn't track on what rectangle my character was. once I did it, it worked perfectly. Now my character can jump to the higher platform, and can jump back down from it. once I implement a function for falling down, it will be all done ^^
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