Search Unity

[RELEASED] Terrain Engine 2D - A 2D Block Engine Sandbox

Discussion in 'Assets and Asset Store' started by projectposeidon, May 23, 2018.

  1. projectposeidon

    projectposeidon

    Joined:
    Mar 31, 2018
    Posts:
    24
    Terrain Engine 2D
    This asset is now deprecated
    You can contact the creator at: te2dcontact@gmail.com if you have any questions​
     
    Last edited: Nov 20, 2021
    AthrunVLokiz, chelnok and JAMiller like this.
  2. Endi24

    Endi24

    Joined:
    May 6, 2015
    Posts:
    50
    Nice asset m8! Hope I win too!
     
  3. Cywizz

    Cywizz

    Joined:
    Oct 5, 2017
    Posts:
    17
    Hi Matthew...looks like a very handy asset indeed!

    I have a question about the level of support you have for top down 2d games. I see you make specific mention about things like water fluids, etc but is there anything you specifically implemented for a side scroller that is not usable for a topdown game? By the look of things I do not see anything obvious, but I thought I should just check with you.
     
  4. projectposeidon

    projectposeidon

    Joined:
    Mar 31, 2018
    Posts:
    24
    Currently all features are available for both a top-down and side-scroller type game. Frankly the only difference between the two is how you setup your Terrain Data script for generating the world. The fluid has to have an option since it uses a different algorithm depending on the type of game to account for the direction of gravity. All other features like the block lighting remain the same. I haven't and do not plan on releasing features that will only benefit one implementation and not the other.

    Also I want to mention that the majority of the images being side-scroller has nothing to do with the amount of support the engine has for top-down 2d.
     
  5. Cywizz

    Cywizz

    Joined:
    Oct 5, 2017
    Posts:
    17
    Great, thanks for the quick response and clarity...
     
  6. xu-tom

    xu-tom

    Joined:
    Dec 20, 2015
    Posts:
    2
    Hi Matthew:
    this plugin support mobile platforms?
     
  7. projectposeidon

    projectposeidon

    Joined:
    Mar 31, 2018
    Posts:
    24
    I haven't done much testing on mobile, but the major features should work!
     
  8. martin_ls

    martin_ls

    Joined:
    Jul 19, 2017
    Posts:
    2
    Fairly new to unity, so bare with me.

    I cannot get my sprite show in front of the tilemap. I want to use sprite animation for my character.
     
  9. projectposeidon

    projectposeidon

    Joined:
    Mar 31, 2018
    Posts:
    24
    What is the material/shader you are using for your sprite? The tiles are rendered in order depending on their Z position. You need to set the Z Position of the GameObject with the Sprite Renderer component so that it is in front of the tiles.

    For further help please join the discord: https://discord.gg/PBphAvq
     
  10. martin_ls

    martin_ls

    Joined:
    Jul 19, 2017
    Posts:
    2
    Thank you for the reply. Further questions on Discord (on the support section).
     
  11. krkim_unity

    krkim_unity

    Joined:
    Mar 30, 2018
    Posts:
    5
    Unity 2D Lighting Technique - When is the update involving the Flood fill algorithm for generating mesh vertices?
    Your assets are very good and I'm looking forward to the next update.
    Can you tell us when the update will be
    I will wait for an answer.
    Have a nice day!!!
     
    dioteos likes this.
  12. qqqbbb

    qqqbbb

    Joined:
    Jan 13, 2016
    Posts:
    113
    Does it use tilemaps?
     
  13. projectposeidon

    projectposeidon

    Joined:
    Mar 31, 2018
    Posts:
    24
    The update will be released by the new year!
     
  14. projectposeidon

    projectposeidon

    Joined:
    Mar 31, 2018
    Posts:
    24
  15. qqqbbb

    qqqbbb

    Joined:
    Jan 13, 2016
    Posts:
    113
    You should use Unity tilemaps. They are faster than any custom system.
     
  16. projectposeidon

    projectposeidon

    Joined:
    Mar 31, 2018
    Posts:
    24
    Please explain why you think that is.
     
  17. qqqbbb

    qqqbbb

    Joined:
    Jan 13, 2016
    Posts:
    113
    I did some testing. Did you?
     
  18. projectposeidon

    projectposeidon

    Joined:
    Mar 31, 2018
    Posts:
    24
    Well I'm not sure what kind of testing you did, but this engine is highly optimized for performance and minimizing memory usage. Just look at these benchmarks, I don't believe it is fair to say Unity's tilemap system is faster than any custom implementation. Faster is a very broad term, specifically what is faster about Unity's tilemap system?

    Skip to 5:34
     
  19. qqqbbb

    qqqbbb

    Joined:
    Jan 13, 2016
    Posts:
    113
    Are you saying your system is faster than tilemaps and there is no need to test it?
     
  20. projectposeidon

    projectposeidon

    Joined:
    Mar 31, 2018
    Posts:
    24
    I am saying it is potentially faster than Unity's built in Tilemap System, but I can not test this until you explain what exactly you mean by 'faster'. Do you mean faster setup, faster procedural generation, better in game performance, faster dynamic tile editing, faster chunk loading? ...
     
  21. qqqbbb

    qqqbbb

    Joined:
    Jan 13, 2016
    Posts:
    113
    Anything you write with scripts will be slower than source code.
     
    Last edited: Dec 5, 2018
  22. nosajtevol

    nosajtevol

    Joined:
    Jun 28, 2012
    Posts:
    219
    He made his own source code.
     
  23. valentinwinkelmann

    valentinwinkelmann

    Joined:
    Nov 3, 2014
    Posts:
    191
    it looks so incredibly good... is there already a possibility to generate dungeons? what does it look like with save and load? if i change tiles in the runtime, can i save them as a savegame? the fluid system really looks amazingly good, even with pressure. do different fluids also work? e.g. lava and water?
    And I suppose the whole thing runs via threading? so it probably won't be webgl capable? is there a webGL function so the threading functionalities will be outsourced in coroutines?

    Many questions, I hope you can answer some for me, I am very interested in this asset!
     
  24. Vanamerax

    Vanamerax

    Joined:
    Jan 12, 2012
    Posts:
    938
    That does not even have to be remotely true. Especially with Unity's Job System that compiles to native and highly optimized machine code. @mattwilson180 Is this using the Job System by any chance? Looks very good overall.
     
  25. projectposeidon

    projectposeidon

    Joined:
    Mar 31, 2018
    Posts:
    24
    1. It is possible to generate dungeons (or really anything you can imagine), but you would have to figure out how to do that on your own, I left the procedural generation very open for scripting for that reason
    2. There is a static Serialization script that you can call to save and load your game data. The game data is saved in two files. One that contains the basic world properties (width, height, seed, name), and the other contains all the terrain data. Any changes you make to the blocks at runtime will be saved.
    3. The fluid system I spent a lot of time on optimizing and adding features to, but I can't take all the credit as the algorithm for the fluid physics is open source
    4. Next update will be focused on fluids, giving the ability to add multiple different fluid types with different properties. This will include fluid density and the possibility of fluids mixing.
    5. No multi-threading implemented (you might be surprised based on the performance), I am waiting till the 2018 LTS is released, and I will then implement the Job System. So right now the only problems you might face with WebGL is shader issues, I haven't tested the new lighting with WebGL, but there is a demo showcasing V1.0 of the engine here: https://activegamedev.com/TerrainEngine2D-Demo.html
     
  26. projectposeidon

    projectposeidon

    Joined:
    Mar 31, 2018
    Posts:
    24
    Currently it is not using the Job System. This is for the sake of keeping the engine compatible with Unity 2017. Once Unity 2018 LTS is released I plan to update the project to use as many of the new Unity features as I can!
     
    jovino likes this.
  27. ThoZ

    ThoZ

    Joined:
    Apr 21, 2013
    Posts:
    29
    Heyho,
    i just read the patchnotes for the new version:
    *This update introduces a whole new type of lighting to the advanced lighting system

    What is the different to the old lightning? Is there a way to see this new lightning in action? Thinking about purchasing it :)

    EDIT:
    Is it possible to not have lightning in "unexplored caves"? So you do not see where caves are until you explored them (fog of war kinda thing)
     
  28. madshkramer

    madshkramer

    Joined:
    Jan 15, 2018
    Posts:
    2
    Really good job on the whole project!
    I am curious towards knowing how easy it would be to implement various biomes in the same generation?
    For example having an ice biome randomly located in the world or something like that..
    Cheers!
     
  29. projectposeidon

    projectposeidon

    Joined:
    Mar 31, 2018
    Posts:
    24
    Thank you very much!
    Biomes aren't something I've ever tried to implement, but after doing some brainstorming I don't think it would be too hard..
     
  30. GreenPixel-ltd

    GreenPixel-ltd

    Joined:
    Jul 17, 2016
    Posts:
    17
    Hi
    I'm working on the strategy game with top down camera view (RimWorld or Prison Architect like) and I want to ask you is there any chance to add shadows from light like in RimWorld or Prison Architect

    Thank you
     
  31. GreenPixel-ltd

    GreenPixel-ltd

    Joined:
    Jul 17, 2016
    Posts:
    17
    And another question: I'm just curious - Why are there so many draw-calls/ batches(for about 130) in demo scenes if you are using only 4 texture atlases to draw the scene.

    And how could I reduce it since my game will be for Nintendo switch
     
  32. projectposeidon

    projectposeidon

    Joined:
    Mar 31, 2018
    Posts:
    24
    Hi Denis,
    I'm not familiar with how the lighting works in RimWorld/Prison Architect, but the lighting system in the asset does include Raycast Lighting which will generate shadows. If you are asking if I can add something to the engine in the future you will have to provide me with some more information as to exactly what you want.
     
  33. projectposeidon

    projectposeidon

    Joined:
    Mar 31, 2018
    Posts:
    24
    The engine requires many draw calls because you have to realize that every chunk has to render its own terrain and each chunk has multiple layers which each have their own mesh (and thus batch). Combined with the rendering of the fluid chunks and lighting, it can add up fast.

    There are many ways you can go about reducing the amount of draw calls. I'll list a few below:
    • Decrease the amount of layers you use
    • Increase the size of the chunks
    • Decrease the amount of chunks are loaded to screen
    • Decrease the amount of chunks that are visible to the camera
    • Use the Occlusion Culling setting
    • Disable lighting or use Basic Lighting
    • Disable fluid or render it as a single texture
    • Use a Sprite Packer/Texture Atlas
    The Nintendo Switch is a pretty powerful device, if you do a few of the things listed above you shouldn't have any problems with performance.
     
  34. GreenPixel-ltd

    GreenPixel-ltd

    Joined:
    Jul 17, 2016
    Posts:
    17
    Yep, I was looking for the option which I could use to setup the height of individual object to simulate sunlight (Just google those games and you will see).

    But it doesn't matter now, I decided to not use you plugin, plugin is fine and even more than I needed, but because of difficulties to adding new sprites, I mean I can't use individual sprite and than make unity sprite atlas from the folder with my sprites. Instead I have to make atlases by my self and use one for each layer.

    I apologize for the time you spent on me and wish you luck with your plugin it's really cool
     
  35. avvahnin

    avvahnin

    Joined:
    Apr 22, 2015
    Posts:
    1
    Hi Matt,
    I found something what look like bug. When I switch the "Basic lightning" option on World Inspector, this is turn off AmbientLight behavior on AmbientLighting object. But not Block Lighting behavior. Last one continue to work and rise a exception:


    Code (CSharp):
    1. NullReferenceException: Object reference not set to an instance of an object
    2. TerrainEngine2D.Lighting.BlockLighting.GenerateLighting () (at Assets/TerrainEngine2D/Assets/Scripts/Lighting/Advanced Lighting/Block Lighting/BlockLighting.cs:163)
    3. TerrainEngine2D.Lighting.BlockLighting.UpdateLight (Int32 x, Int32 y, Boolean lightSource) (at Assets/TerrainEngine2D/Assets/Scripts/Lighting/Advanced Lighting/Block Lighting/BlockLighting.cs:330)
    4. TerrainEngine2D.Lighting.BlockLighting.BlockRemoved (Int32 x, Int32 y, Byte layer, Byte blockType) (at Assets/TerrainEngine2D/Assets/Scripts/Lighting/Advanced Lighting/Block Lighting/BlockLighting.cs:458)
    5. TerrainEngine2D.World.RemoveBlock (Int32 x, Int32 y, Byte selectedLayer) (at Assets/TerrainEngine2D/Assets/Scripts/Terrain/World.cs:855)
    6. TerrainEngine2D.WorldModifier.RemoveBlock (Int32 x, Int32 y, System.Collections.Generic.List`1 layers, Int32 radius) (at Assets/TerrainEngine2D/Assets/Scripts/Tools/WorldModifier.cs:107)
    7. TerrainEngine2D.WorldInputHandler.Update () (at Assets/TerrainEngine2D/Assets/Scripts/Tools/WorldInputHandler.cs:157)

    When I turn off behaviors on BlockLighting and AmbientLighting objects all work without exceptions
     
  36. Zyblade

    Zyblade

    Joined:
    Jul 1, 2014
    Posts:
    141
    Hmm, the asset looks pretty good.
    Does the light raycasts only cast, when the light moves or a block changed in the immediate range? Or does it currently casting the whole time? Another question is, if I destroy a background block, can I add a feature, where the water will flow out, if behind the destroyed background block is only the sky layer? Because further down in the caves, there would be just "earth" behind the background block and the water won't flow out.

    Hm, same thing could be with light, coming from the background, if behind the destroyed block is the sky layer^^
    Just ideas.
     
  37. recon0303

    recon0303

    Joined:
    Apr 20, 2014
    Posts:
    1,634

    Hi, is this still in development? Thanks!
     
  38. projectposeidon

    projectposeidon

    Joined:
    Mar 31, 2018
    Posts:
    24
    Raycast lights can be either static or dynamic, if they are static then when they are placed they will raycast only once to determine the shape of the light, if they are dynamic then they will be casting the whole time. If you wish you can extend upon the class to create a raycast light with some sort of mix of the two like you described.

    I'll look into that fluid mechanic as a potential feature for the future, of course you can always add it in yourself if you wish to delve into the source code.

    Also the background lighting like you suggest is already possible.
     
    Zyblade likes this.
  39. projectposeidon

    projectposeidon

    Joined:
    Mar 31, 2018
    Posts:
    24
    Development has slowed since my return to school, but the asset is still very much in development.
     
    recon0303 likes this.
  40. recon0303

    recon0303

    Joined:
    Apr 20, 2014
    Posts:
    1,634
    Tyvm, and no problem, completely understandable. I was just curious as I run a smaller company, and we are either going to make our own tool like this or buy this or something like it, so I like to see the future of an asset from a developer I don't know . I slowed down on buying from devs I don't know so I figured to ask.

    Thanks a lot for this information.
     
  41. projectposeidon

    projectposeidon

    Joined:
    Mar 31, 2018
    Posts:
    24
    You're very welcome, good luck with your project!
    if you have any further questions feel free to join the discord server: https://discord.gg/PBphAvq
     
    recon0303 likes this.
  42. Shilo

    Shilo

    Joined:
    Jun 8, 2014
    Posts:
    20
    Why was this deprecated? It's depressing to see such a awesome asset, that was incomparable, to get deprecated. Would love to know the details. Best of luck to the developer! Thank you for your work.
     
  43. TeramonGame

    TeramonGame

    Joined:
    Oct 8, 2017
    Posts:
    21
    It looks like he got a job in the industry and had to sign a non-compete.

    It would bring in a new era of sandbox games if this asset went open source!