Weapon generation system

Hi, Giktayms, I would like to tell you about my first project in c #. Since I am interested in computer games, I wanted to do something from this area. I took the idea from the Borderlands series of games, namely the weapon generation system. I have it, of course, much simplified.

I think it's better to start from the beginning. I already tried to work on with ++, however something did not go. I began to be interested in the c # language in the summer, initially the video lectures from Microsoft really helped. After the course, I wanted to do something interesting. So I started work.

What I wanted from the beginning:


The weapon generation system itself is something like a puzzle. In the game Borderlands firearms are created, and the parts there are appropriate (Butt, Handguard, Barrel, etc.). They are assembled into one unit, and the finished equipment receives the characteristics corresponding to the parts. Also, he must have a manufacturer, name and level. There is also a separate list of already created "legendary" weapons with special characteristics and a low chance of falling out. I also made this system in with #. Just wanted to make cold arms. For a start, I decided to generate two-part swords: blade + handle.

What implemented:


Text files were the simplest item in the program, they contain lines of characteristics: name, speed of combat, damage, critical damage chance, price, manufacturer, level and image number for the characteristics of this line.

Here is the text file for the legendary swords:
UltraLord 5 100 20 1000 human 11 31.
TitanKiller 6 90 23 1000 orc 11 32.
SoulEater 4 120 21 1000 daemon 11 33.

With pictures it was much more difficult. I had to edit the images found on the Internet. Made pixel pictures 200x600. So that everything coincides, I arranged the parts strictly in the center. Later, another problem arose, the color gamut and the detail of the elements are different. This problem can be solved at the initial stage of creating images: draw in one color, then paint the already created weapon.

All possible options for conventional swords:



Three legendary swords:



Advantages of this system:


Minuses:


All posted on GitHub , made comments in his program. The process of developing, drawing, studying was fascinating for me. Combined business with pleasure. Perhaps I will add more types of weapons: bows, axes ... I also think about transferring this project to Windows Forms with the addition of an interactive one, so that I can choose from which parts to assemble. If you have any questions or comments please write, I will try to answer. New ideas will be especially happy.

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


All Articles