Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

163
Views
How to implement server-side multiplayer for a simple JS game?

Thank you, this is my first post so please correct me on any etiquette. I am a beginner programmer and I want to make a game in JavaScript for one of my classes. Specifically, my Latin class for an "anything" project. My goal is to make somewhat of a Roman-themed version of Among Us. I already have basic movement, and an Apache server running my game. The only thing that I need help with here is making it multiplayer.


The way I want to do this is to have an array on the server where each row is a player, and their username, password, coordinates, and various states (connected, dead, role, etc.) is stored in each column. Only the username, coordinates, and some of the states need to be made available to each client. This is to be copied into an array for each client, who will then take this information and display it. A client takes control of their character by entering their index and password, at which point a 1D array on the client-side will be created that stores their coordinates, which can be changed by the player using their controls, and sent to the server to be stored in the main array.


I've honestly tried to research this, and I have learned a little bit about databases like MySQL, and server-side languages like PHP and node.js. The problem with these is that, as far as I know, they run once at loading and cannot be manipulated further. I don't care about anything like separate lobbies at this point, my class is of only 30. Does anyone know of any good libraries or tutorials for this? Or is there a better direction to go entirely? I hope to make this mobile-compatible.
If needed, I can provide the URL to my website and the code so far.
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

You want to figure out if you're going to do it in 3D or 2D, pick your language, and implement what you said in said language.

The main thing I think you're missing is the data transport, which can be provided to you with a TCP websocket library like socket.io or socks, which will facilitate an instant, constant data flow between server and client.

The other thing you're missing is a graphics library, which you can do more research on after you figure out whether or not you're doing 2D or 3D.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!