ANet 1.4.0.0 public Beta

Posted By: Dark_samurai

ANet 1.4.0.0 public Beta - 08/04/11 09:08

Hello multiplayer developers,

I proudly present the new public ANet Beta (1.4.0.0). A lot of time has passend since the last update of ANet (I think it's already a year). This was due to the fact that I had nearly no free time because of another very important project. But in the last month I had enough time to finish all features I wanted to see in the new update. I also totally reworked some parts of ANet.

Here a small overview of the highlights:
* C-Script is not support anymore which leads into a much better interface
* UPnP functions for automatic portmapping (special thanks to JustSid who shared his project with me!)
* totally rewritten VoIP feature (now Peer-2-Peer based, new features like AGC, input threshold, denoiser,...)
* totally rewritten socket functions (now also tcp sockets can be created)
* now it's also possible to use different scripts for client and server WITHOUT producing additional traffic (variable names are not sent anymore in this mode)
* new internet and lan serverlist template
* ...

Please notice that you can also try this Beta without owning a full version of ANet. ANet will automatically start in Demo Mode.

For those who already worked with ANet, read the updates/changes section of the manual, please. There have been a lot of changes.

The examples and workshops of the homepage have not been updated to the new version yet.

Please download the new ANet version here: Download ANet 1.4.0.0
If you find any bugs or have wishes for changes, improvements or new features feel free to send me a message or post in this thread!

Have fun while testing! laugh
Posted By: alibaba

Re: ANet 1.4.0.0 public Beta - 08/04/11 10:59

Thanks! I´ll test it now laugh
Posted By: Tempelbauer

Re: ANet 1.4.0.0 public Beta - 08/04/11 11:02

cool, thanks
Posted By: alibaba

Re: ANet 1.4.0.0 public Beta - 08/04/11 11:44

Hmm.. i´ve got some problems with the enet_sendto function.

before i could send arrays like this: enet_send_array("points",sender,sender,BROADCAST);

but how do i do it now?
like this?
enet_sendto(points,sizeof(double)*sender,BROADCAST);

And is it possible to tell the meaning of playerstring and playervar?
Posted By: Dark_samurai

Re: ANet 1.4.0.0 public Beta - 08/04/11 11:59

The "arrayname" thing was because of C-Script and is now not needed anymore. Thus you only have to pass the address of the thing you want to send, second parameter is the size in byte you want to send.

Example:
Code:
double TestArray[10];

void send()
{
   //Sends all 10 elements of TestArray
   enet_sendto(TestArray, sizeof(double) * 10, BROADCAST);

   //Send only element 4:
   enet_sendto(&(TestArray[4]), sizeof(double) * 1, BROADCAST);
}


Posted By: alibaba

Re: ANet 1.4.0.0 public Beta - 08/04/11 12:04

Ah okay, so when i want to sendn just the only part of an array then it would look like this?

Example:

Code:
var points[12];

void bla()
{
      enet_sendto(&(points[enet_get_clientid()]), sizeof(var) * 1, BROADCAST);
}



And is it possible to tell the meaning of playerstring and playervar?
Posted By: Dark_samurai

Re: ANet 1.4.0.0 public Beta - 08/04/11 12:13

It's something like global variables for every client (can be used for health, armor, ammo,...). But I'm currently thinking about removing this feature because you can easily do the same with a global array.

My plans for ANet are to make things more simple and compact again. I don't think that playervars were ever used by users. That new mantra is also the reason why I introduced enet_sendto() (1 function for all so to say).

If nobody is using the playervar feature, I will delete it. So please tell me if any of you want this feature to stay laugh
Posted By: alibaba

Re: ANet 1.4.0.0 public Beta - 08/04/11 12:16

I never used it until now wink
Posted By: Rackscha

Re: ANet 1.4.0.0 public Beta - 08/04/11 15:44

Mh if i remember correctly, i used Playervars in my Bombermanproject, because changing the Var for one client caused an autoupdate for all clients.(score, bombcount etc)

I'll take a look into it as soon as iam home today.

edit: by the way, is it possible to use Anet from C# or C/C++ too or is it absolutely LiteC only?

Greets
Rackscha
Posted By: Dark_samurai

Re: ANet 1.4.0.0 public Beta - 08/04/11 15:53

Yes but only in combination with Gamestudio, but I never tried it!
Posted By: TechMuc

Re: ANet 1.4.0.0 public Beta - 08/04/11 19:06

Dark,

At first, i'll never use your tool as i do not develop games anymore. But i just wanted to congratulate you, that Anet finally made the step into a modern and advanced tool.

Especially the removal of the variable names in different scripts and port-mapping will allow real multiplayer games with your plugin.

So again congratz to your nice tool and thanks for this development,
Greetings,
Timo
Posted By: Dark_samurai

Re: ANet 1.4.0.0 public Beta - 08/05/11 12:36

Thanks for your nice words Timo laugh

I always try to get my whole knowledge into the project and so it grows with my experience. There are still some things I would do different if I would start the project from scratch again, but I think it's currently in a stage where it can be easily used.
Posted By: alibaba

Re: ANet 1.4.0.0 public Beta - 08/06/11 12:58

Okay, now i found a bug. Clients cant send events.I´m 100% sure it´s a bug, because because this code works with the old version.
Here is an example:

Code:
#include <acknex.h>
#include "anet.h"

void conn(var sender, STRING* msg, var length)
{
	error("cl. connected");
}
void dconn(var sender, STRING* msg, var length)
{
	error("cl. disconnected");
}
void clevent(var sender, STRING* msg, var length)
{
	error("client send event");
}
void sendev()
{
	enet_clsend_event(25,"",0,BROADCAST);
}
void main()
{
	wait(3);
	enet_init();
	
	enet_svset_event(EVENT_DISCONNECTED, dconn);
	enet_svset_event(EVENT_CONNECTED, conn);
	enet_svset_event(25, clevent);
	
	while(!key_s&&!key_c)wait(1);
	if(key_s)
	enet_init_server(2300, 4, "");
	if(key_c)
	enet_init_client("localhost",2300,"");
	
	while(enet_get_connection()==NO_CONNECTION)wait(1);
	if(enet_get_connection()==SERVER_MODE)
	error("server started");
	if(enet_get_connection()==CLIENT_MODE)
	error("client started");
	on_a=sendev;
	while(1)
	{
		
		if(enet_get_connection()==CLIENT_SERVER_MODE)
		draw_text("cl/srv",0,0,COLOR_WHITE);
		if(enet_get_connection()==CLIENT_MODE)
		draw_text("client",0,0,COLOR_WHITE);
		if(enet_get_connection()==SERVER_MODE)
		draw_text("server",0,0,COLOR_WHITE);
		if(enet_get_connection()==NO_CONNECTION)
		draw_text("no conn.",0,0,COLOR_WHITE);
		
		wait(1);
	}
}



Open two windows. At the first window press s for a server. At the other one press c for client. You´ll recieve a message from server, that a client connected.
Then as client press "a" to send an event.
Nothing happens.
But with old version you´ll get the message as expected.
To use this code with the other version you have to set the events in "".
Hope it helps to improve your üroduct laugh
Posted By: picoder

Re: ANet 1.4.0.0 public Beta - 08/08/11 09:04

Code:
void enet_svsend_event(var type, char* msg, var length, var receiver) 
void enet_svsend_event(var type, STRING* msg, var receiver) 
void enet_clsend_event(var type, char* msg, var length, var receiver) 
void enet_clsend_event(var type, STRING* msg, var receiver);


When you send a string by enet_clsend_event, you should not write length of string in it.

Code:
void sendev()
{
	enet_clsend_event(25,"",BROADCAST);
}


Posted By: Dark_samurai

Re: ANet 1.4.0.0 public Beta - 08/08/11 09:41

@alibaba: Thanks for reporting! This was indeed a bug and I already fixed it, but I want to wait for possible other bugs before I release the new version.

As a workaround use picoder's code, please.
Posted By: alibaba

Re: ANet 1.4.0.0 public Beta - 08/09/11 11:10

Okay, thanks! laugh
Posted By: Rackscha

Re: ANet 1.4.0.0 public Beta - 08/14/11 21:36

ah okay, i'll try to use it in c#
Posted By: darkinferno

Re: ANet 1.4.0.0 public Beta - 08/29/11 19:45

heard u had some bugs with this version, were they all fixed ?
Posted By: Rackscha

Re: ANet 1.4.0.0 public Beta - 08/29/11 20:27

who had bugs?
Posted By: darkinferno

Re: ANet 1.4.0.0 public Beta - 08/29/11 20:48

Originally Posted By: Dark_samurai
@alibaba: Thanks for reporting! This was indeed a bug and I already fixed it, but I want to wait for possible other bugs before I release the new version.

As a workaround use picoder's code, please.


my reply was based on this post
Posted By: Dark_samurai

Re: ANet 1.4.0.0 public Beta - 08/30/11 08:45

Yes the bug was fixed. I wanted to wait for possible other bugs, but I think it's time for the final release, now.

I will release the update in a few days (when I converted the example scripts to the new version).
Posted By: darkinferno

Re: ANet 1.4.0.0 public Beta - 08/30/11 12:13

ok thats what i wanted to know before starting to convert my game to this version, so i'll wait for the update or maybe you could email me with it ?
Posted By: Dark_samurai

Re: ANet 1.4.0.0 public Beta - 08/31/11 12:26

All ANet users will receive an email with a download link for the new version soon. I already converted half of the examples and workshops.
Posted By: Dark_samurai

Re: ANet 1.4.0.0 public Beta - 09/05/11 13:28

The release will be a bit delayed, because a user found a bug in the http feature. I used this chance and rewrote the whole http feature:

Quote:

The http feature was completly rewritten. It supports now an unlimited number of http posts at the same time. Thus the prototypes of the functions have been slightly modified. Additionally the functions http_init() and http_deinit() have been removed. It's not needed anymore to manually initialize this feature.

Posted By: William

Re: ANet 1.4.0.0 public Beta - 09/06/11 02:15

Thanks again for the fix Peter! Anet now seems to be rock solid. cool

I am using it extensively throughout Silas. I'd recommend anyone who plans to do a multiplayer game to purchase it. Or even if you need it for just database/php usage for your leaderboards.
Posted By: darkinferno

Re: ANet 1.4.0.0 public Beta - 09/07/11 12:44

any news ?
Posted By: Dark_samurai

ANet 1.4.2.0 Released - 09/07/11 13:48

The update fixes all reported bugs and adds a huge number of new features like new socket functions, a totally redone http and voip feature, upnp functions for automatic portforwarding,...
Additionally it's now possible to split the server code from the client code thanks to a new sending system for variables, structs,... The C-Script support is now officially stopped which leads into a better interface.
For updating, download the ANet Demo and follow the instructions in the readme file.

The update is free, as always!

You can download it here.
Posted By: Dark_samurai

Re: ANet 1.4.4.0 Released - 09/16/11 10:51

Today I released a new ANet version 1.4.4.0. The update fixes all reported bugs and introduces the completly rewritten file transfer feature.
For updating, download the ANet Demo and follow the instructions in the readme file.

Download: http://www.anet-plugin.com/downloads_eng.htm
Posted By: Dark_samurai

ANet 1.5.0.0 Beta released - 09/26/11 12:32

I proudly present the new ANet Beta 1.5.0.0. The new version fixes all reported bugs and introduces a completly rewritten entity system (which produces much less traffic) and a completly rewritten player name feature.

Before updating, read the update/changes section in the manual, please!

Download: ANet 1.5.0.0 Beta

Please report any problems you discover and tell me your wishes for future versions.

Have fun!
Posted By: JoGa

Re: ANet 1.5.0.0 Beta released - 09/29/11 13:41

First, thanks for the update and the bugfixes!!!

The rewritten entity system is a bit scary in terms of rewrite the own projects, so i will keep for some days the older ANet version and if I have some free days, I swith to 1.5 and include the new Entity-system.

But again, thanks so far, I'm excited laugh
Posted By: Dark_samurai

ANet 1.5.1.0 Beta released - 10/18/11 19:17

I found a small bug while converting the "AUM76 to ANet" example:
* When the EVENT_SYNCHRONIZED was called enet_sv/clent_create() couldn't be used before 1 frame has passed. [Fixed in 1.5.1.0]

Thus I release a new Beta version. Here is the download link for the new version: ANet 1.5.1.0 Beta

Here you can get the converted "AUM76 to ANet" example. It should give you a clue of how the new entity system could be implemented: AUM76 to ANet 1.5.1.0

Finally I want to share my plans for the future:
* Converting all examples and tutorials to the new ANet version
* Releasing the new ANet version
* Improving the examples and tutorials, replacing old/bad ones with new ones

For the last point I need your help!
Where have been your problems when starting with ANet?
Is there anything that should be explained more detailed than currently explained by the tutorials?
Are you missing example scripts for special situations?
Anything else that should be improved/changed?

Thanks for your help!
Posted By: Zwiebli

Re: ANet 1.5.1.0 Beta released - 10/21/11 10:56

1. It just took me some time to get used to multiplayer functionalities but nothing ANet specific.
2. /
3. Is it possible to create a peer-to-peer connection like the Voip feature does using the new socket functions? If it is, a tutorial on that would be great.
4. It would be good if you find a way to change the connection time out.
Otherwise I think ANet is really awesome!

Posted By: lostclimate

Re: ANet 1.5.1.0 Beta released - 10/21/11 17:00

My only request would be easier ways to serialize and deserialize data for custom packets, or if some way to do it already exists, a small section showing useful ways to do it. Other than that, well... I don't use much more than that anyways so that's all I can really comment on.... That said, I'm not complaining:) this is a wonderful plugin. easy setup, quick support, not abundant, but sufficient documentation. laugh
Posted By: Dark_samurai

Re: ANet 1.5.1.0 Beta released - 10/23/11 14:07

Quote:
3. Is it possible to create a peer-to-peer connection like the Voip feature does using the new socket functions? If it is, a tutorial on that would be great.


Yes, the udp socket functions are more or less peer-to-peer based because every udp socket is server and client in one. You can send packets to every udp socket you wish. All you have to know is the ip address and the port number of the socket. With the tcp functions no peer-2-peer application is possible.

I don't think that there is the need for an extra tutorial for that, because as explained above, it's very simple! But if you have problems with that, I could explain it more detailed if you wish.

Quote:
4. It would be good if you find a way to change the connection time out.


I already looked into that some time ago, but it seemed like this is not possible. But I can take a closer look again, maybe I find a way.

Quote:
My only request would be easier ways to serialize and deserialize data for custom packets, or if some way to do it already exists, a small section showing useful ways to do it.


Best way would be to use memcpy:
Code:
//Data you want to send in a packet:
int Data1;
short Data2;
var Data3;

char* PacketBuffer = (char*)malloc(10);

//Serialize data
memcpy(PacketBuffer, &Data1, sizeof(int));
memcpy(&(PacketBuffer[4]), &Data2, sizeof(short));
memcpy(&(PacketBuffer[6]), &Data3, sizeof(var));
//and so on

enet_clsend_event(USEREVENT_SENDDATA, PacketBuffer, 10, BROADCAST);
free((void*)PacketBuffer);



Does that answer your question? Or did you ment something different with serializing data? I could add that to the "Tips and Tricks" section of the manual.
The deserialization would be the other way around.

I think I will go this way:
I will replace the current workshops that don't explain the templates with a multiplayer shooter workshop. The workshop will cover everything from building up a connection to dead reckoning and shooting. Every finished chapter will contain the produced script so that the user can try what was explained in theory.
The final script will be some kind of template that will replace the old dead reckoning template. So I try to make the script as configurable as possible. So that it's possible to create multiplayer shooters without much scripting (but the shooter won't be much complex as this would break the mold).
Posted By: Zwiebli

Re: ANet 1.5.1.0 Beta released - 10/23/11 14:47

Thx yes i tested the socket functions..your right they don`t need an extra tutorial. Great Plugin really great I have never regret the purchase of ANet thx a lot for the help.
Posted By: Dark_samurai

ANet 1.5.2.0 Beta released - 10/24/11 17:06

Today I release a new ANet Beta: 1.5.2.0

Changes:
+ The function sock_recv() returns now also the destination port of the received data packet.
+ After every level change, enet_ent_sync() has to be called now (--> should be called in EVENT_LEVEL after the level was successfully loaded). This behavior is new since 1.5.0.0 but wasn't documented.
+ Bugfix: The angle of global entities wasn't sent to the clients when they synchronized with the server. [Fixed in 1.5.2.0]

Please read the Updates/Changes section in the manual before updating.

You can get the new version here: ANet 1.5.2.0 Beta

Have fun while testing and thanks for your support! laugh
Posted By: Rackscha

Re: ANet 1.5.2.0 Beta released - 10/24/11 17:17

Ah, the enet_ent_sync after every load level sounds good.
Something i noticed in earlyier versions of Anet(1.2/1.3 havent used newest yet) is that as soon as the client is connected, every newly created entity got synced and created on the freshly connected client.

Though i had the problem that i had not loaded any empty level before connecting in my first game versions, so this had been a problem.
I fixed that by loading an empty level before connecting and enet_ent_sync8only once) after loading.

I thought about something like disabling entity retrieval for a client at connection so client can communicate with server without getting entity updates.
For example retrieving current mapfile etc.

Might be solved with the current solution by dropping everything in an empty level^^
Posted By: Dark_samurai

Re: ANet 1.5.2.0 Beta released - 10/26/11 15:04

Maybe this will help you: In the new version, no entity related data is accepted by new connected clients as long as they didn't call enet_ent_sync(). Why do you need to load an empty level?
Posted By: Dark_samurai

Re: ANet 1.5.2.0 Beta released - 10/26/11 17:55

I looked into the enet source code for a way to change the timeout. It's basicly possible to change the timeout BUT you won't be able to set for example a timeout of 1000ms because the timeout mechanism isn't based on a timer but on some other network related things. The timeout is different under different circumstances (as some of you maybe have already noticed). The current values give the best results so it won't be reasonable to change them.
Posted By: Rackscha

Re: ANet 1.5.2.0 Beta released - 10/26/11 23:20

Originally Posted By: Dark_samurai
Maybe this will help you: In the new version, no entity related data is accepted by new connected clients as long as they didn't call enet_ent_sync(). Why do you need to load an empty level?


As i said, i had to load an empty level in older versions. Havent used the new ones yet wink

But good to read about this new functionality.
Posted By: darkinferno

Re: ANet 1.5.2.0 Beta released - 10/28/11 01:52

i dont get enet_reg_ent fully; it says:
Originally Posted By: MANUAL
Through the parameter id, a unique number for identifying the entity type has to be set. This number has to be the same on all participants and must not be used twice

so if i do:

Code:
#define GRENADE 30


does that mean that i can only create one grenade at a time? or would have to use an array to manage grenade IDs and manage it myself ?
Posted By: Rackscha

Re: ANet 1.5.2.0 Beta released - 10/28/11 17:56

no it measn that you cant do:

Code:
#define Grenade 30
#define Pistol 30



You use the same ID for 2 objecttypes.
The id is just to identoify the TYPE you want to create and NOT the created entity.
Posted By: Dark_samurai

ANet 1.5.2.0 final release - 10/29/11 13:40

ANet 1.5.2.0 is now out of the beta phase and was finally released today!

A short overview of what have been changed since 1.4.4.0:
+ The function sock_recv() returns now also the destination port of the received data packet.
+ After every level change, enet_ent_sync() has to be called now (--> should be called in EVENT_LEVEL after the level was successfully loaded). This behavior is new since 1.5.0.0 but wasn't documented.
+ The player var and player string feature was removed. The player name feature was completly rewritten. The length of the player name is now unlimited.
+ The entity system was completly rewritten. The traffic consumption was greatly reduced which leads into much faster synchronisation. Entities now have to be registered by enet_reg_ent() like an event before they can be created. The function enet_ent_register() was removed. enet_send_flags() produces one Byte less traffic per call now. Instead of enet_ent_create(), enet_svent_create() and enet_clent_create() and instead of enet_ent_remove(), enet_svent_remove() and enet_clent_remove() have been added. enet_ent_synchronize() was renamed to enet_ent_sync().
+ Most of the overloaded functions of enet_sendto() have been removed because they have been wrong selected by the Lite-C compiler.

For updating, download the ANet Demo and follow the instructions in the readme file.

ANet Homepage: www.anet-plugin.com

Please notice, that all examples have been updated to the new version BUT not the tutorial of the 3d chat example (although the source code itself was updated). The reason is, that this tutorial will be soon replaced with a newer one.
© 2024 lite-C Forums