Advanced NPC system using custom .rec files
#1

Hi,
I just resurrected one of my extreme old and yet unfinished projects: analyzing and understanding the .rec file format for the NPC recordings. The system behind it is mostly quite simple, and I already allocated most things in the on-foot-recordings just by comparing and testing.
I already tried that about 1,5 years ago, but gave it up after some first successes as i lost interest in it.
This time im more serious with it, my next step will be decrypting the record file for vehicles.

Why Im doing this? Well, im wondering why noone did that before, at least not in public. I know that there were plans for this around here, but Ive never seen an actual result yet. Knowing how the .rec files work allows a lot of improvements to the default NPC system. Starting with the ability to create editors for the .rec file, to alter, create, or merge different npc recordings without actually recording a single movement ingame, it also allows live creation of NPC recordings on a server. This means, it would be possible to create a NPC recording using scripting stocks, without walking around manually for the record.
So for example you would build a taxi path part-by-part ingame when someone calls a npc taxi, then it is stored to a .rec file and the taxi driver npcs plays it back. So NPCs would be way more dynamic.
Also functions like NPC_WalkTo would be possible and allow very smooth movements.

However, this isnt perfect of course, as going the way with creating .rec files is quite dirty and inefficient. The NPCs reaction time will be quite high, but still good enough for dynamic driver routes and similar things. Also an accurate acceleration for vehicles is difficult, as it is unique for every vehicle, so acceleration and curves might look ugly.


The final result (if i should decide to create it) would come as a plugin, a pure script version isnt possible as it needs to have access to the recordings folder of course. I would also release all information about the .rec file format, as long as this isnt a problem for the developers.


So far. Before beginning to create the plugin, Id like to ask if this would be useful for anyone. It isnt as good as CNPC was, but completely without memory hacking, and still more dynamic than the default NPC system.
Also, please give me any suggestions you have regarding this, and Ill see if they can be realized.


Update: I wrote down what I know about the format. It can be found here: https://sampwiki.blast.hk/wiki/.rec_file
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)