smallon08 Posted March 11, 2014 Share Posted March 11, 2014 Is it possible for me to build a real time multi-player game together with something like socket.io(node.js)?If yes, is it possible for different player to look at different part of the game world at the same time? Link to comment Share on other sites More sharing options...
enpu Posted March 11, 2014 Share Posted March 11, 2014 I would suggest you to take a look at this article:http://buildnewgames.com/real-time-multiplayer/ jerome and xdiepx 2 Link to comment Share on other sites More sharing options...
smallon08 Posted March 11, 2014 Author Share Posted March 11, 2014 Thank you. But i want to to know if i can do this with phraser Link to comment Share on other sites More sharing options...
xronn Posted March 11, 2014 Share Posted March 11, 2014 Yes of course you can, take a look at a guide here - http://haanto.com/phaser-websocket-multiplayer/ xdiepx 1 Link to comment Share on other sites More sharing options...
smallon08 Posted March 11, 2014 Author Share Posted March 11, 2014 is it possible for different player to look at different part of the game world at the same time? Link to comment Share on other sites More sharing options...
ctmartinez1992 Posted March 11, 2014 Share Posted March 11, 2014 Everything is possible, you just need to believe Link to comment Share on other sites More sharing options...
Maxime Posted March 12, 2014 Share Posted March 12, 2014 As @photonstorm said once it's not possible yet as pixi.js doesn't include this feature, but maybe in the future it will be possible to manage multiple cameras. Link to comment Share on other sites More sharing options...
enpu Posted March 12, 2014 Share Posted March 12, 2014 As @photonstorm said once it's not possible yet as pixi.js doesn't include this feature, but maybe in the future it will be possible to manage multiple cameras. It is possible if you use RenderTexture. Link to comment Share on other sites More sharing options...
Mariusz Posted March 12, 2014 Share Posted March 12, 2014 is it possible for different player to look at different part of the game world at the same time?Well, I think your question is semantically unclear. My gut is telling me that what you are asking about is whether a player on a different computer can join in a game made with phaser and socket.io and whether that player's camera can focus on a different point in the game world than another player's. If this is the case, then the answer would be yes, absolutely. Link to comment Share on other sites More sharing options...
Kobaltic Posted March 13, 2014 Share Posted March 13, 2014 Yes you can. To try it open your game in two browsers and move one way in one and another way in the other. If you program your own server you can hook it right into Phaser. I use ajax to a php server from within phaser with no problems. Link to comment Share on other sites More sharing options...
smallon08 Posted March 13, 2014 Author Share Posted March 13, 2014 THANK you all.Well, I think your question is semantically unclear. My gut is telling me that what you are asking about is whether a player on a different computer can join in a game made with phaser and socket.io and whether that player's camera can focus on a different point in the game world than another player's. If this is the case, then the answer would be yes, absolutely. Mariusz: yes , i mean that, but in http://www.html5gamedevs.com/topic/1384-syntax-for-adding-camera/ Rich said that multiple camera is not supported, is that what i want to do? It is possible if you use RenderTexture.enpu : can u explain more , i am a newb Many thanks!! Link to comment Share on other sites More sharing options...
smallon08 Posted March 13, 2014 Author Share Posted March 13, 2014 btw, i have tried several socket.io examples (like:http://buildnewgames.com/real-time-multiplayer/) , they all show noticeable delays in the sprite move, I am trying to make a game that allow little delay between diff players, wt can i do?THZ Link to comment Share on other sites More sharing options...
dnassler Posted March 13, 2014 Share Posted March 13, 2014 I don't think that whether Phaser supports multi-cameras or not has any relevance to your question. And I don't understand what relevance the reference above to "render texture" has to your question (sorry if I'm just too dumb). But I think some others above have said (i.e. Mariusz) that it is possible and I would agree. Because: Each player is on a seperate computer on a seperate browser using it's own Phaser environment, right? Each of those browsers has a Phaser.Game (and camera with it). Each browser uses sockets or whatever to send messages back and forth to communicate the locations of the players (or whatever other states are needed to be shared). It is only the messaging between the seperate browsers (players) that makes it become multiplayer. Link to comment Share on other sites More sharing options...
enpu Posted March 14, 2014 Share Posted March 14, 2014 @dnassler, yes talking about multi-camera support was a little off topic, but i just wanted to clarify, that it is possible with Pixi Link to comment Share on other sites More sharing options...
Zef Posted March 14, 2014 Share Posted March 14, 2014 Yes you can do this and it works great. You will not be able to get lag free movements though using serb sockets unfortunately. They use TCP connections which are really quite bad for latency effected real time applications. If you are making an rpg, or another game where a little bit of lag doesn't matter too much, you can store a buffer of the other players last positions and then tween between them. This can help to smooth out the movement quite nicely as it helps prevent position jumps caused by suddenly receiving a burst of TCP packets. Link to comment Share on other sites More sharing options...
Fishrock123 Posted March 14, 2014 Share Posted March 14, 2014 Yes, you can do it, though you'll have to be able to make a lot of the interconnecting game/server parts yourself.Furthermore, I strongly recommend primus as opposed to Socket.io. (Primus has better support, works better, is faster, is actually updated, etc.)I am currently working on a multiplayer project, and I hope to be able to extract a good amount of it into a library, or at least a very comprehensive tutorial, in the future. Mike 1 Link to comment Share on other sites More sharing options...
Nikolay Tsenkov Posted November 20, 2014 Share Posted November 20, 2014 @Fishrock123, did you manage to write that tutorial? Link to comment Share on other sites More sharing options...
Recommended Posts