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

Author Topic: BG & FG Level design ?  (Read 90 times)

0 Members and 1 Guest are viewing this topic.

digimikeh

  • Newbie
  • *
  • Posts: 5
    • View Profile
    • Email
BG & FG Level design ?
« on: July 12, 2020, 11:30:41 pm »
Hello!

I'm pretty new to 2d game development, i only worked on 3d and 2.5d views, but those are quite bit different since they are model based..

On 2d, how do you design your background and foreground's sprites for your level?...

1) Use big and long sprites as layers for all the level.
for instance,  a long 4096 x 256 texture that cover everything for your background, you put everything in that texture so do not need to repeat anything, the same for foreground alpha texture.  (This maybe absurd if the game is really long or need better bg details).


2) use single sprites repeating them on the whole level
reusing short textures like 128xx and 256xx as many copies over the level.  (To make game look good should be using many kinds of trees, rocks, plants and so....

3) any other?

Thanks..

Hapax

  • Hero Member
  • *****
  • Posts: 3001
  • My number of posts is shown in hexadecimal.
    • View Profile
Re: BG & FG Level design ?
« Reply #1 on: July 13, 2020, 11:40:01 pm »
Using "tile maps", one can use smaller pieces as "building blocks" for the bigger picture, repeating small parts where they need to be. This is very similar to the approach of "instancing" in 3D - you basically start with a few types and repeat them in different places.

A simple grid-based tile map could look something like this (as an example):

(source: https://www.sfml-dev.org/tutorials/2.5/graphics-vertex-array.php#example-tile-map )
You can see that in that example, there are only four different "tiles" (small images) and they are repeated where needed to make up the level.
Selba Ward - SFML drawables
Kairos - Timing Library
Rectangular Boundary Collision - Rectangular SAT Collision

@Hapaxiation - Hapaxia on Twitter

eishiya

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: BG & FG Level design ?
« Reply #2 on: July 17, 2020, 08:28:02 pm »
It's quite common for games to use a mix of large images and tiles. For example, a sidescroller game might use a large image for the sky and tiles for everything else, or there may be large drawn image layers for the terrain and tiles for the interactive elements.

Another option is to use a whole lot of freely positioned sprites rather than tiles. Examples of games using that approach are Blasphemous and Lunafon. Even among tile-based games, it's not uncommon to have freely positioned sprites for props.

Different approaches yield different looks, so if you look long enough, you'll find many different ways of doing it.

 

anything