[Suggestion] Population Sync - Printable Version + open.mp forum (https://forum.open.mp) -- Forum: open.mp (https://forum.open.mp/forumdisplay.php?fid=40) --- Forum: Questions and Suggestions (https://forum.open.mp/forumdisplay.php?fid=42) --- Thread: [Suggestion] Population Sync (/showthread.php?tid=1177) |
Population Sync - Sasino97 - 2020-09-09 Population Sync I am not sure whether this has been suggested before, however after a quick forum search I didn't find anything like this. It would just be a great thing?to have the default?San Andreas population while playing online! How would it work? Every client will just let the GTA:SA default population spawning logic be, and for each ped that is spawned by it, sync it with the server. When two clients?are close to each-other, an algorithm selects the client in charge to sync the population. The peds will also be automatically transferable from a client to another based on latency and other variables.? Basically, the client with the best conditions?(I will call it master) creates the peds, gets their info (skin, position, speed, animations, weapons, and everything), and sends that info to the server. The other clients (I will call them?slaves) will simply get this data from the server, and create simple peds that don't follow the logic of their own game, but instead, use the received data. Every single ped will have a unique id on the server.? In the case of ped driving vehicles, every time the client generates a vehicle for a ped to drive, it will inform the server, which will then keep track of that vehicle until the ped despawns. TL;DR Basically, like in FiveM. Server functions and callbacks Notice: This is just a prototype, and functions might be incorrect?(e.g. I didn't use output/reference?params nor return tags?to simplify reading). Code: // enable or disable the feature altogether (if disabled, peds will not be generated by the clients'?games) That's pretty much everything that came to my mind at this moment. Of course more functions could be made. What do you guys think of this suggestion? Think about how radically differents servers will be with population in them :) RE: Population Sync - Manyula - 2020-09-11 If I remember correctly, the main reason why we got recorded NPCs was because Kalcor didn't want to put ped sync into the hands of the clients, and since the server doesn't run an instance of the game there would be no other way to sync them. I guess, we have two options: 1. Letting the clients sync the peds lets us use the game's existing ped AI, so we as a community wouldn't have to implement our own one. I don't know what the implications of trusting the client to sync the peds are, though. A player who's in charge of ped sync could be running an annoying ped AI mod and wreak havoc. 2. Letting the server sync the peds provides a uniform ped AI for all players. However, we would have to implement the ped AI by ourselves. My personal opinion is that we're better off going with server-side NPCs. [*]The paths can be extracted from the game files. [*]Ped AI shouldn't be too difficult to implement. Vehicle AI is definitely more challenging. RE: Population Sync - LaszloR1 - 2020-09-13 I wouldn't trust the client with handling population sync either. Would be way too easy to spoof and cause havoc. Using decompiled scripts it would be possible to recreate ped AI. Although a few limitations exist at the moment which are: One client can only show up to 51 NPCs (Actors) and a server can only have 1000 of them. RE: Population Sync - Sasino97 - 2020-09-14 (2020-09-11, 10:43 AM)Manyula Wrote: If I remember correctly, the main reason why we got recorded NPCs was because Kalcor didn't want to put ped sync into the hands of the clients (2020-09-13, 11:58 AM)LaszloR1 Wrote: I wouldn't trust the client with handling population sync either. Would be way too easy to spoof and cause havoc. FiveM has been doing basically the same thing; yeah some people tried to cheat by creating fake peds and manipulating them, ok, but with frequent updates that problem doesn't exist. There is no problem in letting clients be the brains of peds if there are systems put in place to prevent spoofing and frequent updates to deter hackers from building those programs. RE: Population Sync - JustMichael - 2020-09-15 It's definitely possible to do this, and the server doesn't need the game files, we could maybe down the line re-implement this ourselves using our system, or we could find a way to piggy back off the current implementation and yet still have the server be in charge of sync. It's not impossible, it's just quite a big task to do, and it's not going to be a priority for us. However since the idea of open.mp is to be open source eventually, the whole community is freely available to contribute help towards making this possible. RE: Population Sync - Manyula - 2020-09-15 I always assumed the game's implementation couldn't be used because the server doesn't run an instance of the game. So, would those peds be any different from regular NPCs then? And while we're on the subject of contributing: Do you guys have a contribution guide in place? RE: Population Sync - LaszloR1 - 2020-09-16 (2020-09-15, 07:56 PM)Manyula Wrote: I always assumed the game's implementation couldn't be used because the server doesn't run an instance of the game. So, would those peds be any different from regular NPCs then? And while we're on the subject of contributing: Do you guys have a contribution guide in place? NPCs arent made out of miracle dust. You don't need the game to run it to have a population system. They are just very basic AI that follow paths and react to what is happening around them and to them. RE: Population Sync - CJ101 - 2020-10-12 I support this completely. Ive always wanted this. RE: Population Sync - Ezio_Auditore - 2020-12-21 Damn, I've always wanted something like that. Adding peds would be such a huge leap for the mod and it would add those singleplayer vibes it could made the mod more popular towards GTA SA's nostalgics. Years ago, when?I discovered SA-MP,?I've been excited by the possibility of a real multiplayer on San Andreas but even disappointed for the dearth of SP features. And the lack of pedastrians was by far the most disappointing?one. |