Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / Sprites Limit

Author
Message
haliop
User Banned
Posted: 16th Jan 2009 15:13
is there a way to overpass the 256 sprites limit?

i'm Building a Tile System game..
including the obvious Tiles , i have about 150 of them only for maping , its a 2d game.

now if i want the game to be MP , i don't have a lot of Sprites left to use ... lets say
150 for map.
20 - 40 online players sprites..
20 - 40 online players shots sprite (using guns etc.. so i want to see the Shot from time to time..

150 + 80 = 230..

that gives me very little to add more stuff..

in my game ,you see your player from above 2d Top Down Shooter

so actually you see everyting the entire map and all of the players..

i think i'll need more then the 26 remmaings sprites ..
and idea? mybe i'm doing something wrong?
Lilith
16
Years of Service
User Offline
Joined: 12th Feb 2008
Location: Dallas, TX
Posted: 16th Jan 2009 20:34
Where did you get the 256 sprite limit? The documentation says

Quote: "You are able to have over sixty thousand sprites on the screen at any one time, but it is advisable to restrict yourself to a few hundred sprites for speed critical programs.
"


Lilith, Night Butterfly
I'm not a programmer but I play one in the office
haliop
User Banned
Posted: 16th Jan 2009 22:38
...
well i'm an idiot.

i think i missplaced the numbers and data.. damn Human memory..
ok ok , my bad..


ty/.
SushiBox
16
Years of Service
User Offline
Joined: 20th Sep 2008
Location: Ohio
Posted: 17th Jan 2009 08:16
Although, this does bring up a problem. There is no limit as Lilith pointed out, but speed issues after a few hundred? You may want to set visibility of your sprites off when they are too far out of view. That way your map is keeping the sprite count low.

I'm sure you already know this, but since I'm developing a 2D MMORPG also, gave me the idea :3 Figured id share it ha ha.

www.Helios-Online.net
Korx
15
Years of Service
User Offline
Joined: 22nd Jan 2009
Location:
Posted: 22nd Jan 2009 15:22
Maybe I'm forgetting something, but why using sprites that slow down everything when you could simply paste images on the screen?

Lilith
16
Years of Service
User Offline
Joined: 12th Feb 2008
Location: Dallas, TX
Posted: 22nd Jan 2009 15:49
Quote: "Maybe I'm forgetting something, but why using sprites that slow down everything when you could simply paste images on the screen?"


Have you tried it? You pretty much have to redraw the background for every frame. Then you have to deal with the position, angle, transparency issues of the image you're going to paste and other things that take up processing time. Essentially having a sprite with associated functions to do this for you saves the programmer a lot of hassle. Yes, there's some overhead for keeping track of everything and determining whether a sprite can be printed. If that doesn't work for you then, yes, use your own methods.

Lilith, Night Butterfly
I'm not a programmer but I play one in the office
SunDawg
19
Years of Service
User Offline
Joined: 21st Dec 2004
Location: Massachusetts
Posted: 22nd Jan 2009 21:30
I can personally attest that sprites are leaps and bounds faster than image operations. I had designed a GUI system with windows and form elements that drew directly, every frame, to the screen. Changed it to draw to sprites, and the program ran literally 5 times faster.


My site, for various stuff that I make.
Plystire
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 23rd Jan 2009 03:17
I use a combination of sprites and pasting images:

Pasting Sprites


You have the speed of the sprite (plus a bit faster from what Ive seen) and the flexibility of pasting. You don't have to worry about hiding the sprite when it's not in view, you simply don't paste it, which means skipping code and not extra code.

Pasting the sprite also means you're pasting whatever the sprite currently looks like, including it's offsets, diffusion, angle, transparency, etc.


The one and only,


Login to post a reply

Server time is: 2024-09-30 15:16:16
Your offset time is: 2024-09-30 15:16:16