Quantcast
Channel: SA-MP Forums
Viewing all articles
Browse latest Browse all 18226

Issue with NPC record

$
0
0
Welli-wello-hello boyos,

Since some times, I've been working on a project of mine, which goes by the name of Survive-all;
Well, the name says enough about what it's all about, so... zombies, bug:

I've always been using RNPC on this, but in a first time, I've used it along with PathFinder. For some reasons, including bad ratio efficience/ressources, desire to quit using MapAndreas... which I think being obsolete... I chose to give no worth on such a realistic AI to get more zombies displayable (and to get my server working, at least!), which led me to give up PathFinder, finally !

For the ones who'd not left after this "short introduction" and have found out, I decided to get my gamemode uniform under precise traits and clear results of ColAndreas!


There are two modes: Attack and Freeroaming. Attack mode is a right and straight path, from the zombie to the target. Attack mode zombies would just take the shortest and straightest camino while keeping their feet on the ground, getting their z pos from ColAndreas.

As said previously, there would be the Freeroaming mode as well: Zombies without a target would just roam freely, considering walls and obstacles, with a relatively coherent path.

My issue is that the Freeroaming mode... well... crashes the server down!

I sort of succeeded to understand how it happens:

[spoiler]
[10:45:38] Zombie 0 - 0
[10:45:38] Zombie 0 - 1
[10:45:38] Zombie 0 - 2
[10:45:38] Zombie 0 - 3
[10:45:38] Zombie 0 - 4
[10:45:38] Zombie 0 FinishBuild
[10:45:38] Zombie 0 StartBuildPlayback
[10:45:38] Zombie 1 - 0
[10:45:38] Zombie 1 - 1
[10:45:38] Zombie 1 - 2
[10:45:39] Zombie 1 - 3
[10:45:39] Zombie 1 - 4
[10:45:43] Zombie 1 FinishBuild
[10:45:43] Zombie 1 StartBuildPlayback
[10:45:43] Zombie 2 - 0
[10:45:43] Zombie 2 - 1
[10:45:43] Zombie 2 - 2
[10:45:43] Zombie 2 - 3
[10:45:43] Zombie 2 - 4
[10:45:43] Zombie 2 FinishBuild
[10:45:43] Zombie 2 StartBuildPlayback
[10:45:43] Zombie 3 - 0
[10:45:43] Zombie 3 - 1
[10:45:43] Zombie 3 - 2
[10:45:43] Zombie 3 - 3
[10:45:43] Zombie 3 - 4
[10:45:43] Zombie 3 FinishBuild
[10:45:43] Zombie 3 StartBuildPlayback
[10:45:43] Zombie 4 - 0
[10:45:43] Zombie 4 - 1
[10:45:43] Zombie 4 - 2
[10:45:43] Zombie 4 - 3
[10:45:43] Zombie 4 - 4
[10:45:43] Zombie 4 FinishBuild
[10:45:43] Zombie 4 StartBuildPlayback
[10:45:43] Zombie 5 - 0
[10:45:43] Zombie 5 - 1
[10:45:43] Zombie 5 - 2
[10:45:43] Zombie 5 - 3
[10:45:43] Zombie 5 - 4
[10:45:43] Zombie 5 FinishBuild
[10:45:43] Zombie 5 StartBuildPlayback
[10:45:43] Zombie 6 - 0
[10:45:43] Zombie 6 - 1
[10:45:43] Zombie 6 - 2
[10:45:43] Zombie 6 - 3
[10:45:43] Zombie 6 - 4
[10:45:43] Zombie 6 FinishBuild
[10:45:43] Zombie 6 StartBuildPlayback
[10:45:43] Zombie 7 - 0
[10:45:43] Zombie 7 - 1
[10:45:43] Zombie 7 - 2
[10:45:43] Zombie 7 - 3
[10:45:43] Zombie 7 - 4
[10:45:43] Zombie 7 FinishBuild
[10:45:43] Zombie 7 StartBuildPlayback
[10:45:43] Zombie 8 - 0
[10:45:43] Zombie 8 - 1
[10:45:43] Zombie 8 - 2
[10:45:43] Zombie 8 - 3
[10:45:43] Zombie 8 - 4
[10:45:43] Zombie 8 FinishBuild
[10:45:43] Zombie 8 StartBuildPlayback
[10:45:43] Zombie 9 - 0
[10:45:43] Zombie 9 - 1
[10:45:43] Zombie 9 - 2
[10:45:43] Zombie 9 - 3
[10:45:43] Zombie 9 - 4
[10:45:43] Zombie 9 FinishBuild
[10:45:43] Zombie 9 StartBuildPlayback
[10:45:45] Zombie 10 - 0
[10:45:45] Zombie 10 - 1
[10:45:45] Zombie 10 - 2
[10:45:45] Zombie 10 - 3
[/spoiler]

I've set the tempus bold. As you see, there're awful timelapses between some zombie movements settlements.

Finally, by some miracle, I've been looking at the \npcmodes\recordings folder, in which I've seen werideries as such:



Bang, 300mb file, enlighting us on that huge tempus running between the two first recordings. The "Zombie 10", he has no file of his, and, that's the point, the logs failed to write any more before it crashed, because... it crashed then, which led me to think the file was even bigger than the first one.




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




Of course, here are the pieces of code:



https://pastebin.com/QLrAs8Wg

MoveZombies : Function called every second; calls ZombieAttack, individually for each zombie; every second it also calls MoveZombie for a fifth of the whole zombie pool.


https://pastebin.com/gZXQvgxq

MovieZombie : Function individual to every zombie: Chooses a direction between the eight ones and then determines 5 nodes the zombie'll pass by, creates a .rec and plays it; this is the Freeroaming mode.
Fonction individuelle à chaque zombie: Elle détermine une direction parmi les 8 points cardinaux et détermine ensuite 5 positions par lesquelles le zombie passera, en crée un .rec et le lit. C'est le mode "vagabondage".



https://pastebin.com/QHT26MqK

ZombieAttack : Function making the zombie attack ; If the target's close enough, the zombie'll punch, else, will walk to its pos. I know I'm being illogical doing this "foot by foot", but this one's only a try, will change it in further development)

The issue I'm experiencing is, despite the difference of the work between MoveZombie and ZombieAttack, none of the two works smooth. MoveZombie will led, as I said before, to a server crash, ZombieAttack, on its side, leads the zombie to "disappear" - Doesn't respawn it, doesn't kill it, doesn't crash it : Disappears it as a Stalin's opponent :(


So that was my issue, it's been long tempus since I was first blocked on it, which led me to pause my coding operations, and I'm finally asking for any help, would be kharacho if someone would do this for me (assistantship :p ). I'm pretty sure the thing is obvious or extremely stupid, but since I've been working and dumbly staring at it for too long, I've become unable to see any further than what I'm describing here :rolleyes:

Viewing all articles
Browse latest Browse all 18226

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>