Jump to content
  • Advertisement

Quantastical

Member
  • Content Count

    7
  • Joined

  • Last visited

Community Reputation

112 Neutral

About Quantastical

  • Rank
    Newbie

Personal Information

  1. Quantastical

    Trying to figure out WebSockets

    Thank you for the thoughtful responses. I agree, hplus0603, that refactoring my code is probably the ideal solution.   I think for now, as you said, it might be easiest to do it the non-ideal way, since I don't have to break everything down and build it back up, and because it's a simple hobbyist project.   This will give me the opportunity to learn everything in a more simplified manner, then I can revisit it down the road to refactor and improve everything.   To relaxo4o, I actually started with a MEAN stack but was overwhelmed a bit because I have such a solid understanding of PHP MV* pattern. In an effort to GSD (Get Shit Done) I abandoned that process to do it on Apache, but now I am starting to better understand how those things all work together and why they are beneficial.   Ultimately, I think I am going to continue following the "GSD" method and then possibly convert everything down the road (a version 2, so to speak) to a MEAN stack, modularize my game code, and update the multiplayer strategy, and improve my game code to improve memory management and reduce garbage collection impact.   Thank you both for your assistance and knowledge.
  2. Quantastical

    Trying to figure out WebSockets

    Cool. I was able to get two browser instances to connect to each other and go through the character selection process while waiting for the peer to do the same.   Now, I'm trying to figure out the best way to replicate the game logic on the server. In my case, I wrote my game in plain-ol' JavaScript...no libraries, no node, no nothin' except a bunch of custom objects using prototypal inheritance.   That code all lives on an Apache server, what I'll call "Server A". The node server, a.k.a. "Server B", is what I'm using solely for handling the peer-to-peer communication, but this, too, needs to run the game logic, in addition to interacting with the clients (gathering input and pushing updates).   Is there a best practice for including all of my game code on the node server?   The game logic isn't written to be modularized, so it doesn't play well with node's require function, since it doesn't have any "exports" exposing the global objects. I'm not sure what I should be doing here. Besides that, since they are two separate environments (Server A and Server B), I can't just require them.   I feel like I'm a bit mixed up here, I hope I'm explaining my situation well enough to make sense.   Maybe I shouldn't be worrying about executing the game code on the server, even though it's the "correct" way, since it prevents clients from manipulating the information sent to the server that is to be broadcast to the other peer. (Sorry for the babbling, sometimes it's nice to just explain things so I understand them better myself).
  3. Quantastical

    Use gimp instead of Photoshop

    I eventually bought a PhotoShop license, but prior to doing so, I found a free online editor called Pixlr that provided a very familiar interface. Like many of the others posting to this thread, I gave up on Gimp after the first use all because of the interface.
  4. Quantastical

    Hey everyone! Got advice?

    I'm kind of in the same situation as you...no degree, hard worker, strong desire. I was able to land a job with a digital marketing/advertising agency, as an "Interactive Developer" (aka Front-End Developer). I found the role to be very beneficial and it provided real working experience in doing things that can somehow be applied to games. As a bonus, there is a high demand for developers in roles such as these, as there are a lot of programming languages and paths you can take.   I, personally, focused on web technologies and ended up working on a project for Coca-Cola's Fanta, where I was actually tasked to create some mini-games. A lot of the other projects, although not exactly games, featured relatable topics, such as handling user input, performing animations, translating ideas into projects that can be used for portfolio inclusion. Using your own web page and a web-based portfolio, you can get as creative as possible and show off what you can accomplish. I'm trying to use web-based projects to build a body of work, and then hope to transition that knowledge to a gaming company.   Networking with like-minded individuals is also a major advantage, as you are well aware. I'd guess that over half of a company's employees are connected through one another.
  5. Quantastical

    Trying to figure out WebSockets

    Also, just to get things into perspective, I'd like to point out that this is a very simple PONG clone that I'm making, well re-making. It's a rebirth of a game called Pong Kombat created by Stefan Gagne in 1994, so my first multiplayer goal is to create something where players can play anonymous matches against others. I think the process would be as follows:   1. Establish connection with available player, or wait. 2. Each player selects their character, then waits for the other to do the same 3. Game is played the same as in single player, but each sends their input commands to the server 4. The server computes the positions of everything then sends the updated positions of the ball, paddles, and projectiles to each player
  6. Quantastical

    Trying to figure out WebSockets

    Thank you for the quick run-down. I have been reading a lot about multiplayer game logic, as well as experimenting with socket.io to create a rudimentary version of the loop that you describe.   I am aiming to "do it right" by replicating the physics updates on the server and pushing the results to the clients, which are also updating physics but are overridden by the server's commands. I believe this is what is referred to as an authoritative state, preventing clients from modifying values since the server is the one handling the true simulation. From what I understand, the client performs it's update just to mask any hiccups in network traffic that cause latency between server updates.   The particular aspect I'm having trouble with is getting two clients to connect and speak to one another without broadcasting their messages to other users. A lot of the socket.io articles explain how to set up an environment where everyone is messaging everyone, i.e. a chat room.   I've been diving through the socket.io documentation and there is a feature called "rooms" that seem to be what I need to use. But, I feel like the process of creating a room name, then having to require the next user log in and enter the same room name to connect to each other seems excessive. And, when they finally do "talk" to each other, what is being said? For example, "Player A to Server: Player A is pressing the Down button."?
  7. I've been working on pong clone using HTML5, my first attempt at creating a complete game using web technologies. I'm trying to implement online multiplayer using web sockets (socket.io, node.js), but am having difficult time wrapping my head around how these it all fit together.   Is this the appropriate place to have such a conversation and is there anyone willing to assist?   I'm not looking for anyone to straight up do the code for me since I want to learn, but it would be nice to be able to discuss how to integrate web sockets into my specific project.
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!