Jump to content

Kent747

Retired Staff
  • Posts

    1,013
  • Joined

  • Last visited

Everything posted by Kent747

  1. yea string stuff is a bitch in vb.... could one use masking to make this job easier w/ a double or long... im not sure if masking is easy in vb... i dunno maybe winsock isn't the best way to go about it... also outputting text to the form caption takes a long time... regardless netcode should NEVER be done in a manner where things are sent individually... i bet somewhere out there somebody has designed a control that is similar to winsock, only is polymorphic... if not a dedicated server written in a decent language should probably be written...
  2. heh ok i understand the limitations of winsock but there is no reason one couldn't take the array and store it as a string each item is put into the string, which is delimited by some character to mark anther item ie. car1xpos*car1ypos*car1zpos|car2xpos etc just some arbitrary character could be used to allow one to turn an array into a string.... the client could could then use a string tokenizer to break that apart... Thoug i'd highly suggest that future versions have a dedicated server written in C... also a for loop for each item would still execute extremely fast... write aprogram in vb to run through a loop 30,000 times then display something in a text box (if you want ot use vb..) it would be a lot faster than you'd think... the display buffer of 32 objects could actually be used to the advantage of the server... by this the server is limited to only sending 32 elements of data per packet... that would be about 1.56k per packet assuming 32 elements are being sent, assuming each item has 10 4byte properties of the vehicle/ped... all games in some form have to run through a loop for every object in a multiplayer game... there is no way around that... and 32 objects really isn't that much... in a game like quake3 arena.. if there are32 objects you'd experience more lag just because each object is controlled individually on seperate computers... in the case of GTA3, all 32 objects are controlled by the server... I don't think it would be as bad as people think kent
  3. exactly.. which is much smaller than having to send the position of every car and every pedestrian to every client....as some people believe.. with the circle method... each client can get the info they need in one or 2 packets... tahts relatively small.. (the server wouldn't have to send out 20 seperate things for each client. it can be done in one transmission. by putting all the info into an array for example.. and just sending that array.) with more players that will increase.. but that is the case w/ any multiplayer scenario... Personally i think half the fun of GTA is running down the streets trying to avoid the cars going 30 miles/hour.. having a variable circle size would also improve customizability (sp?) for people playing the game... maybe the cirlce radius could change dynamically according to the amount of lag... I don't think gta would be the same game w/out being able to be a faceless person in the crowd... thats just me i guess.. maybe it'd be better if i made a little example of how he server code wold work. some basic assumptions about the server - server has all cars and peds walking around.. its a lot yeah.. but - server has a list of all player's position in the game. ok here's the routine for determining what to tell x-client what cars are in their area: -- for all cars and peds on server { // even if its 3000 it would be insanely fast if current AIcar is in players circle (distance formla) addit to packetlist if current AIped is in players circle (distance formula) add it to packetlist send packet //should probably be able to be done in one transmission } on the client side when received packet for car/peds { for each item in the packet list{ //probably 30-50 items? place car/ped in the scene } } So yeah there is going to be more bandwith w/ more people and more items.. but the method i showed is probably one of the better ways of handling the bandwith.. Its just an idea haha Kent
  4. couple things... more concept than anything the server wouldn't have to send the data of EVERY car and EVERY ped to EVERY client... it could just send all those near a current players location... as far as clients having ot tell the server about interraction w/ the world.... why couldn't hte server do that itself based just of the objects position as told by the client... I.E. Client A drives along and runs through a telephone pole... (or a pedestrian).. the server's GTA3, sees this car go through and adjusts the world accordingly... this is then sent back to all the clients.. Iuno seems like that could work... and save a lot of bandwith...
  5. Even if there were 3000 peds / vehicles whatever, only the server needs to keep track on the cpu.. and only tell the client about a certain number of them.. perhaps a variable draw distance for cars/peds here is an example of what i mean blue dots are AI controlled peds... pink dashes are cars... the red circles w/ dots in the middle represent players.. (circles can vary in size according to bandwith capabilities) anyways.. server is keeping track of thousands of cars and peds... but only tells the client about which ones are inside the circle (this can be done w/ a simple distance formula)... (ok technically its a sphere in the 3d world, but i think you can get what im saying) anyways the effect is that all clients are playing in the server's world without huge bandwith issues.. as far as decals and things go.. i was talking bare necesseties........ other stuff could be added.. but to be played those are the absolute necessary things to be sent.... im not sure why so much data needs to be sent by the server.... as far as i can see the client only needs to know where the car is, where the car is facing, and where its going... (maybe how much damage the car has.. but even still a limited view of this would work) a lot of other things are kinda superfluous.... Kent
  6. i posted a litle coment on this in the mod suggestions section... kinda technical but it kinda puts a feasible (you can sorta see how the code could be implemented) twist to it.. Kent
  7. i just got this bug too... quite humorous... happened to me after gta3 throwing faults a few times and me restarting it... im sure the way i was doing that was throwing the mp console software through a trip... it was cute though.. Kent
  8. when the netcode is all optimized and stuff.. it will be interesting to see what will be kept from the normal gta3 game.. as far as traffic goes... i don't see why adding all the other stuff is a big deal... lets assume there are a hundred AI controlled cars in the game.. the client machines need only know the position and orientation of the vehicles... (maybe some other stuff as far as damage goes... but thats just another integer probably or even a short)... so you have 3 floats for position and 3 floats for rotation... (on 3 axes) floats and integers are each 4 bytes.. so we have 24 bytes per car... in total tahts only an extra 2.34k maybe 2.7k if counting the damage of other vehicles... to have to send across the server... (that doesn't sound like a whole lot when people are getting 300k/sec connections... add pedestrians to that.. it become bigger.. even still the server would only have to tell the client machine where peds are in a certain radius.. (same for cars)... i imagine a good size chunk of peds and AI vehicles would be 25 cars... and i dunno 30 peds (really crowded area).. a ped would need the same amount of data (3 position floats, and 3 angle floats.. and an integer for which animation sequence the character is in).. so thats an extra 1.5k to send each time... thats chump change ... even then they are adding compression algorithms to the netcode... I don't think its necessarily going to be aproblem to support all this... the biggest trouble would be having the client machines clear out all vehicles... and nextly writing the algorithm to customize packets for each person to receive.. (a distance formula sqrt((originx-pedx)^2+(originy-pedz)^2+originy-pedz)^2).. just check that in a condition against some arbitrary distance (which could be customized according to the client's bandwith capabilities...)... it would work, .. also..i think the 3dNow! on Athlons has a built in assembly call for the square root function (its pretty cpu intensive otherwise if doing it for every pedestrian for every packet on each client).... though, even then the more you put on the server's cpu, the less you need to tell the client... ok im getting entirely way to low level with this, i'll try tokeep it more general.. im just saying that it shouldn't be a big deal for a server running gta3 as an observer, to check where the other cars are and tell the client's accordingly what is near it..) Kent
  9. awesome, thanks a lot.. it actually works pretty well.. i mean its laggy... but its still a lot of fun... especially watching somebody else's tank flying slo-mo over the bridge in portland... Hope 0.3 comes out soon... it looks very promising... just needs a few bug fixes... especially alt+f12 crashing if the other person isn't ready .... but that shouldn't even be an issue in the next version, so i dunno what im saying... wish i'd have thought of it... i've been tinkering in game design lately.. I have a working opengl engine.. but no physics coders or netcode coders (?) .. but yeah the concept of using an external program to make a game multiplayer, by messing w/ memory addresses and such is a novel concept.... i wonder how many other "single" player game modders will catch on.... kent
  10. guess this isn't really a bug more or less me doing something wrong.. just need some clarification.. do the cars need to be in the same place as on the other computer when synchronizing?? example.. I pick a taxi to represent the other player, and a stallion for myself.. Do i need to place the taxi where the other players car will start or do i just need to pick a car, and then get in my stallion? Sorry if this is unclear.. im really not sure how best to explain where im confused... Kent
×
×
  • Create New...