XaiJu
VerehrER
VerehrER

patreon


New progress on enemies vs each other

I have to say, npc vs npc make significant impact on frame rate. 

Global damage zone require every npc run though the code per frame to check if it is hit, which is not good when there are too many enemies on the screen.

I am still trying to optimize it, haven't found a better way. 

However, it doesn't affect current gameplay, because it needs at least 20+ enemies all attacking on screen to see 10-20 frame drop. 

But if you got a crappy cpu it is going to be worse... sadly, I am sorry.

---------------------

我不得不说,npc对战对帧率影响很大。

全局伤害要求每个NPC每帧都要运行代码来检查它是否被击中,当屏幕上有太多敌人时,就可能会卡。

还在试着优化,但还没找到更好的方法。

不过,目前还不会影响游戏本身,因为至少需要20个以上的敌人都在屏幕上大乱斗攻击才能看到大概10到20帧下降。

但如果你有一个很烂的CPU,情况会更糟……那就非常遗憾了。

New progress on enemies vs each other

Comments

Like, normally it is not going to be a problem. Limited radius is easy. But what if I want to create a massive scene where I need everyone fighting? Uhm, I don't know, just what if. Maybe just sometimes I worry too much.

RoVerehr

You could also make it only work in a radius around the player. Really the only NPCs that need to focus on fighting are the ones near the player. If it extended to just a little bit off screen you won't be simulating the entire map while still allowing enemies you can't see to fight eachother.

Dark Nite Sunset

I see your point, I will try adding that

RoVerehr

You could put a limit to how many NPC's fight at once and add an option to set the limit, like you have for hard mode and language. Those who might have frame rate issues could adjust the game to the capability of their computer.

Namira


More Creators