As softener wrote Yes the game was written

Background. It so happened that my youth came at the onset of 3D games. Spectrum first saw Total Eclipse, I immediately began to consider the pinnacle of 3D technology. Soon came the IBM-compatible computers with known Wolfenstein and Doom. I was impressed. Having a flair for programming, I began to try to repeat them. It was the mid nineties, I was slow QuickBASIC, 5х86 comp and zero experience. Nothing came of it. Well, almost nothing.

image

These days. And in 2016 I thought, and now I have the experience, why not set yourself such a challenge? Namely softwary to write a rasterizer from scratch. Softwary here means that the image is constructed by forces of the CPU, without the video accelerator. Just like was done for those shooters of the nineties.

The task was set. I started with simple tests of performance: to fill the fixed memory color and display it. On the screen I deduced the function StretchDIBits, she has many peers and her work here just to send my buffer to the screen. And first tests showed that performance is bad. At 1920x1080, even a simple color and the mandrel on the screen already squandered fps to 200. I had to build the 3D and not the color fill, and textured polygons.

And I decided that the only option is the render without overdraw. It is necessary to explain that the majority of tips for writing your render comes down to the texturing of the polygon, and the polygons are encouraged to withdraw from the far to the near, one after another. I myself did so in the nineties, trying to replicate Doom.

This option was discarded for two reasons. First, if we have in the scene a few polygons one after the other, drawing from the far to the middle will give overdraw in other words, the pixel we are going to repaint a few times. Secondly, the rendering of polygons will cause frequent cache misses in the display buffer. Because the triangles are located arbitrarily.

Total, I decided to write a rasterizer as a linear cycle through the OSD buffer. In one pass, consistently. By organizing the polygons and textures in memory a most ingenious way I could. It is worth saying that the one-pass rasterizer among other things, parallelizes well, much better than polygon shading.

In the process of writing the engine, I arranged a festival, where I proposed to repeat the proposed stage on a conventional GPU engines. To my delight, sometimes software render, even advanced. Here.

image

It was inspiring and I decided to go further. Why not make the dream to the end and write down the shooter? That's right shooter from the nineties!

Thus, I began to choose the main points of the implementation. The first thing he thought about the type of monsters. In early shooters, this Wolf, Duma, Heretic with Hexanon — enemies were made in the form of 2D billboards. Late in shooters since Quake enemies have polygon, in full 3D. And the thing is, I 2D the enemies of Heretica and Hexene liked much more than enemies Quake. It was the charm in 2D depiction. Although 2D required a much longer work, because it was required to draw the enemy from all sides, I chose him. 2D Billboard, drawing.

Screenshot: Billboard 2D vs full 3D.

image

We also needed to decide how to create game levels. Games of those years typically had its own editor of vertices, but I decided to go anyway. I thought than writing your own 3D editor, it is easier to make the download models .obj. Because the editor is better, for example Blender, I probably would not be able to write. And I will say that this decision benefited the whole car, I haven't been short of game level absolutely. Model what you want regardless of what the Blender had ever done before.


As a result work on the project has brought a lot of joy. It's not a perfect game, in any case, you should know that. But while I was doing it — a ton of fun and positive, plus the fulfillment of a childhood dream to make your shooter the nineties.

The game itself I posted in the Steam, it turned out that I need the money. In fact, as always. If you wish, I will be glad of any support and feedback and criticism and just any kind words.

Play a shooter!

image
Article based on information from habrahabr.ru

Комментарии

Популярные сообщения из этого блога

ODBC Firebird, Postgresql, executing queries in Powershell

Installation LivestreetCMS on MODX Revolution package 10 clicks

The Ministry of communications wants to ban phones without GLONASS