Gamestudio Links
Zorro Links
Newest Posts
hello all
by jcl. 09/24/19 09:04
Right AssetsFix for trading Forex on IG?
by Andy60. 09/23/19 21:11
Converting fbx file to mdl7
by Dark_Light. 09/23/19 15:50
New system for Zorro S subscriptions
by jcl. 09/23/19 08:34
IG plugin initial release
by Andy60. 09/23/19 07:40
Any chance of PBR materials with A8?
by Dooley. 09/22/19 21:43
Levels, textures, etc for A8
by Dooley. 09/22/19 03:57
AUM Magazine
Latest Screens
The Space Between
Pogostuck: Rage With Your Friends
Worst Case Z
AckCon'18 - Lotter vs the World 2 - Preview Release
Who's Online Now
8 registered members (svenbob, Tamas, MatPed, Superku, kvm, jenGs, 3run, 1 invisible), 642 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Zylo, Hjuutgckk, Dark_Light, oxygenjoe, web20tpo
18292 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: 1,968
Germany
rayp Offline OP

X
rayp  Offline OP

X

Joined: Jul 2008
Posts: 1,968
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


My entry...your exits
Zombies dont like pink glow slime, fact!
"We gonna rock down to electric avenue" "One way ... or anotha ..."
"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
-=GOOGLE IS SKYNET=-
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,811
Netherlands
Reconnoiter Offline
Serious User
Reconnoiter  Offline
Serious User

Joined: Dec 2011
Posts: 1,811
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,985
Canadian, Eh
DLively Offline
Serious User
DLively  Offline
Serious User

Joined: Apr 2005
Posts: 1,985
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,844
Kiel (Germany)
Superku Online
Senior Expert
Superku  Online
Senior Expert

Joined: Sep 2003
Posts: 6,844
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