[GAME] MULTIPLAYER 3D Survival Game! SNEAK PEEK
fuzzyastrocat (789)

EDIT: Check out the update here!

Many games here are 2D, so I thought I'd try my hand at 3D with THREE.js. I'm not done with the game yet, but I thought I'd post a sneak peek so that I can get feedback for it!

As of right now, there's no real goal (you can't win or lose). But you can go around and do stuff. Here's the controls:

  • Arrow Keys or WASD to move
  • Q and E or rightclick+drag to rotate the camera
  • Click and hold to saw stuff (when not placing — you have to be touching an object too)
  • Click on an item in the upper-left to craft it (these items will appear when you have the necessary resources to make them)
  • Click on a item you've crafted in the bottom bar to start placing it (a ghost version of it should appear in front of you, you can move around to position it as you like) and then click again to place it or right click to cancel.
  • NEW: Enter to chat!

As of now, you can build walls (with wood) and campfires (with stone and wood). There's a day and night cycle in place too, so your campfires will look good :D

And yes, this game is fully (server) multiplayer, so you can build a base with others! (Try opening two tabs if there's no one else around)

Enjoy! If you find any bugs or have any suggestions, please post them!

IMPORTANT: If the land is empty at first (no trees, rocks, etc), please let me know! (And then reload the page until it isn't.) I think I've fixed that bug but I'm not certain.

You are viewing a single comment. View All
RolandJLevy (499)

@fuzzyastrocat you are on fire! this is awesome!!! 🔥 it runs so smoothly - well done!

fuzzyastrocat (789)

@rjlevy Thank you! The smooth interpolation was a goal for this game, I think it works pretty well!

RolandJLevy (499)

@fuzzyastrocat, great job! Can you summarise the stack you used?

fuzzyastrocat (789)

@rjlevy Thanks! Sorry for my ignorance (I don't have much formal background so I'm not good with terms), by stack you mean "the software platforms/languages/etc I used" right?

RolandJLevy (499)

@fuzzyastrocat yes, that's what I meant, thanks!

fuzzyastrocat (789)

@rjlevy Ok. So, for client-side, I used HTML/CSS for all the UI elements and THREE.js for the interactivity along with the main 3D game view. On the server side, I used node.js to handle all the shared state and socket.io to communicate with all the clients.

RolandJLevy (499)

Hi @fuzzyastrocat, thanks for explaining. I'm interested in how you've been able to run Node in an HTML repl. Are you using an endpoint from a different Node repl?

fuzzyastrocat (789)

@rjlevy Great question! I'm actually not running node in an HTML repl. I like to separate out my servers and my clients (so that I can make quick fixes to either without having to restart the entire system), so I have a separate repl (AskewServer) which runs the nodejs server. The HTML repl is just the client alone. Hope that helps!

RolandJLevy (499)

Hi @fuzzyastrocat, great - that's what I thought! It's good to know that's how you did it. I've been taking the same approach recently, mainly to hide API keys in .env files so people can't use them. Here is a very basic example I made:

This is the front end (client) code in an HTML repl
https://repl.it/@rjlevy/html-unsplash-search-getting-api-keys-from-node-app

Here is a demo: https://html-unsplash-search-getting-api-keys-from-node-app.rjlevy.repl.co/

It connects to a Node repl via an endpoint like this which provides JSON for the front end: https://node-api-keys.rjlevy.repl.co/json?s=smile

Here is the Node repl which provides the JSON
https://repl.it/@rjlevy/node-api-keys-for-unsplash which can be tested here:

I hope that makes! :)

fuzzyastrocat (789)

@rjlevy Cool! Glad to know I could be of assistance (and those are really cool!) Hiding things in .env's is definitely very useful!

RolandJLevy (499)

Hey @fuzzyastrocat, thanks, your game is going viral whoop, whoop!

By the way, are you a student or do you work as a software developer?

ZDev1 (657)

@rjlevy most of repl users are very young...

fuzzyastrocat (789)

@rjlevy Yay viral-y!

Actually neither. I'm not (and have never been) in any formal software education program, but I don't work as a developer either. I'd describe myself as a hobbyist.

RolandJLevy (499)

Hey @fuzzyastrocat, you're up to 153 cycles, wow and well done! Amazing that you've never had any formal software training. I think you could quite easily get work as a developer. Is that something you're aiming for?