Search Unity

✅ 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:
    916
    Are you an aspiring game developer creating their own tycoon game?
    Then look no further!
    Tycoon Tile is the terrain solution for all your tycoon needs!
    Create a classic tycoon game instantly with Tycoon Tile.
    Suitable for city builders, theme park tycoon games, transport games etc.
    Can be used with a 3D perspective camera or use an orthographic view for your isometric games.​




    What is Tycoon Tile?
    Tycoon Tile is a tile based terrain asset that allows you to create tycoon and city builder games quickly. It can be used in perspective or isometric camera view. Supports intuitive terraforming tools that recreate the classic tycoon game terrain mechanics. Adjust tile height per corner, create rolling hills or steep cliffs. Paint terrain with up to 65536 unique materials. Create water bodies with the click of a button.



    Features:
    • High performance jobified code, compatible with the unity job system
    • Low memory footprint
    • Easily extendible with custom operations
    • Ready to use out of the box
    • Water support included
    • Tested for terrain up to 2048x2048
    • Supports up to 65536 unique materials
    • Includes example runtime terrain generator
    • Includes example user interface & terraforming tools
    • Create custom terrain operations to adapt to your game's needs.



     
    Last edited: Nov 5, 2019
    mrCharli3, RobbyZ and digiross like this.
  2. Vanamerax

    Vanamerax

    Joined:
    Jan 12, 2012
    Posts:
    916
    Hey everyone!

    I updated the store page with new screenshot and images.

    I would also like to point out that with the version that is on the asset store right now, the focus of this release was on the terrain itself: easy terraforming and painting terrain textures while also adding support for water bodies. This will provide a solid foundation for the further expansion of Tycoon Tile.

    I am planning on adding more features and improvements. While I cannot guarantee or promise anything in the near- or long-term (and thus any purchases should not rely on these plans), I would still like to share a roadmap with some of the features I want to add to later versions of Tycoon Tile:
    • Callbacks for terrain attached GameObjects. A perfect example for this would be trees, rocks and bushes that can update their vertical position when tiles are modified, or objects that get destroyed on terrain modification.
    • Locking and unlocking tile heights in position. This will be useful for the next feature in the list.
    • Support for terrain-attached structures and buildings. Included operations for checking terrain clearance such that multi-tile structures can be placed as well as restricting terrain modification around buildings.
    • Cost calculations and preview of terrain modifcations (when terraforming should cost $ in your game).
    • Advanced object placements. Think tile edge snapping, corner snapping, offsetting etc.
    • Road integration. Think paths and roads similar to Rollercoaster Tycoon or Transport Tycoon.
    • Support for custom cliff edge decorations. These can include grass blades at the bottom of cliffs or surface overhangs at the top.
    • Collider-less raytracing. Remove the need for mesh colliders to raytrace the terrain, which is required for terrain tools etc.
    • Custom water shader with water depth and foam rendering.
    • More optimizations and improvements.

    In short, the goal of Tycoon Tile is to provide an out-of-the-box tycoon game experience to headstart your game development workflow.

    Please let me know what you think and what features you deem important to you! If you have any other feature suggestions or ideas, feel free to discuss them in this thread!
     
    digiross likes this.
  3. Vanamerax

    Vanamerax

    Joined:
    Jan 12, 2012
    Posts:
    916
    I just released version 1.0.1 which should fix some issues regarding the Unity job system in newer ECS package versions. If you are still experiencing any problems after this patch, please let me know!
     
    aFeesh likes this.
  4. StrogaBeef

    StrogaBeef

    Joined:
    Mar 1, 2017
    Posts:
    6
    Yo super nice package! nice that it uses the job system to :)
    I have some questions before I buy:
    Can one supply it's own tiles? Is the system built out of tiles or is it generating the geometry?
    I'm intending to build my own tiles,
    perhaps even quite detailed ones, do you think that it's possible with this system?
     
  5. Vanamerax

    Vanamerax

    Joined:
    Jan 12, 2012
    Posts:
    916
    Thank you!

    Can you elaborate on what you mean by 'supply my own tiles'? Do you mean inserting your own mesh geometry?

    Tycoon Tile generates the mesh geometry based on the height data of each tile corner. You can adjust the step height of these corners (eg. How many real world units each step differs) and specify your own textures.

    I suppose I could add a feature to 'skip' geometry generation for specific tiles if that is what you're asking. I'm interested to hear what your usecase is!
     
  6. StrogaBeef

    StrogaBeef

    Joined:
    Mar 1, 2017
    Posts:
    6
    I'm making an RTS (really just started on a server) to make things easy I want to have a tile base for the world so that I can say that on tile x22 and y55 there is grassland. I browsed around and found this system and it looks like a real gem!

    One way to make it easy for an artist to define what grassland means is to make a 3D tile(mesh geometry) for grassland, I think cliffs would especially benefit from this.
    Grass, cliffs etc could also be done with a shader that has surface displacement and scattering of objects on top, maybe this would be easier.

    what would you recommend if one wanted to make a Age of Empires style tile based game?
     
  7. Vanamerax

    Vanamerax

    Joined:
    Jan 12, 2012
    Posts:
    916
    @StrogaBeef I see.

    So custom tile types are supported in Tycoon Tile, you can use a custom material for each tile type surface and tile type cliff.

    For other decorations such as grass blades, scattered rocks and the like, you can implement an IChunkListener interface and register it to Tycoon Tile. That will allow you to receive a callback whenever a part of the terrain geometry updates, so you can instantiate objects or kick off your own geometry generation logic/jobs.

    Combining these two techniques allows you to do a lot of interesting visuals. I think that should suffice for your use case?

    Sounds like an interesting project btw!
     
  8. StrogaBeef

    StrogaBeef

    Joined:
    Mar 1, 2017
    Posts:
    6
    Hello again, so now I have experimented some and read the documentation, There are two things that I feel is missing:

    Some kind of save functionality like save terrain to json or xml
    Shadows on the terrain

    Another thing that would be useful would be if this whole thing ran in the editor as well, so one could edit the
    "start terrain" in edit mode before runtime. I understand if this would be a tall order though, if there was a save function one could edit in runtime and save it down as well.

    I will definitely use the IChunkListener that's neat man.
     
  9. Vanamerax

    Vanamerax

    Joined:
    Jan 12, 2012
    Posts:
    916
    @StrogaBeef

    Shadows can be enabled with the ReceiveShadows boolean and ShadowCastingMode dropdown on the TycoonTileRenderer component.

    Saving and editor functionality are indeed valid points, which is why they dominate the top of my todo list. I know that these features are important for many usecases, so this is definitely something I want to implement in the future.

    For now, you could serialize the data yourself if you want, all data is neatly packaged into a few arrays. Namely the TerrainGrid and TerrainTypeTable classes. Together with the terrain size, reconstructing the terrain from these arrays should be relatively straightforward.
     
  10. StrogaBeef

    StrogaBeef

    Joined:
    Mar 1, 2017
    Posts:
    6
    Nice with the shadows, it was just me that was blind, sorry.
    I'm writing save load functionality and when I wrote the save I saved dwon all tiles with the respective slopes and water height just like I saw them in the TerrainGrid and LandTile NativeArray.
    But when I came to implement loading the map I notice that you have a job called CopyHeightMapOperation to feed the terrain its heights. Before I write a new job that feeds it with slope data/gets hight instead, I would like to check if I have understood the system correct. Is there already is a job for getting the terrain data in single heights? or a way to feed it corner\slope data?
    I feel like translating the slopes back into heights would be the best approach right?
     
  11. Vanamerax

    Vanamerax

    Joined:
    Jan 12, 2012
    Posts:
    916
    No problem, glad it works for you :)

    I'm not sure whether I understand your question exactly, but there is a CopyHeightMapOperation that copies a nativeArray of bytes to the terrain grid. Note that this will not preserve any cliffs. I would therefore suggest to simply initialize the internal arrays yourself in an overloaded constructor during the initialization instead of doing it with terrain operations. That way you extract the terraingrid corner heights on terrain save, and load the corner height back into the arrays on terrain load.
     
  12. StrogaBeef

    StrogaBeef

    Joined:
    Mar 1, 2017
    Posts:
    6
    Got save load working. I made jobs for it in the end, so one can sit and edit the map and save\load the result.
    Now I have another probably disturbing question hehe
    How can I change the size of the tiles?
     

    Attached Files:

  13. Vanamerax

    Vanamerax

    Joined:
    Jan 12, 2012
    Posts:
    916
    Looking good! I like your water shader! :)

    Here is me hoping that changing the scale of the TycoonTileMap's gameobject will work fine. If you encounter any issues with this (tools not taking scaling into account etc.), then please let me know and I will fix such problems. It should basically just workTM.
     
    Last edited: Mar 26, 2020
  14. RaptorRaptures

    RaptorRaptures

    Joined:
    Mar 5, 2014
    Posts:
    9
    Just wanting to see how the progress on the updates are going? Read that you were working on some really cool features for this and would like to see if you have progressed at all, which is the reason I bought this to support you?
     
  15. Vanamerax

    Vanamerax

    Joined:
    Jan 12, 2012
    Posts:
    916
    Hi RaptorRaptures!

    First of all, thank you for your purchase! I am currently in the process of fixing a few odd behaviours in the example water tool that is included in the package. After that I will submit a new version to the asset store that will have builtin support for serialization and deserialization of all the terrain data based on the .net BinaryReader/BinaryWriter API. This was the feature that got most requested through my support email or other channels, so that is what got the highest priority now.

    I will post here when the package is approved by the asset store team.

    EDIT:
    I would like to add: Although I greatly appreciate people buying the asset for the future potential and to support the development of the asset (I really do), please consider the product as-is at the moment of purchase and whether that is worth it for you (I think it is, if you are looking for this type of product). The reason I say this is that, quite frankly, further development of the asset is totally dependent on the feasibility of development time with respect to the sales volume. That is not something that is completely within my control. I want to prevent anyone being unsatisfied with their purchase because of their expectation that the product will develop over time. I would love to develop it further, but I cant make any promises on it. I just want that to be clear and transparent with that :). So please purchase solely for the state of the product at the moment of purchase. Of course, I will always provide support for questions and the like while the product is sold on the store.
     
    Last edited: Apr 5, 2020
  16. RaptorRaptures

    RaptorRaptures

    Joined:
    Mar 5, 2014
    Posts:
    9
    Thank you very much. That is the part I am wanting the most so cant wait :D.

    Thank you for this asset though, its really great and is meeting every expectation that I had when buying it.
     
  17. Vanamerax

    Vanamerax

    Joined:
    Jan 12, 2012
    Posts:
    916
    That is great to hear, thank you! :)

    I just submitted a new version for review to the asset store. I will post here when it has been approved.
     
  18. gato0429

    gato0429

    Joined:
    Mar 5, 2015
    Posts:
    12
    Hello, I am interested in the asset, but I have some questions,
    This generation of the terrain, is based on a mesh, or based on a terrain component, it is possible to create my own tile rules to paint each quadrant.
    Thank you
     
  19. gato0429

    gato0429

    Joined:
    Mar 5, 2015
    Posts:
    12
    Hello again, I have been testing a bit with the documentation and the code, but I see that I cannot rotate a tile by surface, would this be possible, is there any method? Another question, is there the possibility of obtaining the type of Terrain type that it is used by tile. I want to make rules based tiles. to generate paths on the terrain surface and further stylize the terrain.
     
  20. Vanamerax

    Vanamerax

    Joined:
    Jan 12, 2012
    Posts:
    916
    The generation is based on a standard unity Mesh, not the unity terrain. This gives full control over the output and visual look of the mesh.


    I am not entirely sure what you mean. Do you want to 'rotate a tile' in the following way:
    Say you have a tile that is slanted upwards towards the north and you 'rotate it to the right', the slant now faces eastwards? You can create a terrain operation that operates on a single tile position and swaps the corner heights. You can do this fairly easily with the builtin corner and cardinal direction helper classes/methods.

    Yes this is supported. If you create a terrain operation you can read from the terrain type table.
     
  21. gato0429

    gato0429

    Joined:
    Mar 5, 2015
    Posts:
    12
    Hello, thanks for the answers and I was able to get the type of terrain. And explaining a little more what I want to achieve with my previous question about rotating the tile, I mean the image that is drawn in each quadrant.
    In the image I attach as an example, it is a single tile, which was rotated on the "Y" axis, by 90 °.
    That is what I want to achieve with each tile.
    upload_2020-5-14_13-41-58.png
    As another question, it is possible to have a single material, for the surface of the tile, and that it has all the textures, which will be used for painting, (UV mapping).

    The above about UV mapping, I can fix it. IF there is some function that allows me to send the mesh positions uv, this in order to indicate what positions the texture of the general material should take.

    Because for my game I will have multiple biomes made up of several tiles, and creating a material for each type of tile is very expensive.

    regards
     

    Attached Files:

  22. Vanamerax

    Vanamerax

    Joined:
    Jan 12, 2012
    Posts:
    916
    I see what you mean.

    All the UVs are generated in the Scripts/Core/Rendering/RenderTerrainSurfaceChunkJob class. Specifically the GenerateTopFace() method. The implementation generates a uv mapping that always points in the same direction. The thing you want to do is rather specific and not included by default, but it should be rather straightforward to change the mesh generation code to do what you want. You can modify the RenderTerrainSurfaceChunkJob code to 'rotate' the uv coordinates for each top face. I would suggest exposing a native array on the job that indicates the uvs for each rotation for each tile corner. Then you will probably need a second native array to indicate each tile's rotation. For example, using an int for each tile rotation allows you to use that integer value as an index into your uv array.

    The job is scheduled in the Scripts/Components/TycoonTileRenderer.ScheduledMeshJobPair struct. You can fill your uv mapping and tile rotation arrays there. You are probably bookkeeping the tile rotations somewhere, but you have acces to the TycoonTileMap component during the job scheduling.

    As for using a texture array instead of multiple submeshes with their own material, you can use the same job to generate other uv/vertex data if you add more native arrays to the job. Results from the job are applied in the TycoonTileRenderer's RenderMesh() method, which gives you acces to your jobs and the different meshes relevant to a given chunk. So you can set your surface mesh uv2 data or something along those lines to keep track of your texture array index. You will need a custom shader for indexing into a texture array though.

    Hope that helps!
     
  23. McBrideMusings

    McBrideMusings

    Joined:
    Apr 8, 2014
    Posts:
    3
    Hi Vanamerax! Thank you for producing such a high quality asset! I recently bought it and I'm in the process of integrating it into my project, and I wanted to ask about the status of some of these items on your roadmap. I'm particularly interested in the first 3 items related to GameObject callbacks and structures attached. If work on this asset has slowed down as well, I'd appreciate the context and perhaps some suggestions about how you planned on implementing those features.

    Second I wanted to know if you had any additional tips or documentation about how the terrain is generated under the hood. I'm looking at the TestTerrains class and the provided PDF documentation, and it's unclear exactly how I might go about either generating terrain from noise. I have noise generators, but it looks like your height is generated and stored as a byte array. Could you provide some details as to how to fill that array? I'm admittedly not very familiar with working with bytes and it's hard to tell where the data is being generated in the ExampleTerrain method.
     
  24. Vanamerax

    Vanamerax

    Joined:
    Jan 12, 2012
    Posts:
    916
    Hi @McBrideMusings !

    First of all, thank you for purchasing Tycoon Tile! I am delighted to hear that you like the asset :)

    This feature is indeed still work in progress. I have been experimenting with how to tackle this such that it works out of the box for most use cases, while also providing enough flexibility for extension for the more exotic situations. I must admit that development has not been as quick as I would have liked, but this has been a result of the lower sales volume than I had hoped for this asset. I am currently evaluating ways to increase financial feasability of continued development for Tycoon Tile. Either way, the feature you mentioned is currently at the top of my todo list :)

    Of course. So the way the terrain mesh is generated, is based on the values of the byte array and the components configured maximum height and stel height values. The value in the byte array indicates the number of steps the height will be at a given tile corner. So a byte value of 10 will be 10 height steps. When the stepheight is 1 (the default), this equals to a height of 10 units (meters in unity). For a stepheight of 0.5, this means a height of 5 meters. The maximum height of 20 means that the height will be clamped to 20 steps above 0.

    Note that because the heights are stored as a byte, there is an implicit maximum of 255 steps. This is a tradeoff between memory usage and flexibility. Since I deemed 255 height levels to be sufficient for most use cases, I decided to store these as a byte in order to reduce the memory footprint. If you or anyone has a usecase in which 255 height levels does not suffice, I would love to know about your use case :)

    Off the top of my head, the example terrains show a method of generating terrains using unitys builtin perlin noise functions. These values are generated as floats at first. Then they are converted to a byte range of values and applied to the terrain. If you are still struggling to digest the example scripts with this explanation, I can provide you with some more examples later if you would like.;)

    Hope this helps!
     
    Last edited: Jun 24, 2020
  25. McBrideMusings

    McBrideMusings

    Joined:
    Apr 8, 2014
    Posts:
    3
    Thanks! That's very useful to know. I understand the sales concern. One of the reasons this asset drew me in though, if it helps, was it's focus on a grid as opposed to the standard Unity terrain. The project I'm working on is closer to Animal Crossing actually, but I want object placement and terrain height to be more tightly controlled and this asset is amazingly performant (thank you Jobs and Burst compiler).

    That's also the reason I'm interested in GameObject features as well. That's not a part of the the examples though. I see there's a LandTile struct, and I'm guessing ExecuteTileJobOperation will perform a Job on each tile. I also see there's a WorldToTilePosition method, might there be a TileToWorldPosition method to get a valid point to place GameObject at?

    To the generation question, I see what you mean now I was confused because ExampleTerrain in TestTerrains appeared to always generate the same map so I thought it was hardcoded somewhere. I see now TerrainGenerationJob has a generate height method that must be operating off of the same seed each time. That helps a lot!
     
  26. Vanamerax

    Vanamerax

    Joined:
    Jan 12, 2012
    Posts:
    916
    Thank you for understanding! I hope to be able to focus more on developing this asset in the future :). It is interesting that you mention the selling point for you, since I found the same problem when I was looking for a Tycoon Tile-like solution myself and happened to find only unity terrain based solutions. So the focus for Tycoon Tile in particular was to more strictly define the geometry and game rules that emulate the classic tycoon games more closely

    Yes I totally understand. I expected this to be the most pressing issue of Tycoon Tile for integration into a game, therefore this is on the top of the todo list as I mentioned :). I will see if I can add a TileToWorldPosition in method in the very short term. That shouldn't have been missing!

    That is exactly it! The standard example terrains are generated with perlin noise using a hardcoded 'seed' (in this case the final formula uses some hardcoded offsets, scales and number of octaves).

    At the moment I dont have access to the code base, but I will try to push some changes according to your suggestions! Customer insights like these are always very helpful, thank you :)
     
  27. McBrideMusings

    McBrideMusings

    Joined:
    Apr 8, 2014
    Posts:
    3
    Thank you for the response! I actually sent you an email as well asking for more information regarding the updates, but one other thing came to mind is reference attached GameObject Neighbors on the grid.

    Each Tile/LandTile presumably has 8 neighboring tiles, it would be useful to be able to query adjacent tiles for either specific objects, empty tiles, or just get all 8 neighbors and iterate over each. I'm thinking about the weed propagation in Animal Crossing, weed objects can potentially spawn new weeds in adjacent tiles. To make a similar system, iterating over adjacent tiles would be useful either to find valid empty tiles or picking 1 tiles from that valid set. Similar problem when moving decorations, if they move they can only move to adjacent cardinal empty tiles. I imagine in Tycoon games there are similar use cases, like potentially a pollution system in a city builder where pollution spreads from either a central source or existing clouds.

    I could probably do it myself assuming I could query a LandTile/Tile for attached GameObjects and if I knew the X/Y index of the starting tile, but it would be a helpful utility method.

    Thanks again! I assume support@tycoontile.com was the right address to email?
     
  28. Vanamerax

    Vanamerax

    Joined:
    Jan 12, 2012
    Posts:
    916
    Ahh, after you mention this I found out your mail landed in my spam folder for some reason. I will respond to your mail ASAP.

    As for your other question regarding tile neighbours, yes there are helper functions for this. You will especially want to use the TileHandle class this, as its purpose is to be a user friendly 'index' into the terrain. Using the TileHandle for a specific tile position, you can get a new TileHandle instance to reference a position relative to you current handle. Also take a look at the CardinalDirection struct. This contains some static helper getters and functions to help you with retrieving telative positions. The ToVector method will translate the direction instance to a offset integer vector which you can add to/subtract from your current position vector. There should be some functions for this on the TileHandle as well. If you miss any specific scenario or it is unclear to you how to proceed, then let me know!
     
  29. Vanamerax

    Vanamerax

    Joined:
    Jan 12, 2012
    Posts:
    916
    Hi everyone!

    I am excited to announce that Tycoon Tile version 1.2 will soon hit the Asset Store!





    Version 1.2 will include the following features:

    - Added terrain modification callbacks
    - Added utility functions for surface sampling, position snapping and conversion
    - Scenery tool
    - More low poly example assets
    - Improved demo scene UI
    - Improved code documentation
    - Bug fixes

    Stay tuned for the release of update 1.2 of Tycoon Tile which will hit the Asset Store soon!
     
    Last edited: Sep 18, 2020
    digiross likes this.
  30. Vanamerax

    Vanamerax

    Joined:
    Jan 12, 2012
    Posts:
    916
    Hi everyone!

    I am excited to announce that Tycoon Tile version 1.2 has been released on the Asset Store!

    The full changelog:
    - Added terrain modification callbacks
    - Added Tile Listener component to demonstrate usage of callbacks
    - Added utility functions for surface sampling
    - Added utility functions for position snapping and conversion
    - Added scenery tool to demonstrate usage of tile position snapping
    - Added some more low poly example assets
    - Improved demo scene UI
    - Improved included tools behaviour and interaction
    - Improved documentation throughout the code
    - Fix render glitch while painting terrain with the paint tool
    - Fix errors when painting invalid terrain types
    - Fix some issues with scaling the terrain transform

    I hope you all will enjoy the new features of Tycoon Tile 1.2!
     
  31. Vanamerax

    Vanamerax

    Joined:
    Jan 12, 2012
    Posts:
    916
  32. T_dev

    T_dev

    Joined:
    Nov 13, 2019
    Posts:
    3
    Hi, Vanamerax .
    I purchased your great asset! And I found out that this forum existed.

    Let me ask a question because I need your help again.
    I would like to get the Surface material that the terrain type has from the specified tile coordinates of the terrain map, but I can't find a good way to access it that far.

    If I can do this, what I want to do will work:)
     
  33. Vanamerax

    Vanamerax

    Joined:
    Jan 12, 2012
    Posts:
    916
    Hi T_dev! Thank you for purchasing Tycoon Tile and for your kind review!

    You should be able to retrieve the terrain type on a specific position by scheduling a custom terraintpaintjob. You can do this by implementing the ITerrainPaintJob interface, creating an instance of it, store the tile position you want to query in your job instance and call SchedulePaintOperation with the job as a parameter. In the execute method, a terrainTypeTable will be available to you in which you can retrieve the terrain type for a given coördinate. You can then store the result in a native array in your job and retrieve it after the schedule call.

    While this may seem a little convoluted at first, this approach is used for future Unity Job System compatibility for custom terrain jobs. I am however in the process of trying to improve this workflow.

    Hope this helps!
     
  34. T_dev

    T_dev

    Joined:
    Nov 13, 2019
    Posts:
    3
    Hi, Vanamerax!
    Thank you for telling me so much!
    I will try this method as soon as I can.
    Also, looking forward to some nice updates on the Tycoon tiles!
     
    Vanamerax likes this.
  35. MonkeyCrime

    MonkeyCrime

    Joined:
    Jun 13, 2013
    Posts:
    32
    Hi Vanamerax
    I'm considering purchasing this package however I've got a couple of questions I hope you can answer:
    1. Is it possible to change the default height used when raising or lowering the terrain? I'd like my slopes to much less steeper by default.
    2. When painting, it is possible to apply the texture in triangles rather than quads? I guess this would mean subdividing the quad into 4 triangles so the user could apply the texture to any of the 4 corners but it make the appearance and transition of the textures much much nicer.
    3. Is there a limit on the number of textures one can apply?
    Thank you - it's a great package and if we could solve point 2 I'd purchase today
    David
     
  36. Vanamerax

    Vanamerax

    Joined:
    Jan 12, 2012
    Posts:
    916
    Hi David! Thank you for considering to purchase Tycoon Tile. To answer your questions:

    1. Is it possible to change the default height used when raising or lowering the terrain? I'd like my slopes to much less steeper by default.

      Yes this is possible. You can change change the 'step height' of the terrain in the inspector. The demo shows a setting of 1 unit height per step, but you could change this to any value, like .5f or .1f etc.

    2. When painting, it is possible to apply the texture in triangles rather than quads? I guess this would mean subdividing the quad into 4 triangles so the user could apply the texture to any of the 4 corners but it make the appearance and transition of the textures much much nicer.

      This is not supported by default. However, you can modify the mesh renderer for the terrain to account for this. Since the mesh renderer already internally works by drawing 4 triangles that 'meet' in the middle of the tile, this should not be too hard to do. You will also have to modify the tile type table to store 4 tile type values per tile instead of one. I would be happy to assist you by giving you some directions to implement this, should you decide to make the purchase :)

    3. Is there a limit on the number of textures one can apply?

      The default implementation stores the tile types as a ushort, which means that you have over 65k textures you can use. I expect you will hit memory limitations for storing those textures way earlier though ;) Also there is a submesh limit on Unity's end on a per mesh basis. Tycoon Tile renders a mesh for each 'Chunk', of which the size is configurable in the inspector as well. So yes, technically there is a limit, but I would not expect you to ever run into that issue.
    Hope that helps! If you have any more questions, let me know! :)
     
  37. MonkeyCrime

    MonkeyCrime

    Joined:
    Jun 13, 2013
    Posts:
    32
    Hi Vanamerax
    Thanks for the quick reply - I made my purchase this morning and am looking forward to using Tycoon Tile. Your previous response to T_Dev should be enough for me to tell what kind of terrain I'm on (sand, snow etc) and I'll get in touch with you regarding question 2 above over the weekend I guess.
    Thank you
    David
     
  38. Vanamerax

    Vanamerax

    Joined:
    Jan 12, 2012
    Posts:
    916
    Hi David, that is great to hear! Thank you for your purchase!

    Let me know if you have any questions :)
     
  39. MonkeyCrime

    MonkeyCrime

    Joined:
    Jun 13, 2013
    Posts:
    32
    Hi Vanamerax,
    I tried sending an email to support@tycoontile.com but it bounced with a "No such recipient here" error. Anyway I thought I'd note some first impressions here to hopefully help others too:
    1. It's about 10 minutes to add filesystem save/load instead of memory stream. Dead-simple.
    2. I've hacked together design-time support so you can use the demo to save a scene, then load the terrain data in the scene view. It took a bit of work to understand the memory management issues but it hangs together (somewhat clunkily).
    3. More than the quad-rendering (which I'll eventually add with your help), I'd really (really really) like support for the Unity NavMesh system. I was hoping it'd all come together once I got the terrain working in the scene view but no luck so far.
    4. Noted some issues with tree height and origin changes in the demo. If you set the WordHeightStep to say 0.5, you'll see the trees don't respect the newly-generated terrain height. Also if you change the origin to say -256, 0,32, the tree positions don't respect that either.
    Nice product, happy to share my enhackments if you like. I think using the terrain in scene view and navmesh support would really add to the value-proposition for Tycoon Tile.
    David
     
  40. Vanamerax

    Vanamerax

    Joined:
    Jan 12, 2012
    Posts:
    916
    Hi David! Thanks for letting me know! Apparently my mailbox stopped working since I renewed my hosting plan. Fixed now!

    That is great to hear. I do have an update in the works to support this out of the box, but it needs some more work for me to consider it 'release ready'.

    I have got this request multiple times. If you mind me asking, what exactly are you using when you say 'Unity NavMesh'? Only the builtin functionality or the 'Navmesh components' that are on Unity's github somewhere? I will consider making a plugin for this. I'm interested to hear what your desired setup would be for navmesh support.

    I already have some fixes for this in my next update, needs a bit of code cleanup and polishing though. Stay tuned!
     
  41. MonkeyCrime

    MonkeyCrime

    Joined:
    Jun 13, 2013
    Posts:
    32
    I'm using the Navmesh Components that are available on Unity's GitHub. My current workflow (using Polaris 2020) is building a terrain, adding a Navmesh Surface component, baking, reviewing, editing, re-generating etc. That said I really want to use Tycoon Tile if I can.
    For Tycoon Tile it might be something along the lines of extending the Editor demo to build and save levels, then load the level data into my project. With the terrain now visible in the Scene view I'd then apply a NavMeshSurface component and bake the mesh. One challenge is figuring out how to exclude certain areas from the NavMesh. Typically you'd do this using a NavMeshModifer and assign it as non-walkable. A good scenario is where you might have a hill and you only want the navigation available up a certain side of the hill. The slope of all the sides of the hill will be the same (assuming you're not using cliffs) so you'd want to exclude the other sides of the hill somehow. I haven't figured out how to do this yet..

    Hopefully this makes sense - can add pictures if needed
     
  42. Vanamerax

    Vanamerax

    Joined:
    Jan 12, 2012
    Posts:
    916
    Hi David,

    Thanks for your reply. I think I understand your workflow, although I am not yet sure whether I understand the NavMeshModifier use-case yet. I have done some researching for how the Navmesh Components work and how they should be used, but my guess is that an end user would probably want to have this control on a per-tile basis instead of having to define each volume separately? I will probably have to create a plugin/separate for Tycoon Tile which generates the appropriate meshes to be used as sources for the navmesh builder. This seems doable, but I am not yet sure how users should define what areas are reachable for navmesh agents and which areas are not.

    I would be interested in your use-cases and/or examples for excluding specific terrain areas for the navmesh. Could you give me some examples of game mechanics that you are trying to implement? Is this dependent on tile type of a given tile? Do you want to designate specific tiles to be unreachable?
     
  43. MonkeyCrime

    MonkeyCrime

    Joined:
    Jun 13, 2013
    Posts:
    32
    Hi Vanamerax

    Using a NavMeshModifier would allow us to associate navigation penalties with different parts of the terrain. However it comes at the expense of having to break the terrain up into as many components as you needed modifiers for (at least as far as I understand). There would be a considerable amount of work involved from a UI perspective to allow the user to mark certain navareas as water, lava etc and then break those up into individual mesh objects. I suspect it’s not worth the effort initially, particularly as development effort spent is always a factor of sales and demand for the feature (a perfectly reasonable perspective).

    My use case is not so much building a tycoon-style game as generating a (more or less static) terrain for use in a “real time skirmish” game. I want to exclude certain parts of the terrain completely from navigation and also have speed costs associated with terrain types so that it’s slower to traverse over snow or mud than it is grass. I can partially achieve this by querying the terrain, getting the terrain type and modifying the NavMeshAgent speed depending on what the agent is over. This comes at the expense of navigation being somewhat dumber as everything on the terrain will have the same cost from the navmesh agent perspective.

    Here’s an in-game example. Picture a 4-sided hill with a plateau on top I’ve made by raising the terrain in TycoonTile. The top of the plateau might contain some contested item wanted by both sides. I want to mark 3 of the sides as un-navigable and use the 4th side as the entry/exit path. Given our WorldStepHeight we know the maximum slope of any given terrain tile and adjust the navmesh agent Max Slope property accordingly. If I’m not wrong, with a WorldStepHeight of 1, the maximum slope is 45 degrees? The nature of TycoonTile means the slope angles are the same on all sides so the challenge is how to indicate the other 3 sides of this hill are un-navigable (as default navmesh generation would include all sides).

    upload_2020-12-21_13-0-52.png

    So how might we achieve this? If we modify the demo so we can paint a navigation layer, we could re-use a significant portion of code and also track what is navigable and what is not. The when generating the triangles from the raw data, we skip adding triangles previously marked as un-navigable. This kind of touches on the other change I suggested about being able to apply individual textures to the 4 triangles in each quad, as you’d get a much smoother boundary definition for the navmesh too. The end result would be a mesh that has the sides of hills and cliff faces missing or empty, and just those areas we want navigable included. This is what we’d need to feed into Unity’s navmesh system (but I haven’t figured out how this works yet).

    By the way - I did some more experimenting with NavMeshVolumes last night and couldn’t get them to work at all.
     
  44. Vanamerax

    Vanamerax

    Joined:
    Jan 12, 2012
    Posts:
    916
    Hi David,

    Thank you for elaborating on your use-case. Unfortunately I don't think this will be a simple addition or modifcation to the way Tycoon Tile works at this moment, especially if you also want to define navmesh inclusion for each tile triangle separately. If you intent to use the terrain as a static mesh anyway, I would suggest exporting the generated mesh during runtime to an external mesh format like fbx or obj. Tycoon Tile will generate a submesh per tile type. After exporting you could then edit your mesh in some modeling software like blender to remove unnecessary parts of the tiles. Then use the edited mesh as input for the navmesh components to get your final navmesh.

    Hope this helps!
     
  45. MonkeyCrime

    MonkeyCrime

    Joined:
    Jun 13, 2013
    Posts:
    32
    Hi @Vaneramax,

    Totally understand your perspective and your workaround suggestion makes sense. First thing I'll try tonight when I get home is using GameObject > Export to FBX and see how I go.

    Thank you and have a great Christmas
    David
     
  46. Vanamerax

    Vanamerax

    Joined:
    Jan 12, 2012
    Posts:
    916
    Thank you, let me know me know how the export goes!

    Happy holidays to you as well! :)
     
  47. MonkeyCrime

    MonkeyCrime

    Joined:
    Jun 13, 2013
    Posts:
    32
    Hi Vaneramax

    I didn't manage to get too far with the mesh export. I tried using the standard (well preview from memory) Unity FBX exporter as described here but when I opened the mesh in Blender I didn't see anything. That said, I'm not a Blender user so I might have needed to switch render modes or something.

    So for now I've abandoned using TycoonTile until either I can get the export working so I can remove the unused faces in Blender and then re-import for my NavMesh, or you can help me with the export process.

    Thanks again
    David
     
  48. Vanamerax

    Vanamerax

    Joined:
    Jan 12, 2012
    Posts:
    916
    Hi David,

    That is unfortunate to hear. I suspect the problem you are experiencing with Unity FBX Exporter is due to the Tycoon Tile renderer storing and rendering the meshes internally, instead of spawning child GameObject with a MeshFilter and setting these mesh filters. The exporter is probably scanning for MeshFilter components and only exports meshes assigned in these components. You could try adjusting the renderer to spawn objects with a MeshFilter component instead and apply meshes to these filters. Then you can probably use the FBX exporter.

    Hope this helps.
     
  49. Vanamerax

    Vanamerax

    Joined:
    Jan 12, 2012
    Posts:
    916
    Hi everyone!

    I am excited to announce that Tycoon Tile version 1.3 has hit the Asset Store!



    Version 1.3 is a big update that comes with API improvements across the board. The major new features are support for multi-tile placement of buildings and structures, as well as support for locking tile heights.

    Version 1.3 includes the following features:
    - Revamped terrain operation API
    - Terrain operation is now a two-staged process. Operations schedule modifications instead of directly applying changes, to improve orchestration of tile updates.
    - Adapted all included terrain operations to the new API.
    - Added ability to 'lock' tiles.
    - Standardized tooling API to simplify implementation of custom tooling.
    - Simplified code of included tools and adapted to new tooling API.
    - Added utility classes for terrain overlay rendering and preview object rendering.
    - Added base renderer class to simplify implementing custom terrain renderers.
    - Adapted standard renderer to new base renderer API.
    - Added support for multi-tile object placement (constructables).
    - Added new builder tool to place multi-tile structures.
    - Extended demo scene to showcase building tool.
    - Moved some classes to other namespaces and file locations to tidy up API surface.
    - Several performance optimizations and bug fixes.
     
    T_dev and aFeesh like this.
  50. discordbotstudio

    discordbotstudio

    Joined:
    Aug 2, 2020
    Posts:
    4
    How hard would it be to modify the scripts so that surrounding tiles are updated when a vertex is raised/lowered? For my game, I would like the surrounding quads to also update when you raise or lower a corner. That is, instead of making a cliff when one corner is raised, the surrounding tiles recalculate their triangles according to the new vertex height.

    Thanks
     
unityunity