The Big 10 questions that could help alot of people, PLEASE READ!

Started by
13 comments, last by dave 20 years, 1 month ago
XML is getting hated on a lot here for its supposed inefficiency. It's worth noting that ZIP/etc. compression these days makes this argument more or less moot; but it is often still better to store data which is more "numeric" in nature (and consistent) in a binary format. XML is also friendlier (though still not particularly awesome) for manual editing, if it happens to be needed.

There are a lot of pages on the c2.com wiki about this. You should probably read them in order to get a balanced opinion.

[edited by - Zahlman on March 29, 2004 5:43:38 PM]
Advertisement
quote:
Original port by markr
Of course with the advent of huge discs, and most OSs now use a more efficient filesystem (but still has some slack space), the original motivation for using pack files is now mostly gone.


Not really, modern FSs actually allocate *more* per block than old style FSs (because we have larger discs), plus the fact that seek times are still a (major) limiting factor. A single large file that can be read sequentially still beats a bunch of little files. Of course the actual real world performance depends very much on your loading implementation, and the amount of wasted space for individual files is likely to be trivial compared to the size of a game install (perhaps 5-10MB out of 2GB).
quote:Original post by Zahlman
XML is getting hated on a lot here for its supposed inefficiency. It''s worth noting that ZIP/etc. compression these days makes this argument more or less moot...
No, it doesn''t. XML isn''t being "hated on" for its file size inefficiency, but rather for its runtime inefficiency. Parsing the entire tree takes time, and is virtually mandatory for even the most atomically minute XML operation.
quote:Original post by ace_lovegrove
1. Are most of todays latest levels created with mostly imported objects, or is alot of it done by manually describing the size of walls etc using an editor?

Some editors (Morrowind, Neverwinter Nights) use imported pieces of geometry for walls, buildings, etc. These are popular for games that have a wide variety of outdoor environments and are meant to be easily moddable but don't have a big speed requirement. Some editors (Quake, Unreal, Half-Life), generally for FPS's which want to be as fast as possible and mostly take place indoors in small rooms and corridors, use a system called BSP (Binary Space Partition) trees to store their level data for faster rendering; this generally requires that people shape the walls and rooms out of "brushes" in the game's editor so that it can be easily converted to BSP data. Random objects like lamps or statues are sometimes still imported objects.

quote:
3. When it comes to things like optimizing the engine to make things render from back to front, is it done by a bubble sort or something?

Not sure if this was just a typo, but you usually want to render front to back, not back to front. You should render all regular objects front to back (so that the engine can just skip rendering objects that are already occluded by something in the front), and then render all transparent objects back to front. It's good to keep opaque and transparent objects in two different lists to make this easier.

quote:
6. One topic thats troubling me in particular is when using a spotlight the light passes through objects, which looks stupid. How can i stop this without going through the process of stencil shadows, or is that the best way? Can i do that without the shadows?

If it's a static spotlight (doesn't move around), and a static object (like level geometry), you can do it with a lightmap (look for a tutorial). If it's a moving spotlight or a moving object, you need to do some kind of shadow algorithm (stencil or projection both have good points and bad points).

quote:
7. When i rotate an object with the world matrix, is there some sort of object axis(eseses) that moves with it? When i apply one matrix rotation, the others dont then change the object in the expected way.

If you haven't already, you should look up some tutorials on Scene Graphs. A scenegraph is basically a big tree structure starting with the root (world) node, and then branching out to other objects. So you could say, have a turret attached to a tank attached to a carrier ship attached to the world, and rotating or moving certain nodes will affect all other nodes logically. All modern engines use some type of scenegraph.

quote:
8. How much information about the game/level etc is it sensible to load from files? I noticed on the quake engine that each haracters movement was mapped out in a textfile.

There is a school of thought that says anything that you might possibly want to tweak as you're working on the game should be loaded from an external file so that you don't need to recompile the entire game every time you, for example, want to tweak a soldier's movement a little bit until you get it perfect. Also, if you want people to be able to mod your game, or even if you plan on having level developers working with you on making the game, the more things you allow modifiable outside of the source code itself, the better.

quote:
9. Does everyone use MFC or have you written your own classes specific to your needs?

As others have said, almost no one uses MFC unless they need the Windows GUI. Even then, you're probably better off using WTL or .NET. If you're talking about things like CString and CMap and that stuff, then you're better off using the Standard Template Library (aka the STL). There are a lot of good tutorials on that too.


[edited by - makeshiftwings on March 29, 2004 6:40:04 PM]
1) In Unreal Tournament 2004, there are two types of geometry that make up a level: brushes and static meshes.

Brushes are the basic primatives (rectangular prisms, cylinders, geodesic spheres, cones, etc) and are manipulated using the editor. Brushes can be either ''subtracted''(which creates empty space) or ''added''(which fills some of the space back up) to the world.

Static meshes are 3d models created in ''real'' 3d modelers like Maya, and can then be placed in the level using the editor. Inside the editor, they can be scaled and rotated, but not modified in any significant way. They are always ''added''.

Static meshes have the benefit that they are not used in any world calculations or processing except to test when they are visible. Because of this, they can be very high polygon and still require almost no power compared to brushes.

In the default levels included with the game, static meshes are used for everything from railings to light fixtures to elevators to fancy ramps and other decorations (like pipes).
"Walk not the trodden path, for it has borne it's burden." -John, Flying Monk

This topic is closed to new replies.

Advertisement