OpenTTD

194 readers
1 users here now

In dieser Community geht es um alle Themen rund um OpenTTD.

Bitte Netiquette beachten!

founded 2 years ago
MODERATORS
1
 
 

cross-posted from: https://feddit.nu/post/4217296

Welcome to 14.0!

OpenTTD’s first release was in March of 2004. Now twenty years later, we are proud to present to you: release 14.0.

And boy, what a release it is. Do I dare to say: this has been the biggest release yet?

Sometimes people try to tell us OpenTTD is dead. Well, 14.0 shows you it really isn’t. There are so many new goodies in 14.0, that I don’t even know where to start! Let’s go over a few, just to get you a feel for what to expect when you launch OpenTTD 14.0.

Read more about our birthday celebration here.

When one day isn’t a day

It is now possible to make the calendar time walk slower, up to a point it is frozen. This doesn’t influence vehicle movement at all, nor the amount of goods transported, town growth, etc. But it does influence vehicle introduction dates, inflation, and aging.

With this feature, we hope to enable different game-plays, where people want to have more time to build out their empire before vehicles expire, inflation gets too big, etc.

A brand new day! For some a bit slower than others.

Read more about this new feature in the devblog.

Ship Pathfinder

The ship pathfinder got some great love. It is now capable of directing ships over vast distances without the need for buoys. In fact, one could say, you don’t need buoys anymore at all. The ships will still find their way!

Finally, no more “Ship is lost” non-sense. This enables ship-only games.

Read more about this new feature in the devblog.

Unbunching

Do you also hate when busses start hugging each other on a route? And you did your best to ensure you send them out the depot with a good distance between them. But something must have happened down the road, and now they are very close to each other!

Introducing: unbunching.

A new feature that allows you to tell all vehicles in a shared order pool to keep their distance; automatically, done for you.

Read more about this new feature in the devblog.

Social Platform integration

OpenTTD 14.0 allows better integration with Social Platforms. This is totally optional, and has to be installed separately. But once done, OpenTTD can talk to platforms like Steam, Discord and GOG Galaxy.

For now, the functionality is limited: friends can see you play OpenTTD, if you are in a server or not, and what kind of map you are playing. For future versions, we intend to expand on that, making more possible. But, small steps.

Read more about this new feature in the devblog.

Survey support

To finally put a rest to endless debates about what setting is used and which is not, OpenTTD now has an opt-in survey tool built-in. Over time this will allow us, developers, to better understand how OpenTTD is played, so we can better anticipate what will be a hit or a miss.

You can, at any time, opt in or out from the survey.

Read more about this new feature in the devblog

GUI improvements / scalable font

There has been a huge effort in making all our windows just a tiny bit better. Fixing pixel-errors, moving things around a bit, fixing colouring issues.

But .. not less important, we now also have a built-in scalable font! Zephyris created a real (TTF) font heavily inspired by the sprite font. This means that scaling looks a lot better, especially for zoom levels like 1.5x.

We love it so much, it is the default when you launch the game! (but no worries, you can revert to the sprite font if you really want to).

Read more about this new feature in the devblog.

New players experience

First of all, there is now a Help and Manuals button in-game, that helps you through the basic information of the game. Bringing information closer to the user, and the game more accessible to everyone, has been a path we have been on for a while.

Second, we revised a lot of settings, what their default value should be. Many settings have had their defaults changed, mostly towards enabling modern features by default.

Lastly, we also renamed Cheats to Sandbox. We noticed people were struggling with using “cheats”, as we have been conditioned that cheats in games are bad. But Cheats in OpenTTD context is much more “play how you like” (read: Sandbox). So we renamed it, hopefully making it more clear to new players that it is perfectly okay to use these Sandbox options any time they like.

Hopefully this helps new players get into the game easier.

So much more …

In total OpenTTD 14.0 comes with roughly 40 new features, over 500 bug-fixes, 200 changes, and many many code improvements.

It took us 2,000 commits to get from 13.4 to 14.0, we touched 140,000 lines of code and removed 74,000 of them. This was all done by over 60 contributors.

Interested how this all came together? Check out our blog post explaining it all.

A great thank you to all who contributed, with code or support; it is truly appreciated! Here’s to another twenty years of OpenTTD development!

2
 
 

If you don’t know me, I’m Owen Rudge, and have been involved in the online Transport Tycoon community for almost 25 years. Exactly 21 years ago, I received an ICQ message (look it up, kids) out of the blue from a guy named Ludvig Strigeus (nicknamed Ludde). “Hello, you probably don’t know me, but I’ve been working on a project to clone TTD for a while.” he said, more or less. He didn’t want to release this to the public yet, and wasn’t entirely sure what he was going to do with it. (He’d been working on it since 30th June 2002, so I guess that is technically the birthday of what would become OpenTTD…) Ludde sent me a copy of what he’d been working on, and it was very exciting indeed. It was a fully functional version of Transport Tycoon Deluxe, written in C. Admittedly incomplete at that time, it was still quite remarkable.

To put things in context, in 2004, the Transport Tycoon community generally enjoyed playing the classic Transport Tycoon Deluxe with the excellent TTDPatch started by Josef Drexler. The original Transport Tycoon games only ran on DOS and Windows 95/98, and TTDPatch allowed us to play on the then-current Windows XP, while adding a huge number of exciting features, such as the ability to use third-party graphics and vehicle sets. TTDPatch was an amazing piece of software, but there were always some fundamental limitations - the map size couldn’t be changed, extra cargo types couldn’t be added, multiplayer was difficult to improve, and so on. So having an almost fully-functional clone of TTD, written in a high-level programming language, suddenly appear out of nowhere got people very excited indeed.

Ludde made more progress with the project over the coming year, and it looks like we even attempted some multiplayer games (not too reliable, especially over my dial-up connection at the time). Eventually, when he was happy with what he had created, he agreed to allow me to release the game as open source. Coincidentally, this happened exactly a year after I’d first spoken to him, on the 6th March 2004. But first, it needed a name. I don’t think I thought very much about it, but decided that “OpenTTD” had a nice ring to it, so registered a SourceForge project, created an OpenTTD forum on TT-Forums, and set it loose. OpenTTD 0.1 was released. You can still download it if you want to see what it was like, though it’s not particularly straightforward to run!

Things really got going after this, and a community started to form with enthusiastic developers fixing bugs, adding in new features, and smoothing off the rough edges. Ludde was, I think, a bit taken aback by how popular it proved, and even rejoined the development effort for a while. A read through the old changelogs reveals just how many features were added over a very short period of time. Quick wins like higher vehicle limits came in very quickly, and support for TTDPatch’s NewGRF format started to be functional just four months later. Large maps, improved multiplayer, better pathfinders, improved TTDPatch compatibility, and of course, ports to a great many different operating systems, such as Mac OS X, BeOS, MorphOS and OS/2. It was a very exciting time to be a TTD fan!

Within six years, ambitious projects to create free replacements for the original TTD graphics, sounds and music sets were complete, and OpenTTD finally had its 1.0 release. And while we may not have the same frantic addition of new features we had in 2004, there have still been massive improvements to the code, with plenty of exciting new features over the years, with major releases every year since 2008. The move to GitHub in 2018 and the release of OpenTTD on Steam in 2021 have also re-energised development efforts, with thousands of people now enjoying playing the game regularly. And development shows no signs of slowing down, with the upcoming OpenTTD 14.0 release including over 40 new features!

When I released Ludde’s work back in 2004, I don’t think I could have anticipated where OpenTTD would be ten years later, let alone twenty. Personally, I would like to say thank you to everyone who has supported OpenTTD development over the past two decades - first to Ludde, who has gone on to be an incredibly successful and influential developer. Of course, there have been many developers who have contributed so much over the years, plus the graphics artists and other content developers who have created a wealth of wonderful add-ons for the game. I’d like to also thank everyone who has donated money to cover server costs, and indeed the dedicated folk who maintain that infrastructure (especially TrueBrain, without whom the OpenTTD project in its current form probably wouldn’t exist). We must also show our appreciation for Chris Sawyer for the amazing game that inspired OpenTTD in the first place. Finally, of course, I’d like to thank you, the players! None of us would be here if people weren’t still playing the game.

Seeing how the first twenty years have gone, I can’t wait to see what the next twenty years have in store. :)

3
 
 

cross-posted from: https://feddit.nu/post/3466717

Always wanted to know what kind of OpenTTD game your friends are playing on Steam, Discord or GOG Galaxy? You finally can!

In OpenTTD 14.0, we ship a plugin system which allows OpenTTD to integrate with platforms like Steam, Discord, GOG Galaxy, etc. This didn’t come easy, and is the work of many years figuring out what the best approach would be.

When we first released on Steam back in 2021, it became clear that we would love to integrate with Steam. Only two months after our release on Steam, we started to figure out how to make this happen. In that same month a first draft was created … and it took until now to make that a reality.

We have been asked many times over these three years why we didn’t integrate with Steam yet; why it is taking this long. So in this blog post, we will shed some light on what was needed for this to happen. Answering the question: why does it take so long?

Let’s delve in!

Licensing

The first hurdle we had to take wasn’t technical at all: how do we deal with all the different licenses involved with integration on these platforms.

As you might know, OpenTTD is released under GPLv2. This is a good license for an Open Source game, as it ensures that everyone who makes a modification to the game also have to release the source for that modification. And, if we would like to, we can integrate that change back into the vanilla game again, allowing everyone to enjoy that modification.

There is one downside of the GPLv2 license: it is not really compatible with many other licenses, as it is kinda strict in the implications. I am not going to delve too much into the details in this post, but just know once something is GPLv2, everything it touches has to be GPLv2 or compatible with it.

To integrate with social platforms like Steam, Discord, etc, you have to make use of an SDK they supply. As you might have guessed by now, they are not licensed under a so-called “free” license, which conflicts with our GPLv2 license.

Besides the legal part of the license, we also have the social part of “how people feel about it”, if we would integrate such non-free SDKs directly into the game. And this has always been a debate.

As it goes in the world of Open Source Software, people tend to have a very strong opinion about the “free” part of the license. And so integrating with something non-free is against the principles, and as such, by their argument, bad. We can’t simply dismiss such arguments because we want to integrate with social platforms.

Which means we needed to find a balance: make sure OpenTTD as a game remains Open Source, free, and GPLv2 licensed. But also allow integration with social platforms.

The solution, as it turns out? Make it a choice.

Plugin system

To ensure the game itself remains licensed under GPLv2, we created a simple plugin system which allows us to extend the game with other binaries which might be licensed differently. We have been doing this for years and years now, via our BaNaNaS system. This delivers in-game content to the user, while the author of such content can license it how ever they like. The only “demand” we make, is that the author gives us the right to distribute their content, and that it is available free of charge.

In result, we see a wide variety of content on BaNaNaS, under all kinds of licenses. Some authors embrace the ideology of OpenTTD, and use open or free licenses. Others are more protective of their work, and do not allow anyone to make derivatives of their work. From our point of view, we don’t actually mind either way: as long as our players can download it for free and enjoy the content, we are more than happy and grateful for your efforts.

The plugin system that is added to 14.0 uses the same logic and mechanism. Although technically it is very different, more on that later, but from your point of view it is the same: download a plugin, put it in the right folder, and enjoy the added functionality.

Currently we are releasing three plugins: Steam, Discord, and GOG Galaxy. The source of those plugins are released under MIT licenses; another Open Source license, with much simpler conditions compared to GPLv2.

Security is a thing

Content uploaded to BaNaNaS is executed in the game via sandboxes: nobody can read files on your computer, make network connections, or anything like that. They can only do things we allow the addons to do, which is a very restrictive set of actions.

This is a lot harder for a plugin system that integrates with platforms like Steam, Discord, GOG Galaxy, etc. We can’t sandbox those really, as they have to be native binaries (executables) that run on the player’s system.

So, we have a dilemma: if we would allow a plugin system in the same way we allow BaNaNaS content, anyone could upload a plugin for anyone to download. And that plugin could, in theory, contain things that are harmful to the player. For example, a bitcoin miner or something silly.

This meant we had to find a balance between allowing such plugins and not allowing anyone to just provide any plugin. What we came up with, is a system where a plugin can only be loaded into OpenTTD, if we, the OpenTTD Development Team, approved the plugin.

We find this less than ideal, as we like that BaNaNaS allows anyone to come up with ideas, try them out, see what people think. But, we also have to keep the security of players in mind. And there is just too much potential for harm when we would open up the plugin system to anyone. As such, we were left with no other choice than to restrict who can make those plugins; or of course, not do it at all (which is even less ideal).

In result, every plugin is released and signed by OpenTTD, and before loaded into the game, it is validated the signature is correct. If you are a developer and want to design your own plugin, please come talk to us. We are not against new and different plugins; but we have a responsibility to the players to ensure it doesn’t compromise their security.

Capabilities

With the licensing and security finally addressed, and a solid idea how to build the plugin system, we started work. But as you can imagine, it was a lot of work, with a lot of moving parts. Like … seriously, it took many hours figuring all this out, and getting it right.

An additional challenge was that we release for three OSes: Windows, Linux and MacOS. And they all deal with plugins in a slightly different way; enough to be challenging. A lot of testing, failing, trying again went into getting this right.

Complicating the situation further: we don’t have an active MacOS developer, nor do we have access to a physical Mac. This meant we had to proxy the development / testing via other people who do have a Mac. The conversation went like: “does this work?”, “and now?”, “what does it say?”, “no, in that other window”. I mostly want to thank Emperor Jake for helping out here. Your patience to test yet-another-MacOS-test-build is greatly appreciated.

All this also meant we had to make a choice: either get something to work now and build on it later, or try to do everything at once, potentially never finishing it at all. We went for the first approach, but it also means the current capabilities of the plugin system are rather limited. So don’t think too much of it yet.

The main thing it currently does is announce you are playing the game, whether you are in the Main Menu or in-game, and what kind of map-size you are playing. Other things like being able to join each others games etc is all not implemented yet, but hopefully someone will pick that up for the next version. But, as always, no promises!

How does it work?

When you first start OpenTTD 14, a new folder “social_integration” will be created in your OpenTTD documents folder. In here plugins can be installed, for example the Steam plugin. You have to extract its content in this “social_integration” folder, and start the game.

When the game starts, it is validated that the plugins are signed off by OpenTTD, and if they are, they are loaded. The first step for the plugin is to check whether the social platform is running. If so, it starts the integration with that platform. A plugin can only integrate with a platform that is running when OpenTTD starts; so make sure Steam, Discord, and/or GOG Galaxy is already running before you start OpenTTD.

Under “Game Options” -> “Social”, you will find whether the integration is running.

For Steam, we automatically add the Steam and Discord plugins. For people downloading the game manually, they have to download the plugins manually as well. This is explained on the download page.

The future

With the biggest hurdles out of the way, the future is bright. We now finally have the ability to extend OpenTTD in a way that doesn’t violate our license or the spirit of the license, while still integrating with non-free platforms. And that in a secure way.

This means that for next versions we can start looking into other parts of these platforms, like making use of their network capabilities (joining people’s games, but also maybe making use of Steam’s relay network), or possibly even achievements. We also really would like to deliver these plugins via BaNaNaS, so updating is a lot easier (currently you have to manually download them from our website).

All this will not happen overnight, and maybe not even in a few years. But instead of having to deal with all the above things, developers can now focus on that what is actually interesting: the plugins themselves. Of course this requires people working on this, so if you like a challenge and want to help out: please drop by! Any help is greatly appreciated.

Personally, I am mostly looking forward for the ability to just join someone’s game by right clicking on the friends list and clicking Join Game. A lot of things have to be created to make this possible. For example, when you are currently in a Single Player game, nobody can join. But in a modern game this is a very outdated concept; better would be that when someone wants to join a Single Player game, it automatically upgrades to a Multiplayer game and allows your friend to join. And of course we need to ask you if you are okay with your friend joining. As you can imagine, a lot of work is required to make this happen. But I think it will be awesome when it does!

In closing

I hope by now you understand that integration with social platforms was not only a technical challenge. We also had to deal with both the legal side of licensing, and with the spirit of our license. Additionally, finding a way to keep things secure yet configurable wasn’t easy either.

In total it took over 3 years of figuring out how we want to do it. And over 3 months of actual work to program it all and ensure everyone was okay with this implementation.

It was a journey, one could say. But finally we are here. And I can’t wait for the next step!

More about OpenTTD 14

This post is part of the series of dev diaries about big new features coming in OpenTTD 14. Next week, we’ll talk about how OpenTTD 14 came into existence, and how you can be part of it. Till then!

4
 
 

cross-posted from: https://feddit.nu/post/3345596

OpenTTD 14.0 comes with a new ship pathfinder which allows ships to travel great distances without the use of buoys. Gone are the days of long strings of buoys and convoluted ship orders. Using ships is now as hassle-free as the other modes of transport. Just add the destination and send the ship on its way!

In this post, I’m going to explain how the new pathfinder works and some of the challenges we had to overcome.

Motivation

Personally, I was never satisfied with the way ships worked. All other vehicle types “just work” and always find their path, but ships needed buoys to get to their destination. Placing buoys at the right interval is guesswork at best, and having to add them all to the order (and in the right order) is a pain. In my opinion, it simply makes ships no fun to use. I often found myself terraforming narrow stretches of land into the ocean in order to create railways to access oilfields. Yes, I am “that guy”.

Having messed around quite a bit with A* pathfinders and derivatives, I always felt there had to be a better way to achieve this. I played around with several ideas, but most of them didn’t scale well and didn’t make it off the drawing board. Getting things to work smoothly and reliably on a 4096x4096 map turns out to be quite a challenge. But as they say, “if it was easy, it would have been done already”.

Why is it so difficult?

So why is it so hard for ships to find a path? If trains can do it, so should ships, right? The main problem is that open water creates a ton of symmetric paths which are all “equally good”. The pathfinder must explore all of these permutations in order to find the best path.

Trains don’t have this issue because they are restricted by tracks and junctions. Potential paths branch off far less often, even in complicated networks. The same is true for road vehicles and trams. For ships however, the amount of path options grows exponentially as the distance increases.

The pathfinder eventually hits the node limit and has to throw in the towel. Raising the node limit gets you a bit further, but the impact on game speed becomes more noticable. Adding more ships further exacerbates the problem, since having twice the number of ships means twice the number of pathfinder calls. And since larger maps often means more players and large travel distances, one can see that the problem only gets worse as the scale increases.

The solution

The solution I went for is a two-tiered pathfinding system, somewhat similar to the well-documented HPA* algorithm. First, we try to find a coarse, high-level path. If such a path is found, we choose an intermediate destination not too far from the ship. We use the low-level pathfinder to plan a path to that intermediate destination. Once we reach it, we run the high-level pathfinder again, and the process repeats.

Think of it like taking a long trip with the car: instead of planning the entire journey in meticulous detail, you just focus on how to get to the next city. Ironically, this is similar to how buoys work: they also provide a sequence of intermediate destinations. But this time it requires no user effort.

To enable the high-level path search, we divide the map into 16x16 tile regions. Within each region, we identify separate patches of water. Each tile gets a label, and all tiles with the same label belong to the same patch; i.e. they are interconnected. We also identify whether a ship can travel across a region edge into any adjacent regions. Aqueducts crossing into other regions are also taken into account. The region abstractions allow us to search the map incredibly fast, hopping from region to region instead of from tile to tile. We are effectively searching the map at a “lower resolution”, ignoring the details at the tile level.

Keeping regions updated after construction and terraforming requires some effort, but the impact on overall performance is minor. Such changes invalidate the region, which means it has to be updated the next time the pathfinder “bumps into it”. This can be done quickly, and the big benefit of this approach is that once the region is updated, its data can be used for subsequent pathfinder runs without any additional effort (until the region gets invalidated again).

Suboptimal paths

Searching at a lower resolution unfortunately means that the path is not guaranteed to be the best path. Locally the path to the intermediate destination is optimal, but globally there might exist a path that is shorter. This is the tradeoff between speed and optimality that we have to make. Luckily it is not so bad to have a slightly suboptimal path. Getting a “good enough” path very quickly is much more preferable, especially when dealing many ships traveling great distances. And that trail of buoys you made before probably wasn’t entirely optimal either :). The pathfinder has been tweaked to produce good paths, and you will probably only find signs of suboptimality if you really look for it.

In closing

For me personally, the difference is night and day. I generally avoided using ships, and I know many other players did too. Now I love using them. They are a fun mode of transport, and I hope to see more users give them a second chance now that they work well right out of the box.

So go ahead, create a giant map and let ships travel from one side to the other. No buoys needed!

P.S. Buoys aren’t going to be removed. You can still use them as waypoints.

P.P.S. We have also added support for faster ships and faster ship acceleration in NewGRFs, for an even more complete ship experience.

More about OpenTTD 14

This post is part of the series of dev diaries about big new features coming in OpenTTD 14. Next week, we’ll delve into the integration with Steam, Discord and GOG Galaxy. From now on, your friends will be able to see how much you love playing this game!

5
6
 
 
7
 
 
8
 
 

Ein Bugfix für einen Crash wurde am Samstag releast.

9
10
 
 

In diesem Update gibt es nur ein paar Crash Fixes.

11
12
 
 

Es gibt ein paar neue interessante Funktionen, wie dass Flüsse immer dünner werden, anstatt immer gleich breit zu sein.