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

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Eric Selim

Pages: [1]
1
General / Re: Best method for rendering non-tile-based areas?
« on: April 21, 2018, 03:15:52 am »
So what size are we talking about for one image?
It varies per level, one of them is around 20000x2000.

Don't forget that there's a limit on how large a single texture can be and for older GPUs the limit can be relatively low.
In that case, what's the recommended texture size I should divide it into so that my game can run on old GPUs? How would one go about deciding the pieces' resolution?

You can find out the texture size limit by calling sf::Texture::getMaximumSize and then subdividing your huge texture by that size and drawing it as huge tiles.

Though you should take a look at how levels can be made out of sprites without having a huge illustration.


Thanks for the videos and advice! Doesn't sf::Texture::getMaximumSize return the max texture size for your particular GPU, though? I'd like to support older GPUs as well.

2
General / Re: Best method for rendering non-tile-based areas?
« on: April 19, 2018, 12:17:42 am »
Thanks for the reply. I'm not sure what you mean by drawing each piece individually, though. Each stage has a single large picture that depicts the whole scene, it's not divided in pieces. That is, an area's whole level art is contained in a single image. That's why I was wondering if I should divide it into smaller parts or tiles.

If the levels are big you can determine the current view and calculate which pieces are inside the view and render those.
That sounds like what I proposed in the first method, unless I'm misreading?

My advice is to just pick the most straight forward solution you can think of and implement that. Don't try to prematurely optimize stuff that would never be a problem anyways.
It's easier to see the advantages and disadvantages of a design once you actually implemented it.
The second method sounds more straightforward to me, but I'm not sure how costly it would be for the program to have huge images loaded at once and drawing just small rectangle sections (the texture atlas) of it.

A thing to keep in mind is that currently, there's only one level image per stage, but I may add more depending on whether or not I end up using parallax scrolling.

3
General / Best method for rendering non-tile-based areas?
« on: April 18, 2018, 11:16:27 pm »
Hope I'm clear. English isn't my first language.

My sidescroller has a number of areas that aren't tile-based, but art-based. That is, the scene isn't formed by a bunch of tiles, but by a large illustration.

So I would like to know which of the following methods is superior performance wise:

1) Divide the level art into smaller squares, and load each one as a tile. That way, the game would treat it as if it was tile-based, even though each tile will be unique. The game would only draw the tiles that are within the camera view.

Or:

2) Load the whole level art into a texture, and create a rectangle texture atlas the size of the screen, that shows the area corresponding to the player's position. As the camera moves, I'll change the coordinates of the rectangle source so that the level art moves in sync with the player's movement.

Well? Which one would you recommend I went with?

If I wasn't clear enough, please say so and I'll elaborate.

Pages: [1]