Game authors and players, please read this thread!

Author Topic: AGS Game Server...  (Read 458 times)  Share 

AGS Game Server...
« on: 21 Jun 2012, 06:14 »
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: Adventure Game Studio
  1. File *input = File.Open("test.dat", eFileRead);
  2.  String buffer = input.ReadStringBack();
  3.  input.Close();

I can't figure out if input.ReadStringBack(); will accept anything like cell identifiers in the database? I know that
Code: Adventure Game Studio
  1. File *output = File.Open("temp.tmp", eFileWrite);
  2. if (output == null) Display("Error opening file.");
  3. else {
  4.   output.WriteString("test string");
  5.   output.Close();
  6. }
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.

Re: AGS Game Server...
« Reply #1 on: 21 Jun 2012, 06:20 »
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.

Khris

  • Evil Dark Emperor Death-Kill
    • Lifetime Achievement Award Winner
    •  
    • I can help with play testing
    •  
    • I can help with scripting
    •  
    • I can help with translating
    •  
Re: AGS Game Server...
« Reply #2 on: 21 Jun 2012, 10:00 »
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.
http://whathaveyoutried.com/

The other day on yahoo answers:
"Can you print colored images with black ink? If so tell me how please Thanx Kimberly"

Re: AGS Game Server...
« Reply #3 on: 21 Jun 2012, 14:58 »
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.

Re: AGS Game Server...
« Reply #4 on: 21 Jun 2012, 17:56 »
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...?

monkey_05_06

  • AGS Project Admins
  • Has left the building.
Re: AGS Game Server...
« Reply #5 on: 21 Jun 2012, 19:24 »
Sure. Don't call SaveGameSlot.
Let's be honest. Most people suck at coding. I suck at coding, but at least my code is readable. To Hell with anyone too lazy to maintain consistent formatting in their code. I could deal with bad interfaces and structure if I could even read your horrible code. And that's putting it nicely. -monkey

Monsieur OUXX

  • Mittens Serf
  • Mittens Half Initiate
    • I can help with proof reading
    •  
    • I can help with translating
    •  
    • I can help with voice acting
    •  
Re: AGS Game Server...
« Reply #6 on: 26 Jun 2012, 15:26 »
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)