Что такое fire rate в читах
Перейти к содержимому

Что такое fire rate в читах

  • автор:

modtools/fire-rate¶

Allows altering the fire rates of ranged weapons. Each are defined on a per-item basis. As this is done in an on-world basis, commands for this should be placed in an onLoad*.init . This also technically serves as a patch to any of the weapons targeted in adventure mode, reducing the times down to their intended speeds (the game applies an additional hardcoded recovery time to any ranged attack you make in adventure mode).

Once run, all ranged attacks will use this script’s systems for calculating recovery speeds, even for items that haven’t directly been modified using this script’s commands. One minor side effect is that it can’t account for interactions with the FREE_ACTION token; interactions with that tag which launch projectiles will be subject to recovery times (though there aren’t any interaction in vanilla where this would happen, as far as I know).

Requires a Target and any number of Modifiers.

-item <item token>

The full token of the item to modify. Example: WEAPON:ITEM_WEAPON_BOW

Modify the fire rate for throwing. This is specifically for thrown attacks without a weapon — if you have a weapon that uses THROW as its skill, you need to use the -item argument for it.

-material <material token>

Apply only to items made of the given material token. With the -item argument, this will apply to the material that the weapon is made of, whereas with the -throw argument this will apply to the material being thrown (or fired, in the case of interactions). This is optional. Format examples: “CREATURE:COW:MILK”, “PLANT:MUSHROOM_HELMET_PLUMP:DRINK”, “INORGANIC:GOLD”, “VOMIT”

-fortBase <integer> -advBase <integer>

Set the base fire rate for the weapon in ticks to use in the respective mode (fortress/adventure). Means one shot per x ticks. Defaults to the game default of 80.

-fortSkillFactor <float> -advSkillFactor <float>

Multiplier that modifies how effective a user’s skill is at improving the fire rate in the respective modes. In basic mode, recovery time is reduced by this value * user’s skill ticks. Defaults to 2.7. With that value and default settings, it will make a Legendary shooter fire at the speed cap.

-fortCap <integer> -advCap <integer>

Sets a cap on the fastest fire rate that can be achieved in their respective mode. Due to game limitations, the cap can’t be less than 10 in adventure mode. Defaults to half of the base fire rate defined by the -fort or -adv arguments.

-mode <”basic” | “vanilla”>

Sets what method is used to determine how skill affects fire rates. This is applied globally, rather than on a per-item basis. Basic uses a simplified method for working out fire rates — each point in a skill reduces the fire cooldown by a consistent, fixed amount. This method is the default. Vanilla mode attempts to replicate behaviour for fire rates — skill rolls determine which of 6 fixed increments of speeds is used, with a unit’s skill affecting the range and averages. NOT YET IMPLEMENTED!

Что такое fire rate в читах

Reddit and its partners use cookies and similar technologies to provide you with a better experience.

By accepting all cookies, you agree to our use of cookies to deliver and maintain our services and site, improve the quality of Reddit, personalize Reddit content and advertising, and measure the effectiveness of advertising.

By rejecting non-essential cookies, Reddit may still use certain cookies to ensure the proper functionality of our platform.

For more information, please see our Cookie Notice and our Privacy Policy .

Impacts of the new Tickrate on Firerate

As some of you may have noticed, we increased the server from a tick rate of 20 to a tickrate of 33 last night. This is important for many reasons, but the most important will be things such as improved hit registration. However, there are some side effects of this change, most noticeably how often firearms are allowed to shoot bullets.

The reasons for this are complicated, but it means that some guns will now fire at a slightly higher rate when using full auto, and some will fire at a slightly lower rate.

Here is a visualisation of how different guns have been impacted. The "True" position, is what happens if every gun fired at the exact moment that it was allowed to.

fbfe10e8eb.png

The "true" to achieve completely, without being able to use a tickrate that is much higher than the firerate of all of the weapons. If we had a tickrate nearing 1000, it would be closer, but there would still be a noticeable difference.

Warning — Everything below here will be complicated. Skip to the end if you don't care.

I'm going to try and summarise why things have changed, and outline how I think we might be able to improve things.

  • Tickrate — The number of times a second the server runs all of the code to calculate what happens next.
  • Tickrate Delay — The number of seconds between each frame occuring = 1/Tickrate
    • The Tickrate Delay for a 33 tick server is 0.0303030303 seconds
    • The Tickrate Delay for a 20 tick server is 0.05 seconds
    • A "Think" is called for a gun
    • Check to see if you can fire? If any are not true then stop.
      • Is the player holding left click? (or their +attack bind)
      • Is GetNextPrimaryFire() less than the current time?
      • Is the gun in the hands and ready to fire?
      • Does the gun have enough bullets to shoot?
      • Take a bullet from the available ammo as the current time plus the the Firerate Delay
      • Make a bang
      • Shoot a bullet

      An example of why this is a flaw is if a bullet is now allowed to be fired 0.00001 seconds after a frame has finished, it won't fire until the next frame cycles, which would be 0.03 seconds later on a 33 tick server, or 0.05 seconds later on a 20 tick server.

      • If a weapon can be fired every 0.04 seconds (1200 RPM), it would have fired on every frame with 20 ticks, as 0.04<0.05. However, with 33 ticks it will have some frames in between where it does not fire as 0.4>0.303. This means that the gun may now only fire every 0.06 seconds instead of 0.05 seconds.
      • If a weapon can be fired every 0.06 seconds (1000 RPM), it would have fired on every other with frame with 20 ticks as 0.06>0.05, meaning 0.1 second gaps. However, with 33 ticks, it still fires at every frame as 0.06<0.0606 (0.303*2=0.0606). This means the gun may now fire every 0.6 seconds instead of 0.1 seconds.

      42f683de11.png

      02f7a0e820.png

      So, what do we do now?

      • Change the server back to 20 ticks
        • This will be bad for many things, but might be needed if the server can't handle 33 ticks anyway
        • This is not really a long term solution and would put the guns into bins
        • This does not achieve the goal of making the guns act as they were originally intended to act
        • This might be very complicated, have unintended side effects, and I have no idea if it will work

        I hope you enjoyed my post, and I'm happy to answer any question that you may have.

        реализация AttackSpeed(FireRate) в играх

        Недавно начал интересоваться разными вещами в играх, а точнее их реализацией.
        На данный момент интересует как в играх реализуются параметры юнитов, такие как AttackSpeed или FireRate.

        Приблизительно я себе представляю такую картину:
        Берется какое-то базовое число, которое представляет скорость атаки, например 100 и это число приравнивается к следующему (1 удар/1 секунду) то есть AttackSpeed = 100 = 1hit/1sec;

        Интересует как реализуется задержка между ударами(атакой) юнита.

        Как устанавливается таймер, задержка или что необходимо для такой реализации.
        У меня пока самый простой вариант это установка через Sleep(). Но sleep не даст должного результата к примеру если нужны точные подсчеты (к примеру AttackSpeed = 250 = 2.5hit/1sec при цикле 1000 будут как мне кажется значительные отклонения) . Можно помудрить с QueryPerformanceCounter, но я думаю для данной ситуации такой счетчик не используется, можно взять функцию clock().

        Кто подскажет, как лучше реализовать данную тему?

        1. Берем таймер
        2. Берем анимацию стрельбы/атаки
        3. Запускаем таймер
        4. По событию таймера запускаем анимацию и останавливаем таймер
        5. По окончанию проигрывания анимации переходим к пункту 3
        Так подойдет?

        Или так: каждую миллисекунду (или там 10мс) вызываем обработку. В обработке смотрим: кто из юнитов атаковал раньше чем 200мс секунд назад, тот может атаковать снова (и при этом запоминаем его время последней атаки), остальные не могут.

        У каждого юнита есть такая штука, как "действие" (или несколько таких штук). У каждого действия есть свойство "прогресс". Прогресс — это число от нуля до единицы. Также у действия есть "скорость прогресса" — это число, обозначающее прирост прогресса за единицу времени. При апдейте юнита, происходит примерно следующее:

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *