Gamestudio Links
Zorro Links
Newest Posts
Trading Journey
by M_D. 04/26/24 20:22
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
Zorro FIX plugin - Experimental
by flink. 04/21/24 07:12
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
4 registered members (M_D, AndrewAMD, Quad, Ayumi), 806 guests, and 5 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 4 1 2 3 4
Re: Encrypt and Client-side movement [Re: WretchedSid] #433389
11/28/13 20:13
11/28/13 20:13
Joined: Oct 2011
Posts: 1,082
Germany
C
Ch40zzC0d3r Offline
Serious User
Ch40zzC0d3r  Offline
Serious User
C

Joined: Oct 2011
Posts: 1,082
Germany
I dont want to sell it -.-
Everything is free, if nobody does a thing I need to do something and upload so we have something we can work with. And NO the ac is not made in vb.
Its made in C++ compiled as dll. Ive got all the basics like scanning for windowtitle, process name, looping through all loaded dlls, scanning md5 and for known patterns and so on but these are easy to track so I did some special work on it. First of all Im hooking engine frame, present/endscene reset and dip (DrawIndexPrimitives) and checking for return address and modified memory (crc32) in these regions, not whole module because of the speed gain.
Im also doing maaany anti debugging tricks (wont post them here are up to 12 functions), Ive also encrypted all strings, added an own function to destroy the game if a hack or something was detected (No APIs used, Im writing directly 0xFF into the application memory). I also crypted it in runtime with Code Virtualizer and I packed it with UPX, but I will use a new packer soon something like Themida or VMProtect.
I also hooked 10 standard "hacking" APIs like LoadLibrary, OpenProcess, Write/ReadProcessMemory and so on. Always checking handles, names etc.
I will do these checks if commercial released here with a database so every user can add and review hacking tools etc.

Last edited by Ch40zzC0d3r; 11/28/13 20:24.
Re: Encrypt and Client-side movement [Re: Ch40zzC0d3r] #433393
11/28/13 22:36
11/28/13 22:36
Joined: Jan 2002
Posts: 4,225
Germany / Essen
Uhrwerk Offline
Expert
Uhrwerk  Offline
Expert

Joined: Jan 2002
Posts: 4,225
Germany / Essen
Why would you want to do this?


Always learn from history, to be sure you make the same mistakes again...
Re: Encrypt and Client-side movement [Re: Uhrwerk] #433395
11/28/13 22:43
11/28/13 22:43
Joined: Oct 2011
Posts: 1,082
Germany
C
Ch40zzC0d3r Offline
Serious User
Ch40zzC0d3r  Offline
Serious User
C

Joined: Oct 2011
Posts: 1,082
Germany
To prevent people from cheating?
Or what do you mean? I dont get it lol

Last edited by Ch40zzC0d3r; 11/28/13 22:45.
Re: Encrypt and Client-side movement [Re: Ch40zzC0d3r] #433396
11/28/13 22:50
11/28/13 22:50
Joined: Jan 2002
Posts: 4,225
Germany / Essen
Uhrwerk Offline
Expert
Uhrwerk  Offline
Expert

Joined: Jan 2002
Posts: 4,225
Germany / Essen
Cheating in which game?


Always learn from history, to be sure you make the same mistakes again...
Re: Encrypt and Client-side movement [Re: Uhrwerk] #433397
11/28/13 23:04
11/28/13 23:04
Joined: Oct 2011
Posts: 1,082
Germany
C
Ch40zzC0d3r Offline
Serious User
Ch40zzC0d3r  Offline
Serious User
C

Joined: Oct 2011
Posts: 1,082
Germany
In the game of the threadtarter for example. Many people create online games here and want a little bit security shocked

Re: Encrypt and Client-side movement [Re: Ch40zzC0d3r] #433402
11/29/13 05:01
11/29/13 05:01
Joined: Jan 2006
Posts: 968
EpsiloN Offline OP
User
EpsiloN  Offline OP
User

Joined: Jan 2006
Posts: 968
I never ment I'll make the char stats and inventory client-side. Thats something that needs updating once every minute, for example. But the position is constantly updating.
Nevermind the problem laugh I wont use it. I just tought from that statement from the manual, that I can use client-side movement now.

I have a prediction that is off by 20 quants, and I cant avoid it, because the engine moves things differently on high speeds. I'll try to make it a little more precise, but I doubt I'll get closer to the truth.

Client-side movement would be best, but I guess it'll never happen...

PS.: Anyone can think of a way to make the rendering 100ms late? Like in Counter-Strike Source.


Extensive Multiplayer tutorial:
http://mesetts.com/index.php?page=201
Re: Encrypt and Client-side movement [Re: EpsiloN] #433403
11/29/13 06:10
11/29/13 06:10
Joined: Oct 2011
Posts: 1,082
Germany
C
Ch40zzC0d3r Offline
Serious User
Ch40zzC0d3r  Offline
Serious User
C

Joined: Oct 2011
Posts: 1,082
Germany
You just need a good prediction formula I dont thin its the engines fault.
Im lerping my positions and doing ping/velocity prediction.
Works fine up to 200ms pings but keep in mind im coding a fps no rpg.
You dont even have to be too precise.

Re: Encrypt and Client-side movement [Re: Ch40zzC0d3r] #433482
11/30/13 10:30
11/30/13 10:30
Joined: Jan 2006
Posts: 968
EpsiloN Offline OP
User
EpsiloN  Offline OP
User

Joined: Jan 2006
Posts: 968
"the engines fault"
I once posted here for help because of a test I made that gave a very wrong position.

MMO btw. Dont smile like that :}

I used c_move with a speed X times greater than the speed per frame for Y frames (wich adds up to the total distance, on theory) and the two entities were off by 30 quants when gliding on a wall. I dont remember wich (the instant or actual moving entity) one got further right now.

I discarded that test and code.
Now I use the same principle , multiplying the distance that needs to be covered for certain number of frames.
But my prediction is (at best) off by 7-8 quants, wich is fine. But when it reaches 20 quants (more than half of the time) I move the entity towards the prediction, wich produces visible 'artefacts'. If I dont move it , it'll be more than 20 quants next time and the ent has to snap to place.

I see we're getting off topic on this one, but I hope its fine.
Could you give me some clues how you do it? Keep in mind I update 5 times/sec.

Here's my prediction (simple extrapolation really) code:
Code:
var temp_pos[3];
		vec_set(temp_pos[0],my.x);
		var temp_speed[3];
		var temp_trace[3];
		if(my.movement_input == 1) { temp_speed[0] = ((( 16 / time_step ) / 1000 ) * (my.movement_speed * time_step )) * latency_time; temp_speed[1] = 0; }
		if(my.movement_input == 2) { temp_speed[0] = ((( 16 / time_step ) / 1000 ) * ((my.movement_speed * 0.7142857142857143) * time_step )) * latency_time; temp_speed[1] = ((( 16 / time_step ) / 1000 ) * (my.movement_speed * time_step )) * latency_time; }
		if(my.movement_input == 3) { temp_speed[0] = ((( 16 / time_step ) / 1000 ) * ((my.movement_speed * 0.7142857142857143) * time_step )) * latency_time; temp_speed[1] = ((( 16 / time_step ) / 1000 ) * ((-my.movement_speed * 0.7142857142857143) * time_step )) * latency_time; }
		if(my.movement_input == 4) { temp_speed[0] = ((( 16 / time_step ) / 1000 ) * (-my.movement_speed * time_step )) * latency_time; temp_speed[1] = 0; }
		if(my.movement_input == 5) { temp_speed[0] = ((( 16 / time_step ) / 1000 ) * ((-my.movement_speed * 0.7142857142857143) * time_step )) * latency_time; temp_speed[1] = ((( 16 / time_step ) / 1000 ) * ((my.movement_speed * 0.7142857142857143) * time_step )) * latency_time; }
		if(my.movement_input == 6) { temp_speed[0] = ((( 16 / time_step ) / 1000 ) * ((-my.movement_speed * 0.7142857142857143) * time_step )) * latency_time; temp_speed[1] = ((( 16 / time_step ) / 1000 ) * ((-my.movement_speed * 0.7142857142857143) * time_step )) * latency_time; }
		if(my.movement_input == 7) { temp_speed[0] = 0; temp_speed[1] = ((( 16 / time_step ) / 1000 ) * (my.movement_speed * time_step )) * latency_time; }
		if(my.movement_input == 8) { temp_speed[0] = 0; temp_speed[1] = ((( 16 / time_step ) / 1000 ) * (-my.movement_speed * time_step )) * latency_time; }
		if(my.movement_input == 0) { temp_speed[0] = 0; temp_speed[1] = 0; }
		debug_var[1] = latency_time;
		debug_var[2] = temp_speed[0];
		debug_var[3] = temp_speed[1];
		temp_speed[2] = 0;
		c_move(me , vector(temp_speed[0],temp_speed[1],temp_speed[2]) , NULLVECTOR , GLIDE );

		vec_set( temp_speed , NULLVECTOR );
		vec_set( temp_trace , vector( my.x , my.y , my.z - 150 + my.foot_height ) );
		c_trace( my.x , temp_trace , IGNORE_PASSABLE | IGNORE_ME | USE_BOX );
		if( !trace_hit )
		{
			vec_set( target , temp_trace );
		}
		my.soil_height = target.z - my.foot_height;
		
		if(my.z > my.soil_height + ( 5 + 20 * my.soil_contact ) * time_step )
		{
			my.soil_contact = 0;
			temp_speed[2] = maxv( temp_speed[2] - 9 * time_step , -90 );
		}
		else
		{
			my.soil_contact = 1;
			temp_speed[2] = 0;
			my.z = my.soil_height;
		}

		if( temp_speed[2] ) { c_move( me , nullvector , vector( 0 , 0 , temp_speed[2] * time_step ) , IGNORE_PASSABLE ); }
		my.z = maxv( my.soil_height , my.z );

		vec_set(my.predicted_current_x,my.x);
		vec_set(my.x,temp_pos[0]);



The function takes "latency_time" as an argument, to use for duration of movement, like 200ms between 2 updates.

I tought about using the same prediction client-side to move the entity just a little bit toward the upcomming position, so that it doesnt snap or get corrected when the pos arrives. Thats the best I can think off...

PS.: The "(( 16 / time_step ) / 1000 )" is used to get the duration of one frame in ms(i think, cant remember anymore)
It gets multiplied by speed to get distance to be covered for 1 ms, and then multiplied by latency_time to give total distance for the requested time.
Maby thats what gives me errors, but it all added up on theory...

Last edited by EpsiloN; 11/30/13 10:34.

Extensive Multiplayer tutorial:
http://mesetts.com/index.php?page=201
Re: Encrypt and Client-side movement [Re: EpsiloN] #433484
11/30/13 11:24
11/30/13 11:24
Joined: Oct 2011
Posts: 1,082
Germany
C
Ch40zzC0d3r Offline
Serious User
Ch40zzC0d3r  Offline
Serious User
C

Joined: Oct 2011
Posts: 1,082
Germany
Well your code is rather long and I dont have too much time today.
However, are you doing c_move only clientsided or on server and client?
What Im doing:
Im doing my whole movement clientsided, gravity, jumping, etc etc.
Im sending my new position all time and the whole vector because it needs less overhead as if I would send every position as soon as it gets changed.
On the server Im lerping with a ping factor, means higher ping more smooth lerping.
Then Im calculating the velocity out of the movement multiply it with the ping and add it to the x and y coordinate:

Code:
vVelocity[pPlayer].x = speedX * ping/1000;
vVelocity[pPlayer].y = speedY * ping/1000;

...

newpos = receive(player.x);
newpos.x += vVelocity[pPlayer].x;
newpos.y += vVelocity[pPlayer].y;
vec_lerp(player, newpos, pingoffset);



I wont predict my z pos because the players would glide into the ground if they fall from high places grin

Last edited by Ch40zzC0d3r; 11/30/13 11:24.
Re: Encrypt and Client-side movement [Re: Ch40zzC0d3r] #433522
12/01/13 09:31
12/01/13 09:31
Joined: Jan 2006
Posts: 968
EpsiloN Offline OP
User
EpsiloN  Offline OP
User

Joined: Jan 2006
Posts: 968
The important part is this :
Code:
if(my.movement_input == 1)
		{
			temp_speed[0] = ((( 16 / time_step ) / 1000 ) * (my.movement_speed * time_step )) * latency_time;
			temp_speed[1] = 0;
		}
		c_move(me , vector(temp_speed[0],temp_speed[1],temp_speed[2]) , NULLVECTOR , GLIDE );


This is the code that predicts where the entity should be based on "latency_time" given. It simply moves the entity forward to simulate latency_time passed.

I checked the math, although there is an easier way to get quants/ms, this works accurately. I dont understand where is the problem, because I even include the actual latency time to correct for lag. I'm testing everything on 7ms. (one comp.)
The client moves localy through C_Move , the Server moves the client with C_Move to catch up and use more accurate collision detection, and uses prediction to send the 'next' expected position.
So I'm thinking of including the prediction function on the client and to interp between the actual client position and the expected server future response.
This is all without changing pan angles or anything, simply moving the entity forward on client and server simultaneously and using this function to predict where the client should be on the next update sent. Also , will tune up the time_frame variable to get average frame time on time_step.

Maby even adding a 'speed-up' effect on the client could reduce the error given by the engine.

I dont know why it gives wrong results, cuz in theory it should be extremely accurate.

PLEASE , HELP! grin


Extensive Multiplayer tutorial:
http://mesetts.com/index.php?page=201
Page 2 of 4 1 2 3 4

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