Advertisement

Tiling in DX7

Started by January 27, 2001 09:54 AM
1 comment, last by Kotumo 24 years ago
Hi. I''m working on a tilebased game in DirectX. It''s my first go at it so I need some help. As of now, I''m using 64*64 tiles (only one layer), and all of the tiles is in one BMPimage. The image is loaded into a DXsurface. I also have an array of indexes that tell where each tile should go in the worldmap. I blit from the imagesurface to the backsurface about 70 times pr frame (I''m using 640x480x32 as of now) and you should think this ought to go pretty fast, but it''s not... I''m programming on a PIII 550 with a GeForce 256 gfxcard. What am I overlooking? Also, this engine will be used in a car-racing-game-type-thing and I was wondering how to move the car forward. My first thought was to have a variable containing the speed and move the car forward by that many pixels (or rather the level backwards), but is it possible to make the car go faster and still only move the car one or two pixels at the time? My original thought would make the car move rather "jumpy", right? I know you might need some more info from me to answer these questions, but since I''m totally green it''d be better if you asked me. Sincerely, Jarle Holtan
I prefer loading a template to a surface instead of putting each tile on a surface. Also you just want to blt the tiles that are seen on the screen or else blting everything will be slow. About the race car yes making it move alot of pixels will make it look jumpy. The only thing I could recommend is to find a velocity that isnt to jumpy.
Advertisement
Well, depending upon your card blts behavior, it might be better to batch the blits into 1 large blt to the backbuffer, after you have composited the many smaller blts into a system memory surface. Some cards locks the destination surface on a blt call to the back/primary surface ( though this might have been just DX). These locks could add up to a big performance hit. Or you could try placing your sprites in video mem, that might get some performance increase.

If your framerate is over 15fps, the cars motion will appear smooth enough, as long as your motion is time based, not frame based. Otherwise you will be suseptiable jerkyness due to frame rate abberations due to such things as file access or allocating large amount of new memory ( the stutter that some games display when the systems burp).

Good Luck

-ddn

This topic is closed to new replies.

Advertisement