[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4688: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4690: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4691: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4692: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
Slick Forums • View topic - Will implementing VBO and such improve FPS for tile game?

Slick Forums

Discuss the Slick 2D Library
It is currently Tue May 26, 2020 7:40 pm

All times are UTC




Post new topic Reply to topic  [ 21 posts ]  Go to page 1, 2  Next
Author Message
PostPosted: Thu Mar 08, 2012 12:59 pm 
Offline

Joined: Mon Feb 13, 2012 6:31 pm
Posts: 40
I've read some articles on the forum that while slick is a great library it isn't optimized for displaying many small images. I didn't really care about FPS until it started dropping when I put lots of images in my game. And now I want to fix what is wrong before source code grows too big.

I've heard someone was using VBO in the forum and improved game speed by factor of 10. And was wondering. will implementing VBO or VA or other rendering method greatly enhances tile based game's FPS? The screen of my game is drawn with about 20x16 64x64pixcel tiles and there will be like total of 500-1000 images to show in a frame(excluding tiles). And how hard it is to change the rendering method to VBO? I've almost no knowledge of openGL programming..


Top
 Profile  
 
PostPosted: Thu Mar 08, 2012 1:47 pm 
Offline
Game Developer
User avatar

Joined: Thu Mar 03, 2011 6:22 pm
Posts: 534

_________________
Current Projects:


Projects:
- Build on top of Slick2D, Ideas, Bugs? Open an Issue ticket!


Top
 Profile  
 
PostPosted: Thu Mar 08, 2012 2:20 pm 
Offline

Joined: Mon Feb 13, 2012 6:31 pm
Posts: 40
Thanks for the advice :D Yes, I(m thinking of making several sprites sheets and put&sort all images into them as you suggested. But since it will be already some work and have to rewrite many codes, I was wondering if it's worth to use VBO or VA instead(which I heard very fast) or it's just a myth or exegerated they are 10x faster compared to slick's rendering method?


Top
 Profile  
 
PostPosted: Thu Mar 08, 2012 3:10 pm 
Offline
Regular
User avatar

Joined: Thu Mar 12, 2009 9:52 am
Posts: 142
Location: Portugal, Lisbon
Also abuse the usage of ImageBuffer condensing a set of overlayed images into one.

... 20*16 * 64,64 pixels thats 1280x1024 pixels... if its static dont even use tiles, make it one single image, if its built on several small images, use the image buffer to build one big image.

If something is outside the screen dont even issue the render order, no need to spend time doing stuff that isnt going to be shown.

Also use a ResourceManager to load stuff into memory BEFORE you enter the state (have a loading state), never do it in render or updates. It consumes a bit more of memory, but my game loads everything on start and has a memory footprint of 120 megabytes. I dont care, you have systems with 4gb+ so I really dont care about loading lost of images.

1000 images... I've used around 300 small images at the same time as a stress tests to my game and the frame rate dropped arounds 15% give or take.

Ill do a small stress test when I get Home so I can see the effect of 1000 small images being rendered, I'll get back to you then with more advice if I find any.


Top
 Profile  
 
PostPosted: Thu Mar 08, 2012 3:51 pm 
Offline
Slick Zombie

Joined: Sat Jan 27, 2007 7:10 pm
Posts: 1482


Last edited by davedes on Sun Mar 11, 2012 4:14 pm, edited 1 time in total.

Top
 Profile  
 
PostPosted: Thu Mar 08, 2012 4:01 pm 
Offline
Regular
User avatar

Joined: Thu Mar 12, 2009 9:52 am
Posts: 142
Location: Portugal, Lisbon


Top
 Profile  
 
PostPosted: Thu Mar 08, 2012 4:24 pm 
Offline
Slick Zombie

Joined: Sat Jan 27, 2007 7:10 pm
Posts: 1482


Top
 Profile  
 
PostPosted: Thu Mar 08, 2012 4:45 pm 
Offline
Regular
User avatar

Joined: Thu Mar 12, 2009 9:52 am
Posts: 142
Location: Portugal, Lisbon


Top
 Profile  
 
PostPosted: Thu Mar 08, 2012 5:38 pm 
Offline

Joined: Mon Feb 13, 2012 6:31 pm
Posts: 40
Thanks guys :D 1000 images in a frame, it was a bit exaggerating but the game do have lots of non-static images. And I tried to put them in sprite sheets but found out it isn't efficient as there will be like 1k+ different items/tiles/monsters scattered around the map and each has different image, some of the images are big too. So even if I made lots of sprite sheets, there will be a big chance next image will be loaded from different sprite sheet. I'm still looking for a solution.

@davedes
Thanks again. I actually googled and read that slick could use VERTEX_ARRAY_RENDERER before you reply, and it was your other post in this forum xD I had a good result with the new renderer, think it improved my FPS by 5-15%. Also, using your SpriteBatch class, I did some test showing 2000 same small image(32x32) in a frame. I got 800FPS using slick's image.draw(), and 2400FPS o.o using SpriteBatch. But when I test again by showing 2000 different images(ranging from 32x32 to 512x512), I got 50 FPS with slick.image() and 65 FPS with SpriteBatch. Is it expected?


Top
 Profile  
 
PostPosted: Thu Mar 08, 2012 7:53 pm 
Offline
Slick Zombie

Joined: Sat Jan 27, 2007 7:10 pm
Posts: 1482


Top
 Profile  
 
PostPosted: Fri Mar 09, 2012 8:43 am 
Offline
Game Developer
User avatar

Joined: Thu Mar 03, 2011 6:22 pm
Posts: 534
is it normal that your test gives me more fps with draw embedded o.o Because it does :D

Your classes are missing some references and you spritebatch misses a "flush" method^^ I guess it's the render method. And oh What dies StyledText?

Anyway, really cool stuff. For Sprite I use a texture atlas btw. I don't load any glyphs but use the bytes of the text checking them on acii and then rendering the stuff. The problem... My font renderer must be able to manipulate the vertex data between bind and unbind :( But with davedes ImageTransform this should be work better now (tho it already works fast as hell).

_________________
Current Projects:


Projects:
- Build on top of Slick2D, Ideas, Bugs? Open an Issue ticket!


Top
 Profile  
 
PostPosted: Fri Mar 09, 2012 8:46 am 
Offline

Joined: Mon Feb 13, 2012 6:31 pm
Posts: 40


Top
 Profile  
 
PostPosted: Fri Mar 09, 2012 4:59 pm 
Offline
Slick Zombie

Joined: Sat Jan 27, 2007 7:10 pm
Posts: 1482


Top
 Profile  
 
PostPosted: Fri Mar 09, 2012 7:59 pm 
Offline
Slick Zombie

Joined: Sat Jan 27, 2007 7:10 pm
Posts: 1482


Top
 Profile  
 
PostPosted: Fri Mar 09, 2012 11:56 pm 
Offline

Joined: Mon Feb 13, 2012 6:31 pm
Posts: 40
Thanks again for the advice,I'm going to try again to see if I can batch more images while learning about shaders. And good point on my tester, I'd hate to see it not working after making VBO render my game xD


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 21 posts ]  Go to page 1, 2  Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group