This is my take on a Minecraft clone! This game was built with Three.js and JavaScript Modules, Web Workers and Service Workers.
NOTE
This page will not be updated until I release Survival Mode.
Coming Soon: Beta!
How To Play
Click on the crosshair to lock your pointer
W A S D to move around
Scroll to change block
Space to go up
Right click to place, left click to break
UPDATE 12/1-4/2020
Baconman321 has collaborated with me on this project and has cut the loading time of chunks in half! Minor optimizations have also been made.
12/3/2020
I have also reintroduced realistic lighting and optimized shadows to the game, making cave exploration, terrain, and buildings more visually interesting. A better offline cache system and versioning is in the works, along with sprinting (which I may warn you, is quite buggy at the moment). There is also a new menu you can access by pressing `. This menu allows you to change the material type of all chunks, and will greatly improve performance on lower-end devices.
12/4/2020
The game has been optimized further, and the "plastic" look has been removed. Offline support is being worked on.
Q and A
- The game is REALLY slow. Can you make it faster? Press ` (backtick) to change the graphics setting.
- How do I change block? Scroll up and down.
- It's so hard to look around. A: Make sure your pointer is locked(click)
- It's so hard to place/break. A: It is a bit difficult to break/place on a touchpad. Try a mouse.
- Why is it taking so long to place/break blocks? A: Please use a different computer.
- Why can you jump so high? A: I'm lazy
- Why is the sand biome all slabs? A: I need to fully implement half blocks
Image Gallery
I like that name
@HEMLANU Thanks!
but its name is sortacraft
I felt like I am really plying Minecraft
@HEMLANU Glad you're enjoying it!
NOICE
@Leroy01010 Thanks!
@Lezapy Cool!
@Lezapy i tried
cool
@220723j why oof?
This has been on trending for 29 days bro. keep this up and youll have a streak
@dabombdgdzjr Wow! I'm on the list of top Repls
Yeah man e @tussiez
@tussiez yo can I’m make my own Minecraft game. I want fork urs and add some more stuff to it . U don’t mind right? I’m not gonna share it ok.
@ilovebeef Sure?
@tussiez u really did spend a lot of time on this (I'm checking the code)
@ilovebeef Thanks!
btw how do u build or place a block?
@ilovebeef Right/left click
thanks for some reason it wasn't [email protected]
oof u gave me a billion notifactions [email protected]
u wanna work on movie s[email protected]
This game is AWSOME! Now here are some tips: 1.U should add animals
2. If only this could be multiplayer 3. Music 4. Mobs and bosses 5. crafting table 6. more items that could be made or example pickaxe axe shovel etc. 7. Get a job at mojang
@ilovebeef 1.Couldn't figure out UV wraps, those will come later
2. Basic multiplayer on homepage (worse than singleplayer though)
3.Adding really soon!
4.Same as #1
5.added,doesn't work
6.check the items folder in the Repl,they're going to be added with crafting and inv finish
7.wish i could
@tussiez Thanks!
how do u make a crating table?
@ilovebeef For now, you can scroll through the blocks, but you will be able to craft in the future
the water doesn't flow?? also where's all the lava hiding underground?
RIVER water doesn't flow in minecraft @merrybot
@merrybot i dont think he has lava blocks yet, but i relly would like to see them in the game :)
lagggggggggggggggggggggggy but very very nice
@KobeFF Thanks!
@tussiez I can't wait to see the finished outcome!!! It must've taken forever, with all those files.
BTW, your js skills ate MIND-BLOWING!!! I can hardly create a clicker game lol 😂
@KobeFF Thanks
very cool liked it
@PaigeSaunders Thanks!
give its codes
@Vatsalnath07 Ctrl+U
Wait so, this wasn't coded on repl.it, so does this post count? Technically, your post is just a website with a link to your GitHub project.
@Jeydin21 Hmm, does this count? This does bring a good question. You can’t even play it in Repl, so is this even viable?
@RayhanADev I was having trouble with Repl early on because Repl.it kept crashing on me, so I moved it to GitHub. I will make the necessary fixes to get it working again.
I made most of the game on Repl.it though, so I thought it counts.
@tussiez yeah it’s cool. I was just wondering if it was a thing that people actually allowed.
@Jeydin21 Fixed the bug, it works now
@Jeydin21 still a game
@Ahmadcreate0502 And...?
cool
i would like to give suggestion that gives specific properties to tools like in official minecraft pickaxe can break cobblestone easier than any other tool
@TANMAYBAGADIA Sure! I've already gotten a ton of items drawn out (haven't added though - need inventory)
@tussiez good , keen to see the new changes
Wow amazing! I have a dumb question tho, how do you go down?
@Plorzon It's still a bit broken at the moment :)
@tussiez
Oh, ok :)
I can't wait to see what it looks like! This must have taken ages lol.
@Plorzon Oof yes
whenever i try to jump it just makes me float at the same elevation
Wait what I can download this
@dabombdgdzjr Yup! In Chrome, go to the search bar at the top (near where your tabs are), and press the + button!
its stuck loading
@RileyMears Oh my! Are there any errors in the console? I can help
@tussiez there are no errors? how long does it usually take? i might just be too impatient for it to load but the loading bar doesn't move
@RileyMears Hmm. It has been working for me.. try again today.
@RileyMears We are often working on the game, so you may have been on at a time where we were changing code (often resulting in a syntax error or something of the sort).
@Baconman321 That's often the case :)
Try again later, most game-breaking bugs are fixed pretty quickly
You should use a service worker so this works entirely offline. Also, you can make it a PWA. It's not that hard, maybe takes like 15-20 minutes to set up if you do it correctly. I can help you if you don't want to do it yourself. Also, I really need to congratulate you on this. First of all, I suck as a web designer, and a game designer is no different for me. Also, the use of implementing a chunk loading system like the actual minecraft system is genius! I am also ecstatic that you used the advantage of web workers (since they offer another interpretation thread, meaning you can do complex calculations in them without affecting the main page performance). I would love it if you could make the chunks a bit more large, but let's be honest. JavaScript is slow, and the language they use for the actual minecraft (Java) is most likely faster (since it's strongly typed). If you could do that without affecting my performance... I don't know what I would do this is so great anyways, I sit back and play it and I notice all the complex features added to this. Also, one of your javascript files is like 2k lines of code, so that must have been a lot of work. I made a program with 2k lines of code, but it was more consisting of redundancy. This is great man!
Also I recommend adding shadows (as it's kinda hard to see things without them), torches, bigger biome sizes, less cave systems/bigger systems but less appearing, and music. Personally, I think the music would be really hard to obtain, since the minecraft music is copyrighted, and it wouldn't be minecraft without it (I know it's a minecraft spin-off, but still). However, if you have gone this far with this awesome work of art, you can almost certainly go farther. I believe in you!
@Baconman321 Thank you so much!
I’ve seen a JavaScript Minecraft clone by Khan Academy, and it runs blazingly fast. This is most likely because almost all of the game code is GLSL. I think the Three.js library is slowing it down. Maybe in the future, I could skip the library and port most of the code including the big parts such as the terrain generator and voxel engine, as the engine generates the geometry data itself, and Three.js inserts it into the geometry. I’ll look into PWA and the service workers soon. The comment on chunk size - I’ve used 16 by 16, or maybe 64 by 64. I believe 64, I need to check. My target platform was the school Chromebooks, and they were already struggling with the game. My original goal was cubic chunks, this works half the time as I need to brush up on my math. The Bedrock edition of Minecraft runs much faster than the Java version, since a massive amount of the code that used to run on the CPU is now on the GPU, which is why crazy render distances are possible.
@tussiez Yeah, you seem to know much more game design than me (cry, even though I don't care for game design...yet). Honestly, PWA is something I just made, so I don't think it would be too hard. I could help you with the service worker part too if you need some help. I like how you implemented the chunk worker. But, how does it generate half a tree, then when you generate it again it generates the other half? Do you store the data about half of something being generated? Or... I don't know I'm lost. There's so many things I want to know about this since it's sooooo cool about how chunk loading works. Also, try working on despawning certain chunks but store them so they appear later. And I'm on a chromebook too so off. Yeah, as long as it doesn't load a chunk, the framerate is at about 60.
@tussiez I think creating a new version without Three.js and just WebGL would be a fun project.
I’ve gone through multiple revisions of this game, some starting all the way since last year. I’ve learned a lot about JavaScript during this project, and because of this the code has gotten a bit inconsistent. This could be fixed in a rewrite.
The first revision of this game didn’t have Web Workers, and was freezing up when I loaded in chunks. After adding a Web Worker, I realized that the data load from the worker itself was also causing the game to hang. Because of this, I created a clever cache system that lazy loads the lazy loaded chunks, to prevent lag. In a future revision, I could add an option that can customize the loading speed (The Web Worker generates the chunk blazingly fast, however the processing of the output does take some time) so you could get a faster load if you have a powerful computer. An automatic version of this could be done too.
@tussiez What do you mean by lazy loading? Like load the whole game but only show parts of it (or at least load major parts)? Also, the game doesn't load unless you have a certain flag enabled in chrome://flags (for my chromebook at least; you should mention that on the mainpage).
@Baconman321 Yeah... oof
Yeah, I would like to learn some more about PWA, so I will gladly accept your help. Oh, partial trees was a very interesting problem to solve. I used to allow trees inside the chunk, so they don’t generate half trees however it made tree clusters impossible. If you look in the code, there is an additional worker called geometrydataworker. This worker handles the geometry data generation, reducing the lag on the main thread. When chunk data is processed, the voxels are set in a global multi-chunk VoxelWorld, and this is where the geometry data is generated. This means every once in a while, half trees are generated (one chunk overrides the other) and sometimes they don’t happen and tree clusters work perfectly.
Yeah, I tuned the loader for the Acer R11 Chromebook. Around 50-60 FPS.
To put it simply, the chunk data is global, not relative.
@tussiez So essentially it stores information about the trees, then when it generates the other chunk it loads the full tree? (Remember I am totally new to this, but I squeal with delight at this genius idea of chunk loading).
@Baconman321 Huh.. chrome:// flags is blocked on my Chromebook and I don’t have issues. Are you talking about hardware acceleration?
As in lazy loading
The web workers generate the terrain pretty fast, the problem is they load so fast that the main thread can’t catch up. To fix this, the data is stored for later instead of processed immediately.
@Baconman321 Correct!
@tussiez Ah. Yeah, for me you have to enable experimental javascript. I wonder if it's enforced by your network admin, so maybe that's why. Yeah, the whole chunk thing is complex but amazing. I don't know why more games don't use it!
@tussiez Oh, and also add running! And doors... and glass.
@tussiez Invite me to your project so I can help you with offline capabilities and PWA please. I would love to collaborate with you and show you all about service workers (all that I know)! I'm available from 11-12 and 2-3 CST (central daylight time). If that doesn't work, I can just make you a service worker and put comments in describing how everything works. It would be an honor to help you out with this genius project! :>
@Baconman321 Missed the shadows part of the comment :)
I’ve tried cascading shadow maps before on the game, and they do work (and really well). I don’t know if the implementation is still in the code (just commented out) or not, the problem I was having with the shadow map was that lighting wasn’t updating with shadows (lights wouldn’t work). And yes, I should be able to fine tune cave systems as it’s an easy task. Thank you for the feedback!
@Baconman321 Sure! I can add doors (as you can see, I was messing with voxels and sand is now a slab) however glass has been an interesting problem. This has always been an issue with voxel games, as it requires a custom z-index and more computational power. I could probably do this in WebGL in a future version though
@Baconman321 Sorry about late reply, I’ve been busy recently
And yes, I’ll try to invite you soon! I’ll let you know if I’m available tomorrow (most likely yes)
Thank you once again for your help!
@tussiez No problem. Remember, I'm available 12-1 and 2-3 Central Standard Time. Again, if we can't work it out, I can always add comments to the program to show how it works!
@Baconman321 Got it! I will also be available! We can start with a forked Repl (so in case we mess anything up really badly, it's easier to reset). I think we can skip offline for now, as I'm thinking about writing a new version of this game (once again) that may have some new optimizations. You can still tell me how to do it though :)
@tussiez Ok. I have to do some stuff (school). I'll be available in about an hour and 15 minutes (sorry). Also, if you know about repl history, it's really easy to use in case you mess up. Either way, ok.
@Baconman321 1 - same!
2 - sure! It's shared
@tussiez I'll let you know when I'm ready. Also, service workers don't mess with the main stuff. If anything happens, you can just clear your cache. Service workers work on a seperate thread and all, I'll tell you more when I'm ready.
@Baconman321 Got it!
@tussiez I can work now. I'm joining your main game. Just let me know when you are there and ready.
@Baconman321 I'm there
@tussiez I am ready when you are (meet me in ur repl). until 3 P.M CST at least.
@tussiez I'm in your repl if you want to come. I gotta test and fix some things that I found aren't working.
@Baconman321 Got it!
I'm in class at the moment.
@tussiez Oh, ok. Let me know when you don't have class.
@Baconman321 I'm available now
@tussiez Can we do this at 1.PM CST? I'm kinda busy (school). I'm available 1-2 PM CST (not 2-3 today), or at least, I believe I am.
@tussiez Ok I can do it now. I'll meet you there.
@Baconman321 Sorry about the late reply, I've been really busy recently. I'm available anytime today (hybrid)
@tussiez Ah. Let's do 11-12 CST
@tussiez I'm available right now. I'll meet you in your repl.
@Baconman321 Sorry for the late reply, I'll be there in a minute. Helping my friend with a clicking game
@tussiez Ok, I'm available now if you want. The world is super dark so you may want to fix that.
@Baconman321 Sorry, was catching up on homework again... I was working on adding shadows back and also sprinting is broken for some reason
@tussiez Available after 2 CST
@tussiez Ok. I will go in and fix the caching issues (cuz it doesn't work offline now that you added threejs to the project, I'll fix that).
@Baconman321 Got it!
@tussiez I believe I am available until 3PM CST. If you want, I can help (I think I found out the problem to a thing or two).
@Baconman321 Got it! I've seen that SortaCraft works on HTTP only
I'm in a Zoom meeting at the moment, but I'll join soon
@Baconman321 May not be available today at a scheduled time as I have a lot of schoolwork :)
@Baconman321 When the cache updates, you'll see that the day/night cycle may have been fixed
I disabled the shader's lights
(The day/night script has brightness already programmed, so it should work now)
@tussiez Ok. As always I am available 11-12 and 2-3 CST. I found out you can put stuff on the GPU, so maybe we can do that (more on that later when we can meet).
@tussiez I'm available right now.
@Baconman321 Got it!
@Baconman321 We might be able to get sundials to work..
(light direction)
@tussiez Ok. I'm on now. Also, I have no idea what that is XD (remember I don't do game design).
@tussiez Ok I fixed a few minor things in the service worker. Also, you might be happy to hear that I added a little version display at the bottom left of the screen in newgame.html.
@tussiez I'm available right now.
@Baconman321 Oof.. you'll know eventually
@tussiez Thanks for the version display! It'll be helpful
@Baconman321 Got it. On every other day I'm in class from 5 to 1 CST
@tussiez Ok, so you're on now? I'm available 2-3 CST then. (And 11-12 CST when you can do that).
@Baconman321 2-3 CST
@tussiez Class ends ~2 pm for me
@tussiez K. See ya there!
@tussiez I am ready when you are!
@Baconman321 Sorry I wasn't available yesterday, however I am available at 11-12 CST
@tussiez I'll be polishing up lights (light direction, fixing light blocks)
@tussiez K. Not 2-3 CST? (I have some other things to fix on your game too; when we meet I have an idea so that I can keep up with what your making).
@tussiez I'm available when you are.
@tussiez I'm available right now if you need me!
@tussiez I'm available now.
@Baconman321 Got it! I'm in class until 2 CST
@tussiez Ok cya then!
@tussiez I'm ready :D
@Baconman321 Me too
Finishing up a repl I did in half an hour
https://linedraw.tussiez.repl.co/
@tussiez If you're available, I think I know the problem to the gravity thing :D
@Baconman321 Sure! Working on adding colors to LineDraw
@tussiez I don't think I'll be able to help at 2-3 CST. I am really tired today, so if I have time after I attempt to rest, I'll let you know. Otherwise, see you on monday!
@Baconman321 That's fine - see you on Monday!
@tussiez I slept. It's not enough to refresh me long-term, but now is fine. XD just as you read this and respond, I wake up from napping. I am available for about 15 minutes. Other than that, yeah see you tomorrow (I'll help if you're available now).
@Baconman321 Woops! I took a break from the computer but that's good to know!
@tussiez Technically I'm available today (unless my dad turns off internet cuz he doesn't know I have it ;) )
@tussiez IDK if you're on now, but I'm available rn.
@Baconman321 Home now.
I'm feeling a bit sick, so you're free to work on the game if you'd like, but I'll take today off
@tussiez Ok. I need your help with the gravity thing anyways, so I'll wait.
@Baconman321 I should be free 2-3 CST if you want to try getting falling to work. Actually, your part is working great - I just need to fix my code.
@tussiez Ok. I think we should make a math webworker too, since that would be the part that takes up quite some computing power.
@Baconman321 Yeah
This might be your answer: geometrydataworker.js
However we might move the math code into the GPU.. I'm not sure
@tussiez We should use WASM, since it's a compiled language it will run much faster than Javascript (which is JIT or just in time interpreted).
@tussiez Ok I'm ready...
@tussiez I'm ready...
@Baconman321 I enjoyed my snow day yesterday :> I'm available today at 2-3 CST
@tussiez Ok, I recalled a method that is sure to speed up your game if you use a lot of new
operators. Garbage collection! More on it later when we talk...
@Baconman321 Yay! See you then!
@tussiez I'm ready.
@tussiez I'm available now if you want. Let's get that game to work :D
@tussiez I'm in. Are you there?
@Baconman321 I have to go now, but I'm available at 2-3 CST
@tussiez Oh ok...
@tussiez I'm available now if you want to me to help you get the game working :D
@Baconman321 Here.Making cookies
@Baconman321 Sorry I wasn't available, was out
@tussiez I'm tired so I'm going to lay down for a little. I'll let u know when I'm available.
@Baconman321 That's okay! I'll be doing HW in the meantime
@tussiez I'm not going to today. I think it's just my medication. My mom didn't give it to me for a few days since she had to get a refill, and my body kinda got used to being without it, so when I got it I was really tired (same scenario with last time I was tired last last friday)
@Baconman321 Ah thats OK!
@tussiez I can help now if u want!
Edit: OK NVM I can help at 1 CST
@tussiez Also ur repl AUTH doesn't work... Oh well, Let's do that after we get sortacraft working and all :D
@Baconman321 Yeah, it's having issues however it seems to work on me
@tussiez Also u quoted me ^W^
@tussiez On the mainpage :D
@tussiez I'm ready if you want to.
@Baconman321 Ready!
@tussiez Ready to help :D
@Baconman321 I'm there
@tussiez Want to work on sortacraft?
@Baconman321 Missed this comment, woops
I’m free tomorrow
@tussiez I'm available if you want to collab now.
@Baconman321 Sure! I'm writing Mastermind
@tussiez What's "mastermind"?
@Baconman321 A board game
@tussiez If you want I'm ready now :D
@Baconman321 Slept in - I'm probably available @ 2-3 CST
@tussiez K ready?
@Baconman321 Sorry I have to do something outside
how do i break and obtain things
@Ra1han Left click
@tussiez yo thanks
@tussiez but when i break things i cant use them like they disappear
@Ra1han Unfortunately, that's the case for now. However the system for obtaining items is already set up (See the top left, under the framerate counter). In the black DIV, you can see the item name of what you've just broken.
@tussiez thanks
@Ra1han Welcome!
if you place 2 sand slabs on top of echother it becomes water
@TroyLilgeberg Yeah it was a slabs test :)
Cool. I bet you could get a really good job from mojang. :D I would recommend making the sun square, though
The world's not generating.. ☹
@KrazyOrange Reload?
I'm going to speed run this. I'll post a video later.
@DanielRatliff Where will you post?
@tussiez I don't know because you cant post mp4 files on here.
@DanielRatliff You can try putting it in a Repl
@tussiez Also, could you give me some sort of goal because mine was to just find diamonds, break them, and then build a nether portal out of obsidian and water.
@tussiez How would I put it in a Repl? Not very smart and only know basic python so...
@DanielRatliff lol survival no exist yet
@tussiez I'm excited for it
May I take the time to applaud at his wonderful coding skills. Give this guy a few more years and Mojang will hire him.
@Surfit Thanks!
@Surfit so true
@tussiez come to my happy birthday coder100 replit