Gamestudio Links
Zorro Links
Newest Posts
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/19/24 18:45
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (AndrewAMD, kzhao, 7th_zorro), 714 guests, and 7 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rating: 5
Page 10 of 17 1 2 8 9 10 11 12 16 17
Re: ANet - Full version available now! [Re: Dark_samurai] #240300
12/10/08 12:57
12/10/08 12:57
Joined: Oct 2008
Posts: 513
Carlos3DGS Offline
User
Carlos3DGS  Offline
User

Joined: Oct 2008
Posts: 513
I first started to learn about remote procedure calls when I started looking for an alternative to the 3DGS networking at http://www.jenkinssoftware.com/index.html (raknet).

It is so a system can tell another system to call a function (with parameters).

They talk about remote procedure calls with parameters in a thread about a project (that seems to have been abandoned) for a plugin of raknet for 3DGS.
You can find this thread at:
http://www.coniserver.net/ubb7/ubbthreads.php?ubb=showflat&Number=240024&page=1


I have a question. I have never used a plugin yet for 3DGS and was wondering if I have understood everything correctly...

Would the steps to use your plugin be...?
-Your "default.c" is to be copied into "3DGS\include"?
-"anet.h" is to be copied into my project folder with the rest of my code?
-"anet.dll" is to be copied into (I'm not sure about this one... "acknex_plugins" or "sdk_plugin" or "sed_plugins")?

After I have finished placing those files in those folders I would have to enable it in my code writing...

-in my code then I write #include <default.c> as always?
-in the code I also write #include "anet.h"?

so it would look like this?
Code:
#include <default.c>
#include "anet.h"



So after all that everything should be ready to go and I can use you plugin's functions?


"The more you know, the more you realize how little you know..."

I <3 HORUS
http://www.opserver.de/ubb7/ubbthreads.php?ubb=showflat&Number=401929&page=1
Re: ANet - Full version available now! [Re: Carlos3DGS] #240308
12/10/08 13:36
12/10/08 13:36
Joined: Jul 2005
Posts: 1,930
Austria
Dark_samurai Offline OP
Serious User
Dark_samurai  Offline OP
Serious User

Joined: Jul 2005
Posts: 1,930
Austria
It's described in the manual. But it should work like this:

-copy anet.dll and anet.h (Lite-C) into your work folder
-set the plugindir to "." (you need to write this into a .wdl file that is named like your main source file)
-write #include "anet.h" into your main source file

Quote:
It is so a system can tell another system to call a function (with parameters).


Sounds like enet_clsend_event/enet_svsend_event. It let's a client/server call a function with a given parameter (msg).

I will look into the threads later (don't have time yet).


ANet - A stable and secure network plugin with multi-zone, unlimited players, voip, server-list features,... (for A7/A8)!
get free version
Re: ANet - Full version available now! [Re: Carlos3DGS] #240309
12/10/08 13:40
12/10/08 13:40
Joined: Oct 2008
Posts: 513
Carlos3DGS Offline
User
Carlos3DGS  Offline
User

Joined: Oct 2008
Posts: 513
Originally Posted By: Carlos3DGS
It is so a system can tell another system to call a function (with parameters).


Explained a little better...

In some situations (like a mmorpg) you dont want the client to calculate everything to avoid cheating and other things, and because the database for everything is only on the server.

So when the client wants his character to "hit" a different character:
The client sends an order to the server to invoke the "calculate_hit()" function with the parameters (attacking_character, hit_character).

the server recieves that remote proceure call and runs the function:
calculate_hit(attacking_character, hit_character)
{
...
lookup in charatcer database: attacking_character's weapon_ID
lookup in weapon database: weapon_ID's damage
...
lookup in character database: hit_character's armour_ID
lookup in armour database: armour_ID's defence
...
total_damage = damage - defence
...
write in character database: hit_character.life -= total_damage
...
and after all this server does another remote procedure call to clients...
}


The server would do a remote procedure call to the client for them to call their function "reduce_life()" with the parameters (character_ID, total_damage).
The clients recieve that remote procedure call and run the function:
reduce_life(character_ID, total_damage)
{
...
character_ID.life -= total_damage
...
}


This is just an example situation to better explain what is a remote procedure call in both directions (client->server and server->clients).
Basically it is just "tell this other system to run this function (with these parameters)".
To do that of course we would have to make all the functions on the client, and the server has to know the name of all those functions for a remote procedure call to the server->clients.
And for the clients to do a remote procedure call on the server client->server: the server has to have the functions, and the clients need to have the name of the functions they want the server to run.


"The more you know, the more you realize how little you know..."

I <3 HORUS
http://www.opserver.de/ubb7/ubbthreads.php?ubb=showflat&Number=401929&page=1
Re: ANet - Full version available now! [Re: Dark_samurai] #240311
12/10/08 13:50
12/10/08 13:50
Joined: Oct 2008
Posts: 513
Carlos3DGS Offline
User
Carlos3DGS  Offline
User

Joined: Oct 2008
Posts: 513
Originally Posted By: Dark_samurai
Sounds like enet_clsend_event/enet_svsend_event. It let's a client/server call a function with a given parameter (msg).

Yes, that sounds like it. I am still reading your manual and havent gotten to that part yet. It was in there but I thought events werent functions.

Sorry for that dumb question. hehehe

I have another dumb question for you though, hahaha:

I have read what you said
Quote:
-set the plugindir to "." (you need to write this into a .wdl file that is named like your main source file)

but am kind of confused. So if my main code file is called "My_Game.c" I make a "My_Game.wdl" in that same folder that only contains this line in the code?
Code:
PLUGINDIR "."



"The more you know, the more you realize how little you know..."

I <3 HORUS
http://www.opserver.de/ubb7/ubbthreads.php?ubb=showflat&Number=401929&page=1
Re: ANet - Full version available now! [Re: Carlos3DGS] #240313
12/10/08 13:56
12/10/08 13:56
Joined: Jul 2005
Posts: 1,930
Austria
Dark_samurai Offline OP
Serious User
Dark_samurai  Offline OP
Serious User

Joined: Jul 2005
Posts: 1,930
Austria
This exaclty how enet_cl/svsend_event works!
The only difference is that you can't use more than the msg parameter. But because the msg parameter is a String, you can copy all parameters into the string and send these (could look like this: "1;4;5;6;89474585.102384;..." = all parameters in one string).

A detailed explanation is in the manual under enet_set_event() and enet_clsend_event()/enet_svsend_event().

These functions are also used in the pong example. The server sends an event (=a function) and let's the client call a function that plays a corresponding sound (depending on which value is sent in msg).


EDIT: Seems like I was to slow ^^

Quote:
but am kind of confused. So if my main code file is called "My_Game.c" I make a "My_Game.wdl" in that same folder that only contains this line in the code?


That's correct! This is because Lite-C has no PLUGINDIR command.


Last edited by Dark_samurai; 12/10/08 13:58.

ANet - A stable and secure network plugin with multi-zone, unlimited players, voip, server-list features,... (for A7/A8)!
get free version
Re: ANet - Full version available now! [Re: Dark_samurai] #240318
12/10/08 14:07
12/10/08 14:07
Joined: Oct 2008
Posts: 513
Carlos3DGS Offline
User
Carlos3DGS  Offline
User

Joined: Oct 2008
Posts: 513
My last stupid question (for the moment, hahaha).

Do I have to write #include "My_Game.wdl" in my code that is in "My_Game.c"?


"The more you know, the more you realize how little you know..."

I <3 HORUS
http://www.opserver.de/ubb7/ubbthreads.php?ubb=showflat&Number=401929&page=1
Re: ANet - Full version available now! [Re: Carlos3DGS] #240321
12/10/08 14:11
12/10/08 14:11
Joined: Jul 2005
Posts: 1,930
Austria
Dark_samurai Offline OP
Serious User
Dark_samurai  Offline OP
Serious User

Joined: Jul 2005
Posts: 1,930
Austria
No it's not needed, the compiler includes the file automatically.


ANet - A stable and secure network plugin with multi-zone, unlimited players, voip, server-list features,... (for A7/A8)!
get free version
Re: ANet - Full version available now! [Re: Dark_samurai] #240324
12/10/08 14:24
12/10/08 14:24
Joined: Oct 2008
Posts: 513
Carlos3DGS Offline
User
Carlos3DGS  Offline
User

Joined: Oct 2008
Posts: 513
Thanks for your help, I will start writing a simple mp (probably just player movement) right now to start learning your plugin.
And when I have learned it I will start right away with testing your remote procedure calls.


"The more you know, the more you realize how little you know..."

I <3 HORUS
http://www.opserver.de/ubb7/ubbthreads.php?ubb=showflat&Number=401929&page=1
Re: ANet - Full version available now! [Re: Carlos3DGS] #240325
12/10/08 14:28
12/10/08 14:28
Joined: Jul 2005
Posts: 1,930
Austria
Dark_samurai Offline OP
Serious User
Dark_samurai  Offline OP
Serious User

Joined: Jul 2005
Posts: 1,930
Austria
Please tell me if you have problems and/or tell me if you are missing something in the documentation, because I want to make the learning workflow as easy as possible!


ANet - A stable and secure network plugin with multi-zone, unlimited players, voip, server-list features,... (for A7/A8)!
get free version
Re: ANet - Full version available now! [Re: Dark_samurai] #240332
12/10/08 14:59
12/10/08 14:59
Joined: Oct 2008
Posts: 513
Carlos3DGS Offline
User
Carlos3DGS  Offline
User

Joined: Oct 2008
Posts: 513
Sorry to bother you some more but I get an error right before the program even starts.

Quote:
Error in 'C:\3D GameStudio A7\include\default.c' line 121: 'diag_status' undeclared identifier

< diag_status();
>
.


my code at the top is:
Code:
 #include <acknex.h>
#include <windows.h>
#include "anet.h"
#include <default.c>



"The more you know, the more you realize how little you know..."

I <3 HORUS
http://www.opserver.de/ubb7/ubbthreads.php?ubb=showflat&Number=401929&page=1
Page 10 of 17 1 2 8 9 10 11 12 16 17

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