SDL Surface management
#1
Posted 21 March 2006 - 08:58 PM
Thanks!
Brent
#2
Posted 22 March 2006 - 12:00 AM
#3
Posted 22 March 2006 - 12:05 AM
#4
Posted 22 March 2006 - 12:33 AM
#5
Posted 22 March 2006 - 05:09 AM
I guess you could work with some image flipping or something.... but what I did was just say screw it, computers nowadays can handle it. After all, as long as you have loading/unloading optomizations for the rest of the game (loading levels and chunks of levels at different times so you don't take up all resourcable memory), you could really have as much memory as you want for the main player.
I mean if you think about it, 8 directions times 12 animations * 20 movements is about roughly 30 megs. But, that's like you said: a huge ass bitmap, so figuring in tiles that you're loading an unloading, you shouldn't breach 50.
the only other option would be to thread the loading and unloading of files. Like while you're character is doing one thing, load/unload another.
For example: if he was about to die, have the bitmap for dying load right before his death sequence... but then of course you'd have to worry about proper timing.
Gardon
#6
Posted 22 March 2006 - 05:11 AM
Gardon
#7
Posted 22 March 2006 - 11:09 AM
#8
Posted 22 March 2006 - 06:40 PM
#9
Posted 22 March 2006 - 07:43 PM
Jason
#10
Posted 22 March 2006 - 11:15 PM
Accessing a series of bitmaps that are sequential in memory is much faster than accessing stuff that's spread out randomly all around the memory, because of caching. Same holds for any kind of data.
#11
Posted 23 March 2006 - 02:19 AM
And experiment. Try loading your 100's of surfaces. See the lag it produces.
Try it.
Jason
#12
Posted 23 March 2006 - 02:21 AM
The gaming industry uses it, so it must be good.
And I'm only speaking from experience. It's nice knowing I have a bitmap for attack modes, running, walking, dying, etc. rather than managing 100's of surfaces
#13
Posted 23 March 2006 - 05:31 AM
gardon said:
If they're all in one big surface (as opposed to many small ones), they're pretty likely to be sequential...
#14
Posted 23 March 2006 - 05:45 AM
Reedbeta said:
Accessing a series of bitmaps that are sequential in memory is much faster than accessing stuff that's spread out randomly all around the memory, because of caching. Same holds for any kind of data.
then what were you referring to with this? Unless you were supporting my idea with another theory and question?
I don't understand what stance you're taking.
Jason
#15
Posted 23 March 2006 - 05:51 AM
#16
Posted 23 March 2006 - 07:17 AM
Anyway, this topic is dead. If you're doing a fighter-game like street-fighter/mortal-kombat then it shouldn't really matter, because you only have 2directions with different animations.
But big bitmaps are better anyway. I made a top-down RPG style game with 8 directions, 20 actions, and 12 animations per action (roughly). That's one friggen ton of memory for a 2D game, but it worked out, plus it's all nice and smooth XD
Jason
#17
Posted 23 March 2006 - 07:50 PM
"made a top-down RPG style game"
Could you post the exe on here? I'd love to see it!
Brent
#18
Posted 23 March 2006 - 09:33 PM
I'm not releasing anything just yet, I mean after all, wouldn't want anyone to steal my ideas.
But here's a screenshot if interested:
massive-war.com/Untitled.bmp
#19
Posted 23 March 2006 - 09:34 PM
#20
Posted 26 March 2006 - 01:29 AM
Brent
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users












