Multiplayer Online Capabilities?
Looking into creating an application that works with online group of users. Already have done my homework and have sql database working together with MMF2: Developer for data transmittions. I am experimenting with various scripts that will execute desired commands.
The data exchanges are almost all I need, but I would like to add some user interaction into application. It is to my understanding that there are only 4 players allowed within MMF2 PER computer, so what I am wondering is: If MMF2 only offers 4 players PER computer, how will I manage online users through event editor?
Aware scripts can do different functions, and was also told I can use one of the Moos (similar to how I am using MooSock) for these commands, but mostly worried about event editor actions....having users subject to normal event editor cause and effects. (Ex: If online user "0013" clicks, or even having users online use "movements" & other MMF2 features.)
Any informative tutorials on this subject or feedback would be greatly appreciated.
Re: Multiplayer Online Capabilities?
You can't confuse with the internal players in MMF2 and MOO.
They are 2 completely different things and used for 2 completely different types of games. For Moo you would not normaly use the other players as they are meant for player in the same EXE instance. (If that makes any sense)
Similar to how MOO chats work you can have unlimited players and people you just need to work it out.
One way might be to create the new player object (active object) and store the Moo ID in an alterable value. Then you can build some events to track what active object belongs to which moo user. I will dig up/recreate an old Moo example game that showed multiple players.
Re: Multiplayer Online Capabilities?
I am unsure exactly what your getting at, but if your talking about events working for "other machines" then this is how you view it.
Using MooClick:
Every client is individual, whatever is in your event editor will be completely local to the client and user thats playing the game/application, UNTIL you send that data to the server. The server then sends this data out to the other users. You then process that data using the individual client.
So if you have arrow keys that move the user, that user will move with those keys on each individual client.
Im not sure what you mean by MMF been limited by 4 players per machine. Unless you mean player controllers. Again remember each client is INDIVIDUAL.
Either way for example - you on your application clicks a button that turns a light on.
You then send this data to the server.
The server then sends it out to everyone else
The other clients hold a "Compare user ID + recieve message * on subchannel *"
When this message is recieved, you turn the light on. This even would exist in every single client, including yours.
If this what your getting at, you just have to get your head around the idea that you as a client can recieve and send the same data to everyone else.
Now if your looking at managing other users locations, don't use the same object as yours for other players. Have a "player" and a "other player" icon.
Each client will send co-ordinates of "the player".
Then after the server sends out the information, the clients can place the "other player" in there location.
Most important thing to remember is only send the data you need. Keep it limited as possible.
This post is probably a lot of waffle to you, it depends how much experience you have in using MOO. Also what you have done with MooSock. And what your trying to achieve!
There are a lot of examples about if you do searches for them. Some nice ones on the daily click. (If someone could find the link?)
Id be happy to help you further, but would need to chat more properly than over a forum, it can get confusing, took a lot for me to learn it properly. :D
Re: Multiplayer Online Capabilities?
Spike,
I know what you mean about progress.
Many of my trials & tribulations have been diggin' and putting together with limited guidance.
Many times when I reply to forum supports, I help as much as I can, but can't help but think how nice it would have been to find my answers in one location.
So I do appreciate your support.
I see how MooClick will be able to query things like position and other values.
But limiting data exchange scares me on a scalability standpoint.
When it comes to users, I would like them to have controls exactly the same as a regular "on the same machine" user would have. (like racecar,platform,etc. movements and other events)
If I am using a coordinate value for X & Y...it would have to run every 1/100 of a second...and that isnt limiting data.
I am looking for uses online...that would be comparible to uses with local .exe's (using 4 players on one machine)
Is using this Moo method very limited, or could I ever expect a game with fluid updates and movements like on local developments?
Re: Multiplayer Online Capabilities?
research dead reckoning, and DONT use moogamess, it doesnt work
Re: Multiplayer Online Capabilities?
Ok, no game on the planet submits its data that fast :).
Dead Reckoning is the most important part to your coding.
Remember, each user WILL have his/her own movement that is the same on each client.
Simple example - Racing Car
You start, racing along the straight, you send the acceleration / speed / position of yourself to the server
The other clients then place you there, and you code into the client app that they continue to go at that speed. They will move the same on both apps, because nothing has changed.
When the user turns a corner - send the data again, saying that he is turning. you dont need to keep sending information of a player that is continually travelling in a straight line.
This is predicting there next location, and as long as new data is sent when they make a change, and it is updated, players stay where they should be. This limits data transfer, and allows for things to work a lot better.
Hope that helps.
edit: I would like to point out even games like World of Warcraft use a similar system.
Re: Multiplayer Online Capabilities?
"and allows for things to work a lot better."
unless packets are lost, where people will end up in weird places when they think they have stopped
Re: Multiplayer Online Capabilities?
I found the great old example from Tigs that showed multiple players in MooClick. Should still work fine.
You do need the full version of MMF as it uses String Parser 2 to parse some date.
www.clickteam.info/MooClick_Game_Example.mfa
Re: Multiplayer Online Capabilities?
Spike,
I think I am picking up what you are laying down.
Wondered if the MooClick runs with a delay very similar to MooSock.
Querys within MooSock take about 5 secs each.
When using your racecar example from above, worried that if user is approaching zone (near to wall)...and event should happen when user gets in zone (like stop or de-accelerate)...the MooClick will have transmittion lag....forcing movements to be lagged.
Is MooClick faster than MooSock? or the same?
Re: Multiplayer Online Capabilities?
"Querys within MooSock take about 5 secs each."
you have it set in blocking mode, and your using recieve text line... what is sending the data (http server?) needs to send a blank line (add blank line in html file if http)
Re: Multiplayer Online Capabilities?
They both have a similar delay, but it should be more like 50ms, not 5 seconds...
Are you using dial-up?
Re: Multiplayer Online Capabilities?
neat_Kliker2,
Should MooSock be taking 5 secs for transfer of data time?
Running .php file? Looking for almost instant transfers.
Taking a look at running MooClick for online gamelike interaction. It seems to be a bit jumpy on calculations.
Looking for something that transmits movements a bit easier.
Any suggestions, or is this the only route?
-Machina12
Re: Multiplayer Online Capabilities?
neat_Kliker2,
Should MooSock be taking about 5 secs. for transfer of data?
Running .php file. Looking for almost instant transfers.
Working with MooClick for online capabilities, but seems a bit jumpy. Is there any other route?
-Machina12
Re: Multiplayer Online Capabilities?
MooClick is built upon MooSock. So if any, MooSock is faster (because it is simpler). I'm using MooSock to establish a client server connection. If a new connection is built up it seems to take a couple of seconds and after that the delay is like 5ms or even less.
With the different MOOs I think you are trading speed for simplicity. Although there is one thing to one: an extension can perform a calculation faster that you ever could do it with MMF. So if you end up recreating exactly the same dead reckoning system with MMF and MooSock, that MooClick or whatever is using, it'll be slower.
Re: Multiplayer Online Capabilities?
Moosock doesn't have such a delay : on my intranet, I have a server running at about 1000FPS, and the ping I get from the client is very small. In fact this time is one MMF2 main loop, ie at 50fps my ping is 0.02 sec, but if i set client to 500fps it reaches 0.002sec
Re: Multiplayer Online Capabilities?
Ah, I never tried setting higher fps on the client. That would probably make it even faster (although in my case the server runs on a virtual machine on the same computer as the client which probably causes the slowdown).
Re: Multiplayer Online Capabilities?
Corentin,
These are more like the transfer rates I am used to.
Where am I dictating these settings? How will I ensure that settings are the same on other computers?
-Machina12
Re: Multiplayer Online Capabilities?
You can't expect every computer running your game to be as fast as yours, that's why I use most of the time something like 50fps. And I check "Machine independent speed". This way, you should have the same speed on every computer, which makes synchronizing easier.
I haven't done those tests with Mooclick/game, but I had a feeling (in MMF1.5) they were slower than MooSock, that's why I don't use them nowadays.
Re: Multiplayer Online Capabilities?
I guess I was under the impression that this is a setting for transfer rates. Using demo version of MMF2 as of right now, but am familiar with using "indipendant machine speeds", wondered if there is a way to make queries submit and return faster?
When using MooSock, it takes approx. 3-5 secs for data to transfer and return.
Is this expected, or can I do something to make queries faster?
-Machina12
Re: Multiplayer Online Capabilities?
Mayhap your problem isn't with how you're using MOO, but how you're using SQL? If you're opening and closing the connection to the database with each command, that could probably explain the delay. But that's just a wild guess, as I have no idea how your program is structured. Maybe an example of MMF's 5-second-query code would be of help.
And back when I didn't even have MMF1.5 (although I think it may've been out), I made a fairly simple online game with MOO(Click?) that could support a theoretically unlimited number of players. I never really got more than 4 total, and I think our average pings were all between 30 and 70ms, with the tracking being updated every other frame (.04 seconds). For the most part, unless we were exploiting one of the many physics glitches in my engine, there was no lag and infrequent rubber-banding, and I'm confident that could've been fixed with better coding, but it was at its core a house of cards build upon a hack of an example I'd found 'cause I really didn't know what I was doing at the time. (So yes, MMF should be more than capable of fluid online gameplay at 50FPS, or 1 frame per .02 seconds, but it takes a different kind of engine coding to compensate for the fact that even successful online games can't expect low pings or updated player data every frame.)
Re: Multiplayer Online Capabilities?
How can you say you are more used to certain transfer rates?
I am going to asume you understand the concepts of data travel? Also the concepts of the Internet and how it works?
MooClick WILL achieve you at 50ms response time if the server is located properly etc. I believe it can achieve a 20ms response time, but the coding needs to be right, and the server conditions perfect for it.
Im not to sure with the delay of moosock, I haven't used it "that" much so can't really comment. After a lot of testing of MooClick however, I know it can achieve the results your after.
edit: I would like to point out, Tigs example works, it isn't the best way it can be done. But it does work, there are many ways of coding it better.
Re: Multiplayer Online Capabilities?
You must do something wrong if you need 3 secs to get data back (note this has nothing to do with transfer rate, it's latency). If you use a coding like "Always Send position", then 3 seconds is probably normal, but anything correctly coded should give you far-better results.
Try to do some tests with client and server on the same pc, in localhost, you should get the best ping ever, if you don't, then you made something wrong.
As someone said above, try the examples you'll find around, or show us what you're doing. You'll get a better help.