PLUGIN: TCP/IP plugin v0.0.3

Started by a-v-o, Sun 23/02/2003 17:09:37

Previous topic - Next topic

a-v-o

Download here

You will find a functions reference in the readme.txt in the zip of the dll.
You can also download the source of the "game" that I used to test the plugin.
It demonstrates the following:

a) establish connections (interact with object on which Roger is standing at the beginning)
b) transmit player character coordinates (NPC SHADOW is put to the received coordinates)
c) transmit a string (the locationname at the current mouse position is sent)
d) transmit an integer (the object shape at Roger's position is sent, so that the picture is updated)

For local testing use 127.0.0.1 as ip. Then the NPC will act like Roger's shadow and follow him whereever he goes. The status line will tell the object name under your current mouse pointer position. The first 2 pictures will show the same shape like that on which Roger is standing or walking over.

b) and c) aren't designed for use with multiple connections. For a single connection to another test game the NPC will show the other player's position, the upper left picture will show the shape at this position. The status line will tell the locationname at which the other player is pointing with the mouse.

For more questions, please feel free to ask everybody except me ;D .

Remember: It's not like "one click and your game is a network game". There's a lot of scripting to be done. And there are still questions how to handle possible synchronization problems.

Download other AGS scripts and plugins: http://ags.freie-ressourcen.de/

Privateer Puddin'



a-v-o

#3
Version 0.0.2 now up.

Changes:

* Now captures the 10060 timeout error which can occur during connection if the other side doesn't respond within a period of time
* The error code is put at the beginning of the message: 10060 Cannot connect....

Scorpiorus

#4
WOWY! Works fine for me! Thanks a-v-o, that's really great plugin! ;D ;D ;D

... AGS moves on-line, heh ...

-Cheers

DasJan

#5
There seems to be a problem with Windows XP. LucasFan and another friend of mine got errors when trying to connect with me...
"To be or not to be" - William Shakespeare
"To do is to be" - Friedrich Nietzsche
"Do be do be do" - Frank Sinatra

a-v-o

#6
This is no problem with WinXP.

In your script you used TcpSetConnectionInt with a ConnectionIndex (-1) < 0.

A ConnectionIndex < 0 can be used with some functions (TcpSetInt, TcpSetString, TcpSend) as broadcast identifier. This information got lost in the readme.txt, I updated it.

If you intented that the script should send the integer to the other game, then use TcpSetInt. TcpSetInt supports broadcast.

TcpSetConnectionInt just stores the integer locally (similar as GlobalInts) and can be used to store informations which belong to this connection, so that you needn't use GlobalInts for that. TcpSetConnectionInt doesn't support "broadcasting". If you want to set a value for all connections, then you need a loop in your script.

edmundito

#7
When I quit the game, the game quits, but the program remains open in the taskbar (not responding). I've only tried that with connecting to myself, tho.
The Tween Module now supports AGS 3.6.0!

a-v-o

#8
I can't reproduce this here. After quit the program disappears from the bar at the bottom of the screen, isn't in the task manager anymore and also dr. Watson doesn't find the task.

Edit:

If you start the game and quit it without connecting, does the program then disappear?

If it doesn't disappear and you start it again, do you get error messages (which?) on startup?

It seems to be a problem with windowed mode.

ernesti

Hey! When you get this plugin developed further, you should contribute to ags by giving the source code to Chris. It'd be great to have this networking ability integrated into AGS.. that's what we all want..    ::)  

a-v-o

#10
AGS is written in C, but I use Delphi (Pascal) for the plugin, so Chris couldn't make use of the source code.

Pumaman

If it became very popular with a lot of people using it in their games, then yes it would be worth reconsidering whether to add it to the engine. But for now, it's better off in a plugin. This also has the advantage that the plugin can be developed and release new versions more frequently or to a different timescale than AGS itself.

a-v-o

In fact new versions of AGS are released more frequently than this plugin. Though people were interested in this plugin I never heard of any completed game that makes use of this plugin.

Dan2552

#13
is there any way you can send messages to each other? If not instant messages, maybe a "email inbox" type of thing

a-v-o

You can implement a chat (instant messages).

In the test game the mouse over is used as an example. When you move your mouse over one of the shapes then the name of the shape is transmitted to the other game and displayed in the text line at the top.

You can send individual messages like in private chats or broadcast the same message to all other players (can be more than 2).

Dan2552

#15
But how do i make it so the character can type what they say???  ???

a-v-o

You can use e.g. InputBox command or a GUI text box, or whatever other way you prefer.

Dan2552

how does save games work with this plugin? does it save on both computers??

im totally confused now..... ??? ??? ???

Pumaman

Remember what a-v-o said earlier:
QuoteBut it's not like "one click and your game is a network game". There's a lot of scripting to be done. And there are still questions how to handle possible synchronization problems.

It is by no means a simple thing to make a network game - as for saving games, you have to work out a way to do that, probably by saving on both computers yes.

Paper Carnival

Why would you want multiplayer in an adventure game anyway?
*Remembers the multiplayer joke in MI4...*

a-v-o

#20
Dan2552:
As a start it would be great to have a multiplayer adventure. Then in the next step we can learn from the experiences and decide which game data should be saved and how.

Guybrush:
2 or more players could compete in the same adventure like only one can in the treasure. The players can activate traps to stop the others for a while.

Or it can be a cooperative game in which the players would have to work together.

It can be unspecific: one can solve the puzzles alone, but it could be easier with others. So the players can decide wether they want to work together or not.

AGS Newbie

#21
AVO, what is the license agreement for your plugin ? If used in a commercial game, are you requesting more than just recognition ? Thanks.

a-v-o

#22
I don't request anything. But if you really want to give me something, then feel free to do so.  :)

Joseph DiPerla

#23
To whoever said "what kinda game can be made multiplayer..." I think you could make a lot of good adventures multiplayer.

Let me give you an example or a few:

Spy vs Spy.--- Perfect game that can be made multiplayer over a network/lan

How about the platform games that are being released like that tanks clone or James Bond. Those type of games can easily be made Multiplayer.

I can see making a game like "Murder on the Missisipi" Multiplayer with a few tweaks. One person could play the part of the detectives trying to find who the murderer is. Another player could set traps and try and stop them (In other words this player is the murderer).

Someone could make an app like that website that allows chatting in a sierra environment. You could do the same. It doesn't necessarily have to be a game. It could be just an app.

an mmorpg is another thing you could use this plugin for. Although the mmorpg wouldn't be as big as others, but this is a possibility.

Maybe make a game like maniac Mansion where a group of work together online and try and find pieces and put puzzles together.

Maybe you could make a capture the flag type game. EG: You have multiple players. Each one has to mix and match items. Whoever finds the main item wins the game.

There are several things you could make with this game. Me, I would make something, but I am not that skilled or patient enough to do so.

JD

Edit by strazer:

Please keep any further unrelated non-technical discussions about multiplayer adventure games to this thread: http://www.adventuregamestudio.co.uk/yabb/index.php?topic=12421
Joseph DiPerla--- http://www.adventurestockpile.com
Play my Star Wars MMORPG: http://sw-bfs.com
See my Fiverr page for translation and other services: https://www.fiverr.com/josephdiperla
Google Plus Adventure Community: https://plus.google.com/communities/116504865864458899575

magintz

#24
Umm this isn't working, any of you techies able to fix what's wrong, it's not recognising any of the sprites, and when I try to run it, it mentions something about a string not being able to be declared or something.  I really want to have a go to try to get this to work.

Error line 41 of global script:
type mismatch cannot convert 'const string to string'


41: ServerIndex = TcpAddServer (28166, VersionInfo);
When I was a little kid we had a sand box. It was a quicksand box. I was an only child... eventually.

strazer

This particular problem is probably with the provided demo game than with the plugin itself.

http://www.adventuregamestudio.co.uk/manual/UpgradingTo271.htm :

Quote from: AGS ManualBackwards compatibility

In order to maintain backwards compatibility, a new "const" keyword has been added. This applies only to old-style strings, and allows them to interoperate with the new ones. A new-style String can be passed to a function that expects a "const string" (which means that it will not be allowed to change the string's contents), but cannot be passed to a function that expects a "string" (since it could overwrite the string data and mess things up).

So, you may find that any custom functions you have that take a string parameter stop working. If this is the case, change the parameter from "string" to "const string" and that should fix it.

Apologies for the inconvenience, but this is the only way to allow new Strings to interoperate safely with old-style strings.

So this error message should go away once you update the demo's code.

SSH

Except that function is a plugin one and so can't be updated...
12

strazer

#27
Ah, would your "hack" work then?:

Quote from: SSH on Sun 11/12/2005 08:56:54
Code: ags

string x;
StrCopy(x, "WHAT I WNT TO SAY");
old_function(x);


SSH

#28
Oh yeah, I forgot about that :D

However, in my experience the plugin is a bit broken anyway. One thing one could do for multi-player games is  make the game multi-player via different key controls on one keyboard, then start a VNC server and let someone else log in to the computer. Then you can press keys for player 1 and the other person can press the keys for player 2!

See www.realvnc.com for details of VNC
12

Yuri Patrick

Alrighty. I have a quick question... It states in the post that the TCP/IP plugin can be used for stuff such as a small mmo, ummm... I have had some experience with the SmartFoxServer on a pre-made system. So, was wondering, do you think the TCP/IP plugin could be made to interface with SmartFox or do you think I would be better off just writing a SmartFox Plugin?

Dualnames

Depends on what you want to do really. If you want intense stuff I suggest you go ahead and write the SmartFox plugin. I've barely heard of SmartFox, so I may be wrong, but the TCP/IP isn't ideal for animation heavy games.
Worked on Strangeland, Primordia, Hob's Barrow, The Cat Lady, Mage's Initiation, Until I Have You, Downfall, Hunie Pop, and every game in the Wadjet Eye Games catalogue (porting)

Yuri Patrick

Forgive me if this is in the wrong place, I am not positive where to post this....

It's been a while since I tinkered even in VC#, but how would one go about getting the AGS game itself to pop up a dialog via C# under a condition? I'm trying to see if I can get it to simply connect to SFS and upon that condition display a box with an error or display a "connected" dialog. But can't seem to find anything that does such a feat in the AGS dlls. :(

It appears at first glance that I need a script inside AGS that pops up the dialogs and then call the script from within C# based upon the outcome there...?

Yuri Patrick

I now remember why I dislike MS .NET anything. The errors make no sense. I just want to change a few things around in the demo C# plugin and now it doesn't compile again giving me cryptic errors. I miss my ADA.

Construed

I implemented your TCP/IP system into my game. http://www.adventuregamestudio.co.uk/yabb/index.php?topic=42604.0

However i am unable to find any documentation whatsoever about how to expand upon this plugin or even how it talks to the ags script.
I felt sorry for myself because I had no shoes.
Then I met the man with no feet.

Dualnames

Quote from: GrimReapYou on Tue 18/01/2011 07:54:43
I implemented your TCP/IP system into my game. http://www.adventuregamestudio.co.uk/yabb/index.php?topic=42604.0

However i am unable to find any documentation whatsoever about how to expand upon this plugin or even how it talks to the ags script.

The TCP/IP plugin is actually quite old and runs quite slow, so after managing to test various stuff with it, with that small executable, it has proven quite pointless and obsolete to bother writing a tutorial/documentation, as there's no need since no one should want to use this, except for chatting purposes. Now, if someone however / you manages to create a server and make the game work from there, upon proof, I'll be more than glad to document it.
Worked on Strangeland, Primordia, Hob's Barrow, The Cat Lady, Mage's Initiation, Until I Have You, Downfall, Hunie Pop, and every game in the Wadjet Eye Games catalogue (porting)

Construed

#35
I just finished hosting it on a Winsocks VB server, however it is somewhat laggy.I'm looking for other alternatives. I'm looking around for some good open source servers and templates.

//edit
I'm working on writing a server from scratch.
I felt sorry for myself because I had no shoes.
Then I met the man with no feet.

SMF spam blocked by CleanTalk