News/Home
Evochron
Arvoch
Forums
Others
About
Contact
Add to favorites
|
StarWraith 3D Games - Game Development Articles Section
Optimizing the Graphics Engine for Performance
A developer like myself enjoys adding as much visual content as possible. If I had my way, there would be many thousands of polygons for each model, huge textures, and much more complicated environment graphics. Unfortunately, a game is forced to contend with less then optimal system configurations and inherent performance restrictions that limit what is possible. So to create the desired effects, alternative methods need to be used. This article will provide details on several ways a graphics engine can be optimized for better performance. While much of this article focuses on game development in DarkBasic, the concepts are useful for any development tool you are using to write a 3D game.
The first goal to establish is what your target audience will be using to play your game. If the majority of the players interested in your game are going to have the latest 3D video cards, screaming fast CPU's, and lots of system memory, then performance won't be such a major concern and you can use more performance eating graphics effects. But if most of the players interested in your game will be using average systems that might be a couple years old, then you'll need to consider performance a priority in your game's design. If you intend to market and sell your game, then it's very important that your game run well and look good on as many systems as possible the very first time a player tries it. Otherwise, most will simply uninstall it and try something else. In the digital delivery game market, many players won't go to the trouble to download new drivers or perform other updates if something doesn't work. Remember, they are downloading your game to begin with, they didn't stand in line at a store waiting to obtain your game. They want to try it and try it now. So the first priority is to make sure your game is broadly compatible, working well and looking good on the widest range of system configurations as possible.
Once you have a general idea of the range of systems you intend to support, you'll then need to test your game engine to determine if any compromises or different methods of doing certain effects need to be done. One of the most effective ways to improve performance is reducing polygons. You can do this by decreasing the total polygons in each of the models used in your game and/or switch between various levels of polygon detail based on distance from the player's viewpoint. A loss in polygon detail can usually be made up for by increasing texture detail. For example, if you have groove in your model that isn't a focus of it's design or used for any purpose, you can make that groove in the object's texture and remove the polygons it used. You can then switch between the complete higher polygon mesh and the textured version as the object gets closer or farther away from the player's position. You can also hide objects that are out of view or far off in the distance. For my DarkBasic projects, I use an array to keep track of the visual status of each object based on distance. I can scale the value as the object gets closer or farther away, then apply the appropriate mesh based on the value. The object can also be hidden when the object reaches a certain distance.
Another important aspect to consider are any performance obstacles in the development tool you are using. DarkBasic has several coding routines to avoid. Don't scale object limbs frequently during each program loop. Try to limit limb scaling to just a few. Don't rotate object limbs at all, better to create a separate object and rotate it.
Aside from text, render as much as possible in 3D. Try to reduce the need for using 2D and render everything you can in 3D (better to use a textured limb for a flashing warning light rather than a 2D box).
When possible minimize objects, maximize limbs. Although limbs aren't very useful for rotating or scaling, they can help performance when used for fixed positions and orientations. Better to have one object with 20 limbs rather than 20 separate objects. For example, the Heads-Up-Display in Evochron is one object with over 3 dozen limbs.
Make sure to only render the visible surfaces of all objects. Otherwise, you may be doubling the polygon load your engine has to render for just ONE object. This seems to be overlooked quite a bit.
Lastly, even if the framerate drops, smooth and consistent gameplay can still be achieved by using time based movement and rotation. All of your object movement and rotation should be based on a timer rather than a fixed value per frame. I will be covering this concept in detail in a future article.
___________________________________
Copyright © 1999-2005 StarWraith 3D Games LLC. All Rights Reserved.
All trademarks are the property of their respective companies
Alternate route: spacecombat.htm
Alternate route: spacecombat.org
Alternate route: evochron.com
|
|