Skip to content

Kurtenok/TanksFixed

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

RU:
Этот проект представляет собой мою попытку воссоздать всемирно популярную игру "World of Tanks". На данный момент в игре уже в рабочем состоянии находиться механика стрельбы из танка, в том числе и поворот башни, приближение и отдаление камеры. 

Теперь более подробно о стрельбе. У башни можно настроить максимальный угол подъёма и опускания пушки, скорость перезарядки, разброс оружия и стреляемые снаряды. Разброс работает точно так же, как и в упомянутой ранее игре: чем сильнее отводишь прицел, тем большим он становиться. Также при наведении на броню в центре прицела появляется круг, показывающий будет ли выстрел успешным. Зеленый круг показывает, что броня будет почти наверняка пробита, оранжевый - пробитие примерно равно броне в точке прицела, а красный-броня в точке прицела не может быть пробита.

Как добавить и настроить снаряды? Все просто, в инспекторе найти скрипт (Turret Controller), в нем найти раздел Bullet Types и нажать кнопку добавить (+),  далее заполняем необходимые поля, а именно: название пули, её картинка(как она будет отображаться в интерфейсе), gameobject пули, пробитие, урон и скорость. Вот и всё, теперь при запуске игры  у нас добавиться новый вид пуль, готовый к применению. 
Примечание: на gameobject, который вы укажите как пулю, должны находиться компоненты Collider, RigitBody, Script Bullet, layer=3 ”Bullet”, в случае невыполнения хотя бы одного из условий, программа сама установит необходимые компоненты с минимальными необходимыми настройками. Также стоит отметить, что Image Type у картинки пули может быть поставлен на Filled, в таком случаем во время перезарядки картинка будет постепенно заполняться по мере выполнения процесса.

Как работает броня? Для неё существует два скрипта Armor(Manager) и ArmorPlate. ArmorPlate хранит в себе информацию о толщине брони каждого Colliderа и именно из него добывается информация (он добавляется сам  и не может быть нормально отредактирован через инспектор, поскольку информация о пластинах храниться в dictionary). Armor же являет собой своеобразный manager, в котором ты указываешь collider и его толщину(его надо всего один раз создать на танке и просто настроить его). Более того, можно добавлять несколько компонентов collider одного того же объекта, чтобы, к примеру, сделать переменную толщину пластины не создавая дополнительных пустых объектов и не разделяя её модель в редакторе. Также в игре работает принцип приведенной толщины брони, то есть при попадании снаряда в пластину в расчет берётся не только ее толщина, но и угол соприкосновения, что добавляет в игру реалистичность и увеличивает количество возможных тактик на поле боя.

P.S. Все скрипты в игре придуманы и написаны мной, за исключением Camera Rotation, его я лишь модифицировал, добавив возможность приближать и отдалять камеру колесиком мышки и ограничив дальность приближения и отдаления.

ENG:
This project is my attempt to recreate the world-famous game “World of Tanks. For now, the mechanics of firing from a tank are already in working order in the game, including the rotation of the turret, zooming in and out of the camera.

More about shooting. At the turret, you can adjust the maximum angle of raising and lowering the gun, reload speed, accuracy and fired projectiles. The spread works exactly the same as in the game mentioned earlier: the further you move the scope, the larger it becomes. Also, when aiming at armor, a circle appears in the center of the sight, indicating whether the shot will be successful. The green circle indicates that the armor will almost certainly be penetrated, the orange circle indicates that the penetration is approximately equal to the armor at the aim point, and the red one indicates that the armor at the aim point cannot be penetrated.

How to add and configure projectiles? It's simple, find the script (Turret Controller) in the inspector, find the Bullet Types section in it and click the add (+) button, then fill in the required fields, namely: the name of the bullet, its picture (as it will be displayed in the interface), gameobject of the bullet, penetration, damage and speed. That's all, now when you start the game, it will add a new type of bullets, ready for use.
Note: the gameobject that you specify as a bullet must contain the Collider, RigitBody, Script Bullet, layer=3 ”Bullet” components, if at least one of the conditions is not met, the program will install the necessary components with the minimum necessary settings. Also the Image Type of the bullet can be set to Filled, in which case, during reloading, the image will gradually fill up as the process progresses.

How does armor work? There are two scripts for it Armor(Manager) and ArmorPlate. ArmorPlate stores information about the thickness of the armor of each Collider and it is from it that information is obtained (it is added by itself and cannot be edited normally through the inspector, because information about the plates is stored in the dictionary). Armor, on the other hand, is a kind of manager in which you specify the collider and its thickness (you only need to create it once on the tank and just configure it). Moreover, it is possible to add several collider components of the same object in order, for example, to make the plate thickness variable without creating additional empty objects and without splitting its model in the editor. Also, the principle of reduced armor thickness works in the game, that is, when a shell hits a plate, not only its thickness is taken into account, but also the angle of contact, which adds realism to the game and increases the number of possible tactics on the battlefield.

P.S. All scripts in the game were invented and written by me, with the exception of Camera Rotation, I only modified it by adding the ability to zoom in and out of the camera with the mouse wheel and limit the range of zooming.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published