📜 ⬆️ ⬇️

I give the code of the game for programmers and clone Habr

I lay out the source code without any conditions, but make no mistake, it is difficult to call it even a blank. Just a sample of a pen of many years ago, when he only learned to write. The quality is clearly not commercial, but you can play around at home. Externally, the already compiled looks like this (clickable):




This genre, a game for programmers, has never been popular due to the rather high threshold of entry. It's a pity. Because, as Uncle Suvorov taught, it is difficult to learn - it is easy in battle. I am not a militarist and not an oracle, but common sense suggests that pretty soon some of us will have to write software for “gadgets” like this (clickable):
')



So far one such cart has one operator, but mass production will reduce the cost, and each private will feel like a commander, controlling the units of drones. However, you will not follow all of them, much will have to be given to automation. And the autonomy of the drone as a combat unit will not be limited. There is safety in numbers. Programmers of distributed systems will be in great demand.

DroneSoft.com is the place where I would like to prepare for the future some of them. As they say, “si vis pacem, para bellum”, which means “if you want peace, buy a parabellum” :) At the same time, I would like to combine the useful with the pleasant. Like so - it will be possible with a clear conscience to say "I do not play, mom, I learn to defend my homeland." And continue to sit at midnight at the computer, the fruit of bots farmers for Warcraft or EVE, in order to earn one-hundred pounds of pocket money for pocket expenses to a poor student :)

UPD: temporarily unlikable large screenshots of this link (habraeffekt), but there are more thumbnails available than here)



Let us return to our sheep, I mean drones. Here is a brief report about a local conflict (only 1000 per 1000 - is that a lot?) Drones Berserk and Komrad. All parameters are identical, with the exception of five lines of code in the firmware. Berserk acts as befits this character - he saw the enemy, rushing to the meeting. Enemies are not visible - wandering far away. And Komrad, if he does not see the enemy, goes to a colleague, and that is different.

The result - 499 Komradov survived after a fight. It would seem that the ratio is 1 to 2, but combat arithmetic is not so simple, this does not mean that 500 Komradov will overwhelm 1000 Berserkers. In general, much was surprised. For example, how the Comrades form a crescent, which collapses into a swarm, like a swarm throws away prominences, is pulled out with an ellipse and again gathers into a ball at a new place. I did not program it, it is so. Immediately I remembered "Roy" by Michael Crichton, recently he was also remembered here.

By the way, watching this action "live", but on the big screen, is very psychedelic and meditative. A person can endlessly look at three things: at a burning flame, at flowing water, and at a working other person. And war is also work, though one of the dirtiest. Another reason to automate it.

I will add more words about graphics, why it is so primitive, and why I would like to leave it that way. I was inspired by the air traffic controllers radar screens (clickable):




I believe that in the near future, drone operators will see on their monitors basically not live video from the thick of events, but all the same radar geometry. There is another word - "visualization." I think it is not necessary to make the game (for programmers) resemble reality itself. It is only necessary to show what lies beneath it - the hidden patterns, the reasons that have already sunk into the dark past and the potential possibilities of the unrealized future, the probability zones and the paths of alternatives. This is much more useful than millions of polygonal planes and other shaders. But if you really want, you can draw on the background of satellite maps. What could be more realistic?

Oh yes, I almost forgot! Actually, here it is, a present, with instructions, without which nothing will work:



G1.zip (80 Kb)

User's manual



Run G1.exe, the window is immediately expanded to full screen. File → New . In the dialog box that appears, enter the width and height of the playing field in pixels (it is better to choose values ​​slightly lower than the resolution of your monitor if you do not want to scroll, just subtract the size of the menu, toolbar and window frame). OK. A new document has been created (each game is a separate document). The document window can be maximized.

Two additional windows appeared in the document window - the Indicator and the Camera. The indicator will show left and right the number of units of opposing clans, and in the middle - the advantage of one of the clans, the number of units winning minus the number of units losing at the moment. The camera shows one of the sections of the playing field on an enlarged scale. The field of view is moved by the left click to the place of the playing field where you want to see the details. The camera window can be enlarged, the field of view will be increased accordingly.

Game → Unit Random Generator ... - call the unit creation dialog. Select the number of units that will be generated (it is not necessary to generate all at once, but usually I am not worried, and I do just that). Choose a clan for which they will fight. Body - there is no choice yet, everyone is equally standard. Installing software, firmware. Here the choice is also not rich - either Berserk or Komrad.

To facilitate the selection of the area on which the units will be generated, there are two buttons - the Left half and the Right half. Do not forget to click them, but when generating units alternately, battles are far from being so spectacular, but there is no cancellation of generation.

Game → Play . And rushed. In the process, we do not forget to glance at the Indicator (who will win with whom advantage) and do not forget to move the Camera (the window itself is desirable to where the units have already fled, and the area of ​​visibility is to the front line).

There is an option that can be switched without stopping the game - View & rarr Toggle Show Courses . If you disable this option, the units will be depicted not in circles, but in pixels, and the cross will not be visible, indicating the current direction of the unit, and the line-course to this cross.

The last command is Game → Stop . There is no hitchhiking yet, the game continues even after the last enemy unit has been destroyed.

Source: https://habr.com/ru/post/79051/


All Articles