Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Several questions for a top-down/platformer hybrid.  (Read 1873 times)

0 Members and 1 Guest are viewing this topic.

Dark One

  • Newbie
  • *
  • Posts: 2
    • View Profile
    • Email
Several questions for a top-down/platformer hybrid.
« on: April 19, 2019, 05:17:04 pm »
Greetings!

I am new to this forum, but not new to game development in general. It's not my first attempt at an SFML project, though it's my first serious attempt at a 2D game. I usually work with 3D game engines and currently I'm developing a project on id Tech 4, but I also want to work on something else alongside it.

To the point. The project is going to be a 2D exploration and survival game using procedurally generated top/down tilemap based levels for overworld and side-scrolling for combat and location exploration. I'm going to recycle some gameplay code from a text based roguelike I coded last year.

I wanted to ask about:
  • Collisions for both top-down and side-scrolling parts. Should I use Box2D to make it easier?
  • Is Box2D robust for 2d physics?
  • The side-scrolling part will allow player to destroy the terrain to some extent. I thought about the traditional split into destructible squares. What's the best way to implement this?
  • What's the best way to handle transitions between the views smoothly?

Arcade

  • Full Member
  • ***
  • Posts: 230
    • View Profile
Re: Several questions for a top-down/platformer hybrid.
« Reply #1 on: April 19, 2019, 07:46:24 pm »
Welcome to the forums  :). Though, in case you're not aware, the discussion on these forums tends to not be very geared toward general game design discussion. It's usually more focused towards discussing SFML itself. Like, how to use it, what are some good practices, etc. Specifically, you may have more luck asking about Box2D and how to implement destructible terrain elsewhere. I'll try to give some basic answers to some of your questions though.

1. It is hard to give an answer without knowing how complex your collisions and physics need to be. If you just need to check collisions between, say, the player and a wall, Box2D seems like overkill. SFML provides a basic way to see if one rectangle intersects with another. But, if you need your objects to do something like tumble through the air and collide in complex ways, then Box2D may be more appropriate.

2. I've never actually used it, but yes Box2D seems like a pretty popular choice when a game needs to incorporate advanced 2d physics.

3. Are you asking how to implement splitting your terrain into smaller squares, or if this is the best method to implement destructible terrain? I think splitting the terrain into smaller squares would be a fine start depending on your needs. You can then draw these squares with SFML's vertex arrays. Once you have something in place you can see what you do and don't like about it and then perhaps you'll have more specific questions you can come back with.

4. Can you be more specific with what you mean by "transitions" and "views" or provide an example of the effect your going for? If you mean you want to do something like a blur effect when switching between your top-down level and side-scrolling level, you could perhaps use a shader. I think there's an example of a pixelate shader that ships with the SFML sources. There was also someone on the forums recently that made a library that might help with what you want (though, I've never tried it).

Dark One

  • Newbie
  • *
  • Posts: 2
    • View Profile
    • Email
Re: Several questions for a top-down/platformer hybrid.
« Reply #2 on: April 20, 2019, 01:04:38 am »
Thank you for your response! It's hard to discuss specific code issues when the project is still a vague idea.

I want tile-map collision detection on top-down levels and make use of physics and more advanced collision in side-scrolling levels. I had troubles with tile-map collisions and vertex arrays in one of my earlier projects.

I also thought about using triangles for destructible terrain. Vertex arrays may prove useful for graphic representation of the terrain.

I meant transitions between the top-down and side-scrolling levels. A fade-out effect would suit my needs, or maybe a mix of pixelation and fade-out. I will definitely give shaders a try!

I'll use this thread later on for any implementation specific questions that I may have later on.

fallahn

  • Hero Member
  • *****
  • Posts: 507
  • Buns.
    • View Profile
    • Trederia
Re: Several questions for a top-down/platformer hybrid.
« Reply #3 on: April 20, 2019, 09:50:30 am »
For transitions you could try this segue library

https://github.com/TheMaverickProgrammer/Swoosh

 

anything