800x600x16 bit iso game.. asking too much?

Started by
3 comments, last by Sphet 24 years, 6 months ago
Make sure you do not blit too many times from sysmem to videomem. ie: If you have to do 15 blit per frame and most of the surface are in sysmem then blit them on a offscreen surface residing in sysmem and blit this surface to videomem (backbuffer).

From videomem to videomem is fast. From sysmem to sysmem is fast. But when you cross over (from sys to video or vice-versa) it's slow.

Hope it help.

Gizz
gizz_01@hotmail.com

Advertisement
If you are not using smooth scrolling (very unlikely), you can check which tiles have changed from 2 frames ago and blit only them.

Then there's a solution I'm interested if anyone thinks possible or has made (works for smooth scrolling, too):
See how much the screen position has changed and blit that part of frontbuffer into backbuffer (into correct position) which should still be on the screen. Then blit changed borders into backbuffer.

Of course you'll have to blit those tiles that had characters, monsters etc. on them again to remove old frames.

------------------
"Tank, I need an exit. Fast!"

Its all video card. I have tested my 800x600 16bit game Zenfar on two systems one had a Vodoo Rush card, 200 MHz Pentium 64 MB. The other system had a Vodoo Banshee (16 MB) with a 166 MHz Pentium with 64 MBs of RAM.

The game run much faster on the 166 MHz system (about 22 FPS) but dog slow on the 200 MHz system (about 7-8 FPS). Of course I haven't fully optimized the code yet, and many of the above suggestions will help you and me out. But video memory really makes the difference, so I think a newer video card with your current 266 MHz system will get the job done. Of course you still need to optimize for the rest of the world.

------------------
Glen Martin
Dynamic Adventures Inc.
http://www.dynamicadventures.com

Glen Martin
Dynamic Adventures Inc.
Zenfar
Hello,

I have been fooling around with tile based games off and on for some time now, and have just started doing so 16 bpp code. Is it unrealistic to think I can do a tile based game at 800x600x16bpp on a Pentium 266 with a 4MB matrox millenium card? I am getting pretty rotten frame rate (10-15/s) when blting diretly from offscreen sysmem surface to backbuffer, then flipping. I am blitting 12 x 10 tiles per frame; refreshing the entire screen each frame.

I'm using C++, so there are a lot of GetSurface() sort of calls made for my image libraries, but I would have thought that wouldn't make a big deal..

Anyone have any ideas?

Anyone have any fast 16 bit samples?

One of the main reasons why your engine may be too slow is the sheer number of locks that may be required to render.

Every Blt or Bltfast locks the surface(s) involved (up to 2 lock/unlocks a call). Depending on the size of your tiles, these locks can stack up fast.

A quick and dirty way to handle this, is to lock the backbuffer only once, and use your own blitter. While using Blt/Bltfast you gain the ability to use the hardware blitting engine, the overhead means that isn't practical for a tile based game.

And as the other poster mentioned, you may want to try to use a "dirty rectangle" approach. By only drawing what needs to be drawn, you can maintain a fast framerate.

Ultima Online, which runs at up to 1024x768 in 16 bit color uses this method and it runs decently fast on even older machines (Ran fine on my old 133)

Your best bet, is to try a number of things, and see what provides the best average framerate, on a number of display cards.

This topic is closed to new replies.

Advertisement