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
2 registered members (AndrewAMD, VoroneTZ), 831 guests, and 5 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
Got quick ( and lazy^^ ) basic MP related questions... #450862
04/23/15 21:41
04/23/15 21:41
Joined: Jul 2008
Posts: 2,107
Germany
rayp Offline OP

X
rayp  Offline OP

X

Joined: Jul 2008
Posts: 2,107
Germany
Hi @all!

Today its me having a "iam2lazy4google" - like question. ^^
My problem atm: have 2much work ( reallife [i need the dollar baby] ) and 2much hobbyprojects running ( 4one life grin ).

Guess since A6 came out i never played around with 3dgs mp (mp = multiplayer) again. So i have a quick and really basic question ( or two ), simply trying 2save reading / searching - time while getting some noobinfos about mp related stuff ( on the fly ).

Lets say ive such simple kind of "normal" ( means: none mp ) script:
Code:
#define distX skill100       // X - axis movement in this example

action Monster_WED(){        // applyed2 monster-ent (placed in WED)
   while (!player) wait (1); // maybe wait until player - ent was spawned
   while (my){
      my.distX  = time_step * 4; // this must be done on server site not here? right (asynchron)?
      move_mode = IGNORE_ME | IGNORE_PASSABLE | IGNORE_SPRITES;
      c_move (me, vector (my.distX, 0, 20 * time_step), nullvector, move_mode);
      if (player){ // simply face player (while moving infront)
         VECTOR _temp;
         vec_set      (_temp,  player.x); 
         vec_sub      (_temp,  my.x);
         vec_to_angle (my.pan, _temp);
      }
      wait (1);
   }
   wait        (1);
   ptr_remove (me);
}


What would i add or modify now, 2turn "Monster_WED" in2 mp - compatible action ?
As far as i know the distance / movement - vector must be calculated on server - site ? Right ? shocked


Modified version of script ( mentioned above ) would help me alot 2get the first logic in2.

Thanks for your time n tips.
Greets


Acknex umgibt uns...zwischen Dir, mir, dem Stein dort...
"Hey Griswold ... where u gonna put a tree that big ?"
1998 i married my loved wife ... Sheeva from Mortal Kombat, not Evil-Lyn as might have been expected
rayp.flags |= UNTOUCHABLE;
Re: Got quick ( and lazy^^ ) basic MP related questions... [Re: rayp] #450870
04/24/15 05:16
04/24/15 05:16
Joined: Jan 2006
Posts: 968
EpsiloN Offline
User
EpsiloN  Offline
User

Joined: Jan 2006
Posts: 968
For best results, you should run this action simultaneously on client and server and have some method to correct once in a while with the server's position...


Extensive Multiplayer tutorial:
http://mesetts.com/index.php?page=201
Re: Got quick ( and lazy^^ ) basic MP related questions... [Re: EpsiloN] #450880
04/24/15 10:11
04/24/15 10:11
Joined: Dec 2011
Posts: 1,823
Netherlands
Reconnoiter Offline
Serious User
Reconnoiter  Offline
Serious User

Joined: Dec 2011
Posts: 1,823
Netherlands
As EpsiloN you will want to run the entity both on the server and client. And every once in a while you let server update it if needed.

So first off don't forget to set dplay_localfunction to either 1 or 2 somewhere in your script (actions run on clients too), you probably don't but just to be safe. I once forgot this and was searching for bugs like a headless chicken.

Add
Code:
white(connection != 0 && my.client_id < 0) wait(1);

as your first line in the action. Or it was white(connection != 0 && my.client_id == 0) wait(1); .

Than determine what part of the code you want to run on the server only, and what on both the server and client.

And add the lines to actually send the data from server to client (send_skill, ent_sendnow, whatever you prefer).

Also a tip I once saw on this forum was to set dplay_entrate to a very high number (high dplay_entrate means a long time between updates) and use send_skill and/or ent_sendnow, so you have more control. (allowing for better interpolation, optimizing bps etc.)

Last edited by Reconnoiter; 04/24/15 10:18.
Re: Got quick ( and lazy^^ ) basic MP related questions... [Re: Reconnoiter] #450892
04/24/15 14:08
04/24/15 14:08
Joined: Apr 2005
Posts: 1,988
Canadian, Eh
DLively Offline
Serious User
DLively  Offline
Serious User

Joined: Apr 2005
Posts: 1,988
Canadian, Eh
Awesome laugh This is very helpful indeed!


A8 Pro 8.45.4
YouTube: Create Games For Free
Free Resources: www.CGForFree.com
Re: Got quick ( and lazy^^ ) basic MP related questions... [Re: DLively] #450902
04/24/15 14:52
04/24/15 14:52
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
@rayp: Have you seen this already: http://opserver.de/rwik9/index.php?title=Multiplayer ?


"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends
Re: Got quick ( and lazy^^ ) basic MP related questions... [Re: Superku] #450921
04/24/15 19:36
04/24/15 19:36
Joined: Jan 2006
Posts: 968
EpsiloN Offline
User
EpsiloN  Offline
User

Joined: Jan 2006
Posts: 968
Or this:
Multiplayer - Basic Extensive Tutorial

laugh

But, really, it's easier to start MP, than to convert into MP...

Last edited by EpsiloN; 04/24/15 19:37.

Extensive Multiplayer tutorial:
http://mesetts.com/index.php?page=201

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