Flash + -=*Net*=-

A place for tutorials on how to get the most out of Flash

Flash + -=*Net*=-

Postby OwnerOfSuccuby » Thu Nov 05, 2015 10:07 pm

Hello. Do some body work with flash in Internet - making multiplayer games ?

I start looking in that direction. Have some problems - lose some data when transfer it. (But a lot of games in internet i see have the same problems).
https://www.youtube.com/watch?v=3x6IulT ... e=youtu.be (for now have some mistakes in code so some times it do not work like i want - but already fix a lot of them ;) )

I make all calculations on clients now - because do not have and think that it will be possible for me to have good server :roll: :oops: (The same for white IP adress :mrgreen: :oops: - i even have problems with internet because of manapoly by internet company in our area (and mobile internet is not good too :? :shock: )) (Already thinking about create some test server on linux (it is cheaper then windows servers :mrgreen: ) - but for now i have only exp how to make windows server work - so i will need some more practice in it (linux magic etc ... :lol: ) :mrgreen: )

Server on PHP - make URL reguests or use sockets to transfer data... .

Do some body know good info about serverse for flash better on php ? Is there some good sites about it ? How is better to make calculations and etc.

What is good for multiplayer games - what idea it can be ? What type of the game ? I can not get any idea other then some kind of 2d quake :roll: or games like that ... . But i do not think that 2 d quake will be interesting ... .
But it was interesting to play games like battle city with some body when i was young :mrgreen: - so may be i am wrong and 2 d quake is not as bad idea as i think.

1) So the question is - what is possible to make ?
2) Where to read good info about it ?

I do not plan to make some thing for now - i only want to practice in it. But may be i will make some thing if i will like an idea. Unfortunatly i am not as self motivated to make some thing complicated ;) only geting exp. My Job does not intersects with flash unfortunatly and it takes a lot of time :cry: so i do not have a lot of time left :? :shock: but i like this tehnology so i want to learn more about it ;) And who knows may be one day ... - but i do not think so optimistic :lol: :mrgreen:
OwnerOfSuccuby
 
Joined: Fri Jun 11, 2010 9:33 pm

Re: Flash + -=*Net*=-

Postby OwnerOfSuccuby » Sat Nov 07, 2015 6:03 pm

Find not bad book about multiplayer games : Flash Multiplayer virtual worlds
(But i only do not like that in this book is about how to use shareware server :oops: only free for 20 or 100 clients online).
But as i understand now to wright own server is not as easy as i thought. And may be not as nesesarry.

I will try to look in different directions and think may be it will be possible to combine server and client calculations for better work.
Now reading book about flash and PHP :mrgreen:

Now looking info about stream videos, red5 servers and etc :twisted: :lol:

If i will find some good information i will try to post it on this forum. But i do not think that it will be soon :mrgreen: To many trash in the internet :evil: :?
OwnerOfSuccuby
 
Joined: Fri Jun 11, 2010 9:33 pm

Re: Flash + -=*Net*=-

Postby GoRepeat » Sat Nov 07, 2015 6:40 pm

Let me know how this pans out, I was thinking it would be fun to have a player vs player option for SnT II
Picarto LiveStream: https://picarto.tv/GoRepeat
Other Stuff: Click Here
User avatar
GoRepeat
Moderator
 
Joined: Wed Jul 21, 2010 2:26 am
Location: Behind the Looking Glass

Re: Flash + -=*Net*=-

Postby OwnerOfSuccuby » Sat Nov 07, 2015 8:06 pm

For now i know 2 ways:

1) If you have your own server (VPS - virtual private server) - or you have white IP on your provider - you can put wamp on your machine for example (i am not good now on Linux machines :( ;) so only know how to make it work on windows).
Then you will need to put some changes in its files - and you will get some kind of your own private server.
(Or use already existing servers like for example http://www.smartfoxserver.com/ - but they limit you by 20 online yousers (or may be 100)).

Or you can make it using URLrequest to php files / Or use sockets.
URLrequests let you get some data and do not use your machine to much, sockets as i understand use more power - can lose some data some times but they are good for real time battles (without delays) - as an example of this interaction:
http://www.youtube.com/watch?v=3x6IulTnQGk (i test up to 6 clients running on the same server PC - but it can be more).

2) You can use stratus - and connect players yousing P2P (pear to pear). I think it is the best solution for 1 by 1 pvp battles for players. But for now i am not good enough in its direction. (Have some problems with connecting to stratus :mrgreen: - you will need some registration on there server for use it).

For now i only studing - so we can try to think about together. If you are interested you can PM me - or say where it is possible to chat with you about it (i think if all will go well i even make some tutorial for the forum how to make the thingth like that). I can give any sources i have and try to explain how all i have works :mrgreen: So it is not a big problem for me ;)
OwnerOfSuccuby
 
Joined: Fri Jun 11, 2010 9:33 pm

Re: Flash + -=*Net*=-

Postby OwnerOfSuccuby » Sun Nov 08, 2015 8:47 am

As an example of simple P2P connetction is this (open flash in 2 winfows and press button move (blue button)).

But do not know why it works only in one network - can not get it why and make it work with all internet :( Now reading documintation :roll:

Can connect with one network to my new test swf file - but this is bad thing i found in the internet about p2p:

NetGroup problems connecting devices with different internet connection:

Create a chat using technology Cirrus (p2p) and class NetGroup.



If the device is a mobile phone, and has network via 3G or 4G, then connect to the same group with other devices is not happening.



For example, there are a PC and the mobile device:

1 If both are connected to one Wi-Fi:

onNetConnectionNetStatus: NetConnection.Connect.Success

onNetConnectionNetStatus: NetGroup.Connect.Success

onNetGroupNetStatus: NetGroup.Neighbor.Connect

A connection is made.

2 If both are connected to different Wi-Fi:

onNetConnectionNetStatus: NetConnection.Connect.Success

onNetConnectionNetStatus: NetGroup.Connect.Success

onNetGroupNetStatus: NetGroup.Neighbor.Connect

A connection is made.

3.If one device is connected to Wi-Fi, and the other to a 3G or G4

onNetConnectionNetStatus: NetConnection.Connect.Success

onNetConnectionNetStatus: NetGroup.Connect.Success

No connection.


the results you're showing indicate a symmetric NAT (that is, a NAT that uses a different translation for each unique destination). there is no way for a peer behind a symmetric NAT to coordinate and find another peer that's behind a different symmetric NAT or behind a port-restricted cone NAT.

this posting by Matthew Kaufman explains the situation with NATs in more detail:

https://forums.adobe.com/message/1064983#1064983


as far as "fixing" it: the issue isn't the protocol -- a symmetric NAT is inherently defective. the only fix is to not use a symmetric NAT in your network. unfortunately this is often outside your control (such as with your mobile provider).


P2P can't work in all network configurations. most likely your mobile phone network is implementing a symmetric NAT. if the PC's wifi has a port-restricted cone NAT, then you could get P2P to work with another wifi (as long as it wasn't symmetric NAT), but it wouldn't work with a symmetric NAT.

please go to http://cc.rtmfp.net and post the results (minus your public IP address).
OwnerOfSuccuby
 
Joined: Fri Jun 11, 2010 9:33 pm

Re: Flash + -=*Net*=-

Postby Anonymouse » Wed Nov 11, 2015 10:29 pm

The Yahoo Games Network SDK (previously player.io) is pretty good for this, I've found it pretty easy to use.

https://gamesnet.yahoo.net/
User avatar
Anonymouse
 
Joined: Sun Nov 24, 2013 2:47 am

Re: Flash + -=*Net*=-

Postby OwnerOfSuccuby » Thu Nov 12, 2015 4:08 pm

Thank you very much ! I will try to play with it soon ;) :mrgreen:
OwnerOfSuccuby
 
Joined: Fri Jun 11, 2010 9:33 pm

Re: Flash + -=*Net*=-

Postby OwnerOfSuccuby » Mon Nov 16, 2015 6:04 pm

Start to play with yahoo - but for now there examples give me this: Error: You can only call Connect() on game connections that are using the Basic authentication provider
Or some mistakes like this.

Hot to make there samples work - makeing all like in tutorial but it do not work this is strange. Do not understand where do i mistake.

Code: Select All Code
PlayerIO.connect(
            stage,                        //Referance to stage
            "[MyIdThere]",      //Game id (Get your own at playerio.com. 1: Create user, 2:Goto admin pannel, 3:Create game, 4: Copy game id inside the "")
            "public",                     //Connection id, default is public
            "GuestUser",                  //Username
            "",                           //User auth. Can be left blank if authentication is disabled on connection
            null,                        //Current PartnerPay partner.
            handleConnect,                  //Function executed on successful connect
            handleError                     //Function executed if we recive an error
         );   


And they write this one:
Connect() is being deprecated in favour of Authenticate, so please use that method instead. We recently released a fix for an issue with Authenticate, I think your use-case should be covered by that. Are you still seeing the error?


Code: Select All Code
PlayerIO.authenticate(stage, [MyIdThere], "public", { userId:"testuser" }, null, function(client:Client){
       trace('connected'); // connection established
});
OwnerOfSuccuby
 
Joined: Fri Jun 11, 2010 9:33 pm


Return to Tutorials



Who is online

Users browsing this forum: No registered users