Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

✅ Tycoon Tile: The terrain solution for your Tycoon game!✅

Discussion in 'Assets and Asset Store' started by Vanamerax, Nov 5, 2019.

  1. Vanamerax

    Vanamerax

    Joined:
    Jan 12, 2012
    Posts:
    937
    Hi @discordbotstudio!

    If I understood your feature wish correctly, this is already possible and implemented with the included scripts. In the included demo scene (or the online web demo), you can select the smooth terrain editing mode in the terraformer tool to do this.


    By dragging the highlighted selection upwards, it will create a smooth terrain in neighbouring tiles:


    This tool uses the DecreaseHeightSmoothConnectedOperation and IncreaseHeightSmoothConnectedOperation operations to accomplish this.

    If you have any further questions, please let me know!
     
  2. discordbotstudio

    discordbotstudio

    Joined:
    Aug 2, 2020
    Posts:
    4
    Thanks for the quick reply. What I mean was similar to what you are showing, but when only selecting a single vertex on the "corner" of a tile.



    In this image you can see how the one vertex is raised, but the tiles around it do not recalculate their triangles to match, as if they are not sharing a common vertex in that corner.
     
  3. Vanamerax

    Vanamerax

    Joined:
    Jan 12, 2012
    Posts:
    937
    Ah I see. This should be easy to accomplish by making a new terrain operation or by modifying the standard one. The TileHandle and CornerIndex classes contain some helper functions to easily access neighbouring tiles and/or tile corners. If you need specific details I'd be happy to assist!
     
  4. Vanamerax

    Vanamerax

    Joined:
    Jan 12, 2012
    Posts:
    937
    Hi there!

    I have just released Tycoon Tile 1.3.1 on the asset store!

    This release fixes a problem that generated chunk colliders with 1 tile overlap on each side of the chunk.


    Also with this release comes the availability of the online documentation! There is also an API reference available.

    Enjoy using Tycoon Tile!
     
    Dev-4U likes this.
  5. glutexo

    glutexo

    Joined:
    Mar 23, 2018
    Posts:
    1
    Hi,
    I'm considering to use this asset.
    But I have a question. How complicated is it to add Tiles which support tunnels?
    And can I use your tile grid to easy implement a node based pathing algo?
    Thank you!
     
    AldeRoberge likes this.
  6. Vanamerax

    Vanamerax

    Joined:
    Jan 12, 2012
    Posts:
    937
    Hi Glutexo!

    The mesh generator is an isolated part of the package, which makes it easy to customize for your own needs. As long as you know which 'tile positions' and which side/direction of the tile requires a tunnel, you could simply skip generating triangles for that cliff or surface or generate a different mesh there. I don't expect you to run into specific problems here, but it depends on your specific requirements I guess.

    There is no explicit support for node based navigation built in, but using terrain operations makes it very easy to query the tile grid and 'navigate' through the grid by the tile neighbors and positions. I have also seen some customers integrating the Unity navmesh system with success, if that is what you are looking for. Again, this depends on your specific requirements and game rules, which is why there is no built in and standard solution for this within the product. Tycoon Tile does aim to provide an easy to use API surface which is also easy to extend, such that these features can be implemented as desired.

    I hope this helps! If you have any further questions, please let me know! :)
     
    AldeRoberge likes this.
  7. EricDaily

    EricDaily

    Joined:
    Dec 31, 2012
    Posts:
    16
    Does it support infinite, procedurally generated terrains at this time?
     
  8. Vanamerax

    Vanamerax

    Joined:
    Jan 12, 2012
    Posts:
    937
    Hi @EricDaily,

    Thank you for your interest in Tycoon Tile!

    At this time, Tycoon Tile does not support infinite dimensions within the same terrain object. You can however define quite large terrain objects and use multiple objects within the same scene. Working out cross-object modifications or placements however would require some extra effort to work correctly, but is certainly doable.

    The demo scene comes with a procedural terrain generator included. You can customize this generator to your desire.

    I hope this helps!
     
    EricDaily likes this.
  9. Vanamerax

    Vanamerax

    Joined:
    Jan 12, 2012
    Posts:
    937
  10. Elivard

    Elivard

    Joined:
    Apr 1, 2020
    Posts:
    10
    Hello Vanamerax!

    I have some question for you.
    Are you planning on making further update on this asset? And if the answer is yes do you have any idea when?

    Also one of the shader stops working on the new Unity versions. Do you have any idea why? (TerrainGridShader). There is no direct errors but it's rendering pink.

    Happy holiday season to you too!
     
  11. Vanamerax

    Vanamerax

    Joined:
    Jan 12, 2012
    Posts:
    937
    Hi Elibion!

    Thank you for your interest in Tycoon Tile!
    To answer your questions:

    Yes I do have updates planned. On the top of the roadmap is better in-editor support for saving/loading/viewing/modifying the terrain. Most of it has been implemented but I do not deem it production-ready enough yet for public release. I cannot tell you a release date on that unfortunately, as Tycoon Tile is a product that I run besides my full time job and development on Tycoon Tile is not fulltime. I do try my best to provide any support as requested, but I advise to purchase Tycoon Tile solely on the notion of the product being as-is at the moment of purchase.

    As for the shader, are you using a scriptable rendering pipeline by any chance? The sample shader only supports the builtin rendering pipeline at this moment. The grid shader only serves as an example, you can use any shader compatible for your rendering pipeline as you like. Refer to the tile type assets to change your shaders.

    Happy holiday season!
     
    Elivard likes this.
  12. Dev-4U

    Dev-4U

    Joined:
    Nov 2, 2021
    Posts:
    23
    Good to know you're still on it!
    I wanted to report a couple issues that I had when getting started with TycoonTile, but unfortunately emails to support@tycoontile.com don't go through. I keep getting automated responses that the email couldn't be delivered.

    A few issues with the current version 1.3.1 and Unity 2021.2.7. Missing URP support is a bummer, but you mentioned that already.

    The main issue is: the package is not built correctly. Unity says it's a "complete project" package (probably by right-clicking the "Assets" folder?) and importing it could cause issues, see below:

    Trying to import package:
    upload_2021-12-26_16-51-31.png

    After choosing "Import" option from above:
    upload_2021-12-26_16-51-47.png

    Choosing "Install/Upgrade" will install package dependencies such as Collections. However, it results in errors originating from com.unity.package-manager-ui which I did not even want to try and resolve, because the issue is with Package Manager's dependencies and that seems fishy when this happens in an internal package. Possibly the Package Manager UI package was downgraded as a result of importing the TycoonTile package.

    Choosing "Skip" will install the package without dependencies: Mathematics and Collections. Collections has to be installed by identifier "com.unity.collections" since it's still in preview. So that's annoying but fixable by adding those two packages.

    The alternative option to "Switch Project" unpacks TT into a new, temporary project. From there I could export the package and re-import the new package in my project. That then behaved the same as choosing the "Import => Skip" options above.

    Finally, in OperationResult.cs(27) the three uses of .Length need to be changed to .Count() and then you're set.

    In result I got it working (in legacy RP) but with a lot of friction. I hope this helps others in the meantime until an update with fixes to these issues gets published.
     
    AldeRoberge likes this.
  13. Vanamerax

    Vanamerax

    Joined:
    Jan 12, 2012
    Posts:
    937
    Hi deprecatedperson,

    Thank you for reporting the issues you are having. The support email not coming through is a new one for me, I will check with my hosting, thanks!

    The issues with the package manager are known problems. Installing Tycoon Tile will require going back and forth with the package manager for a bit. I haven't found a reliable way to always get it working on first import. Importing and exporting from a different project does work indeed (but is obviously not an import process I can facilitate from the asset store). It is a very unfortunate and unexpected behaviour of the package manager, but the issue does seem to happen because the version of the package manager is also saved with the project, effectively downgrading it on install. I don't think there is much I can do to prevent this as long as I intend to support the 2018 LTS version. Given that that LTS will soon reach end of life, I will increase the minimum version to 2019 once the 2021 LTS version drops, which should hopefully resolve the issue.

    The Length/Count() is also known, again an issue that I simply cannot provide a fix for. Unity has decided to remove one of the properties and rename it, but didn't bother to provide a precompiler directive that allows me to switch the usage based on the installed package version. Should also be resolved once I upgrade the minimum version to 2019 LTS...

    Again, thank you for reporting the issues on the Unity forums. I would've gladly fixed them if I had a way to do so, but Unity lets publishers in the dark with changes like these. Plan is to resolve the problems in 2019 LTS, since minimum package versions there should be more compatible.

    I'm sorry that you had to endure the rough import process, but I am glad you found a way to get it imported. Enjoy using Tycoon Tile!
     
  14. Vanamerax

    Vanamerax

    Joined:
    Jan 12, 2012
    Posts:
    937
    Hi Everyone,

    I have pushed an update to Tycoon Tile that should improve the importing procedure. The minimum Unity Editor version will be 2019.4 LTS from this point on.

    Let me know if anyone still experiences problems importing Tycoon Tile into their projects!
     
    AldeRoberge likes this.
  15. GoldenSkullArt

    GoldenSkullArt

    Joined:
    Aug 14, 2013
    Posts:
    49
    Hello,

    I have purchased your solution today and am starting to look into it and evaluate it for my project.
    One of the biggest issues I have is that I wish to see the terrain in pause-mode and in editor as well, is there any way this can be easily accomplished? I find it a bit of a bummer to only be able to see the terrain during play-mode. This makes iterating and a couple of other things a bit of a nightmare.

    Also: do you have discord or easier ways of communication about the tool?
    I am aware you are working on this on the side, I have full sympathy for that and can relate, but maybe you are interested in potential deeper communication/support on this.

    All the best.
     
    Last edited: Mar 4, 2022
  16. Vanamerax

    Vanamerax

    Joined:
    Jan 12, 2012
    Posts:
    937
    Hi @MaxHeyderArt-GoldenSkull,

    First of all thank you for purchasing Tycoon Tile!

    Indeed, Tycoon Tile does currently not support viewing the terrain during edit time. While there has been work done to get editor support functional as an upcoming release, progress has been mostly halted due to personal circumstances. I do not have an estimate on when I can devote more time to the project yet. I can however provide you with the current state of that feature branch if you would like. It is still work in progress, functional, but not as bug free as I would like (hence not released yet). It should provide you with a great starting point however. Let me know if this is of interest to you.

    I do not have discord, that is correct. I would prefer to keep communication on the Unity forums either in this thread, or you are welcome to DM me if there are any specific non-public details that you would like to discuss.

    Hope this helps!
     
    GoldenSkullArt likes this.
  17. polimerjones

    polimerjones

    Joined:
    Jun 11, 2018
    Posts:
    5
    The multi tile buildings dont check for level ground in all cases. Also. Tried to leave code as-is and swap out the house for a different prefab and the preview spawns/displays 10 or so tiles to the right for some reason.
    upload_2022-3-13_20-39-18.png
     
  18. Vanamerax

    Vanamerax

    Joined:
    Jan 12, 2012
    Posts:
    937
    Hi Polimerjones,

    Is your own prefab zero'd on the transform? It may help to create a root transform for your object and scale all visible meshes accordingly under that root node.
    In the default setup, the overlay on the terrain is what is being registered as the occupying terrain tiles, which is also the area that is checked for being level. Make sure the width and length are configured properly in the Constructable asset such that the area to check is well-defined.

    Hope this helps!
     
  19. T_dev

    T_dev

    Joined:
    Nov 13, 2019
    Posts:
    4
    Hi, Vanamerax.
    Once again I need your help.

    I'm looking for a way to change the material for each water source.
    (example, creating independent blue sea and muddy swamp water sources.)
    Since these water sources seem to be batch rendered by the Terrain tile renderer, it may be complicated to achieve what I want to do.
    If you have any good ideas or tips, please let me know.
     
  20. Vanamerax

    Vanamerax

    Joined:
    Jan 12, 2012
    Posts:
    937
    Hi @T_dev ,

    Having different materials for each water source is not supported by Tycoon Tile out of the box, however I understand your usecase.

    What you would need to do is modify the TerrainRenderer component and the water surface generation jobs it uses to account for different water materials. Probably needs some form of floodfill searching to 'match' different water tiles as a single body. There are some jobs which use this technique to 'remove the whole water body at once' included. When you click on a flat bottom of a water body it removes the entire body for example. You would also need to keep track of which water body uses which material somehow. And what happens when you 'connect' two different water bodies by lowering the terrain edge between them? These are things you probably have to account for.

    Hope this helps!

    Vanamerax
     
  21. AldeRoberge

    AldeRoberge

    Joined:
    Jun 23, 2017
    Posts:
    48
    Hello! Really cool asset. Just a few questions :

    Is there any plan for Tile Texture Blending?
    Is there any plan CTRL + Z support?

    Does the system automatically generate a Collider for the terrain?
     
  22. AldeRoberge

    AldeRoberge

    Joined:
    Jun 23, 2017
    Posts:
    48
    One more thing I would need from this asset, is the ability to change the 'visible width' of the top face.
    How hard would it be to do?

    upload_2022-5-27_14-24-6.png
     
  23. Elivard

    Elivard

    Joined:
    Apr 1, 2020
    Posts:
    10

    Tile texture blending would be awesome!
     
    AldeRoberge likes this.
  24. Vanamerax

    Vanamerax

    Joined:
    Jan 12, 2012
    Posts:
    937
    The included materials do currently not support tile texture blending. However, you can customize the renderer to your liking and use any material you wish. Certainly possible!

    There is no CTRL + Z support currently, no. Changes are handled in a centralised place though, so you could get this to work with some modifications. I will add it to the wishlist.

    The terrain does automatically generate colliders for the terrain, yes.

    I will also add it to the wishlist then :)
     
    Elivard likes this.
  25. Vanamerax

    Vanamerax

    Joined:
    Jan 12, 2012
    Posts:
    937
    You can use any material you would like to use for the surface and for the cliff meshes separately. In this case, you would need to have a shader where you can define some rendered width bases on vertex attributes. Then you would have to set these attributes on the cliff mesh vertices in the terrain renderer code, based on distance from top of the tile.

    Example: You set the uv1 attribute (or any other) of the two top vertices to 0 and set it to 'the distance from the top' for the bottom vertices. Then you interpolate between these values with a cutoff to either render the 'top edge' or the 'cliff texture' in your pixel shader.

    You could even use the uv0 attributes which already get mapped by the renderer to make an approximation, but then your 'edge width' would not be a fixed width but dependent on the height of the cliff face (it will stretch)
     
  26. AldeRoberge

    AldeRoberge

    Joined:
    Jun 23, 2017
    Posts:
    48
    Is the wishlist (project roadmap) public? I'd like to see what's on the schedule!

    I know you have mentioned that we should have no expectation, so I will say this under reserve, but if you can develop the top texture height width feature I'm willing to pay twice as much for this asset.
     
  27. AldeRoberge

    AldeRoberge

    Joined:
    Jun 23, 2017
    Posts:
    48
    Is it possible to not render tiles below a certain threshold?

    upload_2022-5-31_21-2-24.png

    I want to not render tiles below the water level (0). Is it possible to skip rendering tiles below a certain height level? Right now the tiles under the water are rendered, making a square. I do not want those tiles to be rendered, as I want a circular world.
     
    Last edited: Jun 2, 2022
  28. Vanamerax

    Vanamerax

    Joined:
    Jan 12, 2012
    Posts:
    937
    The wishlist/roadmap is not public, no. It is my internal wishlist/roadmap. I don't want to create any expectations for future development as I can not reserve to time to spent on further development at this moment. Although I would love to do so in the future.

    Buyers should decide on their purchase based on the current state of the product, which in my honest opinion is still a very good deal. Support will be provided within the scope of the asset as anyone could reasonably expect.
     
  29. Vanamerax

    Vanamerax

    Joined:
    Jan 12, 2012
    Posts:
    937
    You can modify/inherit from the TycoonTileRenderer component and use your own job implementation to customize the way the terrain is rendered. Rendering is decoupled from the other logic in Tycoon Tile. Easiest would be to either change the included implementation of the rendering jobs or copy the implementations and start from there.

    You basically skip rendering tiles based on their x/z position (for example using a formula based on distance from center, resulting in a circle) or you check the water heights and use that as a mask for your positions in the job.
     
  30. roh032

    roh032

    Joined:
    Sep 6, 2014
    Posts:
    3
    Hello, if i may, i would like to use edit terrain during editor mode. So, can you please send me mentioned branch also?
    Thank you.
     
  31. Vanamerax

    Vanamerax

    Joined:
    Jan 12, 2012
    Posts:
    937
    I have sent you a message
     
  32. Elivard

    Elivard

    Joined:
    Apr 1, 2020
    Posts:
    10
    Any idea on how to make edge of different ground material blend together :) ?
     
    AldeRoberge likes this.
  33. Vanamerax

    Vanamerax

    Joined:
    Jan 12, 2012
    Posts:
    937
    There are multiple methods to do this. You may use a fixed number of textures to blend between (usually 4 or 8) and use that for most tiles. If you have more tile types, you could split the terrain mesh in multiple meshes that use different materials to blend between. Alternatively you could use a texture array and blend between any textures.

    Blending will either way be determined by 'weight' values as attributes on the vertices. Using a uv1 or similar would probably be the most convenient. You would have to implement a custom terrain renderer component that sets these vertex attributes appropriately. The vertices on the edge would essentially be a 50/50 weight between texture A and neighbouring texture B. The center vertex could then be assigned a 100% weight of its own texture.

    Hope this helps!
     
    Elivard likes this.
  34. AldeRoberge

    AldeRoberge

    Joined:
    Jun 23, 2017
    Posts:
    48
    Would it be possible to add this as a built in functionality? I think a lot of people would benefit from this feature.
     
  35. Vanamerax

    Vanamerax

    Joined:
    Jan 12, 2012
    Posts:
    937
    That would certainly be possible, but unfortunately I currently do not have the time available to implement this feature as built-in functionality. Maybe in the future though, who knows :)
     
  36. silentrob79

    silentrob79

    Joined:
    Oct 7, 2021
    Posts:
    3
    First, let me say this is such a wonderful resource and saved me hours and hours of work. Thank you! It is exactly what I was looking for.

    So here is my use case. When you modify the edge of water I would like to re-flood the modified tile, or drain the pond if it spills out into the unknown.

    My thought was to attach a callback to the map bounds, and check to see if it is the edited tile is on or next to water but I don't believe the callback returns the tile directly. Is this the right approach or is there a better way?

    Ill keep poking with it, thanks again and happy holidays.
    Rob
     
  37. Vanamerax

    Vanamerax

    Joined:
    Jan 12, 2012
    Posts:
    937
    Hi Rob,

    Thank you for purchasing Tycoon Tile and glad to hear you enjoy using the asset!

    The WaterTool class contains some logic to fire the CreateWaterBodyFloodOperation and/or ClearWaterBodyOperation operations that modify these water levels. You could use this as an example for how to scan your tiles. I would suggest the best approach would be to create your own version (copy/paste) of these operations and then modify your copy to your requirements. For example, if you reach the map bounds while scanning for the tiles that would be 'part of your water body', you know you can clear all these tiles at that point. Then it is only a matter of scheduling your operation when you modify tiles in your terraforming tool.

    The reason I consider this a better approach than using the callbacks, is that you can process the tiles 'in bulk' with a single operation. The meshes of your chunks will then only be recalculated once. Using callbacks would probably result in many smaller tile modifications that could also cause the chunks to recalculate their meshes multiple times, reducing performance. The callbacks are intended to be used to alert objects/behaviour outside of the Tycoon Tile context of any changes to the terrain. In the demo scene included, this is used to reposition the trees to the terrain surface when you modify the tile that the tree is 'attached' to, for example.

    Hope this helps and happy holidays as well!
     
  38. silentrob79

    silentrob79

    Joined:
    Oct 7, 2021
    Posts:
    3
    Wonderful. I was heading down this track modifying CreateWaterBodyFloodOperation to create a new "pond" resource with size, volume, inflows/outflows etc for a prototype, but was hung up on how to fire the operation. I'm pretty sure Im on the right track now, and just need to change / copy / piggy back off the terrain modification tool for firing the check to re-checking the water edge.

    Thanks for clarifying the callbacks.

    I suspect you have put this project in maintenance / support mode, but I would also be keen to test / help with your dev branch if such a thing exists.
     
  39. Vanamerax

    Vanamerax

    Joined:
    Jan 12, 2012
    Posts:
    937
    Sounds like you know what you're doing, glad to hear it! :)

    At the moment I am indeed in 'support mode' for Tycoon Tile due to personal circumstances (big house renovation taking up all my time at the moment). Although I wouldn't rule out new developments in the future as well (no promises though).
    I do have a dev build of Tycoon Tile that is focused on better editor-time integration instead of only runtime generation support, but that requires more testing before release which I haven't gotten around to. Can send you the build if you're interested. I won't actively provide support on that build, but having a tester would certainly be helpful.
     
  40. silentrob79

    silentrob79

    Joined:
    Oct 7, 2021
    Posts:
    3
    Absolutely. Having the ability to generate the terrain in edit mode is top of my wish list and since this is just a hobby project I'm not worried about bumping up against any bugs, and happy to help push any fixes upstream should I hit them.

    Let me know if you need an email. My github username is silentrob.

    Cheers
     
  41. Vanamerax

    Vanamerax

    Joined:
    Jan 12, 2012
    Posts:
    937
    I sent you a PM :)
     
  42. Pollyfun

    Pollyfun

    Joined:
    Nov 6, 2009
    Posts:
    13
    I recently purchased this asset, and it works pretty much like I expected. I've modded some of the code and created a handful of maps to be used in my game.

    Now for the next step, I want to add units/characters that move on top of the terrain.
    Is the Unity terrain system (with physics and collisions) used, or how would I go about this?

    I need to spawn a unit, then click somewhere and make it move there in a straight line, but following
    the hills up-and-down.

    thanks
     
  43. Vanamerax

    Vanamerax

    Joined:
    Jan 12, 2012
    Posts:
    937
    Hi Pollyfun,

    By default TycoonTile uses Unity's mesh colliders to provide physics collision functionality when the TycoonTileCollider component is attached to the same object as the TycoonTileMap component. This would work with your standard character controllers etc.

    An alternative would be to sample the terrain yourself. By retrieving a TileHandle instance by scheduling a TerrainOperation. Within the operation you can then use helper methods on the TileHandle class to transform positions between world spaces and also sample the terrain height.
    Additionally, there are some helper methods on the TycoonTileMap component itself such as MapToWorldPosition that allows you to transform a 'local' map position to a scene/world position.

    Hope this helps!
     
  44. Pollyfun

    Pollyfun

    Joined:
    Nov 6, 2009
    Posts:
    13
    I got it working when using Rigid Body, gravity and RigidBody.MovePosition().
    Thanks for the feedback.
     
    Vanamerax likes this.
  45. Vanamerax

    Vanamerax

    Joined:
    Jan 12, 2012
    Posts:
    937
    Great to hear you got a solution!
     
  46. CommandoSwat

    CommandoSwat

    Joined:
    Aug 16, 2021
    Posts:
    1
    Hi there, I know this was a while back but I was wondering if your offer still stands on receiving the latest development build without support? I can send you the necessary info to verify my asset store purchase.

    I'm specifically looking for the ability to edit tiles in the Unity scene view (i.e. "better in-editor support for saving/loading/viewing/modifying the terrain")

    Keep up the great work! Hope the housing renovation is going well!
     
  47. Vanamerax

    Vanamerax

    Joined:
    Jan 12, 2012
    Posts:
    937
    Hi there! Of course, if you can send me the invoice no. via PM I can send you the development/WIP version. Use as-is and 'at your own risk' etc.

    Thank you! We're getting there! :)