• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.

Archived

This topic is now archived and is closed to further replies.

Paladin

How to produce FAST 2D hi-res scrolling engine ?

13 posts in this topic

Ummmmmm...I think it's pretty hard to fuck up a 2D side scroller with DirectX as the API, unless there are too many overlays and alpha blending. DOOM and Quake are 3D games, not "scrolling" games.

A side scrolling engine using DirectX on a Pentium 133 would acheive about 32 fps with a first generation video card.

0

Share this post


Link to post
Share on other sites
Take a look at how many tiles you're blitting, how many layers you've got, and if you're alpha blending or not. Blit your base tiles with DX so you can get hardware acceleration. If you're not doing alpha, blit everything with DX.

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.

0

Share this post


Link to post
Share on other sites
Yes, there are, but mostly those are talking just about 320x200 resolution, AND if it's about 640x480, engine ISN'T made for "fast" use... I don't know why, but it seems to be that 640x480 "changes" scroller to strategy game or so...

So this engine that you made, was done with Direct-X API or not ?
It sounds pretty NICE
Just what I'm looking for...

0

Share this post


Link to post
Share on other sites
30 fps in 640x480x16 isn't an unreasonable goal. But you're going ot have to work for it

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.

0

Share this post


Link to post
Share on other sites
OK.

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

0

Share this post


Link to post
Share on other sites
OK, here's the basic run down on what I did:

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

0

Share this post


Link to post
Share on other sites
Hmm... so we can get some hi-speeds with hi-resolution when we are using DX... How about software ? What kind of FPS could I get without hardware acceleration ? And how about OPENGL API ? (mostly I'm just interested because of Linux port).
0

Share this post


Link to post
Share on other sites
I honestly don't know what kind of fps to expect without hardware acceleration. I'm fairly new to game programming and I don't have any OpenGL experience. If there is a graphics library for Linux that supports hardware acceleration (there should be one) then you'll be fine.

0

Share this post


Link to post
Share on other sites
I've got a 2D vertical scroller, and in 16bit color, with DX, it does about 130fps (with all the music, colliosion detection, ....). When using the hardware, you can generally get pretty close results between the different color depths, so going to 32bit color isn't too much of a hit. However, there really isn't much chance of pulling off a 32bit software scroller, and I'd say that greater than 16bit color for 2D is way overkill. Those colors are for 3D shading.

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

0

Share this post


Link to post
Share on other sites
Yes, I'm pretty "newbie", with about 1 1/2 year experience. I don't have experience with DX, but I'm trying to fix this at upcoming christmas (ah, my present; Lamothes new book .
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 ?

0

Share this post


Link to post
Share on other sites
There's no reason you need two API's to get hardware accelerated graphics, just use OpenGL. If you like the idea of only writing input routines once also, I'd suggest you use GLUT with OpenGL. It handles the OS-specifics for creating windows and you can also use it for keyboard and mouse input and timing. I can't recommend GLUT for commercial games or applications, but for games which are mainly for the experience and knowledge of the developers, I don't know why you'd want to spend your time working on multiple renderers and input routines instead of working on what's important: the game.
0

Share this post


Link to post
Share on other sites
Ok a few comments yes that speed is possible.
In software... Yes i think so though im not all that sure(almost all cards support accelerated blitting).

I have a tile engine using 64x64 tiles. I have a old vodoo rush hercules stingray with 6mb of memory(4mb in 2d). I get 75 fps in 640x480x16,800x600x16,and probally at 1024x786(dont know cant run the mode because i have my refresh rate for all modes locked to 75hz and 1024x786 doesnt support it).

I use directx and flipping (with vsync/wait)
I place both the back buffer and primary surface in vid mem(which only takes like 1.8mb video mem in 640x480x16). Right now all my tiles are in system memory(including some animation for a character).

As far as opengl goes ( i know it supports 2d)but i didnt think it was really made for or great for 2d?

0

Share this post


Link to post
Share on other sites
I had the exact same problem for awhile with my sidescroller, and I'm using DJGPP and Allegro too. My game runs at around 20 fps using entirely software in 640x480x16-bit, with 5 layers (it has parallax scrolling, and one of the layers can also be translucent.) This is on my PII-233 Mhz with a crappy old video card with 2MB of VRAM that doesn't have hardware acceleration support. To make it run this fast, I use RLE sprites (compiled sprites are a little bit faster, but then I can't use transparencies). 20 fps really isn't that bad - it's a little bit choppy, but not really that noticeable. It still plays perfectly fine. I'm pretty sure I could get a lot better with hardware acceleration though.
0

Share this post


Link to post
Share on other sites
Hi everyone !

I'm very new over here, but I think that I'm going to be using LOTS of time with you guys

I started designing my own game, which supposed to be very "hardcore" design:
Fast speed without 3D-acc.
Then I started to collect my team up, and right now game has been under design for about half year.

Originally we started to create 2D- tile engine & mapeditor, but then we got problem:
Game didn't look great, mostly because of the lack of resolution (320 x 200). We were thinking that we could make fast (30fps atleast) scrolling engine for 640x480 WITH 16bit colors, but it seems to be that we were "wron". After couple of months, without doing almost anything for project, we started to dream about getting 3D-acceleratioin for help:
Quake & friends are very fast "scrolling" games, and what we were thinking, because of 3D-acceleration.

First we were thinking about adding just OPENGL & Direct-X API to speed the graphics, but then we started to dream full
3D-world... and now... and noww.... I'm dreaming about going back to original idea:

Fast (30 fps) scrolling engine for 640x480 16bit colors.

IS THIS "IMPOSSIBLE" to create ?
Jazz Jack Rabbit 2 did use this resolution and colors (I think), and some other games, Doom ect. can actually draw graphics pretty fast to screen... How is the code optimized ? We have been using Allegro, and we were thinking that Allegro's code is already very fast, but we couldn't figure out how to get smoot 640x480 with rainbow colors...

I have asked this question from many places half year ago, and no one gave me answer... Maybe I have better luck this time

Thank You

0

Share this post


Link to post
Share on other sites