A Doom engine in about 2000 lines of C

Page 1/4
| 2 | 3 | 4

By ARTRAG

Enlighted (6367)

ARTRAG's picture

30-05-2017, 23:24

Anyone willing to compile it for msx?
http://bisqwit.iki.fi/jutut/kuvat/programming_examples/porta...

Here, the reason why this file is so interesting https://www.youtube.com/watch?v=HQYsFshbkYw
:D

Login or register to post comments

By santiontanon

Paladin (946)

santiontanon's picture

31-05-2017, 04:19

Ha! really cool! just glimpsing through the code I see lots of multiplications, divisions, and other floating point code. So, for whoever attempts this, I guess the first step would be to turn all the code into fixed point arithmetic Smile

By ARTRAG

Enlighted (6367)

ARTRAG's picture

31-05-2017, 09:57

I agree, getting something able to run in frames per second and not in seconds per frame is not trivial at all...
Nevertheless the video is inspiring and the code very concise for what you get
Look also at the qbasic examples (!!)

By Grauw

Ascended (9071)

Grauw's picture

31-05-2017, 12:49

http://msx.gnu-linux.net/doomlike/doomlike.html

Nice related article by David Heremans.

By Manuel

Ascended (16639)

Manuel's picture

31-05-2017, 13:26

ARTRAG: what does this have to offer over the engine/demo you created with Wouter? I think it's using mostly the same techniques, isn't it? https://sites.google.com/site/testmsx/msx2-doom/ is it, right...

By ARTRAG

Enlighted (6367)

ARTRAG's picture

31-05-2017, 17:35

They are different approaches, mine is equivalent to wolfenstain 3d, this other to duke nuken 3d

By Lord_Zett

Paladin (807)

Lord_Zett's picture

31-05-2017, 23:05

duke nukem 3d is nicer.

and dont try it to in basic

By hit9918

Prophet (2891)

hit9918's picture

01-06-2017, 07:16

I feel the best MSX 3D game would be with single color polygons
LMMV on 9990 is a magnitude faster than anything else
the lighting can be better than 486 texture game

things like this


or hard drivin

By Grauw

Ascended (9071)

Grauw's picture

01-06-2017, 09:30

I agree on the flat shading. But LMMV draws squares, not polygons. And issueing a single draw command takes 15 OUTs, V9990 sitting idle while doing so.

By ARTRAG

Enlighted (6367)

ARTRAG's picture

01-06-2017, 10:13

If you do not want textures, bisqwit's code allows you to compute directly vertexes and draw polygons. The raycasting technique (the one in wolfenstain 3d) would be more clumsy in this regard, as it scans all the view directions in any case, so plotting the screen column by column is more natural.
Naturally the rendering speed depends on how long you need to plot a generic polygon (usually a trapezoid) with respect to a set of single color columns (which in turn are vertical lines or boxes according to the angular resolution).
About the underlying math, it is hard to say, as bisqwit's code does less operations (dealing with the list of vertexes of the convex hull to be represented), but involving more math per vertex.
Raycasting instead, basically casts a ray per view direction, so it does simpler operations (using mainly integers) but repeated for each column.

By ARTRAG

Enlighted (6367)

ARTRAG's picture

01-06-2017, 11:33

Maybe, with few vertexes and black portals (no iterations outside the current convex hull) the bisqwit's code could work on msx...

Page 1/4
| 2 | 3 | 4