• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

C++ Nekiro 1.5 772 monsters attacks tick interval

Gover

Member
Joined
Sep 3, 2009
Messages
72
Reaction score
19
Hello everyone,
I have another question about nekiro 1.5 downgrade 772.
In old TFS 0.4 there was a great parameter called interval which could be set on each monster attack in monster script. It could be decreaced from standard 2000ms to lower value. With that it was possible to decrease the interval value and control the spells spam with chance value. It allows monsters to cast spell combo (for example demon could cast double UE in one second if player was unlucky).

In nekiro 1.5 downgrade 772 there is a default tick interval 2000 which cannot be changed in lua monster script (I measured it with a stopwatch with hunter monster attack with chance value set to 100 - and it cast the attack every two seconds).

I would like to change the default 2000 tick interval in nekiro to the lower value or if possible to set different values for each spells like in 0.4.

I searched all source files with the value of 2000 and here are the results:
1741896778346.webp

I changed each of this value's to lower one to test which one could be responsible for this interval, but it looks like none of them is responsible for it (of course I compiled sources after each change).

Maybe someone know how if this monster spam combo can be somehow reproduced in new 1.5 nekiro distribution?

Thanks in advance for your help!
 
Solution
Change src/creature.h
C++:
static constexpr int32_t EVENT_CREATURECOUNT = 10;
static constexpr int32_t EVENT_CREATURE_THINK_INTERVAL = 1000;
to
C++:
static constexpr int32_t EVENT_CREATURECOUNT = 1;
static constexpr int32_t EVENT_CREATURE_THINK_INTERVAL = 100;
Change src/creature.h
C++:
static constexpr int32_t EVENT_CREATURECOUNT = 10;
static constexpr int32_t EVENT_CREATURE_THINK_INTERVAL = 1000;
to
C++:
static constexpr int32_t EVENT_CREATURECOUNT = 1;
static constexpr int32_t EVENT_CREATURE_THINK_INTERVAL = 100;
 
Solution
I have done it but dont really see the change.
I have set demon spells to chance 100 for each attacking spell, and it just cast all spells at once each two seconds.

1741898032824.webp


I remember that I have set it somehow in TFS 1.2 few months ago and it was connected with:
C++:
g_scheduler.addEvent(createSchedulerTask(EVENT_CREATURE_THINK_INTERVAL, std::bind(&Game::checkCreatures, this, 0)));
 
Last edited:
I have done it but dont really see the change.
I have set demon spells to chance 100 for each attacking spell, and it just cast all spells at once each two seconds.

View attachment 90965


I remember that I have set it somehow in TFS 1.2 few months ago and it was connected with:
C++:
g_scheduler.addEvent(createSchedulerTask(EVENT_CREATURE_THINK_INTERVAL, std::bind(&Game::checkCreatures, this, 0)));

This edit I sent you above is for attacks, take a look at this part of the code, I believe it is for spells.
HTML:
https://github.com/nekiro/TFS-1.5-Downgrades/blob/a4675433d0e5c0001d37d4cab1241120216597e4/src/monsters.h#L198
 
here is a behemoth for example.
I increased the haste spell and rock throw:
LUA:
<?xml version="1.0" encoding="UTF-8"?>
<monster name="behemoth" nameDescription="a behemoth" race="blood" experience="2500" speed="340" manacost="0">
    <health now="4000" max="4000"/>
    <look type="55" corpse="2931"/>
    <targetchange interval="1000" chance="5"/>
    <targetstrategies nearest="70" health="0" damage="30" random="0"/>
    <flags>
        <flag attackable="1"/>
        <flag hostile="1"/>
        <flag summonable="0"/>
        <flag convinceable="0"/>
        <flag illusionable="0"/>
        <flag pushable="0"/>
        <flag canpushitems="1"/>
        <flag canpushcreatures="1"/>
        <flag targetdistance="1"/>
        <flag staticattack="80"/>
        <flag runonhealth="0"/>
    </flags>
    <attacks>
        <attack name="melee" skill="110" attack="75"/>
        <attack name="physical" checkshield="1" chance="100" range="7" min="-125" max="-185">
            <attribute key="shootEffect" value="largerock"/>
        </attack>
    </attacks>
    <defenses armor="50" defense="357">
        <defense name="haste_behemoth" chance="100"/>
    </defenses>
    <elements>
        <element firePercent="100"/>
        <element earthPercent="100"/>
        <element energyPercent="100"/>
    </elements>
    <immunities>
        <immunity paralyze="1"/>
        <immunity invisible="1"/>
    </immunities>
    <voices interval="1000" chance="5">
        <voice sentence="You're so little!"/>
        <voice sentence="Human flesh - delicious!"/>
        <voice sentence="Crush the intruders!" yell="1"/>
    </voices>
    <loot>
        <item id="2666" chance="40000" countmax="6"/><!-- 6 40% meat -->
        <item id="2148" chance="70000" countmax="60"/><!-- 60 70% gold coin -->
        <item id="2148" chance="50000" countmax="80"/><!-- 80 50% gold coin -->
        <item id="2150" chance="4000" countmax="2"/><!-- 2 4% small amethyst -->
        <item id="2231" chance="7000"/><!-- 7% big bone -->
        <item id="2553" chance="6000"/><!-- 6% pick -->
        <item id="2023" chance="11000"/><!-- 11% amphora  -->
        <item id="2125" chance="300"/><!-- 0.3% crystal necklace -->
        <item id="2489" chance="3000"/><!-- 3% dark armor -->  
        <item id="2463" chance="2000"/><!-- 2% plate armor -->
        <item id="2645" chance="400"/><!-- 0.4% steel boots -->
        <item id="1987" chance="100000"><!-- bag -->
            <inside>
                <item id="2393" chance="1000"/><!-- 1% giant sword -->
                <item id="2377" chance="4000"/><!-- 4% two-handed sword -->
                <item id="2387" chance="10000"/><!-- 10% double axe -->
                <item id="2416" chance="15000"/><!-- 15% crowbar -->
                <item id="2174" chance="800"/><!-- 0.8% strange symbol -->
            </inside>
        </item>
    </loot>
</monster>

Already tried to lower this value, but with no luck. TFS-1.5-Downgrades/src/monsters.h at a4675433d0e5c0001d37d4cab1241120216597e4 · nekiro/TFS-1.5-Downgrades (https://github.com/nekiro/TFS-1.5-Downgrades/blob/a4675433d0e5c0001d37d4cab1241120216597e4/src/monsters.h#L198)
 
Last edited:
here is a behemoth for example.
I increased the haste spell and rock throw:
LUA:
<?xml version="1.0" encoding="UTF-8"?>
<monster name="behemoth" nameDescription="a behemoth" race="blood" experience="2500" speed="340" manacost="0">
    <health now="4000" max="4000"/>
    <look type="55" corpse="2931"/>
    <targetchange interval="1000" chance="5"/>
    <targetstrategies nearest="70" health="0" damage="30" random="0"/>
    <flags>
        <flag attackable="1"/>
        <flag hostile="1"/>
        <flag summonable="0"/>
        <flag convinceable="0"/>
        <flag illusionable="0"/>
        <flag pushable="0"/>
        <flag canpushitems="1"/>
        <flag canpushcreatures="1"/>
        <flag targetdistance="1"/>
        <flag staticattack="80"/>
        <flag runonhealth="0"/>
    </flags>
    <attacks>
        <attack name="melee" skill="110" attack="75"/>
        <attack name="physical" checkshield="1" chance="100" range="7" min="-125" max="-185">
            <attribute key="shootEffect" value="largerock"/>
        </attack>
    </attacks>
    <defenses armor="50" defense="357">
        <defense name="haste_behemoth" chance="100"/>
    </defenses>
    <elements>
        <element firePercent="100"/>
        <element earthPercent="100"/>
        <element energyPercent="100"/>
    </elements>
    <immunities>
        <immunity paralyze="1"/>
        <immunity invisible="1"/>
    </immunities>
    <voices interval="1000" chance="5">
        <voice sentence="You're so little!"/>
        <voice sentence="Human flesh - delicious!"/>
        <voice sentence="Crush the intruders!" yell="1"/>
    </voices>
    <loot>
        <item id="2666" chance="40000" countmax="6"/><!-- 6 40% meat -->
        <item id="2148" chance="70000" countmax="60"/><!-- 60 70% gold coin -->
        <item id="2148" chance="50000" countmax="80"/><!-- 80 50% gold coin -->
        <item id="2150" chance="4000" countmax="2"/><!-- 2 4% small amethyst -->
        <item id="2231" chance="7000"/><!-- 7% big bone -->
        <item id="2553" chance="6000"/><!-- 6% pick -->
        <item id="2023" chance="11000"/><!-- 11% amphora  -->
        <item id="2125" chance="300"/><!-- 0.3% crystal necklace -->
        <item id="2489" chance="3000"/><!-- 3% dark armor --> 
        <item id="2463" chance="2000"/><!-- 2% plate armor -->
        <item id="2645" chance="400"/><!-- 0.4% steel boots -->
        <item id="1987" chance="100000"><!-- bag -->
            <inside>
                <item id="2393" chance="1000"/><!-- 1% giant sword -->
                <item id="2377" chance="4000"/><!-- 4% two-handed sword -->
                <item id="2387" chance="10000"/><!-- 10% double axe -->
                <item id="2416" chance="15000"/><!-- 15% crowbar -->
                <item id="2174" chance="800"/><!-- 0.8% strange symbol -->
            </inside>
        </item>
    </loot>
</monster>

Already tried to lower this value, but with no luck. TFS-1.5-Downgrades/src/monsters.h at a4675433d0e5c0001d37d4cab1241120216597e4 · nekiro/TFS-1.5-Downgrades (https://github.com/nekiro/TFS-1.5-Downgrades/blob/a4675433d0e5c0001d37d4cab1241120216597e4/src/monsters.h#L198)
LUA:
        <attack name="physical" interval="100" checkshield="1" chance="100" range="7" min="-125" max="-185">
            <attribute key="shootEffect" value="largerock"/>
        </attack>
 
Thank you very much Forkz!
The first tip is necessary to change, but to take effect I had to set the interval="x" inside the monster file.
Now it cast 10 spells in one second (for test purposes)
Post automatically merged:

To clarify this in one post.
From my observations it looks like the interval="value" parameter inside the monster file was supported from the beggining, but it cannot handle the value lower then 2000ms (2seconds). I did not even tried to set it at higher value (because the purpose was to set it lower), but I believe it would work.

Change inside src/creature.h is necessary to let this parameter go lower then 2000:
C++:
static constexpr int32_t EVENT_CREATURECOUNT = 1;
static constexpr int32_t EVENT_CREATURE_THINK_INTERVAL = 100;

And then we can use the interval value inside the monster attacks with value even 100 (10 hits per second).
We can set this interval="value" on monster spells and also on normal melee attacks - on both it works great.

I'm not sure if this values are optimal for CPU utilization, but for sure I will try to test it later. But if you set the interval value on every attack for all the monsters for the reasonable value - then it would not suffer that much i guess.

And if you dont want to edit each attack on each monster file, then I believe you can set this value which Forkz suggested here:
to the lower one, and it should be the default value for all the spell attacks.

Again thanks Forkz for help, maybe someone else will find it usefull :)


1741905220268.webp
 
Last edited:
Back
Top