DiSaMe Posted August 13, 2012 Share Posted August 13, 2012 (edited) Here's a video about the script which I'm working on: Bots are generated around the players and disappear when they are far. Driving peds stop if there's a player, ped or a car in the front. They also stop when traffic lights are red Edit: new videos of released traffic and path editor scripts: Edited September 20, 2012 by Guest Link to comment
Castillo Posted August 13, 2012 Share Posted August 13, 2012 Nice job , keep up the good work Link to comment
Jaysds1 Posted August 14, 2012 Share Posted August 14, 2012 wow, all that, damn, keep it up Link to comment
Scripting Moderators Sarrum Posted August 14, 2012 Scripting Moderators Share Posted August 14, 2012 Like, like, like! Link to comment
DakiLLa Posted August 17, 2012 Share Posted August 17, 2012 Looks impressive! Btw, what about client (server) CPU and also bandwidth usage? Link to comment
DiSaMe Posted August 17, 2012 Author Share Posted August 17, 2012 On the client, all peds streamed in are looped through onClientPreRender and their control states are updated, but it doesn't seem to make my PC lag any more than it already does when there are many peds and vehicles around On the server, generating peds slows down a little bit, but I know why exactly it does and how to optimize it and this happens because creating elements takes some time, so there's nothing I could do to optimize it And the bandwidth is something what i'm not sure about. I store tables with task parameters as element data to sync ped actions. Something like this: {"goToPoint",x,y,z}. Anyway, if something is wrong, reducing traffic density will help. Something is still better than nothing. Link to comment
MatthewFerris Posted August 18, 2012 Share Posted August 18, 2012 Nice Job, I like it! Link to comment
Dev Posted August 19, 2012 Share Posted August 19, 2012 That's cool, nice job! will it be available at community resources? Link to comment
DiSaMe Posted August 19, 2012 Author Share Posted August 19, 2012 No, but I will release it at my scripts website. I don't want my works to be somewhere between thousands of works of other people Link to comment
Wojak Posted August 22, 2012 Share Posted August 22, 2012 Very nice, as far the AI goes, it seems to be better than my attempt. How did you created the paths? (trying to create a tool that is able to create paths easily was the thing that put my project in the coma...) As for the bandwidth - I've don a lot of tests in that mater and I'm shore that by default MTA syncs velocity, position and rotation with the minimal interval of about 0,5 sec and max (if there ate no network problems) 2 sec. as long you don't transfer any other data there is no difference between static and moving vehicle... However to keep the vehicles from "drifting" on remote clients it is necessary to sync the information about left and right control states manually. The large intervals on witch the data is updated work great if the vehicle is not moving, or moves very slowly, the faster they move, the less accurate is the position, and they start to lag even if the fps is high and the ping is low (speed = 30-40 km/h seems to be good) In my script I've made it so the bot is only controlled by one client at a time, and the "task data" is only exchanged with the server when some player gets in or out the range (i even found a cheap way to keep the vehicles persistent, synced and moving when no player is in range) Anyway good lock to You, hope you finch it Link to comment
DiSaMe Posted August 22, 2012 Author Share Posted August 22, 2012 I made a separate resource to create the paths. It's the resource which draws all paths in the beginning of the video. Tool creation part is usually the most boring, but I did it in a few days The sync shouldn't be a problem. Because all what is synced by the script is the task data, there's no need to manually sync control states. Clients use task data to set control states and control peds independently, so the result is the same or at least similar for everyone most of the time. When it isn't, it's still OK because MTA synchronizes positions anyway, making all clients see the same. What I'm not sure about is the server CPU usage. It works fine when I'm alone in the server, but it will probably slow down when there are many players all around the map. My script moves unsynced peds server-side too, and there may be a slowdown if it needs to move a few thousands of peds at the same time. And I just scripted simple collision checking. It prevents vehicles and peds from getting stuck inside each other when they're generated or moved server-side. Although the algorithm is pretty efficient, using it on thousands of peds may be slow. On the other hand, I'm going to make traffic density and collision checking controllable by the server. Even if such traffic like single player has turns out to be too much for a public server, a few peds here and there will be better than nothing Link to comment
Wojak Posted August 22, 2012 Share Posted August 22, 2012 all clients controlling all vehicles may solve the sync problem (but I'm not 100% convinced) but it certainly may be a source of efficiency problems... Like i said in my script only the client that has the power to send the data about the position of a ped is controlling that ped, so 1 player on the server (or no players, when all need to be handled by the server) is actually the worse case scenario - its like multitasking - more players online - more equally the tasks are divided Link to comment
DiSaMe Posted August 22, 2012 Author Share Posted August 22, 2012 I see no reason why setting control states on each client would be inefficient. The worst thing it could do is reducing FPS for players if there were many peds streamed in and there was some task requiring heavy calculations. Syncing control states directly, on the other hand, would require additional bandwidth. Link to comment
xNova Posted August 27, 2012 Share Posted August 27, 2012 WIll you release this in a server? Link to comment
Anderl Posted August 28, 2012 Share Posted August 28, 2012 He already released on his website. Link to comment
Castillo Posted August 28, 2012 Share Posted August 28, 2012 Is not yet on his website, if I'm right, he's still working on it. Link to comment
Anderl Posted August 28, 2012 Share Posted August 28, 2012 Is not yet on his website, if I'm right, he's still working on it. Yea, you're right. I confused the news about it with the download. Link to comment
Renkon Posted August 31, 2012 Share Posted August 31, 2012 Probably the best script and the hardest one I have ever seen. Link to comment
Jaysds1 Posted August 31, 2012 Share Posted August 31, 2012 Probably the best script and the hardest one I have ever seen. same Link to comment
DiSaMe Posted September 20, 2012 Author Share Posted September 20, 2012 In case someone hasn't noticed yet, I want to say it's released now. Link to comment
LoveFist Posted September 20, 2012 Share Posted September 20, 2012 Great work I love it. But after some time fps falls down to 4 - 6 and it's not impossible to play. How about some more settings for traffic resource (traffic density, enable/disable onfoot traffic, peds controls update delay etc)? Link to comment
DiSaMe Posted September 20, 2012 Author Share Posted September 20, 2012 Do you mean I'm not the only one whose computer slows down? Nice... NPC HLC and NPC HLC traffic pages in my website have documentation pages where you can find information about traffic density and update intervals. Link to comment
LoveFist Posted September 20, 2012 Share Posted September 20, 2012 Yes I test it with 5 peoples on the server and everyone had the same problem. NPC HLC and NPC HLC traffic pages in my website have documentation pages where you can find information about traffic density and update intervals. Oh thx, I'll check it Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now