[REDACTED: Mostly inaccurate] How does Terraria handle thousands of tiles? | Bitwise

Ойындар

I'm a professional programmer who works on games, web and VR/AR applications. With my videos I like to share the wonderful world of programming with everyone!
DISCLAIMER:
This video is not actually representative of how Terraria works. The research I did for this video turned out to be inaccurate and inadequate for the purpose of this video. I apologise for the misinformation. Most of the elements discussed in this video are not used in terraria and are mostly based on speculation and intuition. This video turned out to be more a discussion of my own ideas and solutions to those ideas.
How can Terraria handle hundreds of thousands of tiles in its world without crashing? We discuss the basics of 2D rendering and what techniques can be used manage rendering so many tiles.
Music in in outro:
Besus y Abrazor - Rolemusic: freemusicarchive.org/music/Ro... available under a Creative Commons Attribution license creativecommons.org/licenses/...

Пікірлер: 1 400

  • @DigiDigger
    @DigiDigger4 жыл бұрын

    As several people have pointed out, this video is a wrong representation of how Terraria actually works. It turned out to be more of a discussion of my own ideas and solutions. I am sorry for spreading misinformation. The inaccuracies were neatly pointed out by user Mirsario, who I will quote directly to lay out all the mistakes I made in the video and their rectifications. Thanks Mirsario (and others) for taking your time to point all of this out. " ==Relation to Terraria== 1:00 - It doesn't keep track of anything. They just sit in memory, this is not a physics simulation. There are also really not a lot of tiles, the "Large" world size is just 8400x2400. 2:16 - Your Unity3D object-oriented rendering has nothing to do with Terraria, XNA, and its SpriteBatch rendering. It wouldn't have been possible for the game to render so slow in the worst of the worst cases. Additionally, the game only renders tiles 12 times a second, rendering to a texture. 2:45 - No, the game has no object-oriented tile logic. Nothing in it is object-oriented, actually. And that's a good thing for tiles. Your idea is really, really bad. 3:54 - Frustum culling is a 3D technique that has nothing to do with 2D and non-object-oriented designs. Like the ones Terraria spams tons of. Cutting off off-screen stuff in 2D is nothing but a check for rectangle bounds, which is hundred times faster and simpler. 4:48 - Chunks? Yeah, Terraria has none of that. At all. It never did. It just uses a giant Tile[,] array, which is idiotic, but works for vanilla version of it. 5:13 - "If a tree falls in Terraria and it isn't happening on screen... Does it still make a sound?" Yes. It tries to. 5:37 - Yes, all tiles are active at all times. Trees grow when they grow. Only multiplayer clients don't get all world data immediately, and that's all. The way these trees grow is not through some magic object-oriented Tile.Update() calls (no methods like that exist), but through the world's update method, which, again, idiotically, picks like 1000 (depends on world size) random positions every update to do various logic like that, like spreading grass onto dirt if the randomly picked tile is grass. 5:56 - This has no correlation with the game. You could also at least say to store your made-up timers in your made-up chunks. " - Mirsario (altered slightly) Additional points made by Fevix Darkwatch: " 1) Terraria is in no way procedurally generated as you play. The moment you first spawn in, before you've even taken a step, you can exit, load the world in an external editor, and view the entirety of the world, from corner to corner, which brings me to.... 2) There are NOT "Theoretically infinite" tiles in Terraria. Each map size (Small, Medium, and Large) has a hardcoded height and width. You can very easily reach all four edges of the world. The sizes can be seen here, along with total blocks available: terraria.fandom.com/wiki/World_Size 3) Tiles don't activate/deactivate based on distance to the player. Teleporters can work across the entire world's width even without another player standing near the other end. Water falls, even offscreen. Trees grow on their own, even hundreds of blocks away. This can all be seen by using a mod to constantly reveal the entire map ingame while it's running, allowing you to watch from a distance as trees, plants, grass, and water all moves without any players nearby. Terraria uses its own custom engine which can only do one thing, but it does it very, very well: Run Terraria. Blocks don't keep track of their status constantly, either. When a player starts mining a block, THAT BLOCK starts keeping track of its status to determine how much damage it's taken (Better picks do more damage) and when it reaches a threshold it breaks and drops an item. When a block isn't being interacted with, it's pretty much inert, doing nothing and contributing no load aside from render. 4) In addition, you can save a LOT of rendering time by using a buffer of sorts. Render the visible area once, apply a lighting filter layer to darken areas that aren't lit (or color areas that are lit with a colored light), and saving that render somewhere, optimally in RAM provided it's small enough. As the player moves, chop off bits that fall off one side, and render only the bits that come in from the side. Re-render a small area around tiles that get updates (Trees growing, grass spreading, block mined) and boom, instead of rendering thousands of tiles per frame, you only have to render a couple dozen unless some massive changes are happening, EG someone just released a giant flood of water into the caves. " - Fevix Darkwatch (altered slightly) Some more broad points made by Mirsario: " ==How useful this is to game developers== First of all, he brings up an issue that's not real anywhere but in his example, which is him using OOP Unity rendering without any real batching. The way XNA's SpriteBatch (which Terraria uses) works (in immediate mode, which avoids sorting) is by creating a buffer (you can think of it as a mesh/3d model created for just one frame), and putting vertex data into it. Then it's all uploaded to the GPU with one call and drawn with another. It's all really quick. The way Unity3D rendering works is, like in any 3D engine, by storing data about what needs to be rendered, then sorting that data, then doing a draw call per mesh in just an optimized order (to avoid frequent calls that switch shader programs, but not to avoid draw calls). These sorting optimizations only hurt us with such hierarchies, as they're a very good example of optimizations with trade-offs. Unity3D does have batching, but only for objects marked as static, and he clearly didn't use that. So, rendering optimization has never been an issue to begin with, with something so simple as Terraria (or any game like that with a finite world, that is, Starbound too). Then he brings up frustum culling. I've already mentioned how unrelated this is. Let's just say that it's another overhead for his 'issue example'. Then, he talks about object-oriented designs on tiles. You don't do that. This is not a physics simulation, and if you want to make one - please use GPUs, not CPU. Object-Oriented-Programming is amazing for humans, but not for CPU performance. If you're doing C#, then please only use structure and not class Tiles (which Terraria did use, very stupidly, as it's just more memory usage and more stress for garbage collection). C# 7's ref variables have made structs like that a blessing to use. Now, if I ignore the design shenanigans, the time comparison for when tiles get loaded sounds like a sane way to have freezable logic, but only if you don't plan on updating a tile 1000 times because it was unloaded for 1000 ticks, AND ONLY if timers are placed on chunks, not on tiles. That'd be an extreme optimization with zero cons, and missing it shows his mindset. Or the April 2, 2017 him. Programmers evolve, and I can't say that I wasn't a total pushover 5 years ago. This really does only work with chunks, because for many operations you will need to know information about adjacent tiles. For simple grass spread, you'll need a system that can load neighboring chunks at chunk load distance's corners, without updating them unless they move into the real load distance. Sigh. I have recently worked on making a 2D game (on my own engine) with an infinite world (this guy's weird designs suggest that they're about infinite worlds), and I have to say: The only optimization needed was about generating chunks (No matter how fast your noise is, it's never fast enough), their saving & loading code, and their textures (but that only requires writing something that's like XNA's SpriteBatch, if you're just on that engine - this is not a problem). This vid is really a bunch of made-up issues and incompatible made-up solutions. If this is anyhow about recommendations to game developers - it'd be superior to actually describe how Terraria works, and advise against many of its points, as it works, quite frankly, idiotically* at many points**. Terraria only works well because the issues stated in this video are not issues at all. They just don't exist. * - Re-Logic members do know, and perhaps 1.4 will rewrite many points, but it's not financially viable for them to do, as some once said, which is agreeable. ** - but it runs fine for what it is. As someone else in this comment section approximately said, this game is written to be nothing more but this exact game. " - Mirsario (altered slightly)

  • @clementbaudonnel9475

    @clementbaudonnel9475

    3 жыл бұрын

    Good to know the truth ! You've made a mistake when you forgot to mention that it was your ideas and not the actual solutions in terraria but, hey, making a mistake is ok as long as you admit (and you did) You should totally remake this vidéo!

  • @petergeorge3376

    @petergeorge3376

    3 жыл бұрын

    Much respect for keeping a level head and pointing out all the corrections these guys made, thats an amazing skill that very few people have!

  • @seanandrews5329

    @seanandrews5329

    3 жыл бұрын

    thank god you finally came out and said this I was getting annoyed at arguing in the comments lol

  • @JacobRy

    @JacobRy

    3 жыл бұрын

    @HuffmanTeamGaming why would he do that? Doesn't it take views away from his channel? Also this video can bring in more people that can watch his newer content, which is correct, as far as i've seen. It's pretty hard tp miss the big "redacted" in the title

  • @TriDeapthBear

    @TriDeapthBear

    3 жыл бұрын

    @HuffmanTeamGaming Clearly a lot of work went into this video, and although it may not be accurate to what terraria actually does, it still shares some awesome ideas and solutions to various problems in games, and honestly he probably wouldn't even have to change the title if he just pushed it as how he would do it, as opposed to how it is done.

  • @tomicooltomi
    @tomicooltomi5 жыл бұрын

    Still waiting for the procedual generation video :(

  • @ffccardoso

    @ffccardoso

    4 жыл бұрын

    @@rechronicle some here! excellent channel

  • @FerreusDeus

    @FerreusDeus

    4 жыл бұрын

    I'll PAY for it! C'MONNNN!

  • @nathan44u

    @nathan44u

    4 жыл бұрын

    Terraria world generation is a lot simpler than Minecraft's, etc. since it is a closed world (Not procedural!) Terrain: 2D Perlin/Simplex noise. Caves are a lot more complicated though Trees: I've made an algorithm for spacing them out and I'm not sure what Terraria does. What I do is check if a noise value is greater than the 3(+) values around it Ores: For every chunk (Like 64 size) spawn a random amount of ore patches Stuff like temples, pyramids, and the dungeon probably have much more complicated algorithms that I would not know about

  • @ffccardoso

    @ffccardoso

    4 жыл бұрын

    @@nathan44u it is procedural

  • @nathan44u

    @nathan44u

    4 жыл бұрын

    @@ffccardoso The entire world is generated when you create the world. There is no way to adventure past the oceans

  • @DigiDigger
    @DigiDigger4 жыл бұрын

    Wow, what happened? Two years after I stopped posting the youtube algorithm comes along and now this! :D Guess it's time to start working on that procedural generation video! Thank you all for the kind comments! Since 2017, this channel has since been sort of an abandoned project of mine. I can't lie.... that really makes me want to make new content.

  • @ayarinruz593

    @ayarinruz593

    4 жыл бұрын

    Yes please!

  • @Bennyscott98

    @Bennyscott98

    4 жыл бұрын

    do it :)

  • @Fixed27

    @Fixed27

    4 жыл бұрын

    Sure, do it

  • @khamisk2976

    @khamisk2976

    4 жыл бұрын

    We need it please

  • @Opprimor

    @Opprimor

    4 жыл бұрын

    KZread recommendations caught on I guess, haha.

  • @aqua_pi
    @aqua_pi4 жыл бұрын

    "I'd love to see you in the next episode" me too, me too

  • @sdrawkcabskaerf5345

    @sdrawkcabskaerf5345

    4 жыл бұрын

    Max Pikhteryev :(

  • @user0000user

    @user0000user

    4 жыл бұрын

    Look at his channel banner. New videos will come

  • @SystemDisc

    @SystemDisc

    4 жыл бұрын

    Put this man in the next episode.

  • @redacted1946
    @redacted19465 жыл бұрын

    Why is this channel no longer active. It’s so good.

  • @thanhSon93hcm

    @thanhSon93hcm

    4 жыл бұрын

    OMG. its such amazing channel.

  • @TheActualTed

    @TheActualTed

    4 жыл бұрын

    I've just found this video thanks to the YT algorithm and the whole idea of disecting games sounds amazing.

  • @deamooz9810

    @deamooz9810

    4 жыл бұрын

    Yeah that sucks, this video is really interesting

  • @zegroselia2504

    @zegroselia2504

    4 жыл бұрын

    @@deamooz9810 yeah

  • @mkDaniel

    @mkDaniel

    4 жыл бұрын

    Yes...

  • @ClaDepro
    @ClaDepro4 жыл бұрын

    You wanted exposure; 2 years later, the Algorithm fulfilled your request.

  • @ikonikian475

    @ikonikian475

    4 жыл бұрын

    The Algorithm has spoken.

  • @Pwnners

    @Pwnners

    4 жыл бұрын

    Yea and still as today

  • @crazygamecrafter8830
    @crazygamecrafter88304 жыл бұрын

    0:42 uhhhhhhhhhh this guy know what happens when you get to the ocean?

  • @EmilySucksAtGaming

    @EmilySucksAtGaming

    4 жыл бұрын

    Scrolled to the comments the moment he said that

  • @andrewpulle315

    @andrewpulle315

    4 жыл бұрын

    It is procedurally generated. It uses an algorithm to make a new map each time as opposed to manually building the map.

  • @crazygamecrafter8830

    @crazygamecrafter8830

    4 жыл бұрын

    @@andrewpulle315 well he implied that the world was endlessly procedurally generated

  • @crestfallensunbro6001

    @crestfallensunbro6001

    4 жыл бұрын

    @@andrewpulle315 the size is predetermined (you pick it before the world is generated)

  • @DlcEnergy

    @DlcEnergy

    4 жыл бұрын

    Minecraft: "procedurally generated" Terraria: "procedurally pre-generated" (confusion solved. lol) many of us have misinterpreted "procedurally" to mean "on the fly". there's no shame in it. because what it actually means is kind of redundant. "using procedures". doesn't "generate" already imply there'll be "procedures"? lol so anyone thinking of something distinguishable would think of "on the fly" / "bit by bit".

  • @Navhkrin
    @Navhkrin4 жыл бұрын

    This video oddly tries to make this harder than it actually is. Drawing tiles is one of the easiest tasks your computer can do. But if you use Unity engine to showcase that obviously it will seem as if thats something demanding, not because its hard, but because Unity's graphics pipeline is simply not built for that. When you actually code your own renderer however, rendering let alone thousands, even millions of tiles can easily be done in real time with proper instancing. And you can easily use instancing on a game like terraria. So yeah, Terraria isnt exactly a game that is difficult to render unless coded horribly. On a game like Terraria, if you are coding your own renderer, you can render all blocks of same type in a single draw call. Draw calls are the real performance hitter. You can reduce thousands of draw calls to less than a hundred.

  • @nathan44u

    @nathan44u

    4 жыл бұрын

    Also, using atlas maps is a life saver

  • @LPMAN0

    @LPMAN0

    4 жыл бұрын

    Actually you can also do that in Unity without problems. But you are right, it's all about how you implement it.

  • @percival7532

    @percival7532

    4 жыл бұрын

    additionally, actually compiling the game helps with framerate.

  • @s9k573

    @s9k573

    4 жыл бұрын

    Yeah, unity is focuses on 3d more than 2d, not saying you cant make a good 2d game

  • @notnullnotvoid

    @notnullnotvoid

    4 жыл бұрын

    Exactly. Even the dumbest, simplest possible implementation won't run into any performance problems for a game like this. Assuming one texture atlas, 10,000 tiles on-screen, 6 vertices per tile (2 triangles, no index buffer for simplicity), vec2's for position and texture coords, that's 10000 * 6 * (2*4 + 2*4) = 960,000 bytes, less than a megabyte of trivially computable data. Just toss that data into a single vertex buffer and upload it to the GPU every frame, problem solved.

  • @pancakesandsyrup1233
    @pancakesandsyrup12334 жыл бұрын

    This suddenly got reccomended to a lot of people?

  • @manunavoni7666

    @manunavoni7666

    4 жыл бұрын

    Yup

  • @guyclegg

    @guyclegg

    4 жыл бұрын

    Yep

  • @johnsmantles6619

    @johnsmantles6619

    4 жыл бұрын

    Yip

  • @jameswalsh5683

    @jameswalsh5683

    4 жыл бұрын

    ye

  • @sandgaijin

    @sandgaijin

    4 жыл бұрын

    This and UnboxTherapy getting dragged ruthlessly into the thorns.

  • @wdarkfenix
    @wdarkfenix4 жыл бұрын

    dO YOU GUYS FIND A GREAT CHANNEL JUST TO REALIZE ITS DEAD

  • @Gabriel_Guerra

    @Gabriel_Guerra

    4 жыл бұрын

    Yeah, that's sad actually...

  • @willtheoct

    @willtheoct

    4 жыл бұрын

    'great channel'? he compared the terraria tiles on screen to 8000 unity Game Objects which is just nuts- unity is over-engineered, so it's not surprising that 8k GOs could consume way more than 8k bytes and 8k flops, put 3.5 minutes of fluff before attempting to answer the question, had a bogus question in the first place(Q: how does terraria handle 8000 tiles on your screen? A: your computer does trillions of operations per second, why wouldn't it work?), and is missing the real way to save on performance with tilesets(upscaling on the GPU after storing tiles as individual pixels in a texture), Surely you can find better technical channels on youtube... More notes: -Frustum culling involves rendering boxes to determine if the high-quality mesh should be rendered, and this isn't at all like what terraria does. There isn't even a frustum. -updating certain chunks every tick can save on performance, but for a game like terraria, it just isn't worth it. This wouldn't work on liquids like lava or water, either, which need to be simulated in real-time

  • @willtheoct

    @willtheoct

    4 жыл бұрын

    ​@@null3377 what the hell is a micro operation For channels, I would suggest computerphile at the least. and this guy is a legend, but maybe not as entertaining: yt.com/channel/UCdmAhiG8HQDlz8uyekw4ENw sadly I don't have any recommendations that both captivating and informational on computers. I can only say that this channel does not present real information.

  • @lozfactor

    @lozfactor

    4 жыл бұрын

    Gotta agree with William here

  • @willtheoct

    @willtheoct

    4 жыл бұрын

    @@null3377 You made that term up. If a 'micro' operation is 2 inputs -> 1 output on the hardware level, then what exactly is an operation? Why are GPUs measured in teraflops? FLOPs stands for FLoating-point OPerations per second. Is a teraflop not one trillion floating point operations? No one's going to be mad if you're wrong on the internet, and I don't think you should argue the point

  • @sandjgaez257
    @sandjgaez2574 жыл бұрын

    Looks like KZread decided to recommend a video from several years ago by a channel that has been inactive since said video to a whole bunch of people again.

  • @rebmiami6803
    @rebmiami68034 жыл бұрын

    Terraria modder here. I’ve been working with this game and it’s inner workings for almost a year now, and a lot of things here aren’t accurate. First of all, Terraria’s worlds are finite and are generated only once. I’m not sure how the conclusion that it was infinite was reached, but that’s one of the more obvious errors here. Terraria uses a random tile update function to handle things like the growth of grass and crops, spread of biomes, etc. This happens randomly and can affect any tile. While I’m not sure how often it’s called, it can happen to any tile regardless of where it is. Second, tiles are absolutely not updated every frame. Or, more specifically, when you leave them alone. Terraria uses a function to tell the game if a tile has been interacted with in some way, and it updates the tile appropriately. This includes things like liquids flowing, tile textures connecting, etc. If you were to modify a tile (let’s say by adding some water) without telling the game that the tile needs to be updated, it would just stay. (our water block in this example would float in mid-air and not flow) This is actually similar to what Minecraft does in some ways (although I have no idea how Minecraft does it). In Minecraft, if you were to add a sand block, for example, via a third-party editor or otherwise, it would remain in place until an adjacent block is updated. The example of updating a timer each frame as shown in this video does not apply at all to how tiles work. The total number of tile updates, due to this system, isn’t actually that large. The game would suffer if a lot of those took place at once. If you’ve ever tried to drain an entire ocean into Hell, for example, the massive number of updates the game has to deal with slows fluid processing to a halt and it takes forever for any liquids to update. An exception to this would be tile entities, such as chests, which are updated each frame and can contain additional information and functions. However, there are usually relatively few of these in the world, so their effect on performance isn’t bad. One more thing: Terraria was built around Microsoft’s (now discontinued) XNA framework, which is less of an engine and more of a useful set of resources and tools. Using it, Terraria contains it’s own graphics engine designed to handle the game’s graphics. It does not use any sort of engine like Unity.

  • @oliverpinder7221

    @oliverpinder7221

    4 жыл бұрын

    Also he got rendering wrong. His 20fps is caused by the cpu making a draw call to the gpu for every individual tile. Probally a side effect of having every tile being a unity entity. Tile chunks should be stored in gpu memory with a single draw call per chunk

  • @09jjohns
    @09jjohns4 жыл бұрын

    This video should be full of "I think" asterisks, because many of your points are demonstrably false. 1) Terraria is in no way procedurally generated as you play. The moment you first spawn in, before you've even taken a step, you can exit, load the world in an external editor, and view the entirety of the world, from corner to corner, which brings me to.... 2) There are NOT "Theoretically infinite" tiles in Terraria. Each map size (Small, Medium, and Large) has a hardcoded height and width. You can very easily reach all four edges of the world. The sizes can be seen here, along with total blocks available: terraria.fandom.com/wiki/World_Size 3) Tiles don't activate/deactivate based on distance to the player. Teleporters can work across the entire world's width even without another player standing near the other end. Water falls, even offscreen. Trees grow on their own, even hundreds of blocks away. This can all be seen by using a mod to constantly reveal the entire map ingame while it's running, allowing you to watch from a distance as trees, plants, grass, and water all moves without any players nearby. Terraria uses its own custom engine which can only do one thing, but it does it very, very well: Run Terraria. Blocks don't keep track of their status constantly, either. When a player starts mining a block, THAT BLOCK starts keeping track of its status to determine how much damage it's taken (Better picks do more damage) and when it reaches a threshold it breaks and drops an item. When a block isn't being interacted with, it's pretty much inert, doing nothing and contributing no load aside from render. 4) In addition, you can save a LOT of rendering time by using a buffer of sorts. Render the visible area once, apply a lighting filter layer to darken areas that aren't lit (or color areas that are lit with a colored light), and saving that render somewhere, optimally in RAM provided it's small enough. As the player moves, chop off bits that fall off one side, and render only the bits that come in from the side. Re-render a small area around tiles that get updates (Trees growing, grass spreading, block mined) and boom, instead of rendering thousands of tiles per frame, you only have to render a couple dozen unless some massive changes are happening, EG someone just released a giant flood of water into the caves.

  • @digitalconsciousness

    @digitalconsciousness

    4 жыл бұрын

    I was hoping a real programmer would show up. I wanted to also add that in all likelihood, Terraria does not function like a true tile engine would where it draws each individual tile as separate objects, or tiles. Rather, the smart way to do it is to indeed have each tile exist as its own object derived from a C++ class, but it for the most part only exists as code. Each tile object knows its x/y position and what pixels are associated with it, but the way it draws itself is simply "bit blitting" itself to the buffer. Take a look at that first landscape shot of Terraria in the video - thousands of tiles, but only a handful of bitmaps that are unique. That makes it terribly easy to store in memory and very easy to blit the same square of pixels to the buffer over and over again. It's like if you wanted to stamp your name onto a letter your wrote and were going to write 8000 letters, you don't need a unique stamp for each letter. You can use the same damn stamp and just use it over and over again. Same with tiles. Each tile just has "bluesky" as a string in a variable and the engine knows that refers to a specific square of pixels in the "master tile image" that probably houses all unique tile in it. So, it's just bit blitting that same square over and over again for each tile even though there are thousands of the same tile. Even if Terraria did keep tiles "active" after they went off screen, that would still be pretty easy to do since they just have to exist as code. It's not like there is any drawing going on outside the screen, which is the most intensive process games do.

  • @hayo7073

    @hayo7073

    4 жыл бұрын

    I would like to comment on a few(all) of your points, i'm in no way a terraria expert though so correct me if i'm wrong. 1. External editors could maybe render the world for you 2. Sure thing, Minecraft is not "Theoretically infinite" either, but cmon, nobody likes a nitpicker. EDIT: people keep commenting about this one, oh boy. Apperently i need to be told 20 times. Minecraft IS NOT infinite, its borders are the mathematical limit of a signed 32bit integer. And yes i know now terraria has a fixed size aswell. What the guy ment was: its big and the worlds are randomly generated. 3. In Minecraft when you use a portal, the tiles on the opposite end get rendered, easy. EDIT : it doesn’t matter if Minecraft portals go to another dimension, same concept. Next example : Lets say water falls with 1 tile every half second and you take the example he gave for time spent away. I'm far away and when i'm back 10 minutes have passed. How much did the water fall down? Easy, (10*60)/.5 = 1200 tiles (max) this can easily be rendered. I'm not saying Terraria does this, i'm saying your example is bad. Mods can see it sure, does your game lag when you use that mod? 4. i guess so. He didnt mention it in the video, that does not make his video false (like you mentioned in the beginning of your comment). I don't know how much you know about terriaria's internal workings, but most of your examples can be debunked with a simple explanation, YES debunked mr “you didn’t debunk anything”. Hence my comment.

  • @sossololpipi9633

    @sossololpipi9633

    4 жыл бұрын

    @@hayo7073 The invisible part of the world is only 4 blocks outward in all directions. Terraria mod and vanilla maps do not "enable" the tiles shown; they're always active.

  • @jeffreyblack666

    @jeffreyblack666

    4 жыл бұрын

    1 - If the code to generate the world is known, then the external viewer can also generate the world, using the same algorithm as the game would. That means it could still be procedurally generated. 3 - Teleporters can load the other side as you go through. If you use a mod to keep those tiles active then the mod can keep them active as well as the player. That doesn't show the game will naively keep it active. He already explained how plants can grow off screen. The one interesting point would be water flowing. If you set it up such that water should flow a very long distance, place the water and teleport away (or outrun the water if possible), see if it still flows that long distance even though it isn't visible (i.e. wait that very long distance away and see if it flows to you). However it could also be a hybrid approach were some things work regardless, some only work when close to the player and some only work when they are being interacted with.

  • @drakep.5857

    @drakep.5857

    4 жыл бұрын

    The channel is dead boi

  • @null3377
    @null33774 жыл бұрын

    I felt like I found a diamond. But when I checked your last video, it was from 2 years ago :(

  • @gwennnnnnnnnnnn

    @gwennnnnnnnnnnn

    4 жыл бұрын

    you didnt "find" it youtube found it for you

  • @banoffecake

    @banoffecake

    4 жыл бұрын

    Yup

  • @-ism8153

    @-ism8153

    4 жыл бұрын

    Just like how I didn't "find" that sock I was missing; it just turned out to be sitting on my table. But a box fell over so that I could see it, and I'm grateful that this happened.

  • @mkDaniel

    @mkDaniel

    4 жыл бұрын

    Exactly like me.

  • @willtheoct

    @willtheoct

    4 жыл бұрын

    Find a better channel - this video has errors and there are way better technical channels on youtube.

  • @DerpRob
    @DerpRob4 жыл бұрын

    I can't wait until the 8th Bitwise video so that we, the viewers, will become a byte wiser altogether

  • @jekkey

    @jekkey

    4 жыл бұрын

    There wasnt a video for 2 years, this is the last

  • @willtheoct

    @willtheoct

    4 жыл бұрын

    Find a better channel to follow, please. This guy doesn't know what he's saying.

  • @kicklemon1948

    @kicklemon1948

    4 жыл бұрын

    @@willtheoct Why are you so salty

  • @SDFTDusername

    @SDFTDusername

    4 жыл бұрын

    last video: 2 years ago this comment: made 2 month ago comment: digidigger loved 2 month ago *hes alive*

  • @JacobRy

    @JacobRy

    3 жыл бұрын

    @@kicklemon1948 cause he gets a giant ego-boost from pointing out other's mistakes. The worst thing is, it's not even like other comments, which constructively point out why the video is basically all false, he went around commenting "FinD A BeTteR ChaNnEl"

  • @namlit
    @namlit4 жыл бұрын

    Just had a similar topic in my university, would love to see more content, as you talked about in the end of the video! Great work mate, awesome and easy to understand description!

  • @Nors2Ka
    @Nors2Ka4 жыл бұрын

    I thought I am about to get some interesting insight into how Terraria works... not even close.

  • @villager1831

    @villager1831

    4 жыл бұрын

    BaseFook What do you mean?

  • @willtheoct

    @willtheoct

    4 жыл бұрын

    @@villager1831 This video was like wild guesswork, for a problem that didn't exist, and doesn't even hold up in the context of Terraria. 8k tiles on screen? why ever would that lag? or fry your pc? or crash? If you only store the time a tile was last updated and then use the delta later, then why the hell does liquid in Terraria keep getting updated? I don't understand why people like this video since it's just so wrong.

  • @Nors2Ka

    @Nors2Ka

    4 жыл бұрын

    @@villager1831 None of what he described is specific to Terraria. In fact these techniques are bare minimum expected optimisation on every game (where applicable). He also very clearly has no understanding of Terraria itself too.

  • @mariannmariann2052

    @mariannmariann2052

    4 жыл бұрын

    Like, for example: "The amount of tiles in a Terraria world is theoretically infinite." (not exact quote) Like, WHAT? Terraria worlds are CLEARLY finite. There's even the world size options!

  • @GreenScrapBot
    @GreenScrapBot4 жыл бұрын

    "How does Terraria handle thousands of tiles?" "It doesn't run in Unity!"

  • @CorneliusCornbread

    @CorneliusCornbread

    4 жыл бұрын

    @Chickentenders A bad developer blames the tool. I've played unity games that run like ass and I've played unreal games that run like ass. It's just that there are more inexperienced developers using unity as it's easier to develop for.

  • @Chkoupinator

    @Chkoupinator

    4 жыл бұрын

    that's how the video should have went tbh just "how does terraria handle so many tiles?" "it doesn't run on unity" "thank you for watching the video, see you around next time!"

  • @ThisGuy....

    @ThisGuy....

    4 жыл бұрын

    @Chickentenders Unity is a great engine that since it has a freeware version a lot of shity games are done with it, a game like Escape from Tarkov is made in unity and runs amazingly well.

  • @robin_queer

    @robin_queer

    4 жыл бұрын

    @Chickentenders Developers suck at optimization. I've played more laggy Unreal games than Unity games, just about any engine can create a game that runs smooth as butter, it's simply down to the skill level and amount of effort put in by the devs.

  • @chickeninabox

    @chickeninabox

    3 жыл бұрын

    Use Unreal.

  • @michaelhackman3195
    @michaelhackman31954 жыл бұрын

    This is one of the best channels on KZread! I love learning the coding tricks you've talked about for portals and now here, please keep making new content :)

  • @Mirsario
    @Mirsario4 жыл бұрын

    God, this video is a joke. There are so many things wrong, that I've split the following into 2 parts. Please read everything if you have the stamina, otherwise, well.. hm. ==Relation to Terraria== Nothing in this has any correlation with the game. Things aren't as good, and aren't as terrible. 1:00 - It doesn't keep track of anything. They just sit in memory, this is not a physics simulation. There are also really not a lot of tiles, the "Large" world size is just 8400x2400. 2:16 - Your Unity3D object-oriented rendering has nothing to do with Terraria, XNA, and its SpriteBatch rendering. It wouldn't have been possible for the game to render so slow in the worst of the worst cases. Additionally, the game only renders tiles 12 times a second, rendering to a texture. 2:45 - No, the game has no object-oriented tile logic. Nothing in it is object-oriented, actually. And that's a good thing for tiles. Your idea is really, really bad. 3:54 - Frustum culling is a 3D technique that has nothing to do with 2D and non-object-oriented designs. Like the ones Terraria spams tons of. Cutting off off-screen stuff in 2D is nothing but a check for rectangle bounds, which is hundred times faster and simpler. 4:48 - Chunks? Yeah, Terraria has none of that. At all. It never did. It just uses a giant Tile[,] array, which is idiotic, but works for vanilla version of it. 5:13 - "If a tree falls in Terraria and it isn't happening on screen... Does it still make a sound?" Yes. It tries to. 5:37 - Yes, all tiles are active at all times. Trees grow when they grow. Only multiplayer clients don't get all world data immediately, and that's all. The way these trees grow is not through some magic object-oriented Tile.Update() calls (no methods like that exist), but through the world's update method, which, again, idiotically, picks like 1000 (depends on world size) random positions every update to do various logic like that, like spreading grass onto dirt if the randomly picked tile is grass. 5:56 - This has no correlation with the game. You could also at least say to store your made-up timers in your made-up chunks. If you're a C# programmer, DigiDigger (that's only an assumption based on you using Unity), then why didn't you just decompile the game and have at least a single look at it? ILSpy and dnSpy can easily let you do that. ==How useful this is to game developers== Even if we ignore this being about some game, his designs aren't optimization. First of all, he brings up an issue that's not real anywhere but in his example, which is him using OOP Unity rendering without any real batching. The way XNA's SpriteBatch (which Terraria uses) works (in immediate mode, which avoids sorting) is by creating a buffer (you can think of it as a mesh/3d model created for just one frame), and putting vertex data into it. Then it's all uploaded to the GPU with one call and drawn with another. It's all really quick. The way Unity3D rendering works is, like in any 3D engine, by storing data about what needs to be rendered, then sorting that data, then doing a draw call per mesh in just an optimized order (to avoid frequent calls that switch shader programs, but not to avoid draw calls). These sorting optimizations only hurt us with such hierarchies, as they're a very good example of optimizations with trade-offs. Unity3D does have batching, but only for objects marked as static, and he clearly didn't use that. So, rendering optimization has never been an issue to begin with, with something so simple as Terraria (or any game like that with a finite world, that is, Starbound too). Then he brings up frustum culling. I've already mentioned how unrelated this is. Let's just say that it's another overhead for his 'issue example'. Then, he talks about object-oriented designs on tiles. You don't do that. This is not a physics simulation, and if you want to make one - please use GPUs, not CPU. Object-Oriented-Programming is amazing for humans, but not for CPU performance. If you're doing C#, then please only use structure and not class Tiles (which Terraria did use, very stupidly, as it's just more memory usage and more stress for garbage collection). C# 7's ref variables have made structs like that a blessing to use. Now, if I ignore the design shenanigans, the time comparison for when tiles get loaded sounds like a sane way to have freezable logic, but only if you don't plan on updating a tile 1000 times because it was unloaded for 1000 ticks, AND ONLY if timers are placed on chunks, not on tiles. That'd be an extreme optimization with zero cons, and missing it shows his mindset. Or the April 2, 2017 him. Programmers evolve, and I can't say that I wasn't a total pushover 5 years ago. This really does only work with chunks, because for many operations you will need to know information about adjacent tiles. For simple grass spread, you'll need a system that can load neighboring chunks at chunk load distance's corners, without updating them unless they move into the real load distance. Sigh. I have recently worked on making a 2D game (on my own engine) with an infinite world (this guy's weird designs suggest that they're about infinite worlds), and I have to say: The only optimization needed was about generating chunks (No matter how fast your noise is, it's never fast enough), their saving & loading code, and their textures (but that only requires writing something that's like XNA's SpriteBatch, if you're just on that engine - this is not a problem). This vid is really a bunch of made-up issues and incompatible made-up solutions. If this is anyhow about recommendations to game developers - it'd be superior to actually describe how Terraria works, and advise against many of its points, as it works, quite frankly, idiotically* at many points**. Terraria only works well because the issues stated in this video are not issues at all. They just don't exist. * - Re-Logic members do know, and perhaps 1.4 will rewrite many points, but it's not financially viable for them to do, as some once said, which is agreeable. ** - but it runs fine for what it is. As someone else in this comment section approximately said, this game is written to be nothing more but this exact game. I do understand some people's point that it was an interesting video to watch when you know that most of it is wrong, but not everyone does, and the fact that it's not mentioned anywhere that it's nothing but a discussion of his own ideas makes it awful content. The ones interested in this channel wouldn't be against DigiDigger's content becoming better, from either more research (or ANY RESEARCH, GOD!), or a different presentation that mentions when something (in this video's case that'd be everything) is speculation. DigiDigger, if you did read this - do reply.

  • @antidisestablishmentariani8730

    @antidisestablishmentariani8730

    4 жыл бұрын

    i'm just leaving a reply in the hope that it bumps your comment up in the list, mirsario

  • @MrCmon113

    @MrCmon113

    4 жыл бұрын

    Thank you for saving me from deception.

  • @cabbageman

    @cabbageman

    4 жыл бұрын

    EXACTLY!!!

  • @eliaslamsa6541

    @eliaslamsa6541

    4 жыл бұрын

    Yes this is not how terraria does it but this video does teach optimisation so it's more a tutorial on optimisation so it's more mislabeled. I wouldn't call it a joke but more a tutorial

  • @Mirsario

    @Mirsario

    4 жыл бұрын

    @@eliaslamsa6541 -I have replied to someone else making basically the same point as you in another comment branch. Can't really link it since I'm typing from a phone, so I'll just copy-paste it, but it's another wall of text, beware.- EDIT: Merged that other comment with my previous one.

  • @oliverpinder7221
    @oliverpinder72214 жыл бұрын

    Pretty bad description. Your meant to send the block data to the gpu and make a single draw call per frame. Your making the cpu loop thousands of times per frame to make a draw call for each tile.

  • @SuperShortAndSweet

    @SuperShortAndSweet

    3 жыл бұрын

    By block data you mean like pitch pixelmask and stuff like to instead change the pixels colour using vectors (I'm just trying to understand not saying you meant this, if I'm way off can you let me know) i know next to nothing of spritebatching if that's what it is

  • @realkingofantarctica
    @realkingofantarctica4 жыл бұрын

    “How does Terraria not completely fry your computer?” **cries in laptop**

  • @the_pumpking_

    @the_pumpking_

    4 жыл бұрын

    Holy shit your comment got hearted, they're still alive!!!

  • @iknowimstupidwhenisaythisb6749

    @iknowimstupidwhenisaythisb6749

    4 жыл бұрын

    @@the_pumpking_ *he's

  • @bassdrumflextime1253

    @bassdrumflextime1253

    4 жыл бұрын

    @@the_pumpking_ yay

  • @panos21sonic

    @panos21sonic

    4 жыл бұрын

    SHIT, SHIT, SHIIT, DIGIDIGGER IS ALIVE!

  • @Petar321_GT

    @Petar321_GT

    4 жыл бұрын

    @@panos21sonic interesting he ignored the comment telling what he did wrong

  • @0xPeter
    @0xPeter4 жыл бұрын

    This just popped up in my feed and I loved it! Was genuinely interesting and informative!

  • @TobiasSN
    @TobiasSN4 жыл бұрын

    Keep in mind that Terraria uses a custom engine, which means less overhead than with an engine like Unity.

  • @ExternetEx

    @ExternetEx

    4 жыл бұрын

    Custom engine? Last time i checked it used Microsofts XNA and its language is C# just like Unity.

  • @TobiasSN

    @TobiasSN

    4 жыл бұрын

    @@ExternetEx XNA is not an engine. It's a toolset for making games.

  • @ExternetEx

    @ExternetEx

    4 жыл бұрын

    @@TobiasSN I see. I thought XNA had a foundation since it has helper tools like Unity.

  • @micalobia1515

    @micalobia1515

    4 жыл бұрын

    @@ExternetEx It's sort of an engine, but it's very bare-bones compared to Unity or other similar engines, and not really made for anything more than 2D which it does *very* well, clearly :)

  • @miguelescutia5556

    @miguelescutia5556

    4 жыл бұрын

    The mobile version is developed in Unity. I worked on it for 2 years, such a bitch to optimize.

  • @yalkn2073
    @yalkn20734 жыл бұрын

    Terraria's maps arent infinitely generating, they are finite and have a set size

  • @CatheteriZedEYE

    @CatheteriZedEYE

    4 жыл бұрын

    he meant to say, every level is infinite as in every level can be different, ergo, infinitely generated. i thought the same thing, but it makes sense, but yes the world has a set size S - M - L

  • @yalkn2073

    @yalkn2073

    4 жыл бұрын

    @@CatheteriZedEYE No, he didn't meant that, you are trying to find an excuse. You don't call something infinite because it has variety.

  • @zeropaulsy

    @zeropaulsy

    4 жыл бұрын

    @@yalkn2073 I think what was meant in the video was that, in theory, the world's could be generated infinitely if there was no limit set to the world size. I assume the world's have a cap due to data and processing limitations when keeping track of that much terrain.

  • @CatheteriZedEYE

    @CatheteriZedEYE

    4 жыл бұрын

    @@yalkn2073 infinite in the sense of, you will never see every seed because there are too many. is minecraft "infinite" no because it too has a border and a limited number of seeds but you will never see them all in your lifetime so its considered infinite

  • @Gismo359

    @Gismo359

    4 жыл бұрын

    @@CatheteriZedEYE That's infinite seeds not an infinite map. In minecraft, the map is practically infinite as the time required to explore all of it in would be in centuries, while terraria's maps would require anywhere between a couple of hours and a few weeks, depending on map size and how much you focus on exploration

  • @mariovelez578
    @mariovelez5784 жыл бұрын

    For those who are wondering how terraria procedural generation works, since apparently he hasn't uploaded a video for it, I can explain it to you. I created a version of terraria for my AP computer science midterm project. Here's what I did: - start with a seed. This will ensure same generation every time. When you want a random number, you input a seed, it does some calculations, and outputs a pseudorandom number based on the number you put in. So, what you can do is keep feeding the output of the random number to get a new one, and if you have the same seed it will always do the same "pattern" - Next you want to sprinkle random stone blocks around your blank world, this will start off the generation. - Then, for every tile, if there is a tile next to it, there is a random chance it will become a tile. Do this enough times and your world will now have clumps, then mountains. depending on how you check for tiles around it, you'll get different results. However, this is not how Terraria generates its terrain. - After that, you can add water to all the empty tiles that are at or below sea level - Then, add dirt to all the tiles that have air directly above it and stone directly beneath it, then each tile you set to dirt, set the other 3 directly below it to dirt, and the top one to grass. - You do the same thing but for sand underwater. - For ores, you can have a random low chance of generating one in place of a stone tile, and then a random chance for the ones next to it to become the same ore. - finally, you want to add trees. Check every grass block, and if there is a large enough rectangle of space above it, generate a tree. This method will do good, but will make a bunch of floating islands, which, if that's not what you want, you can use Perlin Noise at the start Terraria doesn't have floating islands, instead, it has a ground and a cave system next to it. Here's a simple way to generate it using Perlin Noise: - Start of halfway on the y axis and set a variable to your current y value. On the y value (let's call it y0), start at the very left and add a grass tile at that value, 3 dirt tiles below it, and stone all the way to the bottom. - Do this for every block, but change y0 by an integer between [-n, n], where n is how steep you want the hills to get. for better results you can use Gaussian (normal) distribution to pick the change in y0. - Any empty tile that is at or below sea level now becomes water - For the caves, start at a random point in the cave and make a line to another point 5 tiles away in a slightly changed direction. Make a chain of lines a random number of times and that will be a single cave path. You can make any number of chains, chains can split like a tree, whatever, until you have enough caves. - Next is to remove every tile that is 4 tiles away from any line, and this will make cave tunnels with a diameter of 8 tiles - Next, you can fill some of the caves with water or lava, by random chance or by how high up the cave is. - You make trees the same way, but since there are no floating islands, you don't need to check for tiles above it This is an oversimplified way to generate it, but terraria is much more complex and adds biomes, buildings, dungeons, and a lot more things. It's called procedural because it follows a set procedure, or order, of things to generate. Hope this helps!

  • @Lena_M

    @Lena_M

    4 жыл бұрын

    Thank you. I haven't been able to wrap my head around how this kind of thing works, and this has really helped.

  • @derekbos1944

    @derekbos1944

    4 жыл бұрын

    Terraria does indeed have floating islands, they often contain a generated house with a chest of two

  • @09jjohns

    @09jjohns

    4 жыл бұрын

    Every world in terraria has floating islands specifically added to it during world generation. Small worlds have up to 4 of them, and Large worlds can have up to 8. terraria.gamepedia.com/Floating_Island. I'll admit it doesn't have the KIND of floating islands you mentioned (Noise-generated), but it does most definitely have many above-ground clusters of blocks. I'm not going to pretend to know how Terraria's caves are generated, but the cave generation you described would make many samey caves, not to mention it doesn't account for the unique generation in certain biomes like the Underground Desert or the Underworld.

  • @skyemegakitty

    @skyemegakitty

    4 жыл бұрын

    "I can explain it to you" then later "However, this is not how Terraria generates its terrain."? Thanks for the tangential information I guess...

  • @aracelidiaz6996
    @aracelidiaz69964 жыл бұрын

    I'm loving this channel now. So interesting :D And I love how you wrote when the next video is coming out on the header picture of your channel XD

  • @MegaBcoyle
    @MegaBcoyle4 жыл бұрын

    Only came across this Chanel yesterday and wtf, it's great. I hope you get back on these.

  • @foilhattiest1
    @foilhattiest14 жыл бұрын

    As someone who started his game coding days in the 80ies on a C64 all I can say is I'm completely amazed at how someone can be amazed that todays gaming computers are handling "thousands of tiles" in a 2D game without crashing, and would feel the need to make a video to explain this.

  • @alexnoman1498

    @alexnoman1498

    4 жыл бұрын

    That's the real problem here. If all you know is Unity, you have absolutely no clue that that's child's play if you did it yourself. Growing up with ready-to-use engines is incredibly unhealthy for game programming, so much reeducation and unlearning to be done in the near future...

  • @notquitehadouken
    @notquitehadouken4 жыл бұрын

    "how many tiles are in the map of terraria, well, theoretically there are infinitely many" no thats not how it works

  • @GunnarClovis
    @GunnarClovis4 жыл бұрын

    Hyped for that procgen video! Subbed and belled. This is great stuff. I really hope you're able to do a full return!

  • @Thefuryspeed100
    @Thefuryspeed1004 жыл бұрын

    You are welcome to come back any time! I loved the video and i would love to see more

  • @TomRyckeboer
    @TomRyckeboer6 жыл бұрын

    Keep it up! You'll have loads of subscribers in no time with videos like these!

  • @jjmj4971

    @jjmj4971

    4 жыл бұрын

    ;-;

  • @yusuf_kizilkaya

    @yusuf_kizilkaya

    4 жыл бұрын

    :[

  • @idkxd9525

    @idkxd9525

    4 жыл бұрын

    :$

  • @MrCreepyPeach

    @MrCreepyPeach

    4 жыл бұрын

    well...he didn’t keep it up. :(

  • @toxiccookievr
    @toxiccookievr4 жыл бұрын

    Oh boy, I can't wait to watch the next video! *Last upload: 2 Years ago*

  • @EvenTheDogAgrees
    @EvenTheDogAgrees4 жыл бұрын

    Great video. There are plenty of similar videos catering to us seasoned devs, but I love how you took the subject and made it accessible to the average gamer who may not have any programming background.

  • @andersonklein3587
    @andersonklein35874 жыл бұрын

    Really liked all the points you raised, and you explained them super well. The tree analogy was awesome. As someone that got into codding some, and loves game development, I would have had a totally different approach to it: First, instead of having tiles perform actions every frame, I would have entities perform actions. So the tiles would be stored in a arrays, one for each chunk, and entities would be handled separately. The blocks would have properties and methods, like HP, but they don't update on their on so they are not iterated through. Then I would have a an entity list, that is iterated through periodically, which contains things like trees, enemies, etc... And those would be capable on calling on methods periodically. Though I might have different update methods getting called whether they are in a visible chunk or not, and then just have the engine go through a list of lists of entities per chunk calling either "light update" or "heavy update".

  • @slap_my_hand
    @slap_my_hand4 жыл бұрын

    Why do awesome channels like these always die after promising to make a video about a really interresting topic?

  • @willtheoct

    @willtheoct

    4 жыл бұрын

    Find a different channel - he doesn't know what he's talking about

  • @DlcEnergy

    @DlcEnergy

    4 жыл бұрын

    William Weissman in regards to making 2D tile games look tough to crunch, yes. it's the same simple logic that's been used since the likes of Mario. (1985 on NES) the only difference today is we can render much more polys on screen. the size of the world means nothing. they could generate an infinite world if they wanted. it's just data. it's not all loaded at once. lol like minecraft. which blows terraria's size away. and the total polys is much higher. "omg, how is minecraft not breaking the computer?! aaargh" **tries setting infinite render distance** bwahaha xD only a fool wouldn't recognize how stupid that is. and he literally mentions frustum culling. lol frustum culling doesn't come in at all for a grid of cells. that's just knowing your render region. lol you have direct access to what portion is in bound. (xz chunks / xy tiles) where frustum culling actually comes in, is when you don't directly have a way to just render what's visible. like with 3d polys. you literally have to check if it's inside the frustum. and the only way to do that is check a single point is within all the frustum planes. since doing that for the tons of poly's there are (especially with todays graphics) would be expensive, we just check a larger area that encapsulates all those poly's. meaning some couldn't be culled away. so some off screen poly's will be processed, and simply clipped away. and again about the poly count, a screen filled with tiles is nothing astounding. literally, the more there are, the smaller the polys are. lol example. say we made them 1x1. omg! 1920*1080 tiles?! how we gonna do that!? that sounds like too many pixels to me! xD while in 3D tons of these polys will be overlapping, so processing much more pixels. and they all need perspective correct interpolations for each pixel's attributes. and they all need translating/projecting with a 4x4 matrix. (16 multiplications 14 additions 4 assignments per vertex) whereas all 2D tiles need is basic xy shifting. (2 additions 2 assignments per vertex) basically, he should've done a video about minecraft. lol

  • @JordanMetroidManiac

    @JordanMetroidManiac

    4 жыл бұрын

    Overburdening. Biting off more than one can chew. Getting too ambitious... Setting goals too high. Over-stretching / over-expanding.

  • @WhoIsLym

    @WhoIsLym

    4 жыл бұрын

    @@DlcEnergy Except just because something you render is small doesn't mean it's not a performance hit. A major factor in rendering performance is draw calls, the actual pixel and blend operations you are talking about aren't usually that bad, depending on the complexity of the shader, even if you have a lot of overdraw. 2D games also need to be projected with a matrix, since clip space is 3D even for 2D games, only difference is you have 4 less vertices per object to multiply with the matrix. The actual performance difference between rendering a sprite and a cube is insignificant. All it comes down to in the end is how many objects you are trying to render. Instancing can play a huge part in reducing performance if you have a lot of similar objects.

  • @DlcEnergy

    @DlcEnergy

    4 жыл бұрын

    Lym my point was that a larger count doesn't linearly increase how many calculations are needed. have you ever had so many 3d polys in the same location and wondered why they're so laggy (when up close) yet fine when spread out? (far away) because they're no longer tiny. translating them all is no big deal. the rendering has a much bigger affect. and for tiles (which we're talking about) is simply 2 additions. you don't need a matrix. we're not even rotating them. lol you're thinking of how the fixed pipeline of opengl makes you use its builtin matrices to project/translate. stop that. lol opengl is prioritized for 3d graphics. which is why we have the homogeneous coordinates. we can't project before clipping. (since it could divide by 0 or invert projection) we can't interpolate in 2d and expect 3d perspective. if all this trouble is powerful enough for 3d graphics, it'll be powerful enough for 2d anyway. and most modern 2d games would likely make use of most of it anyway. if they're gonna have rotation, they're gonna need tri's to do the rendering. but again, we're just talking about a simple tile game. do you think mario on the nes would've used matrices for some tiles? and translated 4 vertices for a square? and interpolated over 2 triangles to calculate the pixel? lol think efficiently. and ask yourself how you might do that. test your ideas and see your results. there's PBO's. there's glBlitFramebuffer. you can just upload the raw pixels to the buffer. and whala. no calculating over tons of interpolated texture coordinates for tons of triangles for no reason. and if you wanted some shader affects, you could just render the texture. of course if maybe you wanted wavy grass or something, then you'd render them separately. and if you didn't want to keep re-rendering all the individual tiles over and over, you could chunk it up. have a range of tilemaps. so as you explore more tilemaps are built quickly. and those larger pixel streams can be uploaded quicker. anytime a tile is changed, its tilemap is updated. yada yada yada...

  • @Reegly
    @Reegly6 жыл бұрын

    Such an underrated channel. Explaining in examples how the certain things works must be hard. Keep it up man. Waiting for your new upload.

  • @nebora4250

    @nebora4250

    4 жыл бұрын

    Reegly Well,

  • @horggroh

    @horggroh

    4 жыл бұрын

    Some say he still waits to this day

  • @willtheoct

    @willtheoct

    4 жыл бұрын

    But he's just.. wrong. Find a better channel to learn these things, please. He's throwing terms around like 'frustum culling' without understanding the concept, and this video is misleading in so many ways

  • @Lena_M

    @Lena_M

    4 жыл бұрын

    @@willtheoct Can you elaborate?

  • @willtheoct

    @willtheoct

    4 жыл бұрын

    @@Lena_M v=YIDbhVPHZbs&lc=UgxElWUm4kcoxqzrp014AaABAg

  • @roxferesr
    @roxferesr4 жыл бұрын

    Man this series is amazing! Please do more of these!

  • @code1997
    @code19974 жыл бұрын

    Very nice explanation of basic CG concepts. This must have been a ton of work with all the little examples. Keep up the good work!

  • @code1997

    @code1997

    4 жыл бұрын

    @JamBixX Well I know that Terraria does it differently but still he explains some basic concepts quite well

  • @code1997

    @code1997

    4 жыл бұрын

    @JamBixX Well then be more specific... where is he wrong?

  • @code1997

    @code1997

    4 жыл бұрын

    @JamBixX Yeah? And? Has nothing to do with basic Game Development Patterns...

  • @code1997

    @code1997

    4 жыл бұрын

    @JamBixX Do you actually know anything about Game Design or are you just salty because he didnt play Terarria? Spoiler Alert: Terraria isnt what this Video was primarily about. So either start being constructive or GTFO

  • @OrchidAlloy
    @OrchidAlloy4 жыл бұрын

    This video's information about how Terraria works is sadly nearly completely false, as many people have explained, but this was still very high quality and enjoyable

  • @Hellefleur
    @Hellefleur4 жыл бұрын

    This was interesting! *Checks channel* Oh......

  • @Gabriel_Guerra

    @Gabriel_Guerra

    4 жыл бұрын

    RIP :(

  • @willtheoct

    @willtheoct

    4 жыл бұрын

    Don't get technical info from this channel - he has no idea what he's on about

  • @Henrik0x7F

    @Henrik0x7F

    4 жыл бұрын

    @@willtheoct Don't get technical info from this comment - he has no idea what he's on about

  • @heikkipalola6760

    @heikkipalola6760

    4 жыл бұрын

    @@willtheoct give an example of where this dude showed that he has no idea what hes talking about

  • @willtheoct

    @willtheoct

    4 жыл бұрын

    @@heikkipalola6760 Linked comment with timestamps: &lc=UgxElWUm4kcoxqzrp014AaABAg

  • @thevajormage8370
    @thevajormage83704 жыл бұрын

    Glad I stumbled upon this right when you are thinking about posting more content, you earned a sub!

  • @ashwinmods9576
    @ashwinmods95764 жыл бұрын

    I love your work man, Thanks for Coming back. Here are few more things we do to optimize these type of games. Using Atlas is very crucial so we don't have to change texture. An array of Similar tiles is combined into 1 tile, with bigger size and multiplied UV. Static Mesh of Multiple Tiles are combines into One mesh, to hugely reduction in draw calls.

  • @misumi6312
    @misumi63124 жыл бұрын

    The world of terraria isn't infinite, I feel the credibility of the rest of the information is lost. This is a simple fact about the game's world and any research into it would reaveal that.

  • @jeffreyblack666

    @jeffreyblack666

    4 жыл бұрын

    Theoretically infinite, not actually infintie. By changing the parameters of the world generation you can make it as large as you want (within the limtis of your computer) and not simply a scaled version. Fixing the map to a predefined size is one way to avoid that issue of so many tiles.

  • @mason3872
    @mason38725 жыл бұрын

    I really needed something like this for my games because I have always loved 2d survival rpg games like Terraria or Zelda

  • @willtheoct

    @willtheoct

    4 жыл бұрын

    you can straight up ignore the part about frustum culling- that's only for 3d games. For most 2d games you don't actually need tricks to save on performance. I'd recommend ignoring this dude

  • @GeddyRC
    @GeddyRC4 жыл бұрын

    This and the Portal video were awesome. Hope you keep making content!

  • @imfobk
    @imfobk4 жыл бұрын

    I love these. Because maybe I wanna build a game. But I want to add an element. These videos give me so many ideas and ways of looking at these problems. These vids are gold. Can't wait to see more.

  • @fahdv2597
    @fahdv25974 жыл бұрын

    You didnt mention sprite batching, which is really the main way they optimize their tile rendering because in modern opengl, drawing something to the frame buffer, isnt the same as rendering it to the screen. You can combine all the tiles into one big model and succesfully render all the tiles in one draw call

  • @cannemen
    @cannemen5 жыл бұрын

    As a game developer I love these videos! It's like mental candy! Keep it up man :)

  • @jazzboi_9026
    @jazzboi_90264 жыл бұрын

    Please continue with these videos! They are very interesting and well made!

  • @EmpuzeUK
    @EmpuzeUK6 жыл бұрын

    Wow, you've really put effort in to this video. Appreciate the work, and explanation!

  • @Yoso_tv
    @Yoso_tv4 жыл бұрын

    I just saw this video is years old, but I wanted to point out that I'm pretty sure Terraria's NPCs also load several chunks around them as they can be killed when you're not around them

  • @antidisestablishmentariani8730

    @antidisestablishmentariani8730

    4 жыл бұрын

    terraria doesn't use chunks. at all.

  • @Jack-hd3ov
    @Jack-hd3ov4 жыл бұрын

    This video was my first introduction to your channel and I thought from reading the title that Terraria used some cool bitwise pipeline to optimise the tile rendering :/

  • @Ethorbit
    @Ethorbit4 жыл бұрын

    That was very enjoyable to watch, please make more :)

  • @charlesquinton9127
    @charlesquinton91274 жыл бұрын

    Hilarious how the KZread algorithm sends me a pretty high quality video, then I go to subscribe to the channel, only to find out it's been inactive for two years. Then I go into the comments to find out that the recent recommendations have inspired the estranged creator to continue his work. It's a pretty uplifting story actually and it makes me excited to see more of your content in the future : )

  • @Katniss218
    @Katniss2184 жыл бұрын

    What about corruption recursively converting tiles to more corruption tiles, which themselves are creating more corrupting tiles, exponentially.

  • @Katniss218

    @Katniss218

    4 жыл бұрын

    @Badog98 I didn't say it increases speed with more tiles. I only really said that the method shown in the video doesn't explain real Terraria's behavior.

  • @Katniss218

    @Katniss218

    4 жыл бұрын

    @Badog98 Nothing really new to me, but I think it's clear.

  • @_ZEG
    @_ZEG5 жыл бұрын

    Hey, I don't know if you will even read this, given your inactivity, but I'm still really grateful for your clear explanation of this topic. I'm really inexperienced when it comes to programming of any kind but find this stuff quite fascinating! It's a shame you didn't follow up with the Procedual Generation part though, as others would agree. Hope you'll come around to do some some day. I'll just leave a sub for now. :) EDIT: Maybe if you still have a script for that video you could also just release that on it's own. I think it would help a lot of people understand the technical part!

  • @_ZEG

    @_ZEG

    5 жыл бұрын

    ... pleeeeaaaaseee? :)

  • @willtheoct

    @willtheoct

    4 жыл бұрын

    "grateful for your clear explanation of this topic" the guy didn't explain this properly at all, threw in concepts and comparisons that don't make sense, and just... don't listen to him. He doesn't understand what he's talking about.

  • @mrGonakaTV
    @mrGonakaTV3 жыл бұрын

    youtube just recommended this. while you say this is inaccurate and appreciated I really enjoyed this video man!

  • @mckvadrat7049
    @mckvadrat70494 жыл бұрын

    Found this video in my recommended tab. Subscribed. Went looking for the next episode. Surprise surprise.

  • @yikes6758
    @yikes67584 жыл бұрын

    "potentially infinite" but terraria worlds are limited in size...

  • @Puff_Freckleburger

    @Puff_Freckleburger

    4 жыл бұрын

    key word: potentially

  • @yikes6758

    @yikes6758

    4 жыл бұрын

    @@Puff_Freckleburger whats the potential to be infinite?

  • @Puff_Freckleburger

    @Puff_Freckleburger

    4 жыл бұрын

    @@yikes6758 That is the idea that if you remove the limits on world size, the program will be capable of generating terrain for an infinitely large map.

  • @mrjam6721

    @mrjam6721

    4 жыл бұрын

    ​@@Puff_Freckleburger 0:40 He says "theoretically there are infinitely many because the map is procedurally generated". Which just isn't what procedural generation is. While procedural generation does have the potential to create infinite tiles, this just isn't how it is used in terraria. The guy in the video seems to have surface level knowledge, and the video is aimed at beginners.

  • @Puff_Freckleburger

    @Puff_Freckleburger

    4 жыл бұрын

    @@mrjam6721 It's not completely pointless. The significance of this comes from the fact that Terraria worlds are procedurally generated rather than "handcrafted." A world that is not procedurally generated can never be infinite. It will always be limited by the amount of time and effort the game designers are willing to put into making it. A computer-generated world does not have this issue and can generate a setting of virtually infinite size. You're right that in the context of this video it's not necessary to mention this, but it's not wholly redundant.

  • @truediamant777
    @truediamant7774 жыл бұрын

    "13 fps is unplayable" Meet my computer

  • @nicks4727
    @nicks47274 жыл бұрын

    I subscribed I hope this channel picks up in 2020!

  • @vhonzo
    @vhonzo4 жыл бұрын

    you earned a sub bro I love this video and your portal one great job !

  • @zonkle
    @zonkle4 жыл бұрын

    You don't need to chunk your tiles, and frustum culling is unnecessary for a 2D game with fake z-depth. With an efficient sprite batcher and tile renderer, you can iterate and draw the entire screen space of tiles every frame and still get thousands of fps. The thing that takes up the most processing time is the realtime lighting, which runs a flood-fill-based algorithm for every light emitting tile or object. This is so expensive that it can't run every frame on lower end machines, and either needs to be done in parallel or processed partially each frame until it's completed. (source: I've developed a custom engine which is meant to handle worlds similar to Terraria.)

  • @GR-yu7gs

    @GR-yu7gs

    4 жыл бұрын

    Rendering millions of sprites at 60+ fps is nearly impossible. I've dealt with optimization before, and I can assure you frustum culling is absolutely necessary to optimize most games. In fact, one of the main reasons frustum culling is so common is because of how effective it is. I'll bet that the reason you don't need frustum culling for your renderer is because it's already doing it for you behind the scenes. However, Terraria uses its own engine, so it needs to do it manually.

  • @zonkle

    @zonkle

    4 жыл бұрын

    @@GR-yu7gs I didn't clarify correctly. The culling isn't happening behind the scenes; it's my custom engine. I'm still only rendering what's on screen, based on the (orthographic) camera boundaries. It's just not technically frustum culling, which is meant for 3D. 1 million sprites is the max my engine can handle at 60fps on my PC. Normally, I'd never need to render over 100k.

  • @Laff700

    @Laff700

    4 жыл бұрын

    Yeah, this youtuber isn't all that knowledgeable in this or Terraria.

  • @psychoDon525
    @psychoDon5254 жыл бұрын

    This video talked about Terraria, but it was actually describing Minecraft.

  • @PhilTruthborne
    @PhilTruthborne4 жыл бұрын

    I always wondered about this and it's really nice to get some insight into these things as someone who actively tries new game concepts in development! I'm definutely checking out your generation video as well, it's sounds like a gold mine of information~

  • @matt1988ish
    @matt1988ish4 жыл бұрын

    When I was still working with XNA when XNA was still a thing, I made a (successful) attempt at a 2d tiled game prototype with several hundred thousand tiles. I simply made a single array with all the tiles and only rendered the tiles within my cameras bounds + a bit of padding and it worked great. For something like Terraria you definitely don't need huge amounts of optimization to get it to run well on modern hardware. Although through implementations of simple things like chunks, a huge amount of optimization cold have been obtained.

  • @matt1988ish

    @matt1988ish

    4 жыл бұрын

    Terraria's developers made the game and only optimized where they NEEDED to. Which is the correct way of optimizing as early optimization can introduce painful and difficult to track bugs.

  • @EnderCrypt
    @EnderCrypt4 жыл бұрын

    i mean, some quick math and you see that even on the biggest map size, assuming each tile is a byte, that'd only be 20mb of data, which really isnt that much and yeah, even with some more data per block, you wouldnt exactly hit the modern ram limit of 8gb.. or even 1gb and rendering.. thats way way simplier, just render whats on the screen...calculate which tile is on the top left corner, and the bottom right corner, do a nested loop and draw, also some other math to offset the player position by the blocks to add 0-16 pixels

  • @alyx8815

    @alyx8815

    4 жыл бұрын

    I did not understand a single word of that

  • @EnderCrypt

    @EnderCrypt

    4 жыл бұрын

    @@alyx8815 well, basically.. lets say that terraria only had (a maximum of) 255 diffrent block types, for example dirt = 1 stone = 2 wood = 3 that means we could represent each tile/block with 1 byte (since a byte can store a number that ranges from 0 to 255) now, the biggest terraria map ( terraria.fandom.com/wiki/World_Size ) is 8400 tiles wide and 2400 high, multiply those togheter and we get how many tiles/blocks are in a whole large map 20'160'000 blocks, and if you give 1 byte to each block, thats 20 mb, so it would take 20 mb's of ram to story that much information now terraria problably stores other information for each block too, so you might need to multiple the ram usage a few times, but even still, its not that much ram for a modern computer and regarding rendering, well.. you can calculate which blocks are gonna be inside the screen by figuring out.. well, which blocks should be in the corners of the screen (depending on camera and player position and zoom) and then just draw all tiles in between not sure if this explanation was better or worse than my original comment but yeah ^^

  • @hyunsiklee2739

    @hyunsiklee2739

    4 жыл бұрын

    @@EnderCrypt Thanks, this was a huge help! Memory was the first question on my mind when he started talking about storing data for that many tiles, which he didn't clarify in the video.

  • @Xenoks01
    @Xenoks014 жыл бұрын

    Just found your channel, what a shame you haven't been active in so long

  • @trent1776

    @trent1776

    4 жыл бұрын

    Wish he comes back

  • @gibran.zidane

    @gibran.zidane

    4 жыл бұрын

    maybe he is dead

  • @friedpotato6037

    @friedpotato6037

    4 жыл бұрын

    @@gibran.zidane i wish his not

  • @jackmatthews649
    @jackmatthews6494 жыл бұрын

    Just come across this channel and the videos are so good. Found that it is not active but I hope it restarts! Maybe one thing that the youtube algorithm has done correctly!!

  • @donatoclemente4421
    @donatoclemente44214 жыл бұрын

    This is really awesome content! Seeing code in a bts video would be fantastic as well! Just a general overview to understand the logic and functionality.

  • @gunchwow
    @gunchwow4 жыл бұрын

    Congratulations, i've never seen a video about how a game works where in the first 45 seconds they manage to convince me that they haven't even played the game before.

  • @cameronprice5546
    @cameronprice55464 жыл бұрын

    Why do people always say "fry" your computer. Computers only "fry" under very specific circumstances, and playing a demanding game is definitely not one

  • @plexyglass429

    @plexyglass429

    4 жыл бұрын

    Why do people say downing in money? It's impossible to drown in paper. Because it's a saying, somthing that just developed over time, people don't actually mean it fried their computer, it's just another way of saying the computer shat itself

  • @snoopy7156

    @snoopy7156

    4 жыл бұрын

    Plexy_ Glass no. Frying a computer mean it’s won’t work anymore, like if you shock your motherboard. Playing a demanding game will crash your software or your computer but it won’t be fried/bricked.

  • @MrSapps

    @MrSapps

    4 жыл бұрын

    @@plexyglass429 because it has a very specific meaning, a short circuit is an actual example of "frying" a computer

  • @thedarklordx

    @thedarklordx

    4 жыл бұрын

    @@snoopy7156 you could likely destroy your computer by running a demanding game, GPUs and other computer parts can burnout from overuse or working them too hard.

  • 3 жыл бұрын

    @@thedarklordx Did you ever see a computer since 1990? Every component in the system since the 2000s will protect itself and shutdown if overheated.

  • @splainintodo4061
    @splainintodo40614 жыл бұрын

    Great channel! Come on back and keep making videos. I would pay for this type of content.

  • @min2724
    @min27246 жыл бұрын

    Please upload the next video! Thank you for uploading this one as well.

  • @guisampaio2008
    @guisampaio20084 жыл бұрын

    First: I never questioned it cause computers are big ass machines doing trillions of calculations per second. Second: My computer can't run terraria at 60 fps.

  • @fyreflynt4767

    @fyreflynt4767

    4 жыл бұрын

    same.....rip

  • @babe6674
    @babe66744 жыл бұрын

    We still wating for you, sir

  • @hehe8138
    @hehe81384 жыл бұрын

    1. Terraria might not have pixel perfect design, so just because I tile is drawn in 16px doesn’t mean it takes 16px on your screen. It might take more which means less tiles to draw = less work. 2. Drawing 8,000 sprites at 60 FPS is no problem at all. Computers today can perform over a billion operations per second. Billion / (8000 * 60) = ~2000. A computer can definitely draw a single sprite in 2,000 operations. Of course, there are other things happening, but a billion operations per second is on the low side. But this graphics stuff is usually done through parallel processing with dedicated hardware meaning each sprite can be drawn at the same time, taking less processor time overall. 3. 2:50, so you’re assuming that in terraria each tile has its own functionality and you put that in the draw call for some reason. I think it’s reasonable to say that the tiles in terraria are mostly static. Dirt does not need it’s own functionality until the player interacts with it. There are some elements which do have their own functionality, like growing plants, but that doesn’t mean that each is an object, running a timer until a random time when they grow. More likely, the game selects a couple tiles per frame at random. Eventually the plant tile will be selected in random time. This is how Minecraft works.

  • @iseldrew9690
    @iseldrew96904 жыл бұрын

    That's amazing. Dude, please, continue! We need more knowledge!

  • @Gofawu
    @Gofawu4 жыл бұрын

    And you can also only calculate tiles that touche air.

  • @RenderingUser
    @RenderingUser4 жыл бұрын

    answer: the same reason Minecraft does not crash that's right! friendship!

  • @simplegaming1326
    @simplegaming13266 жыл бұрын

    When will the next video come out? I'm really looking forward to that!

  • @TheJogorilla
    @TheJogorilla4 жыл бұрын

    Great video! I study programming so this was actually very informative and I learned quite a bit from it. Thank you very much!

  • @LOLWHATBRO

    @LOLWHATBRO

    Жыл бұрын

    Lmfao

  • @brianr6744
    @brianr67444 жыл бұрын

    And so, part 2 never came

  • @CMMNG
    @CMMNG4 жыл бұрын

    "procedural generation" Ahh yes, making a video about a something you haven't checked.

  • @amusenx3793
    @amusenx37934 жыл бұрын

    Okay now I want to see your next episode, you just made me a bit wiser!

  • @Gale42
    @Gale424 жыл бұрын

    You just blow my mind, my concept of game design as a Very begginer was changed, thanks

  • @gandalfdegrey
    @gandalfdegrey4 жыл бұрын

    I’m majoring in cs and Terraria is my fav game. This vid just put two together which is awesome

  • @JoshMate24
    @JoshMate247 жыл бұрын

    Clever, I always wondered this.

  • @luizfernandonoschang8298
    @luizfernandonoschang82984 жыл бұрын

    There are further optimizations. They're a little complex to explain just by typing here, but I'll do my best: 1. Don't check every chunk of tiles. Instead, keep track of all interactive objects (player, enemies, trees) and their position, that is, the index/id of the chunk they're currently on. So, for example, if player is on chunk 3, you know that you only need to update this chunk and can ignore the others 2. The second optimization is called dirty rectangles. It takes advantage of the ghost effect caused when you don't clear the screen. Basically, you draw all tiles once and then you never clear the screen again. After that you only draw the tiles that changed on top of the old ones. The tiles that didn't change will remain there since you didn't clear the screen. The only problem with this technique is when you need to scroll the screen, and this leads to optimization 3 3. If your graphics card has enough memory (this is the case nowadays), instead of drawing the tiles directly on the screen, you create a large image on the GPU memory with the size of your whole scenario. Then you draw all the tiles in this off screen image once, and every time the game updates you draw the updated tiles on this image. Finally you make one single call to the GPU to draw this image on screen. Since the off screen image is larger, you can only draw a portion of the image on the screen (operation known as blit). By chosing a different portion of the image each time, you create a virtual scroll effect. Also this technique improve performance because the GPU is much more efficient on drawing a single large image than drawing many small images. However, with procedural generated scenarios like Terraria, it's not possible to fit all the scenario in a single off screen image. This leads to optimization 4 4. Instead of drawing a single huge off screen image, which can actually degrade performance if the size of the scenario is too large, you can subdivide the scenario in several images/sections. So, if you have a viewport with 1920px width, you can create an off screen image with 5760px width. If you center this image on screen, you will have 1920px displayed, plus 1920px hidden to the left and 1920px hidden to the right. This way, you can scroll the screen for both sides with very little impact on performance because that part of the scenario is ready, you just need to show it on the screen . Now, suppose that the player starts walking to the right, after he walks 2880px, it will be in the right edge of the scenario. This is the moment when you can generate the next section of the scenario and draw it to another off screen image with 5760px. So, if the player walks to pixel 2881, you stop showing the previous off screen image and start showing the one you just created. Repeat the process ifinitely 5. This final optimization is not related to drawing things on screen, but is related to the way you update the game state. Generally you create objects on your game, update them, draw them on screen and once finished you destroy them to free memory space. Now, this technique is called object pool and consists of keeping your objects on memory instead of destroying them. So, suppose you have an enemy that comes from the right of the screen to the left, like the goompas on super Mario. You create the enemy, set it's position to the right edge of the screen and on each frame you move it some pixels to the left. When the enemy passes the left edge of the screen, instead of destroying it, will just reset it's position to the right edge of the screen. On the player's perspective it seems a new enemy, but it's just the old one. You can change, it's position, speed, sprite and many other properties to make it seem a completely different enemy. The secret here is that creating new objects is much more expensive for the CPU then changing the existing ones. For a few objects you may not see difference, but for hundreds or thousands of objects this can have a huge impact

  • @kihayu8872
    @kihayu88724 жыл бұрын

    Hey man. Great instruction video about the theory behind tiles in Terraria. Just for everyone else, that's also why Minecraft has 16x256x16 chunks. So I will subscribe to your channel because I want to see that procedural generation video. I know a little bit about it, but maybe I will learn something new

  • @skyabyss7357
    @skyabyss73574 жыл бұрын

    2 years later: Me: 🤔 KZread : SO YOU WANNA SEE A BOII WHO EXPLAIN TILES YES ?

  • @strollas
    @strollas4 жыл бұрын

    i mean if you can render a bunch of polygons to make triple a realistic games, of course you can render tiles.

  • @JesseBourretGheysen
    @JesseBourretGheysen4 жыл бұрын

    Awesome explanation of these game building tactics. thank you

  • @zane49er51
    @zane49er514 жыл бұрын

    There's also very likely a way for the game to render some tiles only once. Similar to the processing, drawing can sometimes be skipped. For instance, instead of rendering every tile individually on every frame, a chunk could be rendered and stored somewhere, and then later on the whole chunk's image is placed. The chunk only gets re-rendered every time one of its tiles changes. This can be repeated many times, up to the screen size. I recently created a game where screen-sized areas would be pre-rendered and stored as images, and then on updates, the chunk is re-rendered and then placed on top of the old image. This means that there are 2 or 3 draw calls instead of 30, instead of 1000.

  • @69dm
    @69dm4 жыл бұрын

    and now imagine 3d world "tiles" which are pixels of textures of 3d objects which are basicly 2048px each and can be repetable on 1920x1080 resolution. and now imagine 4d.

  • @dot32

    @dot32

    4 жыл бұрын

    You can only see the outside-faces of 3D blocks. Also no, i can't imagine 4D very well xD

  • @beanpork508

    @beanpork508

    4 жыл бұрын

    Using chunks is huge in mc

  • @StudioNBS
    @StudioNBS4 жыл бұрын

    why so many people just finding this channel now?? (i'm one of them)

  • @st.michaelthearchangel7774
    @st.michaelthearchangel77744 жыл бұрын

    This video was very informative for me. Thank you.

  • @codiivt
    @codiivt5 жыл бұрын

    this channel is fantastic! you deserve way more subs

  • @willtheoct

    @willtheoct

    4 жыл бұрын

    Hell no! The concepts he's talking about are wrong and don't even hold up in terraria, learn your compsci elsewhere please

Келесі