Yes, java is perfect for socket servers.
Printable View
Yes, java is perfect for socket servers.
..In the eyes of my WEB host anyway.
I got a socket server and flash client working on my own computer (I actually modified one written in Perl). So I asked OzWebHost, who host my site some questions about hosting it online.
I assumed (probably incorrectly), that I had to be allocated a port number - that I couldn't just pick one out of a hat.
I got the reply:-
"This is not our problem..._ we do not provide programming assistance unless paid for.."
Another question I asked is where in the directory to put the socket server, and what to do about permissions. (I asked this, because I had problems on my own computer until I got it right). OzWebHost replied:-
"Again, we are not a programming school.. we are a web host. Read up about Linux/Perl etc.
_
It has nothing to do with FS, perl open and close request._ not sockets"
- Ok so maybe I am stupid. I have post-graduate qualifications in technical stuff - but as you all know, they don't teach you anything useful at university.
Can anyone shed some light on these issues? I was also going to ask about making sure the s-server was always running? cron? But I didn't think I'd get that past OzWebHost without insult...
Polite enlightenment anyone? Aplologies for my ignorance.
alot of these multi-user sockets are expensive... for example, a 30 person connection for ElectroServer i think is $250.. how can a high-school freshman dish out that type of money? what im trying to get at, if you cant see, is do you guys know if any of these offer discounts for students?? it would help me... :P
-joe
ps rpgprogrammer, or any1.. how can i get the trial version of electroserver on my website? i use http://www.addr.com/ to host my site.. but i cant figure out what i need to do.. help??
Email your ISP, or call them by phone. Then, ask them if they will allow you to put Electroserver for your domain. Alot of ISP's dont allow this, but, there is one ISP that is specifically for hosting ELECTROSERVER on your domain. I forgot what there site was. Im pretty sure that it runs around 18$/month for 30-40 gig of bandwidth, plus 100 meg disk space, and the electroserver trial version.
hey rpg,
when you say "Email your ISP..." do you mean my webhost? sorry, i dont know all of the terminologies.. :p so in my case that would be http://www.addr.com/? thanks for the help...
-joe
edit:
ps.. if they were to agree to host this, what would i have to do? like changing the IP adress in the .cfg file or what? what else?
I don't understand? But I'm having a stupid day - and I'm beyond caring about making a fool of myself :(
What makes these commercial socket servers worth the money over the free examples you can find over the internet (such as the Moock server in Java), which you can then modify and tailor to your own requirements?
Do they hand-craft assembly language for efficiency and increased bandwidth?
Hi brutfood,
Your webhost sounds like its run by a bunch of touchy people. Don't take it personally. That person probably has the lowest job at the webhost and the only way he/she can feel powerful is by slamming someone else. Just order about 50 pizzas and have them sent to their building. Give the name of the insulting tech-support worker as the person who placed the order :-)
Regarding 'what makes commercial socket-servers any good':
Well that's a good question. You want to know why to pay for one rather than modify and use an open-source one. Well the most simple answer is that modifying the code of a socket-server...and knowing what to modify...isn't something that most people can do. I consider myself quite savvy. I've been programming for years and wouldn't even know where to start when it comes to modifying the Java source to one of these things. Luckily another Electrotank employee is a Java nut and built us one from scratch (ElectroServer). But don't count on that level of expertise from many people that don't already have too much to do. To reiterate this point more concisely: if someone knows how to modify the source of a Java socket-server, then they should do it. But how often does that happen?
The second point is regarding time and support. With some of the commercial socket-servers you are getting something that has made it through real-world tests and have several open-source examples for you to use. This cuts months out of development time. For intances, you can buy ElectroServer and have a chat and/or multiplayer game on your site almost immediately...the same day if you are quick enough. But if you have to develop this stuff from scratch it could take days, weeks, or months.
Good luck finding the answers that you are looking for.
Hey Joe,
yes, you would change the IP in the Configuration File, then, email your ISP the file (the ES Program Folder). Now, have them run ES on the server, and change the IP settings on your game to the IP of your host. Now you're good to go :)
You're Welcome!
The socket servers out there (partly due to the specialisation - games) are quite limited in general, I think there are only about 10 or so out there to be bought/downloaded. Because of this, the open source/free pool of socket servers is tiny, and lacks the features you pay for in Unity or Electroserver (ie. a room based archetechture and nice rounded off APIs). This of course doesn't stop you going out there and learning some java from tutorials ( http://java.sun.com for example) and writing a socket server that tops them all.
I had a longer reply to this, but accidently hit one of the side buttons on my mouse MS kindly sets to back, losing all my typings :( If I don't explain something enough, just ask.
Originally posted by brutfood
..In the eyes of my WEB host anyway.
I assumed (probably incorrectly), that I had to be allocated a port number - that I couldn't just pick one out of a hat.
Most ISPs/webhosts block most of their ports to the outside world for security. Only a few are open like http (80) and ftp (various, I'm not sure). You will have to ask the ISP to opena port for you most likely. You could use a lower port that is open like 80, but normal flash clients can't connect to this for silly security reasons :(
Another question I asked is where in the directory to put the socket server, and what to do about permissions. (I asked this, because I had problems on my own computer until I got it right). OzWebHost replied:-
I'm guessing that you are allowed access to your "home directory", a folder with your name on it most likely from all you'll be allowed to see of it. Inside this lies a WWW directory, in which everything is on view to the world normally (you can secure access, but this depends on things, not suitable for your executables really).
It's above the WWW directory (or beside it, but not IN IT) that you place your server files. This way nobody sees the configuration and the admin passwords ect... As for permissions, this depends. For perl scripts, binary executables (ie a C program compiled under the correct conditions) they must be chmoded (change mode) to 7xx, where the x's are what you want other people in your user group (maybe nobody) and everyone else's access to be respectively. This can be from 0 to 7, 0 being no access and 7 being read+write+exec permissions. I think 5 is read only, but check up on this before using it.
Your webhost tech desk sounds overworked and underpayed... sorry.
Hey,
I was just wondering whether there were any tutorials on the polling method, or if anyone could send me an example ([email protected]). I know php but I am not too sure how this works,
any help would be great:D
Cheers.
The 'polling method' is just the normal way that you probably use PHP, but doing it over and over again (polling) in a loop :).
It is all controlled from the ActionScript end, and the PHP just responds pasively to requests. You use:-
loadVariables(), or myvars.load() -> myvars.onData=...in the usual way.
Use this to receive the current state of the variables (perhaps held in a text file or database) that are shared between all the clients.
If you want to change these variables, you pass up some parameters, and the server-side code changes its variables and sets them up ready for future polls.
The socket method on the other hand enables the server-side script to signal the ActionScript. So the Server-Side script can do the controlling here. Or, any flash client can transmit data to the server side code to be disseminated down to all the other flash clients, without them having to poll for them.
Next year i can take a bunch of different programming classes and i want to write a socket server. I want to decide which language i want to pursue and get good at based on which would make the server run the fastest. any suggestions?
Start learning now, by then there will be a new buzzword floating around this board and socket servers will be like duct tape--sooo last week. There are enough tutorials and forums on the web about any language that you can get your start.
For my money, PHP is by far the easiest and is used by many large sites now.
I've read most post's here... but I kinda don't get it :p
Could anyone plz make a simple tut of a simple multiplayer game???
It would be great! :D
mosterdfles_flash,
You can download an example open-source multiplayer game here: http://www.electrotank.com/ElectroServer/
To play it you first need to install ElectroServer. If you are using Windows, then download from the Windows link. There is a file in there that explains how to install it.
I don't know of any tutorials that walk you through all of this, but if you've got some cash you should pick up my book (see my footer). It takes you through step-by-step, installing the server, making a chat, making a multiplayer game.
i2thicko.com here!
I'm just trying to get some new stuff working online - So I have a stupid question.
How do I run a socket server? How do I set it up so it always runs? Do I use cron to start it up every midnight? To test it on my own computer, I just opened a terminal window and run it - I have (unix ssh) terminal access to my host, but I need to ensure that I not only tell it to run - but it keeps running.
Hi do any of you know elctro server well info to tell if I could use it for a racing game?
Kinda dumb
Im a stupid NoOb
hi all
i'm currently in the early stages of designing an online multiplayer rts style game. and trying to decide if flash would be a decent platform to do it on. our game design is similar to the campaign map of the total war series, albeit vastly simplified, and most importantly: real-time.
i'm wondering about the latency issues involved in socket servers and what people's experience of it is. i set up a test using commserver and also aquaserver and measured the roundtrip times of messages for varying numbers of clients. It was generally pretty fast (<50ms) but this was all on a local machine so i expect it is much worse over a modem. neither server seemed to scale all that well either. they were fine with just two clients, getting about 20ms, but the time went up 10-20 ms for each client after that. so i imagine that with 50 clients, they lag would be around 500ms, just on the server-side (let alone the additional delay of the player's modem, which could be seconds or more).
Usability guidelines generally recommend a delay of <100ms, after which a user starts to notice the delay, the game would feel sluggish and unresponsive.
commercial games generally use a number of synchronisation methods to get around these problems. if you've ever played quake online you probably noticed another player jitter from one place to another at some point. basically they use routines that save snapshots of the game state at each moment, and if an event comes in from another player that conflicts with an event you've already executed, the state is rolled back to before the inconsistency appeared.
of course, our game isn't going to be as time critical as quake but we want to make it seem as smooth as possible.
has anyone who's made a multiplayer game with socket servers encountered these problems? how did you get around them? can anyone point me to some open-source actionscript that addresses the issue that we can adapt, or to give me a better idea of how to approach it?
thanks...
Hi EviPuppetMaster,
If you are going to make a multiplayer RTS game, then you will definately need a custom socket-server solution. In this case the server will not only route messages to the different users, but it will have to make decisions based on the game. It would be a nightmare to try to force the client machines to talk to eachotehr round-robin to pass all of the RTS information. Plus if you do it round-robin style then someone can easily cheat.
Not that this is the answer for you, but we are working on another version of ElectroServer right now. When done it will accept generic 'plugins' of AI code. In that way one could have all of the speed and stable backbone of a normal chat server and just worry about coding the AI for the game.
Good luck!
thanks for the tips jobem
yeah we have already started tinkering with aquaserver so that messages are only sent to groups of users, so that you at least only have to deal with messages relevant to your own game! hooray for open-source
the approach we are currently leaning towards is to classify all events as
- critical: meaning that the event cannot be executed until all the clients have received and acknowledged the event
- non-critical: the event can be executed immediately but notification still has to be sent to all clients, ack is not required
- local: the event does not have to be communicated to the other clients
so a critical event would be something like attacking another player's units, they have to have ~not~ moved their units since you sent the attack order, otherwise your attack message has to be rolled back.
a non-critical event would be the completion of a new unit. eventually they need to know about it but it is not time-critical for the other clients to know
and a local event would be choosing to build a new unit... the other players don't need to know about it until it is complete
critical events therefore are the only ones that we need to care about latency for. and hopefully there won't be THAT many of them. (even a person clicking and dragging at a huge rate might generate one of these only once every 5 seconds or something). it depends a lot on how we design the gameplay too as to how often they occur.
our current idea for approaching the critical events is that they'll have to be acknowledged by each player before they are executed by any player, including the originator. to handle this we were thinking that when a player generates the event, it is shown as a ghost and some sort of message pops up 'mobilizing forces' or whatever while the message is sent and acked. once it has been acked by all the players then it can be executed... and if it's rejected then it gets cancelled. this allows us to (fairly) gracefully back out because nothing has actually been executed yet. and the player can be informed that 'communication lines were down, order cancelled' or something. and hopefully the delay would never be more than a couple of seconds...
this is where we could modify the server as well, it could handle the final ack of critical events, not sending it until an ack is received from all players, and cancelling it if one player rejects the event. this avoids the problem that would occur in pure flash of a massive cascade of rejection messages that would have to be sent to all the players.
thoughts anyone?
This may sound really stupid to some of u but what is XML, and do i need a special server to use it?
XML Tutorial: Jucy Studios
2 more questions:
how do you use sockets in flash?
how do you get variables from MySQL?
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:Quote:
Originally posted by brutfood
i2thicko.com here!
I'm just trying to get some new stuff working online - So I have a stupid question.
How do I run a socket server? How do I set it up so it always runs? Do I use cron to start it up every midnight? To test it on my own computer, I just opened a terminal window and run it - I have (unix ssh) terminal access to my host, but I need to ensure that I not only tell it to run - but it keeps running.
java Server &
The & forks the process, basically making it run in the background without your terminal. That should be fine. You could go further and create a script (Perl, PHP, bash ect...) that would periodically check the process is still in existance (say some freak reboot), and fork a new one if required, if you are inclined that way.
Hey, heres a few more questions:
I have been trying to get this dam iis working on the INTERNET(I have it working on local host) to test a multiplayer game. I have everything installed I think but now I am the ONLY ONE who can view the pages through my ip address. My friends cant :S Any ideas why?
And another question, how can I change my ip to be static(if I can)?
Thanks for any help,
Cheers,
Matt
Unsure about the viewing your site thing, If you can see it elsewhere I can't see why others couldn't (bar a deny list or something)Quote:
Originally posted by raticat
Hey, heres a few more questions:
I have been trying to get this dam iis working on the INTERNET(I have it working on local host) to test a multiplayer game. I have everything installed I think but now I am the ONLY ONE who can view the pages through my ip address. My friends cant :S Any ideas why?
And another question, how can I change my ip to be static(if I can)?
Thanks for any help,
Cheers,
Matt
Your ISP has to assign you a static IP, but most want. Many permanent connections have static IPs though (cable, ASDL ect..)
hello...
jobe? or anyone else to that matter. I donwloaded your ElectoServer.
I installed it and ran one of the sample aplications, the dont_fall.swf. Now it works =]...but...Im using IIS, and I have has asp forums chatrooms etc working, but when i try to get it to open the swf it wont work...
Now I thought maybe it was cuss I shouldnt use IIS and that electroserver had its own settings for stten up your machine as a server, but i couldnt find these settings, and Im so puzzled...
Can you help? did any of this make sense? do you need more info??
pleeaase help me, il be very greatful =]
about IIS...ok are you using a router? are you using a network IP to access you files e.g 10.0.0.7 instead of 127.92.104.24???
There is an ip script that will update a page with your ip everytime it changes, i suggets you do a search in google.com if you cant find it then I'l get the link for you (*may take sum time though*)
if you are using a router then you need to configure the virtual server...
Also if you are behind a firewall or on a network then you will need to have your pages on the network server...
I wont say anymore incase you arnt behind a network or a firwall or indeed on a router, i sum times blabble, and its hard to get my message across
here's an excellent example made by jarod tarbell, using unity 2 (harmony) from colin moock and derek clayton.. :D
http://www.randominterface.com/flash...simpledraw.swf
thape
okay....
this stuff is confusing...
i would like a tutorial for making multiplayer games.
also, what is xml, php, perl etc.?
Here ya go, I'll give you a leg up with your scripting...
http://www.php.net/
http://www.perl.com/
http://www.xml.com/
http://www.flashkit.com/board/showth...hp+game+socket is a link to an oild post that I put up that had a php socket server, and a fla to connect with it, also some other info about it for thos looking into using PHP.
Php And Perl are scripting languages that you can use on a server. XML is a form of basically sending data in a "special" format, although with flash, you dont have to worry about xml, even though the command is called xmlsocket or some darn thing like that.
where can i learn all these complicated languages?
unity is great to develop multiplayer games with.. there's a unity developer's forum on http://www.randominterface.com/forumQuote:
Originally posted by lgs
where can i learn all these complicated languages?
thape
For electroserver:
Im trying to install the AS and it says open install.swf in archiveC. Wheres that?
ello all
maybe someone could help me with my problem:
I've set my home computer up as a server and have CommServer running on it. I also have my domain associated with my home ip. When I view my multiplayer game in a browser using my ip address in the url everthing is fine and dandy (to external peeps too) if I goto the same page but use my domain in the url my game fails to connect to CommServer. Anyone got any ideas?
ps if you're interested in setting up your own server but not sure where to start try here: www.firepages.com.au
they've bundled together php, MySQL and apache and preconfigured the package, all you have to do is download, install and you're done (almost) ;)
this forum for Unity and Flash Open Sound Control moved to http://www.randominterface.com/forumQuote:
Originally posted by thape
unity is great to develop multiplayer games with.. there's a unity developer's forum on http://www.randominterface.com/forum
thape
i posted a thread on 'backend and...' about beta testers for my multiplayer shoot m up.
I based it on a server-side java server i wrote myself and i need testers to check it in 'real conditions'.anybody here ?
must be online between 8am and 11am or 2pm and 4pm around GMT+1
?? :)
hope to hear from you soon
My Msnmessenger: [email protected] or Y!messenger : 'madeinrouen'
Cu :)
does anybody have a WORKING link to a multiplayer game in flash ? a one that WORKS with correct GAMEPLAY and useable LANTENCIES ????
xxx