Gamestudio Links
Zorro Links
Newest Posts
Data from CSV not parsed correctly
by EternallyCurious. 04/25/24 10:20
Trading Journey
by howardR. 04/24/24 20:04
M1 Oversampling
by Petra. 04/24/24 10:34
Zorro FIX plugin - Experimental
by flink. 04/21/24 07:12
Scripts not found
by juergen_wue. 04/20/24 18:51
zorro 64bit command line support
by 7th_zorro. 04/20/24 10:06
StartWeek not working as it should
by jcl. 04/20/24 08:38
folder management functions
by VoroneTZ. 04/17/24 06:52
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (AndrewAMD, SBGuy, Petra), 801 guests, and 8 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Mega_Rod, EternallyCurious, howardR, 11honza11, ccorrea
19048 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
client_id stays negative #448898
02/25/15 11:02
02/25/15 11:02
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline OP
Senior Expert
Superku  Offline OP
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
I have a problem with my current multiplayer code which I cannot seem to figure out. I have a grenade launcher and I create grenades on the server globally (clients request the creation). The start of the entity function is as follows:

Code:
void shoot_grenade()
{
	set(my,TRANSLUCENT | PASSABLE);
	while(my.client_id < 0)
	{
		draw_num3d(my.client_id,my.x,0,COLOR_WHITE);
		wait(1);
	}
	reset(my,TRANSLUCENT | PASSABLE);
	...
}


Most of the time it works nicely but sometimes (every 1-30th grenade) the entity creation does not seem to get confirmed and client_id stays negative (some value, the same on both client and server). Have you any idea what could cause such behavior?
Why does it get negative on the server anyway, shouldn't that only be happening on a client's computer?

The setup is Server+client (connection == 3), a client, current A8 pro version with session_open/ connect and
Code:
dplay_localfunction = 2;
dplay_entrate = 100; // does not make a difference if 1 or 100 for that problem
dplay_smooth = 0;
dplay_maxclients = 16;
dplay_diag = 1;


Btw. I can send in the project if necessary, it's not that huge and only mildly confusing.


"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: client_id stays negative [Re: Superku] #448918
02/25/15 12:37
02/25/15 12:37
Joined: Jul 2000
Posts: 27,982
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,982
Frankfurt
Does this only happen with grenades created by the server-client, or also with grenades created by a client?

Re: client_id stays negative [Re: jcl] #448927
02/25/15 16:22
02/25/15 16:22
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline OP
Senior Expert
Superku  Offline OP
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
I had to change the code slightly to test that but the entity/ grenade creation seems to work flawlessly when ent_create is triggered on the client's computer/ application. This can be used as a workaround but for multiple reasons I would prefer to keep the grenade creation server-side.

(EDIT: In the old/ regular version ent_create only gets called on the server(-client), and all player and bot entities request the creation by some skill manipulation.)

Last edited by Superku; 02/25/15 18:05.

"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: client_id stays negative [Re: Superku] #448961
02/26/15 15:25
02/26/15 15:25
Joined: Jul 2000
Posts: 27,982
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,982
Frankfurt
Ok, can you send us the project? Preferably in a state where the problem can be seen without much preparations?

Re: client_id stays negative [Re: jcl] #448981
02/26/15 20:08
02/26/15 20:08
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline OP
Senior Expert
Superku  Offline OP
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
An e-mail has been sent, thanks in advance.


"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: client_id stays negative [Re: Superku] #448989
02/27/15 10:47
02/27/15 10:47
Joined: Jul 2000
Posts: 27,982
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,982
Frankfurt
Thanks, we'll look into it and forward it to the developer when the problem can be confirmed.


Moderated by  old_bill, Tobias 

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