00:00
00:00
jirachi99

Age 29, Male

Programmer

QLD, Australia

Joined on 11/13/07

Level:
6
Exp Points:
300 / 400
Exp Rank:
> 100,000
Vote Power:
4.58 votes
Rank:
Civilian
Global Rank:
> 100,000
Blams:
1
Saves:
5
B/P Bonus:
0%
Whistle:
Normal
Medals:
307

jirachi99's News

Posted by jirachi99 - February 3rd, 2011


In addition to my previous post I will now explain HOW I will make the game actually run!

So as we have seen before, each players information will be stored on the save group here on Newgrounds, when you click 'Online Mulltiplayer' from the main menu and the game starts connecting here is what will be sent to the save groups.

\[USER].ipAddress
\[USER].port
\[USER].language

Just to begin with, then the person gets 2 options, Host game and Join Game, Since we have already covered hosting I will now show you Joining.

Once the user (Which from now on will be referred to as joinPlayer) finds a game and clicks join the first thing it does is downloads the IP from the server (Which is actually just another player hosting the game, and from now on will be referred to as serverPlayer), to get the IP and port from the server joinPlayer will want to check the save group for \serverPlayer.ipAddress and \serverPlayer.port for the IP and port numbers.

After getting the IP and PORT of serverPlayer, joinPlayer uses XMLSocket and send a piece of information saying 'joinPlayerWantsToJoin' and it is defined as true.

serverPlayer than recieves this information and checks the server for \joinPlayer.ipAddress and \joinPlayer.port.

After serverPlayer gets these it uses XMLSocket to connect to the player, now at this point the player has joined the game.

joinPlayer recieves info from serverPlayer saying that the request has been accepted or denied and if accepted the player starts to get info from serverPlayer

serverPlayer will now setup joinPlayer's data, this can include things like
MAP
GAMETYPE
CURRENTSCORETEAMA
CURRENTSCORETEAMB
SCORETOWIN
WEAPONS

And all that kind of data.

once serverPlayer has sent the initial data and joinPlayer has received and setup his game the actual game begins.

So, when joinPlayer spawns into the game the immediate thing to do is tell all other players in the lobby that joinPlayer is now playing!

To do this joinPlayer send data to serverPlayer simply saying 'joinPlayer.inGame' and serverPlayer will be waiting for this info!

After receiving the information the serverPlayer would tell all other players, now the serverPlayer has already downloaded the entire list of ip addresses and ports for everyone in the game so it knows where to send everything, now like before, all other players have already gone through what joinPlayer has gone through, so they will already be playing in the server

Ok so lets say there are 3 players OTHER THAN joinPlayer and serverPlayer, well call them alreadyPlayer1 2 and 3.

Now when serverPlayer recieves the info that joinPlayer is in the game it will XMLSocket the info to alreadyPlayer(i) (i being the number)

So joinPlayer joins, then he starts to walk forward...

joinPlayer is constantly sending various data about his player, things could include
PLAYERXPOSITION
PLAYERYPOSITION
PLAYERDIRECTION
PLAYERHEALTH

And so on

serverPlayer is constantly receiving all this data from joinPlayer and needs to do something with it...

to begin serverPlayer may need to slightly choke the info that he\she is getting to keep the game from disconnecting...

This is where 'LAG' takes place, have you ever been in a multiplayer game, than someone with really slow internet joins and then all of a sudden the game is either unplayable or you get disconnected?

Yep thats lag, but its hardly ever the servers fault, in most cases the server is actually trying to reach a certain player, but that player is unresponsive, but the server devotes too much power TRYING to find this person that LAG occurs because the server isn't worrying about everyone else...

when serverPlayer receives the data from joinPlayer it then stores the information as joinPlayer.data where data is the variable like playerXposition.

After it gets this data it gets the list of IP and PORTS for alreadyPlayer(i) and send the info to them with XMLSockets.

To put this last part simply, all other players are sending info to serverPlayer and it automatically sends it to everyone else.

======================================
======================================
=========
Extras

timeouts occur when the server cannot reach the player for a period of time, by default the XMLSocket has a timeout time of 2000 milliseconds, but I would probably make that a bit higher.

At all times there would be at least 1 server running (I hope) and that server would be madly checking all players and comparing it to any other servers, if ALL servers reported a player unreachable for a period of time then it would say that the player is disconnected (just incase you didn't use the 'Back to main menu' or 'Disconnect from multiplayer' button) and would treat the situation like you clicked Quit.

Now we don't want very private information stored very long now do we? So after you have quit/get disconnected you will have your IP address removed from the server AND your name will be removed from the 'Available users' list.
==================

Thank you, I am Jirachi99 signing off for a while since this took me like 25 minutes to type any my hand is hurting...


Posted by jirachi99 - February 3rd, 2011


Ok, so I think I have everything worked out to make an online multiplayer game, but the only problem is that no matter how I approach the method I will need to use Newgrounds SAVE_GROUP feature (or make a dedicated server...) and that is a pain!!

Basically to any developers I would have the following setup in the Save group

[SAVE_GROUP]\
\[USER].ipAddress = XXX.XXX.XXX.XXX
\[USER].isHosting = true/false
\[USER].language = XXXX
\[USER].port = XXXX

And if \[USER].isHosting is true than the following data would be added
\[USER]\SERVER\playersList = array (List of players in lobby)
\[USER]\SERVER\playersInLobby = number (Number of players in lobby)
\[USER]\SERVER\lobbySize = number (Max amount of players allowed in lobby)
\[USER]\SERVER\lobbyName = "LOBBY NAME"
\[USER]\SERVER\lobbyDesc = "This is the lobby description"

And finally in the overall server you would have
\lobbyList = array (list of all lobby's)
\lobbyOwner = array (list of the people who started/own the lobby selected)

So that when the person clicked 'Browse Multiplayer Lobby's', flash would check [SAVE_GROUP]\lobbyList to build the list of available lobby's, then you would get the people who own the lobby (by accessing the file at [SAVE_GROUP]\lobbyOwner) and then from there you would select the server and the server would check lobbyOwner and find the user that owns the server and you would then use XMLSocket to connect to [USER].ipAddress

Simple no?


Posted by jirachi99 - January 31st, 2011


So I talked to TomFulp and he says that there will be a new newgrounds API soon that will be much better and easier to use than the current version! When It's released I will decipher it and try to make an online game!


Posted by jirachi99 - January 29th, 2011


Im still looking for anyone who knows how to get the save_group feature of the newgrounds API works!


Posted by jirachi99 - January 27th, 2011


As the Title of this post says I am trying to make a game that 2 or more players can play over the internet straight here from newgrounds, the only problem being that I cannot get the Newgrounds SaveGroup feature to work!

If anyone knows how this is meant to work please tell me since I am having no luck!

If I can get it to work I will post a basic game showcasing how it works, in theory it is possible, BUT only if I can get this to work...

So if you do know how to get it to work here is what needs to be done on the two computers, CP1 being the sending and CP2 being the reciever

CP1: Send data (i.e. player movement) to SAVE_GROUP (the server hosting this game) as variable playerXmovement (X being the players Name/number)
CP2: Constantly checking playerXmovement and moving that player accordingly
CP2: Checks SAVE_GROUP\playerXmovement to find out it differs from the current players position
CP2: moves playerX to playerXmovement
CP2: Sends its player's movement variable to SAVE_GROUP
CP1: receives and repeats

In theory it could easily work, but I need to get the save groups to work!!! Please PM me with a response!


Posted by jirachi99 - January 24th, 2011


Hey guys!

See I haven't been able to do much on newgrounds lately since I have been cleaning up after the floods, but now that I have nearly got everything back to normal I will be doing some more projects soon! Helycopta 2 will be delayed until I'm in the mood to start it again but until then prepare for a game recreation!


Posted by jirachi99 - January 18th, 2011


Hi, Jirachi99 here and I have been in the Queensland Australia floods and my computer was completely fired in the flood!!!!! and both of my copies of Helycopta 2 have been completely lost!!!!!! So I am back at step 1! I actually had to buy a new computer and everything! (Good computer though), I actually lost every flash project I have done except like 2 .swf files I had on a USB to show my teachers at school and the .swf files are useless anyway for editing purposes...

So in other words Helycopta 2 has to be started again! And I am not going to enjoy starting again BUT it does mean that I can try to make the code a bit more solid!

Sorry guys I have to start all over again... :(


Posted by jirachi99 - January 12th, 2011


I have been moving a bit slow with Helycopta 2, I have been making a lot of progress in the coding area and the game will have more than just Helicopters and so far I think people will be happy with the new levels.


Posted by jirachi99 - January 4th, 2011


I just checked my overall flash stats, and I have more views on the unreleased Helycopta 2 then I have on my Newgrounds API Tutorial..

And BETA testers, I will have an update soon!


Posted by jirachi99 - January 2nd, 2011


Hey guys and girls! I was sitting here doing some work on Helycopta 2 and I was thinking of like 50 things I want to implement into the game, then my friend came in and I showed him some of the ideas and he was all like 'No they're crap ideas, here's what you need', so I added some of the ideas, then my brother walked in and I showed him the game and he told me I should add his ideas, so I got thinking, what does everyone else want?

Seriously, what do you want in Helycopta 2 people? Just reply in the comments and I will see what I can do!