SFML community forums

Help => Graphics => Topic started by: Autocrator on October 05, 2013, 08:19:52 pm

Title: What is the maximum possible resolution?
Post by: Autocrator on October 05, 2013, 08:19:52 pm
Hey there guys,

we're making an MMO-RTS game and we stumbled upon a problem, whenever we're trying to load inside our engine a sprite that is larger than (approximately) 7972x7972 (which is the terrain of our game) the game doesn't even start.

Is there a maximum allowance on how large the resolution can be? Because right now I have around 800 png files of 7972x7972 resolution that are the whole map of the game and you can load them (one by one) just fine... and I am just asking if it is possible to go even larger.

Thanks for your time
Autocrator
Title: Re: What is the maximum possible resolution?
Post by: Stauricus on October 05, 2013, 08:44:00 pm
no, something is not right. firstly, why do you need 800 textures larger than 7972x7972? i've never seen anyone use a single texture larger than 2048x2048, and that's for main character from the newer 3D games.  also, it's better to use textures in a power of two (16x16, 32x32, 64x64, 128x128, 256x256, 512x512, 1024x1024, etc.)
if you really need all those textures, you'll probably have to break it down and load-unload them on the run.

does the game freezes? or does it return an error?
debug it, and search for where it stops: if it's loading the texture, if it's displaying the sprite, etc..
Title: Re: What is the maximum possible resolution?
Post by: Laurent on October 05, 2013, 08:48:06 pm
Check sf::Texture::getMaximumSize (depends on each graphics card, so don't rely on the value you get on your PC).
Title: Re: What is the maximum possible resolution?
Post by: Autocrator on October 05, 2013, 09:13:04 pm
Thx for your time guys, so after the getMaximumSize, I get around 16k, I suppose it's both for width x height? right?

The game is 2D Isometric and the 800 pngs are the terrain in the background which will be set in a tile formation of 40x20, (it's the map of europe+asia) with transparency

The game doesn't freeze nor do I get any errors, it just doesn't load. In the debugging it stops when it is loading the texture!

Title: Re: What is the maximum possible resolution?
Post by: Ixrec on October 05, 2013, 09:33:23 pm
Yes, it's for both width and height.

FYI, the lowest max texture size people might still have these days is 512x512, so if you want maximum compatibility that's the size to cut things into (though you can always check the max size at runtime and do things differently).
Title: Re: What is the maximum possible resolution?
Post by: Kojay on October 06, 2013, 01:47:56 am
Assuming this is the issue, Thor library offers BigSprite and BigTexture (http://www.bromeon.ch/libraries/thor/v2.0/doc/group___graphics.html) classes.