A side scrolling engine using DirectX on a Pentium 133 would acheive about 32 fps with a first generation video card.
How to produce FAST 2D hi-res scrolling engine ?
Create an off screen surface that is two tiles taller and wider than your viewport. Blit the tiles into the off screen surface, then blit a sub section of that into your viewport. You could also create a blitter that clips and blit the tiles directly into your view port.
Hope this helps. There are lots of good articles in the programming section about tile based games. I've got a 32bit 640x480 tile engine that runs 150fps+ on a Pentium II.
So this engine that you made, was done with Direct-X API or not ?
It sounds pretty NICE
Just what I'm looking for...
You might want to look into the new Allegro extensions, which add hardware acceleration for some cards. I don't remember what it's called, but last I knew they had it implemented for some Matrox and ATI cards.
And keep in mind that you don't necessarily need 30 fps for this type of game. First Person games and Sidescroller games are two completely different animals.
Mostly the problem is that I don't know almost anything about optimizing programs. Actually I just saw pretty nice tutorial with something like 25 different ways to make small piece of blit() code better, but still I'm "newbie"
About assembly, are there any GOOD beginner tutorials for assembly ? I would like to know "basics" (if there is such a thing for assembly) ?
What do you mean that 30fps isn't reasonable for side scroller ? It needs to be smooth... In my opinion... STILL I'm wondering how the HELL did you manage to build same engine for 32bit WITH 640x480 ... and damn 120 fps
When I tried to build own engine, with 16bit, it was running with speed like 15fps with flickering car, and when it started to scroll, game dropped to under 10 frames.
So 32bit is actually two times more than 16bit... DARN, did you write whole thing with assembly ?
If you have any idea where to find this kind of "how to build FAST scroller" (for hi-res), I would like to know... Thats so freaking cool.. I mean 32bit 640x480 120fps
First, get your generic windows program running. Don't lock the game loop to any frame rate at all. I calculate a variable called DeltaTime which tells me how much time has passed since the last frame. Movement for objects is based on pixels per second / deltatime.
OK, on to the tile part. I'm using 64x64 tiles because I don't need lots of small items. Create a primary surface, attach a back buffer. Create BOTH in video memory! This is important. Load your tile bitmap in the video memory too. If your bitmaps don't fit in video memory, your blits won't be hardware accelerated and will be dog slow compared to ones in video memory.
With your tiles and back surface in video memory, blit your tiles onto the screen. Use a blit function that will clip them to your screen or viewport.
I've got a TNT card (not a TNT2) and everything runs great.
Hope this helps.
Marcus
Anyways, for my software version, I pull off almost 100FPS in 16bit mode. That's a fully tiled (only 1 level, no parallax) 640x480 scoller on a Mystique. It is a little tricky though (many optimizations, but no MMX yet), and if you don't know assembly it isn't likely you'll reach it. Also, for software drawing, the video card write speed is critical, so the FPS values can fluctuate quite a bit.
If you are fairly new, I'll just give you the age old advice of 'get something smaller and easier under your belt'. 2D scrollers are a good place to start, but to make it very fast requires some more experience.
Rock
I made this scroller engine already (allegro, djgpp), but I really didn't get enough speed out from it, and actually many people told that its not possible to get scroller with over 256 colors (hmm... I didn't believe this
Actually I'm not the head programmer of this project that I'm LEADING, but I have been trying to get some help, because we have been wondering so much about this big question: Are we going to need 3D-API to get this game fast enough ?
"My" programmer is working with Linux, and so he wouldn't like the idea that we use DX (he doesn't have windows next to linux), and I would like to have DX, so I have been just wondering that do we need API afterall, IF we can make scrolling fast enough with pure Allegro code (only software)... hmm... this has been pretty hard question. Actually if you people think that it's stupid to skip 3D-acceleration (mostly just for 2D purpose), let me know !
It's just that game will need two API's, DX and OPENGL (for Linux)... And how much is this extrawork ?