Terraria

  • Yes, I could do that and just set the angle of the tilemap for a directional light.

  • Does anybody know how Terraria keeps such good FPS? There are millions of blocks and water tiles,

    countless particles torches, etc. How did they do that? Any ideas? Thanks.

  • By the way, this is an open thread about Terraria. If anybody has ideas, comments, or other things relating to Terraria, they can post them in this thread.

  • I am also stumped on the water. I tried to re-create it, but it's not going so well. dropbox.com/s/58h5m76v4dwrbdg/Block%20Water%20Example.c3p

    Can anybody help me with this? I want it to be exactly like or very similar to Terraria's water. I know it probably won't be easy, but that is why I'm here ;). I also found this, but it's very old and the examples don't work. construct.net/en/forum/construct-classic/construct-classic-discussion-37/minecraft-like-lavawater-37554

    Thanks in advance,

    Give me a Pixel

  • Does anybody know how Terraria keeps such good FPS? There are millions of blocks and water tiles,

    countless particles torches, etc. How did they do that? Any ideas? Thanks.

    This was answered in the thread already. Terraria (most likely) uses chunks and processes everything within those chunks while ignoring everything that is outside of said chunks. So the world is basically active around the player (+some extra) but everything else sort of gets frozen, doesn´t create particles/enemies etc. and thus takes basically no processing power. So yes, there are millions of tiles but it doesn´t matter. Even if you would put trillions in, only a specific amount of them is ever needed around the player.

    Also one should mention that when dealing with huge amounts of things, you will get more out of it when you use C# or C++ instead of javascript, even though javascript is slowly creeping up (especially with WebAssembly)

    In terms of water, I really don´t know how one could do it. I found this though

    youtube.com/watch

    Along with the code

    drive.google.com/file/d/0Byqm4cKYC28xV0M1NTdsNVBUMjQ/view

    I think there is a fair chance that you´d be able to translate this into Events or JS (or webassembly?), though it will likely be slower AND it is not optimized for chunking and such.

  • Something is broken with the code formatting and editing the post also doesn´t work :V here´s the link to a nicely formatted code version

    drive.google.com/file/d/0Byqm4cKYC28xV0M1NTdsNVBUMjQ/view

  • Thanks a lot. I will certainly check it out.

    EDIT:

    I looked at the code. That is way to complex for me! I am not the slightest bit familier with JavaScript or CSS or whatever that is written in. I'm going to need some help converting this into events.

  • BTW, is that code directly from Terraria or did somebody just try do make something like it?

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Someone tried to recreate it. It looks very close to me in terms of behavior.

  • Ok, thanks. But I still am going to need some help converting this.

  • It might make more sense if I knew what sprites there were.

  • While looking at that example more, I don't want that many water objects. I have been tinkering around with my example and got a little farther. It works perfectly when you put one block of water down. The problem is when you stack more than one water block.

    Link: dropbox.com/s/hotud4fvgi64qaa/Block%20Water%20Example%20%281%29.c3p

  • About the chunking method:

    If I had a world that was 8640 by 4800 pixels, and a tilemap with tiles that were 8 by 8 pixels, would that work and have high FPS? How can the chunking method be applied to tilemaps for ground? I won't be able to mess with the ground tile in-game (i.e. digging, bombs, or placing blocks), but I will be able to mess with things that are on the ground (i.e. trees, grass, doors) and there will be NPCs. Just wondering if the chunking method would work for a very large layout with small tilemap tiles.

  • How would I divide the world into chunks and find which chunks are around the player? Would I use separate tilemaps for each chunk? Invisible sprites? Also, obviously I could not check every tick to see if the chunks are around the player- that would take the point out of them. How do I find which chunks are around the player? And lastly, like I said earlier, does having a very large number of sprites or tilemap tiles hurt the FPS in any way? Could you please help me with some of these?

    Thanks,

    Give me a Pixel

  • Construct already does some chunking for you, especially on collision checks. First of all, offscreen stuff isn't rendered, so no GPU impact. However, if things move or have behaviors attached it will require the CPU to do work, so you wanna disable those where possible. Btw. checking every tick isn't a problem inherently, it depends on how much work has to be done. Better check 9 things every tick if it helps you to avoid checking 9000 things every tick.

    As for how to do chunking... I'm not entirely sure honestly. Probably with an array of sorts? There gotta be tutorials about it.

    On that note, since construct already does chunking, would it be possible to expose that with a plugin to be used with all kinds of behaviors? Ashley or maybe I'm wrong and this already works that way.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)