Adventure Game Studio

AGS Support => Advanced Technical Forum => Topic started by: Yuri Patrick on Thu 21/06/2012 06:14:19

Title: AGS Game Server...
Post by: Yuri Patrick on Thu 21/06/2012 06:14:19
Alright. I'm thinking back about 20 years now when computer games were textual and multiplayer and the server would use a flat database file.

I'm theorizing at the moment and wondering if my idea might work:

1) Use the TCP/IP plugin for AGS to make the network connections between the server written in AGS.
2) Using the File Functions and Properties functions within AGS to generate a database file for logins and passwords and player coords and room numbers, as well as inventory items and possibly scores.

Does anyone think that this might work?

I'm having trouble trying to fill some deatails in:
Code (AGS) Select
File *input = File.Open("test.dat", eFileRead);
String buffer = input.ReadStringBack();
input.Close();


I can't figure out if input.ReadStringBack(); will accept anything like cell identifiers in the database? I know that
Code (AGS) Select
File *output = File.Open("temp.tmp", eFileWrite);
if (output == null) Display("Error opening file.");
else {
  output.WriteString("test string");
  output.Close();
}

will allow me to write specific things, however.

I'll try researching a little more into my idea, haven't even tried to experiment with the code in my head yet for this vague idea, but just wanted to know if anyone thought it was feasible and how I might go about implementing it.

Thanks.
Title: Re: AGS Game Server...
Post by: Yuri Patrick on Thu 21/06/2012 06:20:44
I just had another idea, instead of readstring and writestring, how about readrawline and writerawline, it appears that they both take input and variables which would make things just a smidge easier. Still researching.
Title: Re: AGS Game Server...
Post by: Khris on Thu 21/06/2012 10:00:54
So basically, apart from the details, you want to create a multiplayer AGS game. There are several threads about this already, technical ones as well as philosophical ones.
You didn't really ask any technical question; if you want to implement an external database, you'll have to parse the strings yourself, and yes, you need to use RawStrings so you can edit the database file outside AGS.

Somebody wanted to make a quiz game recently and I coded a small module that would read out a CSV database file:
http://www.adventuregamestudio.co.uk/yabb/index.php?topic=46049.msg618765#msg618765
It's not a general implementation though, it uses a fixed database structure for now.
Title: Re: AGS Game Server...
Post by: Yuri Patrick on Thu 21/06/2012 14:58:01
Hrm. It's starting to look like if I use the CSV concept you have on that thread, Khris, that I would need to consider using one database file per player to be able to retrieve all their individual variables. But that should be fairly easy. Some of the really old MUD engines still use that setup - each player has their own database on the server. Just call up the database by player name based on their login name to the server and then cross reference the password they inpu with the password line of their database, etc, etc. Just have a slight issue with no coffee and trying to read someone else's code yet. ;) LOL - joke.

I'll get it figured out yet. Thank you for your idea of the CSV files, Khris. Really, it does help.
Title: Re: AGS Game Server...
Post by: Yuri Patrick on Thu 21/06/2012 17:56:06
I was just thinking, most multiplayer games store their player data on the server. Is there anyway to disable the save load game subroutines in the AGS client?

In other words, disable local-machine game saving...?
Title: Re: AGS Game Server...
Post by: monkey0506 on Thu 21/06/2012 19:24:34
Sure. Don't call SaveGameSlot.
Title: Re: AGS Game Server...
Post by: Monsieur OUXX on Tue 26/06/2012 15:26:11
Use some of the more advanced work existing around, rather than the tcp/ip plugin.
I know the TCP/IP plugin has more visibility on the forum, but there is better stuff around (not necessarily in the "Modules/Plugin" forum)