It is currently Thu Dec 13, 2018 7:30 pm

All times are UTC + 1 hour




Post new topic Reply to topic  [ 8 posts ] 
Author Message
 Post subject: Grabbing sprites
PostPosted: Sun Jun 03, 2018 3:19 pm 
Offline
New User
New User

Joined: Sun Aug 27, 2017 12:38 pm
Posts: 7
Hello to all,
I noticed that grabbing many sprites (about 300), even if used only a part, the screen refresh slows down. How is it possible?

I have a medium power computer (core i7, HD4000) so I do not understand how it is possible ...

I used sprite as tile to draw the screen, is this approach correct?

Many thank's.


Top
 Profile  
Reply with quote  
 Post subject: Re: Grabbing sprites
PostPosted: Sun Jun 03, 2018 3:28 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Thu Apr 30, 2009 5:23 pm
Posts: 287
Location: Côtes d'Azur, France
It has nothing to do with your hardware, grabbing 300 sprites is probably the wrong way to go.

If you use these grabbings to create tiles, you probably should do it before the main loop of your game.
But it's hard to say without any code to know for sure what you are doing wrong...

_________________
There are 2 methods to program bugless.
But only the third works fine.

Win10, Pb x86 5.62


Top
 Profile  
Reply with quote  
 Post subject: Re: Grabbing sprites
PostPosted: Mon Jun 04, 2018 5:03 pm 
Offline
New User
New User

Joined: Sun Aug 27, 2017 12:38 pm
Posts: 7
Fig wrote:
It has nothing to do with your hardware, grabbing 300 sprites is probably the wrong way to go.

If you use these grabbings to create tiles, you probably should do it before the main loop of your game.
But it's hard to say without any code to know for sure what you are doing wrong...


Hello,
thank you very much for your reply.
Actually the grab is done outside the main loop, which is why I'm a bit confused.

My game is 3000 lines so it is a bit difficult to extract a piece of code to show the problem, but I will try asap ...


Top
 Profile  
Reply with quote  
 Post subject: Re: Grabbing sprites
PostPosted: Tue Jun 05, 2018 7:23 am 
Offline
Addict
Addict
User avatar

Joined: Thu Jun 24, 2004 8:51 am
Posts: 1447
Location: Germany
Small hint:
Don't call this" outside procedure" in the game loop ;-)

_________________
Belive!
<Wrapper>4PB, PB<game>, =QONK=, PetriDish, Movie2Image, PictureManager,...


Top
 Profile  
Reply with quote  
 Post subject: Re: Grabbing sprites
PostPosted: Sun Jun 10, 2018 9:09 am 
Offline
New User
New User

Joined: Sun Aug 27, 2017 12:38 pm
Posts: 7
IceSoft wrote:
Small hint:
Don't call this" outside procedure" in the game loop ;-)


No, I do not call that procedure from within the main loop, it's one of the first things I've checked.

However, I write a very basic example of my loop, grabbing 1000000 (one million) sprite and I have a rock solid 60fps. So, I'm doing something really wrong, that I can not find.

I think I have to start from scratch.


Top
 Profile  
Reply with quote  
 Post subject: Re: Grabbing sprites
PostPosted: Sun Jun 10, 2018 5:41 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Thu Apr 30, 2009 5:23 pm
Posts: 287
Location: Côtes d'Azur, France
At less you can conclude: grabbing sprites outside main loop is not the issue you are looking for...

_________________
There are 2 methods to program bugless.
But only the third works fine.

Win10, Pb x86 5.62


Top
 Profile  
Reply with quote  
 Post subject: Re: Grabbing sprites
PostPosted: Sun Jun 10, 2018 7:53 pm 
Offline
New User
New User

Joined: Sun Aug 27, 2017 12:38 pm
Posts: 7
Fig wrote:
At less you can conclude: grabbing sprites outside main loop is not the issue you are looking for...


The strange things is that more sprite I grab more slower is the refresh, then is somethings sprite related. Main loop is 500 lines, so I I have to work a lot to figure out the bug...... :)

Thanks guys


Top
 Profile  
Reply with quote  
 Post subject: Re: Grabbing sprites
PostPosted: Mon Jul 09, 2018 8:44 pm 
Offline
User
User
User avatar

Joined: Mon Feb 26, 2018 10:41 pm
Posts: 51
Location: Netherlands
Hey.

I think that your problem is not the program or the way you program. I think its more the memory you have. How big is it. If you have e.g. 4 GB With a 64 bits system. Then you program wil slow down at a point of amounts of sprite you use.

I have a example from Jamie who made 39000 cubes in a 3D world. And let it rotate. Building the cubes takes on his system like 25 seconds. and then every rotation move takes 1 sec. On my system the startup time takes 5 sec and the rotation of the cubes take a good 60 FPS. But his sytem is win 10 64 bits but 8 gb. My system is win 10 64 bits I.7 and 32 GB Actual using 28 GB the rest is in reserve????.

Anyway A second idea can be how big are the sprites. The bigger the sprite the more internal memery you need. Unles you make child sprites than the amount of memory is less.

An idea is, try turn of some parts of the program. And try to find the time the loop takes. Exclude differend parts en see what happend with the cycle time. A large main loop must not make the differend. Maybe there is a piece of the program that do something that takes up to many time.


Bart.

_________________
From my first self made computer till now I stil like computers.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 5 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

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye