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:
- Work with .txt and .bmp files
- Save files and delete them from the specified directory
- For everything to work + for a pleasant development process
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.
- We read txt files with lists of parts and the corresponding characteristics.
- Randomly select for each part (blade + handle).
- We combine their pictures, take the arithmetic mean of their characteristics, apply modifications from the manufacturer, add their names (adjective + noun).
- Several auxiliary methods: "sell weapons", "find the chest" and "kill the enemy" (the last two differ only in the chance to get the legendary weapon).
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:
- The number of finished weapons is growing geometrically with the addition of another part. I, for example, have 2 parts of 5 copies - a total of 25 different swords. When adding more parts with 5 different copies, the number of options will be 125.
- Adding gaming excitement - the desire to get weapons from the best parts.
- All parts must fit together.
- More difficult to implement.
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.
PS Links to used pictures