Gamestudio Links
Zorro Links
Newest Posts
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
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
4 registered members (degenerate_762, AbrahamR, AndrewAMD, ozgur), 667 guests, and 8 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Ent_create with no_send=on problem? #108710
01/23/07 06:33
01/23/07 06:33
Joined: Oct 2003
Posts: 206
N
nkl Offline OP
Member
nkl  Offline OP
Member
N

Joined: Oct 2003
Posts: 206
Ent_create with no_send=on doesn’t creates an a global entity on all connected clients.
Hello.
I am registered A6 pro user.
I use A6 Pro Edition V6.50.6.
I want to reduce the network bandwidth and lag.
I use Ent_create with no_send=on that beats bandwidth.
I write my own movement script for the clients that beats lag.
I have 4 computers.
In computer 1, I start the program in –sv mode.
And then on other 3 computer I start the program in -cl mode.
I find it doesn’t create a global entity on all 3 connected clients.
I want to figure out what cause the problem.
I delete my own movement script.
And test again.
The problem is still happen.
When I delete the no_send=on statement, and test again.
This time I find it can create a global entity on all 3 connected clients.
How do I use Ent_create with no_send=on to creates a global entity on all 3 connected clients.

Thanks for any advice on this problem.
Thanks already.

Following is whole script.
Code:
  
path ".\\Models";
path ".\\Entities";
path ".\\Bitmaps";
//
var video_mode = 6;
var video_screen = 2;
string world_str = <multiplayer.wmb>;
string str_warlock = <blue_warlock.mdl>;
string str_cbabe = <cbabe.mdl>; // CBabe Model
string str_guard = <red_guard.mdl>; // Red Guard Model
function ghost_player()
{
my.nosend=on;
while(1)
{
wait(1);
}
}
//
function move_player()
{
//---
ent_sendnow(my); // force model and position to be sent in the next cycle
wait(1); // make sure it's sent now
my.nosend = on; // don't send anything further
my.nosend_sound=on;
my.nosend_origin=on;
my.nosend_angles=on;
my.nosend_scale=on;
my.nosend_frame=on;
my.nosend_skin=on;
my.nosend_flags=on;
my.nosend_ambient=on;
my.nosend_light=on;
my.nosend_color=on;
my.nosend_uv=on;
//----
wait(1);
proc_local(my,ghost_player);
//
while (1)
{
wait (1);
}
//
}

function main()
{

dplay_smooth = 0;
randomize(); // set random seed

level_load(world_str); // load level
wait(1); // make sure level is loaded
var temp_loc[3];
temp_loc.x =-400 + random(800);
temp_loc.y =-400 + random(800);
temp_loc.z = 0;
ifdef SERVER;
if (connection != 1) // only create a guard on the client/server
{
player = ent_create(str_guard,temp_loc,move_player);
}
ifelse;
player = ent_create(str_cbabe,temp_loc,move_player);
endif;

wait(-0.5);
while (!player)
{wait(1);} // sleep until the player is initialized

wait(1); // give everything a chance to get started before we allow the player to move

move_camera (); // attach a camera to the player
//
}

function move_camera()
{
while (player == NULL)
{
wait (1);
}


while (player != NULL) // player exist?
{
player.x += key_force.y*5; // get force x
player.y += -key_force.x*5; // get force y
player.z = 0; // force z always 0 for now
player.pan+=mouse_force.x*10;
camera.x = player.x - cos (player.pan) * 200;
camera.y = player.y - sin (player.pan) * 200;
camera.z = player.z + 75;
camera.pan = player.pan;
wait (1);
}

}










Last edited by nkl; 01/23/07 06:39.
Re: Ent_create with no_send=on problem? [Re: nkl] #108711
01/23/07 10:46
01/23/07 10:46
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
From the manual:

"When setting this flag immediately after entity creation, the entity can remain invisible on the client because it's file name and position is not sent. For preventing this, set a nosend flag only after the time between two entity updates, given by dplay_entrate, is passed."

Re: Ent_create with no_send=on problem? [Re: jcl] #108712
01/23/07 19:32
01/23/07 19:32
Joined: Oct 2003
Posts: 206
N
nkl Offline OP
Member
nkl  Offline OP
Member
N

Joined: Oct 2003
Posts: 206
Quote:

From the manual:

"set a nosend flag only after the time between two entity updates, given by dplay_entrate, is passed."




Hello.
Thanks for your advice on this problem.
I try change the wait statement before nosend=on from wait(1) to wait(-1).
But the problem is still happen.
I try a number of methods to set a nosend flag only after the time between two entity updates, but all my methods have failed.
Accounting to above code do you have any ideas on how to do it?

Thanks already.


Last edited by nkl; 01/24/07 05:08.
Re: Ent_create with no_send=on problem? [Re: nkl] #108713
01/25/07 04:24
01/25/07 04:24
Joined: Oct 2003
Posts: 206
N
nkl Offline OP
Member
nkl  Offline OP
Member
N

Joined: Oct 2003
Posts: 206
can anyone help with this?

Re: Ent_create with no_send=on problem? [Re: nkl] #108714
01/26/07 05:33
01/26/07 05:33
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
I am not sure what you want to achieve. Do you use an external DLL for sending entity data, or do you just want to limit the bandwidth? The NOSEND flag that stops all entity communication is for the former case, the individual NOSEND_.. flags for the latter case.

Re: Ent_create with no_send=on problem? [Re: jcl] #108715
01/26/07 14:58
01/26/07 14:58
Joined: Oct 2003
Posts: 206
N
nkl Offline OP
Member
nkl  Offline OP
Member
N

Joined: Oct 2003
Posts: 206
hello!
It is because I use an external DLL for sending and receiving entity (position and angle) update data. So I use NOSEND flag that stops all entity communication.
But when I use Ent_create with NOSEND flag, it creates an entity on the server but doesn’t create this entity on all connected clients.
If I run above post script on 4 computers as follow
On computer1, I run the above script in –sv mode.
On computer2, I run the above script in –cl mode. It can display this client entity.
On computer3, I run the above script in –cl mode. This time you can see that it doesn’t create computer2 entity on computer3.
On computer4, I run the above script in –cl mode. This time you can see that it doesn’t create both of the computer2 entity and the computer3 entity on computer4.

how do I use Ent_create with NOSEND flag can creates an entity on the server and on all connected clients?

Thanks for any advice on this problem.
Thanks already.

Last edited by nkl; 01/26/07 16:12.
Re: Ent_create with no_send=on problem? [Re: nkl] #108716
01/26/07 16:19
01/26/07 16:19
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
The NOSEND flag just interrupts the communication after it's set. The engine has no precognition function yet.

So you only need to make sure that NOSEND is set _after_ the server has sent the entity position and model file name to the clients, so they appear there. The safest way to do that is using a local function that sends an entity skill back from the clients to the server, and only set NOSEND after that skill is received.


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