chris.daniel

Members
  • Content count

    7
  • Joined

  • Last visited

  1. A while back, I was here making a multiplayer Contra. I finished it up a few months ago and moved on....but I decided i'd share the results and the source code with anybody interested. It came out pretty good....I called it Contra-2000. Ive actually played the thing quite a bit with my 7 year old..he really likes it. Its buggy and raw but works well. The multiplayer came out very nice. Also...big huge THANKS to all the devs on the site...you guys are super helpful. And the melonJs is really solid and easy. I will definetely be recommending it strongly. Below is link to the source code ... there are videos on there so you can see the game play. https://github.com/chrisDaniel/contra-2000 I dont keep the server running. The game eats network ... and AWS charged me 9 dollars!
  2. I needed the zoom as well today and came across this post. I copied in your code above and the plan didn't really work right away....simple quick fix for me was to use a constant value of 1.02 for zoom out and .98 for zoom in. Seems like, from the partial code above, your idea is to keep a scale variable which you are incrementing and then applying. Which doesnt seem correct becuase [viewport.currentTransform.scale(game.data.scale) ] doesn't set a scale value it just multiplies the current values in the transform matrix. Hopefully that helps....maybe not.
  3. Perfect! Thanks!
  4. First off....everything is working correctly. But I have a question about how the render update is working. See.....I am testing across two open browser sessions in chrome; each are receiving socket messages to update the position of the players in the game....like the picture below.... Both of the open browsers are showing receipt of messages the whole time....But I have to actually be engaging with a window for that specific window to redraw the page. Bottom line...I cant seem to see the updates from screen 1 effecting screen 2 in real time....I have to go click on screen 2 at which point screen 2 immediately draws it correctly. Is there a quick way to explain what the rendering is doing? Im hoping that it would be pretty enlightening for me to understand this....maybe its simple, but I cant seem to figure whats happening.
  5. Thanks for the feedback Jay....the collection of links in the "rabbit hole" are pretty tremendous. And nope, Ive never made a multiplayer game at all. As for melonJS...the framework is really tremendous so far....Ive got a contra map from tiles I cut off old images on the web, plus sprites. Then coded up my entities , and already have a pretty decent looking and working Contra game. So Big High5 to the melonJS devs. Now im wading into the multiplayer....Ive got websocket messaging flowing between client and a server. So easy part done. I suppose from what I read .... the correct approach includes... 1. Server acts as master system of record 2. Clients see the other users as they were in the very slight past and interpolate the gaps. 3. Implement lag compensation on server calculations which kinda reverses that interpolation from step 2. But it seems to me the implementation of that will be a bit bizarre in a game like Contra....because the bullets are moving so slow! But maybe it makes easier, who knows? Its an interesting problem area for sure. Thanks again!
  6. Thanks for the quick reply agmcleod.... Im going to give melon a go I think. I just worked through the Platformal tutorial and it was very easy to get the thing stood up and a game working. So far so good.
  7. This post is from a first time melonJS user. I would love guidance and advice from strong members of the community. Let me know if this is sounds like a good/interesting idea. Is this something melonJS will do well? Game Summary Massive Multiplayer Team Contra (looking exactly like NES contra) Hook: Its a neverending multiplayer Game session. As a player joins the session they are auto-teamed up with 1 random new player . These teams compete to get to top of leaderboard (so kinda similar to slither.io in many respects) Rules: Exactly like contra...1 bullet takes a life. Each player starts with three lives. As a team is killed off, the team is removed from the game and leaderboard. New teams are always being added to the game. If your teammate is killed off...you are alone, but will have opportunity to join another player Why Im Posting This Ive never made a game for browser, after looking around Im almost settled on using melonJs. Im a very experienced server side developer and will also be building a multiplayer micro-server specifically for the game. This server will be responsible for coordination between players (lobby and in-game). It will also do some of the heavy in-game calculation lifting. It will service the clients via websockets and REST. The browser is where Im unsure. Ive done Javascript when I needed it, but Im no expert. Here is what I need melonJS to do for me. Render the game (of course). Do physics / collision detection for the player. (not all players .... just the main player for that browser instance) As new players are added the map will possibly grow. With some upper limit. Take instruction from the server on the game state (other entities and they're actions) Use RX-JS for this interaction with the server (I specifically want to learn RX-JS). So this will require Observable streams to be processed alongside the game loops. Thanks for any feedback! -chris