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...*

SMF spam blocked by CleanTalk