Hey there! My name is Dan. I've been coding for over 20 years. I started this channel to share my passion for 3D graphics and games. I create tutorials primarily focused on Three.js, but also dive into other topics from time to time.
i really am learning new things through this series , this series is awesome , Thank you so much sir😊😊,Also after completing this one i will watch your RPG game dev. series too
I really like your refactoring, but aren't you now creating instances of bushes/trees and rocks for nothing if the addObject function fails to really place them? Furthermore the base GameObject class can be made abstract! :) Can't wait to see the next episode.
Thanks for the feedback! Mesh instances are just plain old JavaScript objects so GC will clean them up (no need to dispose of their resources since everything shares the same geometry/material). But agreed, better not to create objects if you aren't going to use them. Eventually they will be replaced entirely with InstancedMesh's to speed things up. JavaScript does not have the concept of abstract classes. You can throw an error in the constructor to imitate an abstract class, but there's really no problem with creating a base GameObject. And without a compiler, your code is still going to throw an error during runtime if you try and instantiate an "abstract" class.
@@dangreenheck I agree to both answers. JavaScript may not be as strict as other languages but the keyword abstract does exist. So creating an instance then would automatically error.
hi sir, are you ok? Every Monday I'm looking to see if RU-vid is uploading your video. I hope you're okay, I'm trying to develop new features that was not addressed in TODO file
I get that I'm a year too late, but I think I like the more step by step approach. I don't need it but I like to see how people get from where the code was to where it is now. The thought process that's happening while coding, I think is the important part. Almost like learning to read, it's going to take a lot longer and be kind of boring for those of us that know how to read, but for people who don't know how to read hearing the words sounded out is crucial.
That was the general consensus, so my more recent videos take the step-by-step approach. Check out my latest video series (Isometric RPG), I dive into my thought process in more detail in those videos.
This is awesome! I was thinking of doing something like this the other day, came to youtube to see what I could find, and you'd already done it a year ago.
Can someone tell me where my Typo at 9:00 is?: import * as THREE from "three"; const geometry = new THREE.BoxGeometry(); const material = new THREE.MeshLambertMaterial({ color: 0x00d000}); export class World extends THREE.Group{ constructor(size = { width: 64, height: 32 }){ super(); this.size = size; } generate(){ const maxCount = this.size.width * this.size.width * this.size.height; const mesh = new THREE.InstancedMesh(geometry, material, maxCount); mesh.count = 0; const matrix = new THREE.Matrix4(); for (let x = 0; x < this.size.width; x++){ for (let y = 0; y = this.size.height; y++){ for (let z = 0; z < this.size.width; z++){ matrix.setPosition(x + 0.5, y + 0.5, z + 0.5); mesh.setMatrixAt(mesh.count++, matrix); } } } this.add(mesh); } }
At 9:00 i cant enter my website because i dont have enough fps or whaterver but heres my world code: import * as THREE from "three"; const geometry = new THREE.BoxGeometry(); const material = new THREE.MeshLambertMaterial({ color: 0x00d000}); export class World extends THREE.Group{ constructor(size = { width: 64, height: 32}){ super(); this.size = size; } generate(){ const maxCount = this.size.width * this.size.width * this.size.height; const mesh = new THREE.InstancedMesh(geometry, material, maxCount); mesh.count = 0; const matrix = new THREE.Matrix4(); for (let x = 0; x < this.size.width; x++){ for (let y = 0; y = this.size.height; y++){ for (let z = 0; z < this.size.width; z++){ matrix.setPosition(x + 0.5, y + 0.5, z + 0.5); mesh.setMatrixAt(mesh.count++, matrix); } } } this.add(mesh); } }
Good video, I like how you build the algoriithm step by step. But honestly the pronouciaton of Dijkstra hurts ;-). ij sounds just like the englisch I. You can hear a sample on the wikipedia page about Edsger Dijkstra. .
Another awesome video! - I would love to see some kind of main menu/options screen implementation to see how that would work. It would also be sick if there was an episode later on surrounding maybe a skybox or water shader surrounding the terrain! - Great video!
Love the project Bur I am having an issue at 9:01, right after we fixed the code to only update when a building is upgraded, built, or removed. When i checked my browser as you did I just have the grassy platform now and no buildings are being built. I checked dev-tools and inspect and there are no issues as my game is still being updated with my mouse moves. I doubt you want me to waste space by putting my source code here but do you have any idea what the issue might be?
Unfortunately I can't offer much help without looking at your code. I would recommend using plenty of console.log() statements and see where your code might not be behaving as expected.
Hi! I had the same issue and solved it by replacing 'this.building' with 'this.buildingId' in city.js file (lines 17 to 22 in my code). Hope this helps.