Gamestudio Links
Zorro Links
Newest Posts
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (AndrewAMD, Akow, degenerate_762), 1,430 guests, and 9 spiders.
Key: Admin, Global Mod, Mod
Newest Members
AemStones, LucasJoshua, Baklazhan, Hanky27, firatv
19055 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 2 of 3 1 2 3
Re: Simple moving example [Re: Dark_samurai] #95247
10/30/06 11:27
10/30/06 11:27
Joined: Sep 2002
Posts: 8,177
Netherlands
PHeMoX Offline
Senior Expert
PHeMoX  Offline
Senior Expert

Joined: Sep 2002
Posts: 8,177
Netherlands
Okey, but this is still true, when the server is actually also a client? All functions started in the normal main, should actually not run on the server/not be visible there?

Cheers


PHeMoX, Innervision Software (c) 1995-2008

For more info visit: Innervision Software
Re: Simple moving example [Re: PHeMoX] #95248
10/30/06 21:18
10/30/06 21:18
Joined: Jan 2003
Posts: 517
Illinois
G
giorgi3 Offline
User
giorgi3  Offline
User
G

Joined: Jan 2003
Posts: 517
Illinois
ok, it looks like we all need to do a little review on WHAT RUNS WHERE. I believe that this is covered in both Locoweeds tutorial and mine, but since nobody reads mine anymore
Quote:


Rule # 1. By default, entities created with ent_create have their actions or functions run on the Server.

Rule # 2. Everything else by default runs on the same computer as the function that called it is running on.

Rule # 3. There are ways of getting around rules 1 and 2.

...

Any function called from main() will run on both the client(s) and the server. Since main runs on both, all functions called from main also run on the client(s) and the server.






Ways around this?? Try the connection variable.


The connection variable is a predefined variable that is automatically set to 0 when A6 starts up. It changes to the following values depending on how the engine was started.

0 - The engine was not started in any multiplayer mode
1 - The engine was started with –sv (Server Session)
2 - The engine was started with – cl (Client Session)
3 - The engine was started with –sv –cl (Server/Client Session)

SO ....

Code:
  main() {
if (connection == 1) {
server_only_function(); // -sv only
}

if (connection == 2) {
client_only_function(); // -cl only
}

if (connection == 3) {
server_client_function(); // -sv AND -cl
}
}
Or even cooler still:

if (connection & 1) {
any_client_function(); // (-cl) or (-sv AND -cl)
}





Giorgi3

10,000 parts flying in a close formation does not constitute an airplane. Some assembly is required.
Re: Simple moving example [Re: giorgi3] #95249
10/31/06 03:59
10/31/06 03:59
Joined: Oct 2002
Posts: 2,256
Oz
L
Locoweed Offline
Expert
Locoweed  Offline
Expert
L

Joined: Oct 2002
Posts: 2,256
Oz
I took a quick glace at how your code is written Dark_samurai,

I would check out these 2 dplay variables and make sure they are set correctly for how you have your code written.

dplay_smooth & dplay_entrate.

You probably need to adjust those if you are going to be updating entities with ent_sendnow() manually.

Loco


Professional A8.30
Spoils of War - East Coast Games
Re: Simple moving example [Re: giorgi3] #95250
10/31/06 18:26
10/31/06 18:26
Joined: Sep 2002
Posts: 8,177
Netherlands
PHeMoX Offline
Senior Expert
PHeMoX  Offline
Senior Expert

Joined: Sep 2002
Posts: 8,177
Netherlands
Thanks for your explanation Giorgi3! At the moment I'm still gathering and looking into mp tutorials, but since I'm also trying some stuff out at the same time, it's very tempting to just ask around. Sorry for this, sort of lazyness.

Cheers

Last edited by PHeMoX; 10/31/06 18:31.

PHeMoX, Innervision Software (c) 1995-2008

For more info visit: Innervision Software
Re: Simple moving example [Re: PHeMoX] #95251
11/01/06 02:27
11/01/06 02:27
Joined: Jan 2003
Posts: 517
Illinois
G
giorgi3 Offline
User
giorgi3  Offline
User
G

Joined: Jan 2003
Posts: 517
Illinois
No Problem. Ask all you want. It's all part of the learning process. And MP requires a lot of study/questions to get the concepts down.

And just to reiterate a tip from Loco. Test over the internet as much as possible. A LAN hides the two biggest issues in MP, Latency and Bandwidth. Both can rear there ugly head once you move your game to the internet.

Re: Simple moving example [Re: giorgi3] #95252
11/01/06 19:06
11/01/06 19:06
Joined: Jul 2005
Posts: 1,930
Austria
Dark_samurai Offline OP
Serious User
Dark_samurai  Offline OP
Serious User

Joined: Jul 2005
Posts: 1,930
Austria
@Locoweed: I played around with the variables and the code, but I still can't get it run without overshootings. Should I use dead reckoning, or is it better not to make use of it? I recognized that your MPbarebones also has overshootings. Can you please give me a modified version of it, without overshootings?

Dark_samurai

Last edited by Dark_samurai; 11/01/06 19:06.

ANet - A stable and secure network plugin with multi-zone, unlimited players, voip, server-list features,... (for A7/A8)!
get free version
Re: Simple moving example [Re: Dark_samurai] #95253
11/02/06 02:49
11/02/06 02:49
Joined: Oct 2002
Posts: 2,256
Oz
L
Locoweed Offline
Expert
Locoweed  Offline
Expert
L

Joined: Oct 2002
Posts: 2,256
Oz
Try to set dplay_smooth = 0; to start with.


Professional A8.30
Spoils of War - East Coast Games
Re: Simple moving example [Re: Dark_samurai] #95254
11/02/06 03:04
11/02/06 03:04
Joined: Jan 2003
Posts: 517
Illinois
G
giorgi3 Offline
User
giorgi3  Offline
User
G

Joined: Jan 2003
Posts: 517
Illinois
Hi Dark_samurai

Unfortunately the dplay_smooth algorithm has (or at least had) some bugs in it that causes overshooting. The ent_sendnow was suppose to help, but it didn't completely eliminate the problem. The issue seems to be the algorithm doesn't handle rapid changes in motion very well. You might start by just shutting it off, but that presents some other issues.

Here are a couple of MP form threads that might be of interest.

locoweed's script - overshoot revisited

MP Smoothing via c-script


Giorgi3

10,000 parts flying in a close formation does not constitute an airplane. Some assembly is required.
Re: Simple moving example [Re: giorgi3] #95255
11/03/06 16:39
11/03/06 16:39
Joined: Jul 2005
Posts: 1,930
Austria
Dark_samurai Offline OP
Serious User
Dark_samurai  Offline OP
Serious User

Joined: Jul 2005
Posts: 1,930
Austria
@giorgi3: Thanks for the Links!

I had an idea:
The client controls his own character and also starts c_move. Then he saves the position of his character. He sends it to the server, which sends it to the other clients. Those correct the position of the character (for example Player3.x = Send_position[1];...).
But now I noticed, that the last part don't work. If the script should correct the position, I can't see a difference. Isn't it possible to change the position of an entity localy?

I hope you understand my idea and problem.

Dark_samurai


ANet - A stable and secure network plugin with multi-zone, unlimited players, voip, server-list features,... (for A7/A8)!
get free version
Re: Simple moving example [Re: Dark_samurai] #95256
11/03/06 17:37
11/03/06 17:37
Joined: Jan 2003
Posts: 517
Illinois
G
giorgi3 Offline
User
giorgi3  Offline
User
G

Joined: Jan 2003
Posts: 517
Illinois
Um...... Yes, I understand your idea. From the MPSmoothing script referenced above:


Code:
 

/*******************************************************************************************************

Design Concept:

This concept is rather simple. I'm going to change the rotation and movement to be handled on the
client side. The servers job will then be to simply 'echo' each clients movements to all the other clients.

Traditionally 3dgs expects this to be handled on the server. To prevent the server from
sending it's automatic updates, I am setting nosend_angles and nosend_origin flags on all entities.

As we gather_input from the client keyboards, each client will apply the keyforces to it's own entity. Then
each client will send the movement coordinates of the entity via skills to the server.

The server will take these coordinates coming in from the clients and 'move' the corresponding entity. Then
the server will 'echo' these movements to all the other clients via other skills.

And finally a "client_move" function will use these 'echo' skills to move the 'echo entities' of other clients.
To smooth the movement effect client_move will use vec_lerp to interpolate the current position and rotation
of the clients' entities with these 'echoed' position updates coming from the server. Simple huh!


Note: This is not a prediction algorithm. Under very high latency this code will break down.

**********************************************************************************************************/



So, you can use that script as a reference if you like.

Also note that in the thread of discussions about this script, we kinda concluded that this method wouldn't scale well in a real game. I wrote it just so I could 'see' the client movement smoothed out without the overshoot problems you get with dplay_smooth enabled.






Last edited by giorgi3; 11/03/06 17:49.

Giorgi3

10,000 parts flying in a close formation does not constitute an airplane. Some assembly is required.
Page 2 of 3 1 2 3

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