@@h..h floating points are very convenient, powerful, and the double precision variant is precise enough for literally anything (think games about space exploration) and performs fine
@@greenlemon9155 This is generally false, floats are a number with a movable decimal point but fixed number of digits 0.000001 183.0023 134973.2 999999.9 as value increases, precision decreases, leading to weird rounding issues at great distances, like how the minecraft player begins having position snapping to grid or how roblox character becomes pixelated as their vertices snap to grid
So what you've implimented here is an established gamedev technique called a "floating origin". All open world games do it in some capacity to avoid floating precision artificats, however multiplayer games do it differently. Everything that happens on the server is stored in double precision and exsists "in their real position". Its only on the client where everything is converted to floats in order to speed up rendering and thus requires a *local* floating origin. Having the telleports happen on the server as well is something we *desperatly* try to avoid, however it seems you've got a really good system working with masking out the collisions and wrapping everyone back around on the server as well. Very impressive system.
This is awesome! You did a great job! I create maps since my childhood in Warcraft 3 as a hobby, and a year ago I created a prototype of a coop map for multiple players that uses the very same method that you described. So basically my map is infinite. I created another set of coordinates and data storage for this. When players leave chunk - I save all parameters of objects that are left behind (2 sets of coordinates, type of object, life, etc.) and delete objects. But when players come back I create those objects back and restore their parameters, so players will see those objects again. My method is more primitive than yours because the players on my map always stay close to each other. There is an explanation for this - all the players on the board of the spaceship. And the spaceship itself moves between the chunks. Players take on the role of its crew and can only move inside the ship, or if they use a shuttle to only fly nearby. Still, you did an amazing job. Thank you for the new ideas and for the proof that this is a good method.
The creators of the localized physics tool made a map called gm_infinigrass a while back that used a similar technique. I remember it being really buggy, but quite fun
That bit where you need to create a duplicate object to ensure collision works across boundaries has actually been done in source before; portal uses that system to allow collisions through portals! There's a hidden entity called physicsshadowclone that acts as a secondary hitbox before the object has reached reached the other side!
It would've been hilarious if at 1:07 when you said "it's legitimately impossible to go past the hammer map size", you followed it up with "anyways..." and then walked past it XD
Mirror mirror on the wall, who will be the earliest of them all? Edit: I just watched the entire explanation, really cool and easy to understand explanation
I do remember a gravity hull mod that also allowed for infinite maps, but it had the issue of not isolating the players properly, and the physgun glow was still rendered where the players really were. I do also remember that it had limited random generation support if I recall correctly, and the gravity hulls worked in a similar way to the Safe Space addon. lots of source trickery, which is always cool to see :P
I imagine the only way to make "terrain" past the chunk boundaries is with props, so are you gonna try combining your terrain tool with this when you get it all working correctly?
Does 3D skybox have the same render distance limit? It makes everything look 16x bigger, so, perhaps, it might be a way to essentially multiply the default far Z value by 16?
This was a good explanation, it's just a bunch of layers sitting in the same chunk, but with a little math and visual magic you can make it look like it's on a grid. You could also probably do this up and down, which is a cool concept.
Mee, you are an absolute legend. I barely knew you on SSC but holy crap this is cool. You continue to blow my mind with source engine. Have a good one man!
This is super cool, though if I understand correctly then when it comes to making detailed maps bigger than a normal source map you're still limited to the original size, so you'll have the same repeating map over and over and over and over, so the best you could do is an infinite flatgrass. I guess you could solve it if it were possible to superimpose objects in hammer and make them appear only on depending chunk coordinates, maybe something like that could be done with only props
EDIT: I'm dumb, you're referring to terrain, the video is probably just working with props. Original comment left untouched, though. From what I understand from the video, it spends most of it's time explaining the superimposing of objects within a single chunk. The offset applied to rendering is handled based on what chunk the player is in, as is "whether collision is enabled". Grain of salt, though, I have zero experience with the source engine, so perhaps I misunderstood what you were referring to.
This is extremely smart! The simplest wat to put it is that its like going into the upside down in stranger things. It is 2 places merged but not visible or interactive
We do it somewhat similar, have a specific position on the map to store objects physical state (but invisible) and store all other data on server itself and handle everything that way(everything is fake in sense but from stored data there are comparisons to be made that allow it to function), for shots we also do a TraceRay onto compensated position and match it within entity bounds so the hitbox wouldnt be off and that the fake location wouldn't be accidentally hittable, still trying to figure out sounds properly seems like it's better to just tell clients to play sound locally but haven't tested much with directions Also if you apply damage via serverside don't forget to add some sort of directional weak knockback as well cause it looks odd otherwise during pvp sessions. By messing around with sending data to players we seem to have managed to cause nullpointers on multiple cheats that don't have much sanity checks, so that's funny, but never reliable of course.
So it's kind of like how super mario 64's "parallel universes" work, so one question I have is what is the current map you're using? Is it just a sky map? Would a flat water only map work too?
You should do a video where you allow multiple people to try it out on a server (If it's possible/works in multiplayer). See what kind of concepts or ideas people can make out of this. By using and testing it it's limits
@@Meetric1 Does it handle each player as their own origin and teleports everything else clientside? or how does that work in the server where multiple people can't be the center?
Dude you have like the biggest brain ever, your idea is incredible P.s. If I understand it correctly the explosions and bullets will do all sorts of whacky things
The center "main" chunk can actually be much larger. You only need the other chunks to occupy a tiny fringe of the map in order for the teleport trigger to be hit, if you get creative with rendering
LOL I came up with the same method 2 months ago for my own engine project, I think it'll work great aside from NPCs deactivating outside the 9 loaded chunks
so does it just store the perceived offset from the world origin for each object in an array, and then iterate through that to offset the rendering each frame? very very cool stuff, excited to see final product
every boundry is like another dimension. like w,x,y,z where w is a different layer. x,y when escaping the max or minimum limits you get it kind of flipped in a way while updating w to which ever chunk you're in. but the problem is intersecting objects with chunk borders so he duplicates it to make it. the issue i see is bigger maps, map chunks, weapons, vehicles and physics props.
what a maaagic. btw, you can cut the ummm eeeeem ummm part in the editor, so more people would understand you, I guess. but I like it even with ummm eeeeem
warning: there is alot of things to read in this comment and can cause confusion, misunderstanding and bad engelish can't you make it so your playermodel is smaller so there is alot more space but keep the chunks and have some sort of way to make textures "smaller" but not in resolution. this would make it feel even more infinite. make the chunks about half of the size of the map. so it gives you some sort of space idk. if you arr planning on adding this to other maps or even a way as a mod make it infinite for every gmod addon map. make it so your player doesn't clip through any of the walls and if the ground is lower or higher from the ground make sure it does not teleport players above or below the map and teleport them to a space where they can walk without any issues. it's confusing to tell what i mean but something with smaller player, bigger chunks, addon map support, don't tp player underneath or overneath the map you were playing on, tp player to a lower/higher space if the space on the otherside of the map is in a lower or higher altitude (sorry for my bad engelish) and teleport player to a suiteable place where you can walk and not get tped into a wall. my last thing i want you to add is if you are playing on a backrooms map or something like that. make it so the enviroment the player is in without an outside has endless rooms and hallways edit: make it so it's like a randomly generated backrooms map, like a script where it generates rooms based on the rooms from the previous chunk.. unload previous chunk however keep the previous chunk but with only portions that are visible from the next chunk. ray cast only the part that are visible from the other chunk so it doesn't look like an empty space when you enter the other chunk. idk how to describe it. what i try to say is like an infinite but random generated map themed chunks for indoor maps edit edit: make another addon for randomly generated but also infinite maps and for out doors maps make it infinite but randomly generated chunks with same theme as the first chunk however it's completely different and creates as an example: if the map is some sort of hills or whatever it generates chunks in that theme but it's differently. it generates suiteable chunks that fit with the actual map theme.
What about NPC pathfinding, do they go to the player's rendered position as supposed to or do they go to the player's legitimate position (npcs do not exit centre chunk)?
I have two questions, can this work with the Zeta players and other nextbots like Drg and 2D Sanic clones, and with vehicles (WAC, LFS, Simfphys etc.)? PS: The explanation is grate, and the visuals are clever.
I tried testing what happens if you try to generate a nav_mesh for the nextbot to use, but it immediatly resets the map and no mesh is generated. The way the infinite map is made probably does not allow for a nav mesh to exist.
I played something similar to this on GMod where a map is basically one infinitely going flat grassland. You can't really drive vehicles past a certain point as an invisible wall will stop it in its tracks while you're driving it, though. Which begs the question... do props despawn when you go far enough from the "center origin" of the map?
how will explosives and damage work? do bullets still hit said invisible objects like they do when an object has "disable collisions" enabled? won't explosives be a major issue?
how do hitboxes work? if someone goes far away can you still shoot them? and what about explosions? if you took a bomb far away would it damage everything because it is technically still in the center chunk with everything else?
This reminds me of the summoning salt video of super Mario 64 when there’s this glitch to go super fast and teleport to another copy dimension in the game
So basically you have every chunk loaded in the same position, but things in other chunks are offset clientside to give the illusion that they're not overlapping?
The small map size in Gmod was the main reason I was looking forward to S&box, but now that that issue has been resolved, the possibilities are limitless! People can RP on a real GTA style map! Spaceships flying through fast expanses, planet to planet! All of those Wind Waker maps could finally be combined! You could have 50 people all playing in VR on a map the size of Skyrim!
what about weapons, i believe the revolver is hit-scan, how'd that work, or the crossbow, which i believe has a physical bullet. let's say you for example shoot the rendered enemy which has teleported to the other side, wouldn't that brake the hit-scan, with the crossbow, lets say it works but in front of the invisible real version of the enemy there is another one visible, wouldn't that make the crossbow hit the wrong target?
I've been dreaming of creating a map where I could fly a plane in a straight line without having to turn erratically for 2 years, hopefully that dream will come true.
unfortunately unsolvable because the prop would need to be outside of the maps bounds in order to accurately represent where it is in the chunk the flat plane is an illusion of 1 big plate but in reality its only the size of 1 chunk
sooo.. essentially you could have a ship addon like a spaceship or a TARDIS let's say , assuming they'd add auto-pilot to fly forwards while you're walking around, you could make infinite space to fly through? that's mad
Wouldn't increasing the far z make the engines depth calculation less accurate ? like if you have 2 far away objects in front of eachother it might struggle to know which one should be in front.