OpenTTD in Unity
Moderator: OpenTTD Developers
-
- Engineer
- Posts: 1
- Joined: 10 Aug 2019 17:36
OpenTTD in Unity
Could Anyone port OpenTTD to Unity, it would be a great help for my current WIP-Game, since I didnot find any code/help
Re: OpenTTD in Unity
OpenTTD source code is here: https://www.openttd.org/downloads/opent ... atest.html
Download and follow the usual steps for compiling source code. If you have any particular issues, please feel free to post them here and somebody may be able to help.
Download and follow the usual steps for compiling source code. If you have any particular issues, please feel free to post them here and somebody may be able to help.
Do you like drones, quadcopters & flying toys? Check out Drone Strike Force!

Base Music Sets: OpenMSX | Scott Joplin Anthology | Traditional Winter Holiday Music | Modern Motion Music
Other Projects: 2CC Trams | Modern Waypoints | Sprite Sandbox & NewGRF Releases | Ideabox | Town Names | Isle of Sodor Scenario | Random Sprite Repository
Misc Topics: My Screenshots | Forgotten NewGRFs | Unfinished Graphics Sets | Stats Shack | GarryG's Auz Sets

Base Music Sets: OpenMSX | Scott Joplin Anthology | Traditional Winter Holiday Music | Modern Motion Music
Other Projects: 2CC Trams | Modern Waypoints | Sprite Sandbox & NewGRF Releases | Ideabox | Town Names | Isle of Sodor Scenario | Random Sprite Repository
Misc Topics: My Screenshots | Forgotten NewGRFs | Unfinished Graphics Sets | Stats Shack | GarryG's Auz Sets
Re: OpenTTD in Unity
A few challenges to do the port:
1. OpenTTD is written in C++, it's over 300,000 lines of code.
2. It doesn't use the GPU for rendering, drawing is all done by the CPU. You'll have to re-implement that from scratch. Be sure to keep all functionality of NewGRFs, so likely you need to implement some part of NewGRF at the GPU.
3. Once you did that, you'll likely run into performance problems. The current code is highly tuned to run a lot of vehicles smoothly. A JIT interpreter with automagic garbage collection like what's below C# is going to have a hard time keeping that performance.
So good luck porting, you'll need it.
1. OpenTTD is written in C++, it's over 300,000 lines of code.
2. It doesn't use the GPU for rendering, drawing is all done by the CPU. You'll have to re-implement that from scratch. Be sure to keep all functionality of NewGRFs, so likely you need to implement some part of NewGRF at the GPU.
3. Once you did that, you'll likely run into performance problems. The current code is highly tuned to run a lot of vehicles smoothly. A JIT interpreter with automagic garbage collection like what's below C# is going to have a hard time keeping that performance.
So good luck porting, you'll need it.
Being a retired OpenTTD developer does not mean I know what I am doing.
Re: OpenTTD in Unity
I've also wanted to port to unity, but the difficulties are many (and unpaid) to write it in C# while maintaining performance and all the richness in details.
If you have 5 other people willing to collaborate maybe I will someday
If you have 5 other people willing to collaborate maybe I will someday

Re: OpenTTD in Unity
Honestly, if you want to make a OpenTTD-style game in Unity, given that OpenTTD already exists, is in active development and is also quite good, I'd personally prefer if you just made your own game with your own spins on the genre.
99.99% of people do not care what language OpenTTD is written in or which graphics framework it uses. There are many things in OpenTTD that I feel could be improved on in a game that was not beholden to the core design decisions of original Transport Tycoon, but the fact that OpenTTD is written in C++ and uses SDL has nothing to do with any of them.
99.99% of people do not care what language OpenTTD is written in or which graphics framework it uses. There are many things in OpenTTD that I feel could be improved on in a game that was not beholden to the core design decisions of original Transport Tycoon, but the fact that OpenTTD is written in C++ and uses SDL has nothing to do with any of them.
Who is online
Users browsing this forum: No registered users and 12 guests