![]() |
|
Capabilities of the Allegro 3D engine |
Escorter
Member #7,302
June 2006
|
After I have no success with BUILD (you can remember my misery with the input handling...), I decided to give Allegro's 3D engine a try. My goal is to make a System Shock 2-like game for DOS (with software rendering, of course). Is the Allegro 3D engine good enough for this duty? It has some very nice features not present in the most DOS based 3D engines, like true color texture support, but can it do: -basic lightmapping (not as good as in Quake, but something like in SS2), |
Krzysztof Kluczek
Member #4,191
January 2004
![]() |
Quote: I decided to give Allegro's 3D engine a try.
Since when Allegro has 3D engine? It just has some functions to draw textured polygons and doing some 3D math, but this doesn't make it 3D engine. Quote: It has some very nice features not present in the most DOS based 3D engines, like true color texture support, but can it do:
As I've said, it can just render polygons and do some math. What you render using them is completely up to you. Allegro doesn't directly provide any of features you mentioned. ________ |
Escorter
Member #7,302
June 2006
|
And is there any 3D engine which has these features and built upon Allegro? |
Krzysztof Kluczek
Member #4,191
January 2004
![]() |
I haven't heard of any, but you should search a bit to be sure. ________ |
miran
Member #2,407
June 2002
|
I think there was once a source port of Doom which uses Allegro's 3D routines for the software renderer module. It's probably still on the depot. I could be wrong though... -- |
Escorter
Member #7,302
June 2006
|
All of the DOS based Doom source ports built on Allegro (except the unfinished ZDoom DOS port). But the Doom engine is not good for me at all, because it's not 6DOF, it's a raycaster engine. |
Krzysztof Kluczek
Member #4,191
January 2004
![]() |
Quote: But the Doom engine is not good for me at all, because it's not 6DOF, it's a raycaster engine.
Doom isn't a raycaster. It just renders polygonal sectors. As for lack of 6 DOF, Build engine has exactly the same problem - up/down camera movement is just a fake. The same effect was added to Doom engine later (in Heretic or Hexen). ________ |
Escorter
Member #7,302
June 2006
|
OK, OK, but it still not good for me because the game world isn't full 3D. You can't make slopes, you can't make "sector over sector", you can't make curves, etc. If there's no 3D engines based on Allegro, I need to write one. But tell me: is it possible to make a Quake-like 3D engine with Allegro's low level stuff? I found a few 3D (?) FPS games in the allegro.cc collection, but all of them looked like Wolf3D. |
miran
Member #2,407
June 2002
|
Yes, it's possible. -- |
Steve++
Member #1,816
January 2002
|
It is very possible to do this. I started writing (and abandoned) an FPS engine years ago, using Allegro's 3D math and polygon routines. If you do it right, you can even plug in OpenGL or Direct3D routines at a later date. Good luck! |
HoHo
Member #4,534
April 2004
![]() |
It certainly is possible to use Allegro 3d routines to write a real 3d game. But I'm quite sure that Quake has about 10x faster polygon rasterizer so playing your game would need a lot of computing power. Could you tell in a few words why do you want to use Allegro 3d routines and not some real 3d API or even a full-blown engine? Is it just for fun/learning experience or something else? If it is a learning excersize then what are you trying to learn? __________ |
Escorter
Member #7,302
June 2006
|
Why I don't use some real 3D API? I said already: because I write my game for DOS. Don't ask me why not for windows/Linux/Mac/BeOS, etc. And what did you mean under "full-blown engine"? |
HoHo
Member #4,534
April 2004
![]() |
Quote: Don't ask me why not for windows/Linux/Mac/BeOS, etc. Too bad. I'll just say that for the most of the world (MS)Dos has been dead for over five years now and I personally see no point in developing games for it. If you have some fancy arcade machine then it is of cource a whole different story. Unless you have some really high-end CPU in that there is little chance you can get anything to run with decend quality on it by using Allegro routines. For a reference you could run allegro test program and do the 3d benchmark to get a rough idea how many polygons can your computer run. Then divide the number with expected framerate and number of passes (2 if you only use lightmapping). Here are results on 4GHz P4 runing at 800x600-32bpp in windowed mode under Linux X11: Memory profile results, using MMX: flat - 192476 gcol - 78375 grgb - 79050 atex - 92142 ptex - 43882 atex mask - 61163 ptex mask - 30742 atex lit - 57365 ptex lit - 36114 atex mask lit - 50197 ptex mask lit - 31243 ptex is the number that intrest you for drawing perspective-correct textured polygons. For lightmapping you will probably need to combine it with either lit or mask, I don't really know. Perhaps even you have to write your own rasterizing functions. Assuming 30FPS you can roughly render 1.5k polygons (triangles) per frame*. Using coloured lightmapping would leave about 500-750 plygons per frame or less**. Average very low-poly model has ~100-200 polygons, half of them visible. If you have several opponents on screen things will get even more "interesting". Now if you have a slower machine divide them by some certain number, e.g for 500MHz I would divide by something between 5-10. Now add other things that take CPU time (2d UI, sound, networking?, AI) and you get a pathetically low number *) Actually Allegro is not really polygon-limited but pixel-limited but since I have no idea how many pixels per second can Allegro rasterize I just go the easy way and assume that games have as big polygons as allegro test program **) Translucent stuff will eat pixels as there is no tomorrow, also I have no idea how complicated coloured lightmapping is. Most probably quite complicated. To get better understanding of how fast Allegro 3d is I suggest porting some nehe tutorials to Allegro 3d. I did it once and it requred only minor changes if I used the allegrogl port of the tutorial. IIRC I could render quake2 grunt with about 250 polygons, no lightmapping and about 1/3 screen coverage on 640x480@8bpp on 3.3GHz P4 around 100FPS. Quote: And what did you mean under "full-blown engine"? A real game engine, like build, quake or others. Also, there is mesa3d, a software implementation of OpenGL that should run in Dos __________ |
Escorter
Member #7,302
June 2006
|
I played around with that Mesa a few years ago. The only thing I can remember is that U can't compile it with DJGPP. Now I changed to Open Watcom, so I may try to compile it again. And tell me: is it possible to use Mesa and Allegro together (Mesa for 3D graphics, Allegro for 2D graphics, sound, input, etc.)? I know the Quake 1/2/3 engines are open sourced now, because they're my favorite 3D engines. But I don't want to use them, because I simply want to create my own game engine. |
HoHo
Member #4,534
April 2004
![]() |
Quote: The only thing I can remember is that U can't compile it with DJGPP
http://www.mesa3d.org/README.DJ Quote: And tell me: is it possible to use Mesa and Allegro together (Mesa for 3D graphics, Allegro for 2D graphics, sound, input, etc.)? I would assume it is. After all, Mesa is the same as OpenGL and you probably know AllegroGL __________ |
Krzysztof Kluczek
Member #4,191
January 2004
![]() |
Quote: It certainly is possible to use Allegro 3d routines to write a real 3d game. But I'm quite sure that Quake has about 10x faster polygon rasterizer so playing your game would need a lot of computing power.
Allegro polygon rasterizer isn't that bad. I once played with it a bit and without too much optimizations got playable framerates on 486 DX4 100MHz at low resolution (Quake 1 didn't do too much better on it). ________ |
Arthur Kalliokoski
Second in Command
February 2005
![]() |
I couldn't get Mesa to compile with DJGPP either. Two or three tries a few months apart. Open Watcom is good as long as you don't need more than Pentium II capabilities (although the wasm assembler knows recent stuff), gcc or MSVC mop the floor with Watcom. Using Allegro would probably be slower than optimizing exactly what you need for your game, say, 20%. OTOH, I was trying some 1997 texture mapping code from Chris Heckers web page a couple years ago, it was optimized for Pentium I, it ran 40% faster than Allegro texture mapping on a real Pentium I but 20% slower on an AMD K6-2, and the allegro stuff looked better too. They all watch too much MSNBC... they get ideas. |
Kitty Cat
Member #2,815
October 2002
![]() |
Quote: For a reference you could run allegro test program and do the 3d benchmark to get a rough idea how many polygons can your computer run. Then divide the number with expected framerate and number of passes (2 if you only use lightmapping). Actually lightmapping will be much worse than 2x the poly count. Not only do you have to draw the polys twice, the second pass requires multiply blending. And using Allegro's software blender is.. well.. That said, I'll go with Krzysztof Kluczek. I had a nice scene renderer displaying Doom 1 maps with full rotation capabilities using vertex lighting (and a skybox). My old 486SX/33 could run it decently at 320x240x8 (or even 320x240x32, though that got a little jumpy), and a P4 2GHz WinXP machine had no trouble going full speed (60 FPS capped) at 640x480x32. The most important thing to remember is to draw as few polys as possible. Since I didn't use a z-buffer I had to draw far-to-near, and although there was some overdraw, the map format really help me occlude unviewable sections from any given point on the map. -- |
Steve++
Member #1,816
January 2002
|
Quote: I was trying some 1997 texture mapping code from Chris Heckers web page a couple years ago, it was optimized for Pentium I, it ran 40% faster than Allegro texture mapping on a real Pentium I but 20% slower on an AMD K6-2, and the allegro stuff looked better too. That could have something to do with the 3DNow instructions. |
Escorter
Member #7,302
June 2006
|
Kitty Cat: did you used Mesa in your scene renderer, or you used the Allegro 3D stuff? And good news for me: I just downloaded the latest AllegroGL and I discovered that it has a full DOS Mesa support. |
Kitty Cat
Member #2,815
October 2002
![]() |
Quote: Kitty Cat: did you used Mesa in your scene renderer, or you used the Allegro 3D stuff? Allegro's 3D stuff. Though, I haven't used it in a long while. Any computer worth playing games on these days will have respectable OpenGL support, and you can do so much more with OpenGL than Allegro's 3D stuff. -- |
Escorter
Member #7,302
June 2006
|
Finally, I found an open sourced DOS 3D engine which compiles with DJGPP and Watcom, and fully Allegro compatible: the Panard Vision engine. |
|