check some multiplayer games made with Unity on http://www.moock.org/unity :)
Printable View
check some multiplayer games made with Unity on http://www.moock.org/unity :)
Yeah have a look at www.globulos.com too
http://80.11.244.5/www/e-battle/index.html
arrows , mouse pointer , left button and ctrl key to check your current status and swap weapons :) feedback here if you connected :) i'm waiting..
I have been coding PHP for about 7 months now and I feel I am very expierenced with it, I just don't understand a few things here...
I would like to try to create a tic-tac-toe game (to start of course) using the Polling method. This would be based on a forum addon so usernames would already be provided so I would send the usernames to flash using the POST from php and GET from flash. But I don't understand how to...keep track of what is going on. Is it all actionscript? Which parts are php/mysql? I mean could I store the data in a database like so...
0=nothing
1=x
2=o
0,1,0
0,2,0
1,0,1
Then post that to flash and it creates that? Any help would be immensly appreciated.
Thank you,
-Brcolow
http://www.deepmachines.com/bigbattle
created by Big Spaceship
http://www.bigspaceship.com/
backend powered by the new, open-source, free Oregano multiuser server for flash
http://www.oregano-server.org/
Hm, I looked it over Schwa and I am not sure it is what I am looking for. My host will not allow me to run a program like that on their server so I am stuck with the polling option. Any tutorials/refrences on how to make a tic-tac-toe type game with polling?
Thanks,
-Brcolow
Just a couple of questions...Quote:
Originally posted by Ed Mack
Well, once you ftp the files onto the server (NOT in html directory, or in a private one!), you can connect to it, and then move to the directory with the files. Say it was a java class file named "Server.class" you would use this:
java Server &
The & forks the process, basically making it run in the background without your terminal. That should be fine.
First where and how do u put the "&" fork? (id thought u make a bat file and do it that way)
Second, lets say a client has to download a standalone flash exe to play a MP game. would anyone know how updates will work? would i have to create it with a side program?
Peace out!
Stevz!
the defintive URL is here if you wanna make some tests :
http://e-battle.e-planete.com
good luck.Hope to see you there and shoot'ya all (lol).
STEF
Surprising, I was able to write my gameup to allow my action base game to run extremely well and in sync. So to anyone who thinks flash games cannot be somewhat realtime action, i think i may have proven this wrong. Its not 100% perfect and will have some flaws but its damn close to the right path.
My current engine update has high speed users interacting with a low amount of jumping in thier game. (well except with somethings I still need to work on)
If you want to test out what I mean, www.gecko-games.com
With a low ping time , players that I have spoken too with high speed connections are saying that the game runs fairly fluent between different users. Under 300ms is working decent, but under 100 I have not heard any complaints. well atleast when my host is running well.
I am in the process of developing a multiplayer drag racing game as well. Now, reading through all these posts--the best route seems to be going with a socket server.
However, there's a little bit of confusion on my part.
The concept that I am still unclear about is how Flash will directly communicate with the socket server.
Does the socket server communicate via Flash through the transfer of .xml files? Or do I need the xml files read into a database via Coldfusion, and then the database would communicate with the socket server?
Any ideas, solutions are greatly appreciated.
okaypatrick
depends on the server.
The one I use, data is sent from flash to the server and then sent by the server to other clients that need it sent to.
You don't have to transfer through xml files or anything. You can just create a data string, and then send it to the server. Of course, depending on the server.
Then the server can just echo or process and send the data back your your client, and you can create you own handler on how to process the data.
I was thinking about using Electroserver. The only con about it seems like its steep price for an unlimited amt of users. Now I'm kinda lookin towards open-source, but I will continue dissecting the Electroserver code. As I was looking through, I saw XML code written in one of the .as files, so I'm assuming Electroserver is using XML. The task of writing my own socket server implementation seems daunting to say the least.
Hi okaypatrick,
ElectroServer transfers XML over the socket connection. It doesn't transfer XML files, just XML itself.
One of the cool things about ElectroServer is that you don't need to ever even know that XML is being used. The ActionScript class that is handed out with ElectroServer makes it super easy to send/receive messages from the server just using method calls through the API.
For instancce:
ElectroServer.sendMessage("public", "Hello world!");
Or to send a move you can actually send an object and the other uses in the room will receive the object. For instance:
var moveOb = new Object();
moveOb.xspeed = 30;
moveOb.yspeed = -13;
moveOb.x = 100;
moveOb.y = 230;
ElectroServer.sendMove("public", moveOb);
Good luck with your game!
hmm..interesting..So there needs to be no editing done on my part to the included libraries? I also would like to integrate both client side and the socket server software with a cold fusion database because it will hold account information. Does Electroserver already have this functionality included in the software?
ElectroServer has the ability to connect to databases built in. But there will definately have to be some sort of customization on your part to make it talk to the database in some specific way. I know that sounds vague, but there is no way for ElectroServer to know exactly how everyone will want to use their individual databases.
So you can write some server-side ActionScript to perform specific queries, or what ever. If you download and install the ElectroServer 3 demo, there is a database example.
We are happy to help you understand how to integrate your database with ElectroSErver 3.
I have 2 plans with 17 domains on both Verio and CrystalTech. I have good experience with ActionScript, Flash, SQLServer2000 and am a ColdFusion Pro. The problem is, I am a moron when it comes to socket servers. I want to host one at either Verio or CrystalTech, they have no idea what I am talking about and I don't know how to turn one on and off from a remote machine. (Have ElectroServer 3 working on my local machine) PLEASE HELP!!!!
Hi Rovert1971,
To install and run a socket server you need enough access to the machine that will actually let you install applications. Usually this means you need to be running a dedicated machine. But sometimes you can convince your ISP to install and run it. But I think its unlikely that a huge ISP like verio would install a socket server from some random company. But I could be wrong.
If you can't get verio to install it, then I'd recommend the following:
-get a $18/month account with webgamehost http://www.webgamehost.com/account_features.html
-get them to host your socket server (they do it). They prefer ElectroServer 3
-Then either host your multiplayer content on their server or get them to add your IP to the crossdomain.xml security file. That will allow SWFs from another ip to connect to the socket server
Good luck!
The & symbol is a cool *nix thing, bat files cannot use it since they are dos. & just goes at the end of any *nix command, and makes it just goto the background like a 'service'.Quote:
Originally posted by stevz©_
First where and how do u put the "&" fork? (id thought u make a bat file and do it that way)
For updates, you could use loadMovies to get the game from the server, or just have some other program check your server for updates and download if approp.
Just for interest, I've been working with Unity2 recently (school coursework's put a cold axe in my dev work, hopefully will go away soon), and here's a very simple innefficient (sends data for every movement) iso game:
http://www.edmack.com/edland/
Hopefully will be improved :) Haloween holidays should be good for that!
:( Im soooooo SORRY ED! I just realized that this can be done only with unix users (i use XP).
I actually wanted to put java files (and swf) on a remote server (lycos.co.uk) and let the java server run by itself ...
I got this cool example (can't remember where) of a chat server and i wanted to test the reaction speed of it. With the learning curve, costs and all Java is free and writing scripts is like cooking eight course meals for a living. To put my mind on another script might make my brain implode of an overload (not neccessarily sayin that this is bad) ... and i dont think "lycos.co.uk" support Java files anyway!:(
But i'll still be interested working around problems (you could say it gets me high);)
Thats a very nice example... Looks Promising!(Planning to have user accounts with it?)
Real Sorry!
Stevz!
Hi everyone!
I want to make a flash-multiplayer table soccer simulation as a student project for our university.
I have basic knowledge of Action Script & PHP and I'm not that bad at java.
I read the posts in this thread and it seems that latency is a big problem with flash based real time games.
But for this kind of game the only thing transmitted would be the coordinates, speed and angel of the ball and the position and state of the players.
As my project would require very little latency (or else it wouldn't make sense...) I wanted to ask if this would be possible without writing my own socket server (it's enough work already).
ElecroServer seems good (as it is hightly promoted through Jobe in this thread ;)) but will it work fast enough?
thanks, BenderB.
Hi BenderB,
There is 1 very important thing to realize about real-time games and latency. It has almost nothing to do with the server or Flash. It has 99.9% to do with the network speed/Internet speed of each individual game player.
Flash has the same ability to do real-time games as Director, or even games like Half Life or Quake. The key is how you display the partial information that you need to keep loading.
In games like Quake you see characters smoothly walking around. But you are not receiving the information that smoothly, the game just takes the information bits and smooths the motion. The same must be done in Flash, its just that most people don't realize this.
But there is another issue here. How many multiplayer real-time sports games have you seen on the Internet? Basketball, football, ice hockey,....doesn't really happen. There is a reason, the network/Internet latency is too large for precise games like that. With limitations you could do some of these games. I believe that soccer could be done.
But I do not think that foosball (table soccer) could be done...within reason. Titoonic did a good limitation on that game to get it to work. Try pegball.com
If you can think of a game where the characters don't have to be really high speed then it will probably work.
Good luck!
Thanks for the quick and informative reply jobe!
(Although I'm left without a project idea now...;))
My fellow project members and I still want to make a multiplayer flash-game so we are looking for a new idea now...
Would it be possible to make a multiplayer game in the style of Bomberman (isometric view) but with Teams (up to, let's say 8 players) and different game modes and maps??
And another question, would it be possible to make the foosball game runable in a LAN (as there would be very little latency)?
thanks, BenderB.
HI,
Bomberman with teams: extremely doable. Of course, like all games, you have to put in hard work to get everything to flow correctly. But that is the perfect type of game. The game does not hing on having to see exactly where the other players are. A little bit of a delay will not ruin the game.
Foosball on network: possible, but I wouldn't guarantee it.
Wow, thanks again for the quick answer!
Let's see if we can come up with a good idea how to make it...
thanks,
BenderB
..and there I am again.
We started our little "Bomberman plus" project and so far I made the first simple stage with 2 players (thanks to Ed Mack and his great tutorials).
The main problem of the whole project is still the multiplayer part, so we decided to test it out in this early stage to avoid reprogramming at the end.
I downloaded the free ElectroServer and installed it but when I try to start it, it hangs up at:
I kept the standard installation parameter and entered my ip for the Web-Server ip.PHP Code:-=-=-=-=-=-=-=-
Starting Chat Server
Chat server will listen on ***.***.**.**:9875 //ip-address removed...
Attempting to bind chat server address...
Successfully bound chat server address
Client queue: input=1000, output=5000, msglimit=50
Thread pool started: min=1, max=10, keepalive=60000
Chat server listening for inbound connections...
Another question:
Is it best to submit any change of one player through the server or do I have to additionaly implement a timebased synchronisation, like every 2 seconds???
thanks,
BenderB
Hi BenderB,
That means that the server started up properly. I wrote an article on it here:
http://www.electrotank.com/ElectroServer/articles1.aspx
You can compare the screenshot to what you are actually seeing. They should be similar, if not the same.
If you installed ElectroServer 3 and then start it up, you should be able to try any of the test applications successfully. Go to Start > Electrotank > ElectroServer 3 > Examples
On that page you can click to view any of several example files.
Regarding your other question, I'm not sure what you're asking.
Sorry for being so stupid.
I typed my IP for the Web-Server IP and tested the examples but I only got a "couldn't connect to server" message, so I assumed the server must have been hung up.
I didn't realise the IP is set in the FLAs of the examples, so when I changed it back to 127.0.0.1 it worked.....:rolleyes:
I think it's best if I'll test out what I had in mind before I'll ask anymore stupid questions.....;)
thanks,
BenderB
Havent had a computer to work on for like 6 months, but now im back.
first of all, what is the difference of XMLSocket and XML? and does the socket script send all the variables to the server or just what you specify. i havent used socket servers before, but ive downloaded the Elecktroserver and ill try it soon.
btw, my multiplayer game is soon finished. the reason it took so long is that i have to do a lot of things at the same time. one week ill work on the gaem, the next on my website and the third ill work in 3ds max. i asked about php in like february or something and ive learned a lot about it, but still, isnt it very slow to access a mysql database (or any other for that matter)? ive seen that it really slows down the execution of the script. and someone said that with database many people can access it at the same time (i think it was Ed Mack). But can a server send a php file to more than one person at the time? i think ive heard that it cant, but i may be wrong.
XML is a way to format information. For instance, XML for an address book could be something like this:
A socket is an open connection that can transfer data. There isn't really such a thing as an XML socket. Its just that Flash can connect to a server on a socket and it is built to pass XML formatted data, hence XML Socket.Code:<AddressBook>
<Entry>
<FirstName>Jobe</FirstName>
<LastName>Makar</LastName>
<Email>[email protected]</Email>
</Entry>
<Entry>
<FirstName>Mike</FirstName>
<LastName>Grundvig</LastName>
<Email>[email protected]</Email>
</Entry>
</AddressBook>
Files cannot be passed.
sorry, ill refrase my question. in flash, under client/server you got XML and XML Socket. what is the difference between these two? how can i use the XML one?
Hi!
I've used the last week studying the Electroserver class and making a simple testing game.
It contains a simple tile-based map on which two almost identical characters are placed.
Each character can be controled by different user on different computer.
First I sent the x and y coordinates of one user to the other everytime a move was made.
This was, as I expected, very slow.
Then I tried to send only the beginning of a movement(when a Key is pressed down) and the end of the movement (when the key is released).
In addition to that I sent the absolute coordinates every 1 or 2 seconds to synchronise the movement.
The problem I have with this method, is the following:
User #1 presses the left key and the steps in which his character move (for example a quarter of the size of one tile) are being transmitted to User #2.
User #2 gets the information and moves the character of User #1 on his screen according to these steps until he receives that the key was released (for example 8 pixel to the right everytime he enters the frame).
But because the stepwise movement of the characters depend on the speed of the computers, the character is moving much faster on the one computer than on the other.
I would need to synchronise the execution speed of the two users.
How can I do that???
Is this a good method to make the movement smother and more accurat or are there better ones?
I heard of a method called "dead reckoning" which is used in fast multiplayer games.
Could this method be usefull for this kind of game (bombermanclone with different weapons and more player)?
thanks,
BenderB
P.S.:Please excuse my bad english....
what u could do would be to make a variable called time which contains the microtime (or is it milliseconds? one of them is it anyways), on #1s computer, and send it to #2. Every second send the two x/y and time. when #2 recieves the time it checks if the time lapped on his computer is the same as #1. if it has, then it moves it to the new x/y. i havent tested this, but it think it will work.
Hi BenderB,
In general, there are 2 ways to pull off real-time character movement in multiplayer games:
1) Make the movement quantized. Sure it might take 5 charcter steps to move from the center of 1 tile to the center of an adjacent tile. But when the user presses an arrow key you just send the destination tile to the other players. So by controlling a character you are just moving him tile to tile. The character only stops at the center of a tile. This can work *really* well, its how we are pulling off a very cool game that we're working on now.
2) Dead-reckoning algorithm. This isn't so easy. This is for non-quantized movment, known as continous movement. With continuous movement the character can exist at any point (within reason), not just in the center of a tile. The key here is that all characters broadcast information about themselves when it changes, but not more frequently than some amount. The other client machines use the recent history of your characters movement to determine where he will be moved on the next frame. For instance, you might send information to all players about your character such as:
x=100, y = 100, rotation = 270, speed = 4
The other client machines update your character to show that information and then continue him at a rotation of 270 and speed of 4 until another update is received.
Dead-reckoning algorithms can be complicated. I have never built one, but there is no reason why it can't be done in Flash.
Good luck
Thanks for the quick replys again!
Jobe:
From what you wrote it seems that the first method seems appropriate for the kind of game we have in mind.
But if I transmit only the tile on which one player is going to be next, the problem is still that the speed in which the animation to go from one tile to the next is different for the players.
For example, if User #1 would hold the up key pressed his player would appear to go smooth upwards until he releases the key.
But for User #2 the character of User #1 could appear to go from one tile to the next then stops (if the script to move the opponent is faster than the script to move the own player) then it would go again and stop and so on.
It would depent on the time of the different scripts and the speed of the computer how long the transition from one tile to the next for the opponents character would take.
Any suggestions?
thanks,
BenderB
P.S.: I'm curious to see the game you are working on!
BenderB,
Yes, I understand.
In our game we have implimented time-based movement.
The server knows what time it is. At the beginning of the game it tells each client what time it is, for synchronization.
Every move goes through the server and the server gives it a time stamp.
All characters walk at 1 of 2 speeds. We send the time that the walk starts, the speed of walking, and the destination tile. With that information all of the other client machines can precisely move the character to the end tile.
Client A sends a "walk" move
Client B receives this "walk" move. It took, say 1/4 th of the walk cycle to even receive the message. Well, since this is time based we know how long it took and just move the character to where it should be.
With this time-based method you are never more than 1 latency jump behind. On most modern set ups with good network connectivity, the latency should be 80ms to 200ms. Therefore, on a reasonably good set up, no client should be more than 1/5th of a second behind.
If you recieve a message and determine that the character should have already arrived at the destination, then you just plop him into the destination.
Hope this helps
that is what i was on about, but which i could exlain very good. but if client A sends the movement data at time 256 and Client B recieves it at time 258, would he then speed up the movement of character A so they reach their destination at the same time, or does that not matter very much?
ilhos,
It depends on how you want to do it. The 2 basic choices are:
1) Just pop the character into the spot that he is supposed to be in.
or
2) Change the characters speed so that he starts at the starting position and reaches the ending position at the correct time.
In my game I use a combination of the 2. You dont necesarily just move 1 tile at a time. You can click somewhere and move a bunch of tiles. So you move tile to tile. On the first tile I speed the player up to reach the desitnation at the correc time. Then for all other tiles I use the correct speed (because presumably everything is now synchronised)
smart. ive also noticed that when i play battlefield online and theres a lot of lag, the other characters jumps backwards again after moving. does this have something to do with the second option (smoothing out the movement)?
Just depends on the program. Some do no smoothing, so all you see is stuff blipping around. Others do lots of smoothing. Most do a combination.
In many first person shooters you see what appears to be smooth running. But occasionally people blip around. Its really not as smooth as you think. They are tricking you by filling in the gaps of information with best guesses.
..and again I'm here for some bugging questions ;)
If I understand correct that means I'd need to write a server-side Plug-in for the Electro Server.Quote:
Originally posted by jobemjobem
The server knows what time it is. At the beginning of the game it tells each client what time it is, for synchronization.
Every move goes through the server and the server gives it a time stamp.
Also why would you need to put a time stamp on the message if the player includes the time he sent it into the message anyway?
If you send the speed of walking (let's say speed=10) the execution speed of the script would still be different on two different computer (or even between the script that handles the own player movement and the script that handles the oppontens player movement).Quote:
All characters walk at 1 of 2 speeds. We send the time that the walk starts, the speed of walking, and the destination tile. With that information all of the other client machines can precisely move the character to the end tile.
Or should the time on which the player will arrive at the next tile be transmitted?
It shure does a lot!Quote:
Hope this helps
Ihoss:
Thanks for your help.
I just didn't get the point of your first reply! :)
thanks,
BenderB