Gamestudio Links
Zorro Links
Newest Posts
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
Trading Journey
by 7th_zorro. 04/27/24 04:42
Help with plotting multiple ZigZag
by M_D. 04/26/24 20:03
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
M1 Oversampling
by jcl. 04/26/24 11:12
Why Zorro supports up to 72 cores?
by jcl. 04/26/24 11:09
Eigenwerbung
by jcl. 04/26/24 11:08
MT5 bridge not working on MT5 v. 5 build 4160
by EternallyCurious. 04/25/24 20:49
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (TipmyPip, Ayumi), 773 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
wandaluciaia, Mega_Rod, EternallyCurious, howardR, 11honza11
19049 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 2 of 5 1 2 3 4 5
Re: [Anet] physics movement setup [Re: darkinferno] #285439
08/18/09 14:39
08/18/09 14:39
Joined: Jul 2005
Posts: 1,930
Austria
Dark_samurai Offline
Serious User
Dark_samurai  Offline
Serious User

Joined: Jul 2005
Posts: 1,930
Austria
Cheaters normaly manipulate the client application for their cheats. And if they are able to get access to the enet_send_skill() function for example and the health of a player is stored in a skill, they can easily cheat wink
Because of this, such important values should be stored on the server. The client only gets a "copy" of those values. But the value that is used for checking if the client is dead or not must be on the server and the client shouldn't be able to change it directly.

I currently have a lot of work, let's see if I have some time do do something like that in the future. But I really can't promise that.


The best would be to try it like I explained above. Shouldn't be too hard to code wink


ANet - A stable and secure network plugin with multi-zone, unlimited players, voip, server-list features,... (for A7/A8)!
get free version
Re: [Anet] physics movement setup [Re: darkinferno] #285450
08/18/09 15:27
08/18/09 15:27
Joined: Oct 2005
Posts: 4,771
Bay City, MI
lostclimate Offline
Expert
lostclimate  Offline
Expert

Joined: Oct 2005
Posts: 4,771
Bay City, MI
Originally Posted By: darkinferno
i'm hearing about cheating on client side, bit am wondering, if i'm doing movement clientside, what can a cheater do to get an advantage?

also.. i dont know if dark_samuri would like to do this but it would be cool to see a server-side template or demo similar to the 3d chat program on your website... its easier for me and am sure for everyone else when they have a base to study on wink


put it this way, the only things that should be defined on the client (for absolute security, of course not always needed) the only thing that should be made on the client is calls to the server, and possible actions like setting rotation, that dont matter to anyone elses gameplay. for example, lets say you have it so that 60/second your character moves on your machine, one in 6 times your position is updated to everyone else, if it is done on the client, the client could hack your program so that you move 600 times a second so now your character can move 10x as fast as everyone and when it updates to the server, the server doesnt know the difference. of course you could make checks on the server on distances moved, but thats like putting bandage on a gash, better to just be more careful instead.

Re: [Anet] physics movement setup [Re: lostclimate] #285545
08/18/09 23:56
08/18/09 23:56
Joined: May 2009
Posts: 1,816
at my pc (duh)
darkinferno Offline OP
Serious User
darkinferno  Offline OP
Serious User

Joined: May 2009
Posts: 1,816
at my pc (duh)
ok, pretty lame question but somehow am not seeing it, how do i create an entity oh the server? creating them on clients is ok how do i say, create 2 entities on the server, am getting a little mixed up as to how anet handles server, server+client

[edit] or maybe am just not thinking this through.. maybe been infront of tha pc for too long ^^

Last edited by darkinferno; 08/19/09 00:15.
Re: [Anet] physics movement setup [Re: darkinferno] #285557
08/19/09 01:09
08/19/09 01:09
Joined: Oct 2005
Posts: 4,771
Bay City, MI
lostclimate Offline
Expert
lostclimate  Offline
Expert

Joined: Oct 2005
Posts: 4,771
Bay City, MI
sorry, you'll have to get your answer from samauri, i dont use his entity management system.

Re: [Anet] physics movement setup [Re: lostclimate] #285596
08/19/09 09:22
08/19/09 09:22
Joined: Jul 2005
Posts: 1,930
Austria
Dark_samurai Offline
Serious User
Dark_samurai  Offline
Serious User

Joined: Jul 2005
Posts: 1,930
Austria
If you call enet_ent_create() it creates the entity everywhere never mind on which host the function is called.

EDIT: Btw. I would advice you to read the Simple 3D chat tutorial and the HowTos. You will have a much smarter start wink

Last edited by Dark_samurai; 08/19/09 09:34.

ANet - A stable and secure network plugin with multi-zone, unlimited players, voip, server-list features,... (for A7/A8)!
get free version
Re: [Anet] physics movement setup [Re: Dark_samurai] #285635
08/19/09 11:52
08/19/09 11:52
Joined: May 2009
Posts: 1,816
at my pc (duh)
darkinferno Offline OP
Serious User
darkinferno  Offline OP
Serious User

Joined: May 2009
Posts: 1,816
at my pc (duh)
yes, i have been through that.. i did make some progress on creating physics entities on the server, my next objective will be to attach a unique pointer to them so each client can have control

Re: [Anet] physics movement setup [Re: darkinferno] #285642
08/19/09 12:38
08/19/09 12:38
Joined: Jul 2005
Posts: 1,930
Austria
Dark_samurai Offline
Serious User
Dark_samurai  Offline
Serious User

Joined: Jul 2005
Posts: 1,930
Austria
Why a unique pointer? The glob. pointer is a unique pointer and can be used to identify the entity. With enet_ent_creator you get the clientid of the creator of the entity. if CreatorID equals myClientID allow controls.

On the server you set up the physicparameters and on the client that controls the entity you fill a skill with the input. Everytime the skill has changed, send it to the server with enet_send_skill(). The server always updates the positions and angles with enet_send_pos/ang.

This would be the entity function:
Code:
function player_function()
{
   if(enet_ent_creator(enet_ent_globpointer(my)) == enet_get_clientid())
   { //Every client controls his own player
      while(1)
      {
         //store the keys as bits in a skill1
         if(my.skill1 != oldskill1) enet_send_skill(enet_ent_globpointer(my),1,1,SERVER);
      }
   }
   if(enet_get_connection() == SERVER_MODE)
   {
      //set up the physic stuff
      while(1)
      {
           //use skill1 for the controls of the entity
           enet_send_pos(enet_ent_globpointer(my),BROADCAST);
           enet_send_ang(enet_ent_globpointer(my),BROADCAST);
      }
   }
}



That's all wink Simple? Yes it is laugh

All you have to notice is that every client must create his player using enet_ent_create().


ANet - A stable and secure network plugin with multi-zone, unlimited players, voip, server-list features,... (for A7/A8)!
get free version
Re: [Anet] physics movement setup [Re: Dark_samurai] #285646
08/19/09 13:31
08/19/09 13:31
Joined: May 2009
Posts: 1,816
at my pc (duh)
darkinferno Offline OP
Serious User
darkinferno  Offline OP
Serious User

Joined: May 2009
Posts: 1,816
at my pc (duh)
i tried the above, well.. i tried this to be exact:

Code:
function move_player()
{
	while(enet_ent_globpointer(my) == -1) {wait(1);} //wait until the entity gets a global pointer
	
   if(enet_ent_creator(enet_ent_globpointer(my)) == enet_get_clientid())
   { //Every client controls his own player
      while(1)
      {
         //store the keys as bits in a skill1
        // if(my.skill1 != oldskill1) enet_send_skill(enet_ent_globpointer(my),1,1,SERVER);
        wait(1);
      }
   }
   if(enet_get_connection() == 2)
   {
      //set up the physic stuff
		phent_settype(my, PH_RIGID, PH_BOX);//physik entity definieren & kollision = sphere
		phent_setmass(my, 75, PH_SPHERE);//masse definieren & rotation = sphere
      
      while(1)
      {
           //use skill1 for the controls of the entity
           //enet_send_pos(enet_ent_globpointer(my),BROADCAST);
           //enet_send_ang(enet_ent_globpointer(my),BROADCAST);
           wait(1);
      }
   }

}



i'm working with the way you set up the chat program, so the entities are created when the client joins via:

Code:
function create_player()
{
	VECTOR creating_pos; //position were the entity will be created
	
	//generates the starting position:
	if(enet_get_clientid() == 0) {creating_pos.x = 0;creating_pos.y = 0;}
	if(enet_get_clientid() == 1) {creating_pos.x = -200;creating_pos.y = 0;}
	if(enet_get_clientid() == 2) {creating_pos.x = 200;creating_pos.y = -200;}
	if(enet_get_clientid() == 3) {creating_pos.x = 200;creating_pos.y = 200;}
	creating_pos.z = 0;
	
	//creates the coresponding character:
	if(character == 1) {player =enet_ent_create(_str("char1.mdl"),creating_pos,_str("move_player"));}
	if(character == 2) {player =enet_ent_create(_str("char1.mdl"),creating_pos,_str("move_player"));}
	if(character == 3) {player =enet_ent_create(_str("char1.mdl"),creating_pos,_str("move_player"));}

}



what this does however is, when i run as server/client, it creates the entity but physics isnt applied, when i join as a client, the character i created has physics applied, now if am correct, somethings wrong here? i shouldnt be seeing any movement on the client unless i sent positions?

[edit] i think i may be overlooking something simple however, am looking into it, i made this post maybe a little early

Last edited by darkinferno; 08/19/09 13:47.
Re: [Anet] physics movement setup [Re: darkinferno] #285656
08/19/09 14:35
08/19/09 14:35
Joined: Jul 2005
Posts: 1,930
Austria
Dark_samurai Offline
Serious User
Dark_samurai  Offline
Serious User

Joined: Jul 2005
Posts: 1,930
Austria
if(enet_get_connection() == 2) means on every client, but you want the movement on the server correct?

=> correct would be if(enet_get_connection() == SERVER_MODE || enet_get_connection() == CLIENT_SERVER_MODE)


ANet - A stable and secure network plugin with multi-zone, unlimited players, voip, server-list features,... (for A7/A8)!
get free version
Re: [Anet] physics movement setup [Re: Dark_samurai] #285685
08/19/09 17:11
08/19/09 17:11
Joined: May 2009
Posts: 1,816
at my pc (duh)
darkinferno Offline OP
Serious User
darkinferno  Offline OP
Serious User

Joined: May 2009
Posts: 1,816
at my pc (duh)
ok.. well the above worked, i now have movement on the clients by sending positions from the server but, the server/client doesnt get updated, only the other clients that join...

Page 2 of 5 1 2 3 4 5

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