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
1 registered members (AndrewAMD), 945 guests, and 8 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 2 of 2 1 2
Re: ignoring creator entity in multipålayer [Re: Denn15] #450318
04/12/15 13:00
04/12/15 13:00
Joined: Dec 2011
Posts: 1,823
Netherlands
Reconnoiter Offline
Serious User
Reconnoiter  Offline
Serious User

Joined: Dec 2011
Posts: 1,823
Netherlands
It sounds that your problem is that the 'you' pointer is different for the server and each client. So IGNORE_YOU does not do the same on each computer. I don't know for sure though. But its easy to check if that's the problem:

When the server player fires, does his projectile also sometimes hit himself?

Whatever the case, I think the easiest problem to solve this is just to remove the IGNORE_YOU line and create the projectile a bit futher away from player/block.

Or perhaps send a handle of the firing player on the server to the clients, though the problem here is a small delay before the clients get the handle from the server.

Or or: let almost all of the code run only on the server and only small visual effects like movement and particles effects etc. run on the client. And than only create entities on the server (not on the clients) and remove the projectiles only on the server (let the server send the STATE of the projectile to the clients). This way only the server needs to know the 'you' pointer wink.

Re: ignoring creator entity in multipålayer [Re: Reconnoiter] #450319
04/12/15 13:45
04/12/15 13:45
Joined: Dec 2009
Posts: 82
D
Denn15 Offline OP
Junior Member
Denn15  Offline OP
Junior Member
D

Joined: Dec 2009
Posts: 82
The projectiles event does not seem to trigger with the server player, however the player still gets pushed all over the place because of the projectile.

I have thought about just creating the projectile away from the player, but i would rather want the two to completely ignore esch other just to be sure that there is not gonna happen some jerks in the gameplay or the projectiles spawning inside other players and stuff like that.

I have thought about the handle thing but i just dont know how to make a c_move instruction ignore an entity with a specific handle. my first thought was to use c_ignore with the handle but entity groups only ranges from 0 - 30 and the handle is something 3000 number so that would not work. is there another way to use it?

About running it all on the server, that is also an option but it then there would be small delays on players movement and such and it would feel less smooth.


Last edited by Denn15; 04/12/15 13:47.
Re: ignoring creator entity in multipålayer [Re: Denn15] #450320
04/12/15 14:19
04/12/15 14:19
Joined: Dec 2011
Posts: 1,823
Netherlands
Reconnoiter Offline
Serious User
Reconnoiter  Offline
Serious User

Joined: Dec 2011
Posts: 1,823
Netherlands
Originally Posted By: Denn15
About running it all on the server, that is also an option but it then there would be small delays on players movement and such and it would feel less smooth.
, you will get a small delay on the clients, however this delay is technically than only a visual one since the server does the real work and the clients just move projectiles for smooth movement. To 'hide' these small delays, most mp games use things like interpolation. I don't know how experienced you are with mp, but these things can get pretty difficult and head scratching (I have experienced it myself the hard way grin ).

Is your game fps/3rd person or topdown? For topdown it is a bit easier to get things right since the camera is more far away so you could get away with a simple/not perfect interpolation function or no interpolation at all perhaps.

Last edited by Reconnoiter; 04/12/15 14:21.
Re: ignoring creator entity in multipålayer [Re: Reconnoiter] #450321
04/12/15 15:07
04/12/15 15:07
Joined: Dec 2009
Posts: 82
D
Denn15 Offline OP
Junior Member
Denn15  Offline OP
Junior Member
D

Joined: Dec 2009
Posts: 82
the game is a firstperson shooter. this is my first ever try at a multiplayer game so im not experienced at all tongue but im guessing that interpolation is some sort of prediction og players positioing and such?

Re: ignoring creator entity in multipålayer [Re: Denn15] #450323
04/12/15 15:46
04/12/15 15:46
Joined: Jan 2006
Posts: 968
EpsiloN Offline
User
EpsiloN  Offline
User

Joined: Jan 2006
Posts: 968
You cant send handles over the internet. Well, you could, but it will most probably fail at some point...

The solution to your problem is the IGNORE_YOU method you originally tried to use laugh

The problem is that the you pointer is probably reset and you havent saved it anywhere, or on the wrong machine.

Here's what I mean:
Create the bullet on the client and attach a custom local function for it.
On the server it runs the function given in the ent_create statement on the client.
With the local function you attached and on the server's function for that bullet, search for the player entity that has the same client_id as the desired client.
When you find it, set 'you' to that player both in the server function and in the local custom function, and use IGNORE_YOU on both machines.

The other method, (I'm currently building it) is to have local bullets only.
ent_createlocal...
Its executed on the client and on the server when a client hits the mouse button. And the same process goes, search for a player entity with the same client_id, set 'you' to that player entity and IGNORE_YOU.

PS.: If you get stuck, PM me. I think I'll have my code working soon...


Extensive Multiplayer tutorial:
http://mesetts.com/index.php?page=201
Re: ignoring creator entity in multipålayer [Re: EpsiloN] #450384
04/13/15 15:17
04/13/15 15:17
Joined: Jul 2008
Posts: 2,107
Germany
rayp Offline

X
rayp  Offline

X

Joined: Jul 2008
Posts: 2,107
Germany
Just wrote c_ignore - example ... then i saw the 2nd post grin but ive another idea ( no glue if this will work, guess it will )...

Like "EpsiloN" above said u could compare bullet ent handle with creator handle.
Guess it could work like that in the creator - ent:
Code:
...
ENTITY* entbullet = ent_create (bullet...);
if (entbullet) entbullet.skill100 = handle (me);
...


and in the bullet add something like:
Code:
...
ENTITY* entshooter;
if (my.skill100){
   entshooter = ptr_for_handle (my.skill100);
   if (entshooter) if (me != entshooter){
      ...bullet hit entity, but NOT the creator ( different entity - handles )...
      ...bullet removement here and so on...
   }
}

Guess this could work, give it try, doesnt hurt grin

Peace


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: ignoring creator entity in multipålayer [Re: rayp] #450397
04/13/15 20:35
04/13/15 20:35
Joined: Dec 2009
Posts: 82
D
Denn15 Offline OP
Junior Member
Denn15  Offline OP
Junior Member
D

Joined: Dec 2009
Posts: 82
i just found the problem. since you suggested that it was the you pointer that didnt point to the correct entity i decided to make the player do something visible to the players you entity and the projectile do something visible to its you entity and it seemed like the pointer was valid. because i dint know what to do about the problem i decided to try out testing the you pointers again but this time the players you entity was not the projectile and i found out why.

the player action calls a shooting function that created the projectiles with you=ent_create and thus the you pointer would not be set to that entity in the players action and the c_move instructions was in the players action and the you=ent_create was in the shooting function so i now create the projectiles in the player action and now it works laugh

in short the c_move instruction was not in the same function as the you pointer and then IGNORE_YOU didnt do anything.

anyways thanks for your time and help everyone grin

Page 2 of 2 1 2

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