Gamestudio Links
Zorro Links
Newest Posts
Blobsculptor tools and objects download here
by NeoDumont. 03/28/24 03:01
Issue with Multi-Core WFO Training
by aliswee. 03/24/24 20:20
Why Zorro supports up to 72 cores?
by Edgar_Herrera. 03/23/24 21:41
Zorro Trader GPT
by TipmyPip. 03/06/24 09:27
VSCode instead of SED
by 3run. 03/01/24 19:06
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (VoroneTZ, monk12, Quad), 829 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
sakolin, rajesh7827, juergen_wue, NITRO_FOREVER, jack0roses
19043 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 5 1 2 3 4 5
[Anet] physics movement setup #285183
08/17/09 14:19
08/17/09 14:19
Joined: May 2009
Posts: 1,816
at my pc (duh)
darkinferno Offline OP
Serious User
darkinferno  Offline OP
Serious User

Joined: May 2009
Posts: 1,816
at my pc (duh)
ok, i'm trying to set up multiplayer, i dont want to receive the common, "start simple" chat.. i'll learn as i progress, what i want to do here is, no coding [would be helpful tho ^^] but a guideline of steps to take in setting up basic multiplayer movement.... [using physics ^^]...

my thoughts so far is that:

- i initialize the server
- each client joins and a entity is created on the server and given a global pointer that the client can use
- key inputs are fed to the server and the server moves the entity accordingly..

am i off? any pointers or is there a template, demo similar to this somewhere?

Re: [Anet] physics movement setup [Re: darkinferno] #285301
08/17/09 23:20
08/17/09 23:20
Joined: May 2009
Posts: 1,816
at my pc (duh)
darkinferno Offline OP
Serious User
darkinferno  Offline OP
Serious User

Joined: May 2009
Posts: 1,816
at my pc (duh)
[update].. it seems so far that almost all multiplayer demos i've seen so far with Anet use client side movement, am wondering if there is a small player script i could see that shows the basics of server side movement.. i'm coninuing to experiment though... currently i do have physics but i learnt the hard way, i cant do that client side .. gets buggy if its to interact with other clients... grin

Re: [Anet] physics movement setup [Re: darkinferno] #285347
08/18/09 08:27
08/18/09 08:27
Joined: Jul 2005
Posts: 1,930
Austria
Dark_samurai Offline
Serious User
Dark_samurai  Offline
Serious User

Joined: Jul 2005
Posts: 1,930
Austria
Quote:
it seems so far that almost all multiplayer demos i've seen so far with Anet use client side movement


Yes, I already told you that I always do it clientside ^^

Why don't you also make it clientside? It's easier to program and isn't that laggy.


ANet - A stable and secure network plugin with multi-zone, unlimited players, voip, server-list features,... (for A7/A8)!
get free version
Re: [Anet] physics movement setup [Re: Dark_samurai] #285351
08/18/09 08:34
08/18/09 08:34
Joined: Jul 2007
Posts: 959
nl
F
flits Offline
User
flits  Offline
User
F

Joined: Jul 2007
Posts: 959
nl
i am using the free anet together white newton and do it al server side

the project isnt that big but until now it works almost perfect


"empty"
Re: [Anet] physics movement setup [Re: flits] #285360
08/18/09 09:16
08/18/09 09:16
Joined: Jul 2005
Posts: 1,930
Austria
Dark_samurai Offline
Serious User
Dark_samurai  Offline
Serious User

Joined: Jul 2005
Posts: 1,930
Austria
Can you explain us in a few words how you are doing that? I think this is interesting for alot people (not only us).


ANet - A stable and secure network plugin with multi-zone, unlimited players, voip, server-list features,... (for A7/A8)!
get free version
Re: [Anet] physics movement setup [Re: Dark_samurai] #285374
08/18/09 10:30
08/18/09 10:30
Joined: Jul 2007
Posts: 959
nl
F
flits Offline
User
flits  Offline
User
F

Joined: Jul 2007
Posts: 959
nl
i wil try to explain it as easy as i can but i am not realy a pro in multieplayer

first i create a server + client (whiteout the client it doesnt seem to being able to control the entities)

then startup the client

then when finshed al the loading stuff, send a var id of the client to the server(this maby needs to send some time after each other until it get reset by the server)

after that the server checks the id and creates a model and send only to that client the var back white NULL(stops looping the client voor sending the request)

the model wil need to know wich client has created him
so take there the skill and give him that idd and update his skill

now you will need some controlling of the entitie by just adding him to the physics enigne

then you will need to be able to control its thie a device but that wont be that hard because your anet runs the function on each model

just wait until the model skill id isnt 0 anymore and then check if its the client idd else dont be able to control it

i hope you get the idee it wont be the best solution but it works almost every time


"empty"
Re: [Anet] physics movement setup [Re: flits] #285376
08/18/09 10:39
08/18/09 10:39
Joined: May 2009
Posts: 1,816
at my pc (duh)
darkinferno Offline OP
Serious User
darkinferno  Offline OP
Serious User

Joined: May 2009
Posts: 1,816
at my pc (duh)
ok. i got lost a little when reading that... and @dark_samurai: i can do movemment client side but not phyics movement, it gets buggy

Re: [Anet] physics movement setup [Re: darkinferno] #285387
08/18/09 11:01
08/18/09 11:01
Joined: Jul 2005
Posts: 1,930
Austria
Dark_samurai Offline
Serious User
Dark_samurai  Offline
Serious User

Joined: Jul 2005
Posts: 1,930
Austria
@flits: This could be done much easier. After you connected the clients with the host and did the loading stuff, every client creates his player using enet_ent_create(). With enet_ent_creator() you can check which client created the entity. So their is no need to store a id in the skill. In the function you can do the following:

if(enet_get_clientid() == enet_ent_creator(enet_ent_globpointer(my)))
{ /*you are allowed to control the player*/}

If you do the movement serverside, how do you transfer the control input from the client to the server? And how do you update the positions on the server?

@darkinferno: To start simple try it this way:
Store the control inputs in ONE!!! skill. Use one bit for every key.
send the skill if it has changed
the server makes the according movement and updates the positions and angels using enet_send_pos/ang().

After that is working you will have to solve 2 problems:
1) If you have a high ping, you will notice that the controls of your own player will get slow.
2) Updating the positions and angles the whole time will cause a lot of traffic. You will have to implement death reckoning or something to reduce the traffic.

Best would be to do a mix of clientside and serverside movement. So that the thing you will see clientside is something like a preview of what will happen. But the real collision detection and movement will be done by the server.


ANet - A stable and secure network plugin with multi-zone, unlimited players, voip, server-list features,... (for A7/A8)!
get free version
Re: [Anet] physics movement setup [Re: Dark_samurai] #285414
08/18/09 12:52
08/18/09 12:52
Joined: Oct 2005
Posts: 4,771
Bay City, MI
lostclimate Offline
Expert
lostclimate  Offline
Expert

Joined: Oct 2005
Posts: 4,771
Bay City, MI
I do everything server side. That fixes things like speed hackers, item hacking etc. My process is like this


  • create an array of connections that contain things like a pointer to an entity, the particular connection id to the client that it refers to, etc..
  • when a client connects i choose an empty array slot, fill it with there information (which i get from a local database that contains player information, such as name, type, health, mp etc.)
  • I then send the info to all clients including the one just created, so that they can update there connection arrays. I also send all previous connected clients information to the new one so it stays up to date.
  • the server than goes through a loop with a variable that repeatedly counts to a specific number than goes back to zero. every time it hits different numbers it does different updates, so lets say it goes to 10, it will go from 0 to 10 thne restart, at 5 it will request key presses, at 10 it will update all connections positions etc. All of the while the server is doing the moving and interacting of all the objects.
  • create an array of connections that contain things like a pointer to an entity, the particular connection id to the client that it refers to, etc..
  • when a client disconnects, the server sends a message to every client that the client with that id has disconnected, and the clients and the server itself all remove that players connection list entry.
  • on a side note while all this is going on the client is also looping through the connections and moving entities to the estimated positions that they should be, this helps eliminate some of the choppyness, and i know samauri and flit know this but inferno, thats called dead-reckoning. If you want to get some decent theory, locoweed a long time ago made a tutorial about mp games with a6.22 its on the aum resource site. It is usesless code wise, but may give you a lot of idead mp theory wise.



That about sums it up. its not too complicated. I do some dead reckoning, and it is not a great idea to have the 1 in 10 frame updates for twitch games, but Im making an orpg and it works fine for that.

Last edited by lostclimate; 08/18/09 13:05.
Re: [Anet] physics movement setup [Re: lostclimate] #285434
08/18/09 14:20
08/18/09 14:20
Joined: May 2009
Posts: 1,816
at my pc (duh)
darkinferno Offline OP
Serious User
darkinferno  Offline OP
Serious User

Joined: May 2009
Posts: 1,816
at my pc (duh)
i'm hearing about cheating on client side, bit am wondering, if i'm doing movement clientside, what can a cheater do to get an advantage?

also.. i dont know if dark_samuri would like to do this but it would be cool to see a server-side template or demo similar to the 3d chat program on your website... its easier for me and am sure for everyone else when they have a base to study on wink

Page 1 of 5 1 2 3 4 5

Moderated by  HeelX, Spirit 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1