Jump to content
  • Advertisement
Sign in to follow this  
  • entries
  • comments
  • views

[4E4] Random-tiled Maps

Sign in to follow this  


Well, looks like my maps are working. Still need to write a map loader for them, though. I also found some other old tree sprites, so I threw them in there too.

There's a problem right now drawing the surfaces to the screen: its giving me a horrid framerate (~50 fps). I'm pretty sure I'm not converting the surfaces to the same format as the main screen surface, so SDL does it every pass. Which is a "NOES!"

Back to work.
Sign in to follow this  


Recommended Comments

I'm too lazy to convert them. Oh, and I rewrote the surface loading code; now it converts the surface format to the native format, and forces them into hardware memory. Rendering a map screen and 100+ objects gives me 70 fps. Sweeeet.

Share this comment

Link to comment
Is that 70fps capped at the vertical refresh rate, because I'd expect you could do alot better.

Are you using the built in alpha blending? Software alpha is really slow.

Share this comment

Link to comment
Looking pretty good Mushu. 2D games > *. This is not something that is open to discussion. [grin]

Share this comment

Link to comment
Jesse: no, its not capped (sadly). SDL uses RLE (Run-Length Encoding) to optimize alpha functions, and I enable it wherever possible. In all honesty, it would probably be just as slow to manually do alpha operations since I'd be doing them on system RAM too :(

SDL wasn't really made for speed, rather, portability and ease of use. That said, I'm not expecting to have 100+ units on screen very often simply because the gameplay focuses a lot more on strategy than mass numbers*. But yeah, my final product target is 30+fps on my low-end machine. Considering all the loss of speed is caused by the inefficency of the gfx API, I'm not too worried about it.

I'll run a profiler on the code if things get really bogged down by something or another. Yay optimization.

VertexNormal: Yase! [grin]

* uhh... except for zombies. Zombies pretty much just hoarde rush you + eat your brains + hoarde rush next guy...

Share this comment

Link to comment
Mushu, this is looking very nice. Really, I love it. Keep up the good work - I'd love to play your game someday [smile]

Share this comment

Link to comment
Emphasis on the someday. Turns out I had to rewritefuktor all my file handling classes because they were coded like crap.

Right now I'm procrastinating on writing a parser for the map loader. Ugh, I hate parsing. And I've got a tummy ache :(

Its only 20h00. I'll probably get it done tonight ish.

Share this comment

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!