• 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.

voodoo

Should I write my own blitters?

16 posts in this topic

You should go with using the directx blitters. The reason for this is that by using the dx blitters, dx will automatically take advantage of any hardware acceleration available.
0

Share this post


Link to post
Share on other sites
Yeah, but there are a quite a few reasons to write your own blitter:

If you are blitting a lot to system memory there you really can't take advantage of any hardware acceleration because there is none.

If you want to do alpha-blending, or if you want to do color conversion, you will really have to write your own blitter.

DirectDraw's Blit locks the surface before and unlocks after. So if you have a lot of blits you have that Lock/Unlock overhead

Also, it's not hard to write your own blitter.

- Splat

0

Share this post


Link to post
Share on other sites
Here we go again! hehe I asked the question to avoid getting mixed revues I think I will write my own blitters for a couple reasons...

1- I guess I will learn something.
2- I am in the process of making an alpha blitter so might as well continue it
3- I guess eventually, I will have les problems porting.

Anyways, Splat i will continue writting my own blitter maybe you can help me optimize it later on!

0

Share this post


Link to post
Share on other sites
I agree on writting your own blitter for some things. But in general i would mostly use directdraw's. Because can you do all the work for things like mmx,videomemory,acceleration,ect? For alpha ya your gonna have to write your own or use d3d. Do the locks unlocks hurt real bad.. I cant say for sure but on my 4mb card in 800x600 and no bitmaps other than the screen and backbuffer in videomemory. I get 75+ fps(max of my refresh) drawing 32x32 tiles to fill the screen(each using directdraws blt)


Anyways i suggest you leave ddraw blitting as a option (after all if they have 32mb of memory and you can fit all your images in vram.......)

0

Share this post


Link to post
Share on other sites
voodoo: I would be glad to help you out once you've got some prototype blitter code working. If you haven't already, you might want to check out the MMX Enhanced Alpha-Blending article up on this site somewhere...

I agree that it would be stupid to forget the DirectDraw blitter, since those video memory -> video memory blits are just SO nice. Having a full-featured self-written software blitter, a damn-fast bare-bones DirectDraw software blitter, and a super-fast video-video mem hardware blitter gives you quite an arsenal when it comes to speeding up your game once you run into graphic bottlenecks.

- Splat

0

Share this post


Link to post
Share on other sites
Guys, I spoke to one of the best game programmers out there, Andre Lamothe, for those who don't know him. He is the author of Windows Game Programming for Dummmies, Tricks of the Windows Game Programming Gurus and the old Dos versions...

And I quote:
"you can't beat the speed of hardware period. Use the blitter."

So bassicly I will use the DX blitters for basic blitting, but for doing alpha, and additive blending I will have to go and write my own stuff.

0

Share this post


Link to post
Share on other sites

Yep, its virtually impossible to blit in software faster than the hardware blitter can do it. I don't have any benchs of the performance difference though.

My project game is written purely with software draws to a system-memory buffer, which is blitted to the screen. This allows for very exchangable software drawing routines. (Have a draw pointer that can be set for normal, alpha, add, or whatever drawing style you wish)

Still, if you're going to be > 640x480 res, or doing alot of overdraw, hardware blit is a good idea, even if it makes you unportable.

-- Remnant

0

Share this post


Link to post
Share on other sites
Really, it depends on your game, but I feel in general it is better to write your own. Yes you lose the hardware capabilities, but many times you can do it better, and nearly as fast.

Depending on your game, you can avoid tons of locks/unlocks if you do it yourself. Also, since you know what format the data will be in, your blitter can be very specialized and fast.

If you only have a couple of blits per frame to do, then go ahead and use the ddraw blitter, but if you have more than 10 or so, I'd start to consider writing your own.

0

Share this post


Link to post
Share on other sites
any cards made in about the last 6 years have hardware acceleration (though maybe not to the same degree).

however, no cards have support for advanced blitting functions such as alpha blending, add-blending, etc etc, which is why we're all making our own.

-- Remnant

0

Share this post


Link to post
Share on other sites
It must be taking Microsoft a little longer then expected to find someone to buy thier alpha blending code off them. (then take all the credit for developing it)
0

Share this post


Link to post
Share on other sites
When you writting a game it can be very usefull to anticipate different hardware configurations, and take advantage of each.

Stuff to remember:
-Some AGP cards can hardware blit to and from system and video memmory very very fast, some actually use system ram as video ram (watch your system ram drop by up to 16Megs). Example Intel's I740 very nice graphics card.
-Some PCI cards support DMA blitting to and from system ram but to take advantage of hardware acceleration lock the surface, some cards can get around this.
-As far as I know no ISA card supports hardware blitting with system ram.

Soluttion:
Write 3 update/blitting routines
1. Takes advantage of AGP cards that support system to video ram blits.
2. Takes advantage of DMA blitting if the lock call is not required use the 1st routine.
3. Write your own blitting routine in ASM for system to video ram blits as that will be faster then Direct X software blits.

If anyone wants more details on how to check for these features contact me on
phillip.stiby@u.genie.co.uk

Stibbs - Multimedia Expert

0

Share this post


Link to post
Share on other sites
I am making a 16bit game engine and I have read articles here and there and say that it is better to write your own blitter routines cause the DX blit routines are to slow. So should I continue writting my own blit routines or should I use the DX BLT. The only advantage I c to writting my own bltters is for portability.
0

Share this post


Link to post
Share on other sites