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

Protricity

I have a BIG Problem...

7 posts in this topic

I''ve been programming for a few years and got good at simple 2D games, so I decided to take on a big game project, I made a Space Fighting game in 2D using nothing but lines and pixels, the graphics/physics are great, I love what it has become and so on.. The Problem is, I used a simple GDI interface for borland C++ that allows me to draw lines, pixels, squares, and circles. The Game draws around 5000 lines a second and requires a Pentium 800Mhz processor to run at full speed In other words, the GUI is waaaaayyy to slow in drawing the lines and pixels and I suspect it is using absolutely no Hardware accelleration. My game is nearly complete and looks great, but is way to laggy and slow on high end computers and is terrible on slower ones SO, I tried using DirectX and OpenGL''s interfaces to allow faster graphics drawing, but I cant find ANY documentation on how to draw lines and pixels. What I need is a simple interface that initializes a window/surface and allows me to draw on it with something like a simple line() or putpixel() command. It must use Hardware support or whatever to make these simple commands as fast as possible and then I''ll move my game over to this GDI and then it will really rock! If anyone can help me find such an GDI I would most appreciate it seeing that all my work would otherwise go to waste and every programmer knows HOW MUCH ThAT SUCKS!! If you could contact me on ICQ with a sugestion you will become my new best buddy!
0

Share this post


Link to post
Share on other sites
Well, I dont have ICQ so I suppose I am not going to be your best buddy, but OpenGL and DirectX both allow you to draw lines and points....

In D3D you use D3DPT_POINTLIST or D3DPT_LINELIST in the primitive type parameter of the call to drawprimitive. In OGL you call Begin with GL_LINES or GL_POINTS as a parameter.
0

Share this post


Link to post
Share on other sites
Thx for the reply!
I already figured that one out, but the line command requires 3 coordiates per point (X,Y,Z) and is being drawn in a 3D environment. My game is set up in 640x480 mode and uses commands like line(20,20,200,200) the OpenGL commands use the 1.0f stuff.
What I need is a Hardware based function that draws a line the old way - by pixels.
Again, thx for any sugesstions.
0

Share this post


Link to post
Share on other sites
Are you actually drawing straight onto a GDI surface? The fastest way to do drawing under windows is to create your own buffer, do ALL your drawing on this buffer, and when you want to send it to the screen, copy it over to a DIB, and have the BLT to the screen. This can be VERY fast.

Just a thought,
Andy
0

Share this post


Link to post
Share on other sites
Yeah, I was thinking about that,
but I was afraid it would be too slow.
What is the best way to make your own buffer and write on it?
Is there any documentation for this?
Guess I just need to go read all the OpenGL and DirectX docs, right

In general, for what I am trying, which is better? OpenGL or DirectX?
0

Share this post


Link to post
Share on other sites
If you use DirectDraw, you have to write your own line and pixel functions (not hard, you can just use one of the many algorithms out there). But it will be much faster that GDI. And, you definately need to use some sort of off-screen buffer. Drawing directly to the screen is absurd since you will be able to see the frame as it is drawn (which makes it look like it''s flickering). The best way to learn this stuff is from a book. You can try the documentation, but I''d recommend getting a book like Tricks of the Windows Game Programming Gurus. If you read that, you can make a nice fast-running professional quality game on your own. Remember your game isn''t a simple office application, so you need something a little more powerful. Especially since your using direct lines and pixels instead of bitmaps. But trust me, a book is a lot better than looking through documentation.
0

Share this post


Link to post
Share on other sites
For 2D graphics I''d suggest just writing your own line and pixel plotting functions and use simple DirectDraw surfaces to handle the double buffering.

This would allow you to write the functions to use the same interface as what you''re currently using. The main bottleneck is probably your use of the GDI. You might actually be able to achieve respectable results without using DirectX or OpenGL at all. If you create a memory buffer and write your own graphics functions to write to that buffer rather than using the GDI, you''d probably notice a hugh increase in speed.

There''s probably dozens of sources on the web that have line drawing algorithms (probably on this site if you look around a bit). Search for "Bresenham line drawing" in Google.
0

Share this post


Link to post
Share on other sites
Yeah, that would be exactly what I need, but on this site and others, I could never find good documentation on how to do any of that. I know how to make a line from pixels and such, but I cant find any interfaces that allow me to do such a simple thing. I recently found out that I could use OpenGL to draw a line using glVertex2f( x,y ); but I cant find any documentation on how to impliment that function or set up the perspective or anything. Guess I better just go buy some books and read them
0

Share this post


Link to post
Share on other sites