Hi!

This is the first version of the official dead reckoning template of ANet. The goal of this template is to offer an easy methode for creating an online game without thinking about the difficult part of effective position updating.
The template consists of 3 important functions:

- dr_use()
- dr_c_move()
- dr_ghost()

Here is an example of an entity function that uses the DR template:

Code:
function player_func()
{
	VECTOR dist_move;
	
	while(enet_ent_globpointer(my) == -1) {wait(1);}
	
	if(enet_ent_creator(enet_ent_globpointer(my)) == enet_get_clientid())
	{
		use_dr();
		while(1)
		{
			my.pan -= 25*mouse_force.x*time_step;
			dist_move.x = 15*(key_w-key_s)*time_step;
			dist_move.y = 15*(key_a-key_d)*time_step;
			dist_move.z = 0;			
			dr_c_move(me,dist_move,nullvector,IGNORE_PASSABLE+GLIDE);
			
			//controls the camera
			camera.x = my.x-100*cos(my.pan);
			camera.y = my.y-100*sin(my.pan);
			camera.z = my.z+50;
			camera.tilt += mouse_force.y;
			camera.pan = my.pan;

			wait(1);
		}
	}
	else
	{
		dr_ghost();
	}
}



Now I want you to test the template and tell me what you think:
+ Is it already useable?
+ Is it easy to use?
+ What would you improve?
+ How is it working for you?
+ How is it working over internet (had no chance to test this yet)?

The template is free and can also be used with the free version of ANet!
It's currently Lite-C only!


You can get the template here.
Just include dr_template.c into your main script file.

Enjoy!


ANet - A stable and secure network plugin with multi-zone, unlimited players, voip, server-list features,... (for A7/A8)!
get free version