[Released] Tycoon Terrain

A couple of weeks ago I sat down and tried out OpenTTD, an open source implementation of Transport Tycoon Deluxe, and boy was I sold! I suddenly realized why I spent countless hours of my precious youth playing that old game til the 16 bit graphics made my eyes bleed :slight_smile:

I also thought that it wouldn’t be too hard to make a worthy successor and that a lot of people probably have lots of ideas the could be implemented if only they had the terrain engine done for them. So I sat myself down and started working on a system that would fit different types of the “old style” tycoon-games but would be using the terrain engine of Unity so that you could still have it’s vegetation, LOD and stuff.

Well now it’s finally finished and I am quite happy with it. It has the feel of the terraforming in the Tycoon-games but it doesn’t hurt your eyes like someone was twisting a rusty fork in them. Check out some videos of it in use:

Or try the demo and get to terraforming yourself:
https://dl.dropboxusercontent.com/u/34265144/TycoonTerrain.html

Some of the features are:

  • World generation using the Diamond-Square algorithm for heightmaps and Perlin noise for vegetation.

  • Terraforming at runtime like you remember it!

  • A basic building system

  • Roads

  • Works fast up to 128x128 tiles, after that large terraforming operations become slower. Works up to 512x512 tiles with reasonable speed. Try web demo above to see if performance is good enough for your requirements before purchasing.

I have an idea to work around the slow terraforming on large maps by splitting them into chunks and keeping them as separate terrain objects. This will require some work so I would like to know if someone would be interested in using it for maps bigger than 512x512 tiles. Try the demo, that’s a pretty big map!

Also if you want to use this I would love to know what you will be using it for and if you have any requests for features!

Asset store link: Unity Asset Store - The Best Assets for Game Making


2 Likes

I am currently working on an update with resource generation and units as well. I will make sure to keep it all divided in a good way so that if you only want world gen/terraforming then you can just delete the other parts to keep your solution simple and minimalistic.

Nice assets, will be VERY nice if you can consider support 4.6.x ?

1 Like

I’m working on it :slight_smile:

Hello!
Is it possible to paint the terrain (in the editor) using this tool instead of only generating them?
If not,would you be interested in implementing it?

1 Like

Right now the tools only work at runtime but generating it in editor is a very good idea! I am interasted in implementing it but it will take some time as I am currently working on a 4.6-version as requested by several users.

After that I have a planned update which include resource management and units but in the version after that one I might add terraforming in editor.

Well, you can actually use the normal terrain tools in the editor but the changes will not be saved in the world data and the changes do not adher to the strict “Tycoon-rules” of terrain (45 degree slopes etc)

1 Like

There is now a version for unity 4.6.7 but it’s not on the asset store yet. I’m not yet sure if I want to keep two versions up to date or if I’m going to simply roll back to 4.6 alltogether as upgrading to 5 is a lot simpler than downgrading from 5 to 4.

For now, if you want the 4.6 version just send me a message with your e-mail and I’ll send you the unity package for 4.6.

I have just sent an update of the package to the asset store. Hoping it will only take a few days for it to go through!

Hi, does this work on mobile?

I have sucessfully built it for an android pad and that worked, but there are no controls implemented for touchscreen. There are no fishy calls to dll:s or quirky namespaces so should work on all platforms. Currently, games are saved using playerprefs which I think should work on all platforms as well.

Cool, do you forsee any issues using it with this touch camera system? Unity Asset Store - The Best Assets for Game Making

No, should work out of the box I think. There’s a camera control script in the asset that can just be removed from the camera and replaced with whatever you prefer.

Excellent. Thanks for the replies.

1 Like

There’s a strange bug in Unity 5.6 which makes for some strange behaviour with terraing raycasting. It makes raycasting fail in only some cases, at certain angles of view. If you turn on gizmos in game view and select the water game object in the scene hierarchy you get a view like this:

In Unity 5.6 (and only that version) you will not be able to move the pointer outside the bottom quad of the water collider. It has nothing to do with the water collider though, it is just used for visualization here. The bottom quad of the water collider nicely outlines the bottom of the terrain collider and that is what somehow causes the issue.

Moving the world game object any amount at all will fix the bug. Therefore a quick qorkaround until I can figure out what exactly changed about raycasting and terrain colliders in Unity 5.6 is to change the WorldBehaviour class Genereate-method to include the lines:

transform.position = Vector3.up;
transform.position = Vector3.zero;

at the end of the method so it looks something like:

/.../
            StartCoroutine(RegrowGrass());
            StartCoroutine(RegrowTrees());
            StartCoroutine(Terraform());
            StartCoroutine(RemoveTrees());

            transform.position = Vector3.up;
            transform.position = Vector3.zero;
        }

I hope that this will be fixed in the next patch (this error was observed on Unity 5.6p3) but until then this is a quick workaround.

EDIT: Bugreport has been posted to Unity QA

EDIT 2: Unity QA have reported back that they have been able to reproduce the error and will fix it in an upcoming patch.

1 Like

Hey there Mikael

I obtained this tonight, and on import to 2017.1.1f1 I noticed that i got the “api update required”.
Probably nothing, but wanted to mentioned it.

Right now, trying to figure things out.
Thanks for the kind and prompt email support :slight_smile:

Thanks for letting me know! API updates like that are done automatically by the editor so no worries.

I am awaiting 2017.2 and then I’ll probably start upgrading all my assets to the 2017 version and then the message will go away.

Just bought terrain tycoon, getting 8 errors on import.

Assets/Plugins/Submodules/VikingCrewToolsBase/Viking Crew Tools/MVC base/MvcAbstract.cs(59,29): error CS1644: Feature `null propagating operator’ cannot be used because it is not part of the C# 4.0 language specification

We have made the move to the new .NET available in Unity. Set the scripting backend for your project to the latest and it will work. I THOUGHT this should be set automatically when downloading the package as it is listed under systems. I’m sorry it wasn’t.

had it on 4.0, still gave the error, but im using unity Unity 2018.2.17f1 (64-bit) . Should i get 2019 beta?

No, I have not even tried 2019… ok, I’m at work on a legacy project so can’t check the scriping backend settings right now but don’t you set it to 4.5, not 4.0? I am talking .NET version, not C# version. C# version I think should be 6 when using .NET 4.5 but I don’t remember exactly…

EDIT:
These settings should do it:
3958702--339514--player-settings-configuration.JPG
In Player settings => Other settings => Configuration

1 Like