View previous topic :: View next topic |
Author |
Message |
Baker

Joined: 14 Mar 2006 Posts: 1538
|
Posted: Tue Jan 05, 2010 1:00 am Post subject: DarkPlaces as "Model Project/Engine" |
|
|
DarkPlaces does a number of things very "right" in ways that most other engines don't. I thought enumerating these would be good for anyone with any interest in engine modification.
1. The source code is provided in the download of the engine. (Opposite: See www.quaddicted.com/engines where maybe 1/3 of the engines have permanently lost or very difficult to locate source codes).
2. The engine comes with the necessary project files to build it: On Linux, on Windows in both MSVC6 and Visual C++ Express, OS X and I think even MinGW. The project does not require any "go find it" externalities to build. (FitzQuake 0.85 includes all the files you need as well and since the need for assembly language has been stripped out, there is no need to track down ml.exe or anything else).
3. The SVN has nearly infinite incremental versions, making it possible often to precisely define when a feature was added and thefore being able to compare the 2 versions to see how it was done for learning more about the engine.
4. Because DarkPlaces has long been multiplatform, DarkPlaces is a great and quick resource to determine the "right" platform-neutral way to code. Case in point, an old "load any pak" files tutorial by MrG was Windows specific in file handling which of course didn't work on OS X for me and since DarkPlaces generally has nearly every feature thinkable, I referred to DP's source code.
5. DarkPlaces can be used as a reference for best practices. Case in point, C code is particularly vulnerable to string buffer overflow ( http://en.wikipedia.org/wiki/Buffer_overflow ) and DarkPlaces is either generally immune to this or maybe completely immune do to the way strings are written, concatenated and such.
6. DarkPlaces does not require any external libraries to run except OpenGL. If libvorbis.dll or libpng.dll doesn't exist, the engine will run with those feature sets unavailable. The library access is also written in a multiplatform way and due to the way these are handled, updating libraries are not required to be compiled into the DarkPlaces executable maintaining independence from the project files. (Opposite: Currently, ProQuake and Qrack require libcurl to be present to run and if the library is not present the engine will not run.)
7. DarkPlaces "rewires" all the graphics API for multiplatform support to maintain a single code base. (Opposite: At the moment, ProQuake 4 for Windows and OS X have 6 different files that I have not yet taken the time to fully integrate, so OS X doesn't have video mode switching like the Windows version. Yet DarkPlaces has identical video mode switching on all platforms.)
8. DarkPlaces widely uses "static" and "const" to make it easy to identify what does and does not get touched externally and what can and cannot be changed.
9. DarkPlaces does not require any external non-Quake media (Opposite: JoeQuake, Qrack, ezQuake, and many past engines like Telejano and TomazQuake require external media not present in stock Quake).
10. But in fact, DarkPlaces does not require any media at all ... not even Quake pak0.pak to start (opposite: every engine except FTEQW). And in fact runs with virtually any missing media (missing a single model, DP runs and displays a multicolored triangle indicating where a model should be but cannot be displayed.)
There are other ways DarkPlaces handles things that is better than most engines but these are the ones that come to mind. |
|
Back to top |
|
 |
Teiman
Joined: 03 Jun 2007 Posts: 309
|
Posted: Fri Jan 08, 2010 4:28 pm Post subject: |
|
|
Probably you can make this list longer.
Something I like on DP, is how has remade some static buffer as dynamic buffer. This able a "infinite" number of entities, etc. and probably is better for ram useage.
About 10. Telejano can run withouth most external files. The latest version even has a builtin console graphic, to run withouth the gfx.wad file. Only.. the code has a bug, and shows klingon and not the right font. I tried to make Telejano follow a design (minirun) to work withouth any file. |
|
Back to top |
|
 |
Baker

Joined: 14 Mar 2006 Posts: 1538
|
Posted: Fri Jan 08, 2010 10:02 pm Post subject: |
|
|
Hello, Tei  |
|
Back to top |
|
 |
LordHavoc
Joined: 05 Nov 2004 Posts: 243 Location: western Oregon, USA
|
Posted: Sat Jan 09, 2010 4:17 am Post subject: |
|
|
Teiman wrote: | Probably you can make this list longer.
Something I like on DP, is how has remade some static buffer as dynamic buffer. This able a "infinite" number of entities, etc. and probably is better for ram useage.
About 10. Telejano can run withouth most external files. The latest version even has a builtin console graphic, to run withouth the gfx.wad file. Only.. the code has a bug, and shows klingon and not the right font. I tried to make Telejano follow a design (minirun) to work withouth any file. |
Memory usage is the reason I did the dynamic buffers, I could not justify lowering the limits but knew the memory usage in most mods was way too much (some versions of darkplaces needed over 500MB of memory).
There are still a lot of buffers I need to make dynamic, although I did add a special compile option (#define DP_SMALLMEMORY ) that can reduce memory usage to pretty low amounts, in current autobuilds the executable only reserves 6.5MB of ram to itself (global variables, code, etc) and allocates another 1.25MB with the "data missing" menu running, and I think I can reduce it further.
Yeah, darkplaces has a builtin console font, crosshairs, particle texture generator, and can mostly run without anything else - it only needs a progs.dat file and a bsp to load, all else is optional. |
|
Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2004 phpBB Group
|