ANet - Dead Reckoning template

Posted By: Dark_samurai

ANet - Dead Reckoning template - 02/24/09 13:58

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!
Posted By: Cowabanga

Re: ANet - Dead Reckoning template - 02/24/09 15:56

Thanks! smile
Posted By: MaxF

Re: ANet - Dead Reckoning template - 02/25/09 22:33

Hi

I just get errors:

Error in 'dr_template.c' line 50: 'enet_ent_globpointer' undeclared identifier

< while(enet_ent_globpointer(my) == -1) {wait(1);} //wait until the glob_pointer is available
>
.. 0.239 sec
Posted By: Dark_samurai

Re: ANet - Dead Reckoning template - 02/26/09 16:07

You have to include the ANet header:

Code:
#include <acknex.h>
#include <default.c>
#include "anet.h"
#include "dr_template.c"

Posted By: Gumby22don

Re: ANet - Dead Reckoning template - 06/28/09 00:10

seems the DR template download is not available at present? Has the link changed?

Don
have a great day
Posted By: Dark_samurai

Re: ANet - Dead Reckoning template - 07/02/09 13:43

Yes, the link was only for a little public beta test.

If you want the final template, you need to buy ANet Standard or ANet Professional.
Posted By: Gumby22don

Re: ANet - Dead Reckoning template - 07/03/09 08:35

I have a licence purchase in the works, thanks. But your first post here states:

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

You might need to change that. wink

Don
have a great day
Posted By: Dark_samurai

Re: ANet - Dead Reckoning template - 07/03/09 11:35

I can't change the post anymore.

To make it official:

The template is only available for those who buy an ANet Version!
Posted By: XuserTM

Re: ANet - Dead Reckoning template - 01/08/11 06:34

Soon, it'll take to buy anet pro edition for my mmorpg project laugh
© 2024 lite-C Forums