Server Setup Guide for [OpenTTD] Gamers
Game Server Requirements
Establishing a robust and reliable OpenTTD server necessitates a careful consideration of underlying hardware and software specifications. While OpenTTD itself is not inherently resource-intensive compared to many modern 3D titles, the demands scale with the number of concurrent players, the size and complexity of the game world, and the frequency of game state updates. A foundational understanding of these requirements is crucial for selecting appropriate hosting solutions and ensuring a smooth, lag-free experience for all participants.
At its core, OpenTTD operates as a single-threaded application for its primary game logic, meaning that raw CPU clock speed often trumps core count for optimal performance in the game simulation itself. However, the server process, while primarily single-threaded for game logic, does engage in network I/O, file operations, and potentially other background tasks that can benefit from a multi-core processor. For a small server catering to 2-4 players on a modest map, a modern dual-core processor with a clock speed of 2.0 GHz or higher should suffice. As player counts increase to 8-16, or if larger, more intricate maps are employed, a quad-core processor with a higher clock speed (e.g., 3.0 GHz or above) becomes advisable. For very large, persistent worlds with 20+ players, a high-frequency quad-core or even a six-core processor is recommended to prevent bottlenecks during peak activity. The specific CPU architecture, such as Intel's Core i5/i7/i9 series or AMD's Ryzen 5/7/9 series, will offer varying levels of performance per clock cycle, but the emphasis remains on single-core performance for the core game simulation.
Memory (RAM) requirements are relatively modest for OpenTTD. The game state, including map data, vehicle information, and player actions, resides in RAM. For a small server, 2 GB of RAM dedicated to the OpenTTD process and the operating system is generally sufficient. As the map size expands and the number of active vehicles and industries grows, memory consumption will naturally increase. For a medium-sized server (8-16 players, larger maps), 4 GB of RAM is a comfortable baseline. For large-scale, long-running servers with extensive networks and numerous players, 8 GB or even 16 GB of RAM can prevent paging to disk, which would introduce significant latency (Operating System Concepts). It is important to allocate sufficient RAM not just for the game itself, but also for the underlying operating system and any other services running on the server.
Storage considerations primarily revolve around speed and capacity. OpenTTD game saves, configuration files, and potentially custom NewGRFs (New Graphics Resources) are stored on disk. While the total storage footprint is typically small (a few gigabytes for multiple saves and NewGRFs), the speed of the storage medium can impact server startup times and the loading/saving of game states. Solid State Drives (SSDs) are highly recommended over traditional Hard Disk Drives (HDDs) due to their significantly faster read/write speeds. An NVMe SSD would offer the highest performance, though a SATA SSD provides a substantial improvement over an HDD at a lower cost. A minimum of 20 GB of SSD storage is generally ample for the operating system and OpenTTD server files, with more space allocated if numerous custom NewGRFs or extensive save game archives are anticipated.
Network bandwidth is a critical, yet often overlooked, component of a successful OpenTTD server. The game transmits updates about vehicle movements, industry production, and player actions to all connected clients. While the data packets are relatively small, a consistent and low-latency connection is paramount. For a small server, a stable internet connection with at least 10 Mbps upload and download speed is usually adequate. As player counts and map complexity increase, a connection with 50 Mbps or even 100 Mbps symmetrical bandwidth becomes increasingly important to prevent lag and desynchronization issues. Low latency (ping) to the server is also crucial, as high latency can lead to a perceived delay in game actions and an overall less responsive experience. Hosting providers often specify their network infrastructure, and prioritizing those with robust, low-latency connections to major internet exchange points is beneficial.
The operating system choice for an OpenTTD server is flexible. OpenTTD is cross-platform and runs natively on Linux, Windows, and macOS. Linux distributions, particularly lightweight server-oriented versions like Ubuntu Server or Debian, are often preferred for their stability, lower resource overhead, and robust command-line interface, which is ideal for remote server management. Windows Server editions can also host OpenTTD effectively, offering a more familiar graphical interface for some administrators, though they typically consume more system resources. The choice often comes down to the administrator's familiarity and preference. Regardless of the OS, ensuring it is kept up-to-date with security patches and that only necessary services are running will contribute to server stability and security.
In summary, the game server requirements for OpenTTD are scalable. A basic server for a few friends can run on modest hardware, but a high-performance, large-scale server demands more substantial CPU power (especially single-core speed), ample RAM, fast SSD storage, and a high-bandwidth, low-latency network connection. Careful planning based on anticipated player count and map complexity will ensure a smooth and enjoyable experience for all participants.
Beginner's Guide
Embarking on the journey of hosting your own OpenTTD server can seem daunting at first, but with a structured approach, even novices can establish a thriving transport empire for their friends and fellow enthusiasts. This guide will walk you through the fundamental steps, from initial setup to basic configuration, ensuring a smooth launch for your multiplayer adventures.
The very first step involves acquiring the OpenTTD server software. Unlike the client application, which includes a graphical user interface, the dedicated server is typically a command-line application designed for headless operation. You can download the latest stable version from the official OpenTTD website. Look for the "server" or "headless" build specific to your chosen operating system (Linux, Windows, or macOS). For Windows, this usually comes as a .zip archive containing an executable. For Linux, it might be a pre-compiled binary or available through package managers, though downloading the official binary is often the most straightforward approach for a dedicated server.
Once downloaded, extract the contents of the archive to a dedicated folder on your server machine. A sensible location might be C:\OpenTTD_Server on Windows or /opt/openttd_server on Linux. Within this folder, you'll find the openttd executable (or openttd.exe on Windows) and several other files and directories.
The next crucial step is to configure your server. OpenTTD servers are primarily configured via a file named openttd.cfg, which is typically generated the first time the server runs or can be manually created. This file contains a plethora of settings that control game rules, server behavior, and network parameters. While you can start the server without a openttd.cfg file, it's highly recommended to create one or modify the default. Key parameters to consider include:
server_name: This sets the name that will appear in the in-game server browser. Choose something descriptive and engaging, like "My Awesome Transport Empire" or "OpenTTD Fun Zone."
server_port: The default OpenTTD server port is 3979. It's generally advisable to stick to this default unless you have specific networking reasons to change it. If you do change it, ensure your firewall rules and port forwarding reflect the new port.
max_clients: This determines the maximum number of players that can connect simultaneously. Start with a reasonable number, such as 8 or 16, and adjust as needed based on your server's resources and community size.
password: If you want to restrict access to your server, set a password here. Players will need to enter this password to join. For public servers, leave this blank.
admin_password: This sets a password for administrative commands within the game. This is crucial for managing the server, kicking players, or changing game settings on the fly. Choose a strong, unique password.
rcon_password: Remote Console (RCON) allows you to send commands to the server from an external application. If you plan to use RCON tools, set a strong password here.
savegame: This specifies the default save game to load when the server starts. You can either point it to an existing .sav file or leave it blank to start a new game. For a new game, you'll also need to configure map generation parameters.
map_x and map_y: These define the dimensions of the game map (e.g., map_x = 256, map_y = 256 for a 256x256 map). Larger maps require more resources.
grf-paths: If you plan to use custom NewGRFs (New Graphics Resources), you'll need to specify the paths to their directories here. This is an advanced topic, but essential for customizing the game's appearance and content.
To start the server, navigate to the directory where you extracted OpenTTD and execute the openttd binary from your command line or terminal.
On Windows:
.\openttd.exe -D
The -D flag tells OpenTTD to run as a dedicated server.
On Linux:
./openttd -D
Upon first launch, OpenTTD will generate a default openttd.cfg file in the config subdirectory (e.g., C:\OpenTTD_Server\config\openttd.cfg or /opt/openttd_server/config/openttd.cfg). You can then edit this file with a text editor to customize your server settings. After making changes, save the file and restart the server for the new settings to take effect.
Network configuration is a critical hurdle for many beginners. For players to connect to your server from outside your local network, you typically need to configure port forwarding on your home router. This involves telling your router to direct incoming traffic on the OpenTTD server port (default 3979) to the internal IP address of your server machine. The exact steps for port forwarding vary significantly between router models, so you'll need to consult your router's manual or search for instructions specific to your router make and model. Additionally, ensure that your server's operating system firewall (e.g., Windows Firewall, ufw on Linux) is configured to allow incoming connections on the OpenTTD port.
Once your server is running and port forwarding is configured, players can connect by launching their OpenTTD client, navigating to the "Multiplayer" menu, and either browsing the public server list (if your server is configured to announce itself) or directly entering your server's public IP address and port. You can find your public IP address by searching "what is my IP" on a search engine.
For ongoing management, familiarizing yourself with basic server commands is invaluable. These can often be entered directly into the server console or via an RCON client. Common commands include:
save: Saves the current game state.
restart: Restarts the server.
kick
ban
say
help: Displays a list of available commands.
Starting an OpenTTD server is a rewarding experience that opens up a world of collaborative transport planning. By following these steps – downloading the server, configuring openttd.cfg, setting up network access, and learning basic commands – you'll be well on your way to hosting a successful and enjoyable multiplayer environment. Remember to consult the official OpenTTD wiki and community forums for more in-depth information and troubleshooting assistance as you progress.
Hosting Service Comparison and Recommendations
Selecting the right hosting service for your OpenTTD server is a pivotal decision that directly impacts performance, reliability, and the overall player experience. While self-hosting is an option, dedicated hosting providers offer numerous advantages, including robust infrastructure, professional support, and often superior network connectivity. This section will compare various hosting paradigms and recommend specific types of services tailored for OpenTTD, with an emphasis on factors critical for a smooth gaming experience.
Broadly, hosting solutions can be categorized into several types, each with its own set of trade-offs: shared hosting, Virtual Private Servers (VPS), dedicated servers, and specialized game server hosting.
Shared Hosting is generally unsuitable for OpenTTD servers. In a shared hosting environment, multiple websites and applications reside on the same physical server, sharing resources like CPU, RAM, and bandwidth. This setup leads to unpredictable performance, as the activities of other tenants can negatively impact your server's stability and responsiveness. The lack of root access or administrative control also severely limits your ability to configure OpenTTD optimally or install necessary dependencies. While it might be the cheapest option, the compromises in performance and control make it a poor choice for any game server.
Virtual Private Servers (VPS) represent a significant step up. A VPS provides you with a virtualized slice of a physical server, offering dedicated resources (CPU cores, RAM, storage) and root access to your operating system. This isolation ensures more consistent performance than shared hosting. For OpenTTD, a VPS is often the sweet spot, balancing cost-effectiveness with sufficient power. When evaluating VPS providers, prioritize those offering:
High-frequency CPU cores: As OpenTTD's game logic is largely single-threaded, a VPS with fewer, faster cores (e.g., 2-4 cores at 3.0+ GHz) will generally outperform a VPS with more, slower cores. Look for providers that specify CPU clock speeds or offer "high-performance" VPS tiers.
SSD or NVMe storage: Essential for fast server startup and save game loading.
Ample RAM: 4GB to 8GB is a good range for most OpenTTD servers, depending on player count and map size.
Generous bandwidth and low latency: Crucial for a smooth multiplayer experience. Look for providers with data centers geographically close to your player base.
Reputable VPS providers include DigitalOcean, Linode, Vultr, and OVHcloud. These providers offer a range of Linux-based VPS options, which are ideal for OpenTTD due to their efficiency and stability.
Dedicated Servers offer the ultimate in performance and control. With a dedicated server, you lease an entire physical machine, meaning all its resources are exclusively yours. This eliminates the "noisy neighbor" problem entirely and provides maximum flexibility for customization. Dedicated servers are overkill for most small to medium OpenTTD communities but become highly attractive for very large, persistent worlds with high player counts, or if you plan to host multiple game servers simultaneously. The primary drawbacks are higher cost and the increased administrative overhead, as you are responsible for all aspects of server management, from operating system installation to security updates. Providers like Hetzner, OVHcloud, and various local data centers offer dedicated server solutions.
Specialized Game Server Hosting providers offer a managed solution specifically tailored for gaming. These services typically provide a user-friendly control panel (e.g., Pterodactyl, TCAdmin) that simplifies server setup, configuration, and management. They often pre-install game-specific files, offer one-click mod installations, and provide dedicated support for game-related issues. While they might be slightly more expensive than a raw VPS for comparable resources, the ease of use and specialized support can be invaluable, especially for those less comfortable with command-line interfaces. Many game server hosts offer OpenTTD as a supported game. When choosing a game server host, look for:
OpenTTD-specific support: Ensure they explicitly list OpenTTD and offer relevant configuration options.
Control panel features: Ease of use for managing saves, NewGRFs, and server settings.
DDoS protection: Essential for protecting your server from malicious attacks.
Geographic locations: Choose a data center close to your target player base for optimal latency.
Examples of game server hosts that often support OpenTTD include Hostinger, Shockbyte, and various smaller, specialized providers. It's crucial to read reviews and compare features carefully, as quality can vary significantly.
Recommendations based on use case:
For a small group of friends (2-8 players) on a modest budget: A low-tier VPS (e.g., 2 vCPU, 4GB RAM, SSD) from providers like DigitalOcean or Linode is an excellent choice. You'll need some comfort with Linux command-line administration.
For a medium-sized community (8-20 players) or those seeking ease of use: A specialized OpenTTD game server host is highly recommended. The managed service and user-friendly control panel will save significant time and effort.
For a large, public, or competitive server (20+ players) with extensive custom content: A higher-tier VPS (e.g., 4 vCPU, 8GB+ RAM, NVMe) or even a dedicated server might be necessary to guarantee peak performance. This option requires a strong understanding of server administration.
When comparing providers, always consider the total cost of ownership, including potential bandwidth overage charges, backup solutions, and the quality of customer support. A reliable host with responsive support can be a lifesaver when troubleshooting issues. Ultimately, the best hosting service is one that aligns with your technical proficiency, budget, and the specific needs of your OpenTTD community.
Troubleshooting
Even the most meticulously configured OpenTTD server can encounter issues. Effective troubleshooting is a critical skill for any server administrator, enabling prompt resolution of problems that can disrupt gameplay and frustrate players. This section outlines common OpenTTD server problems and provides systematic approaches to diagnose and resolve them, ensuring a stable and enjoyable experience for your community.
One of the most frequent issues encountered is players being unable to connect to the server. This can manifest as "Connection refused," "Server not found," or simply a timeout. The diagnostic process should begin with network connectivity.
Verify Server Status: First, confirm that the OpenTTD server process is actually running on the host machine. On Linux, use ps aux | grep openttd or systemctl status openttd if running as a service. On Windows, check Task Manager for openttd.exe. If it's not running, attempt to start it and observe any error messages in the console or logs.
Check Firewall: Ensure that the server's operating system firewall (e.g., ufw on Linux, Windows Defender Firewall) is configured to allow incoming TCP connections on the OpenTTD server port (default 3979). Temporarily disabling the firewall (for testing purposes only, re-enable immediately after) can help isolate if this is the culprit.
Port Forwarding (for home servers): If you are hosting from a home network, verify that port forwarding is correctly configured on your router. The router must be forwarding external traffic on port 3979 to the internal IP address of your server machine. Double-check the internal IP address of your server, as it might change if you're using DHCP without a static IP reservation.
Public IP Address: Ensure players are attempting to connect to the correct public IP address of your server. If your public IP changes (common with residential ISPs), you might need to use a Dynamic DNS (DDNS) service to maintain a consistent hostname.
Server List Announce: If your server isn't appearing in the in-game server browser, check your openttd.cfg file for server_advertise = true. Also, ensure that the server's public IP and port are correctly detected and reachable by the OpenTTD master server.
Lag and performance issues are another common complaint, especially as player counts or map complexity increase.
Monitor Server Resources: Use system monitoring tools (e.g., htop on Linux, Task Manager on Windows) to observe CPU, RAM, and network utilization on the server host. High CPU usage (especially a single core maxed out) indicates a bottleneck in game logic processing. High RAM usage might lead to paging, causing slowdowns.
Check Server Logs: OpenTTD server logs (typically in the config directory) can provide insights into performance warnings, errors, or unusual events. Look for messages related to slow updates or network issues.
Network Latency: High ping times between players and the server can cause perceived lag. Use ping or traceroute commands from a client machine to the server's IP address to diagnose network latency and identify potential bottlenecks along the route (Data Communications and Networking).
Map Size and NewGRFs: Very large maps or an excessive number of complex NewGRFs can significantly increase resource demands. Consider reducing map size or optimizing your NewGRF selection if resources are consistently strained.
Server Tick Rate: While not directly configurable in OpenTTD in the same way as some other games, the game's internal simulation speed can be affected by server load. If the server is struggling, the game "ticks" might slow down, leading to a sluggish experience. Upgrading server hardware (faster CPU, more RAM) is often the solution here.
Game state corruption or crashes can be particularly frustrating, leading to lost progress.
Regular Backups: Implement a robust backup strategy for your save games. This is the most crucial preventative measure. Automate backups to run periodically.
Check for NewGRF Conflicts: Incompatible or buggy NewGRFs are a common source of instability. If crashes occur after adding new NewGRFs, try removing them one by one to identify the culprit. The OpenTTD console or log files might indicate which GRF is causing an issue.
Server Software Version: Ensure you are running a stable, up-to-date version of the OpenTTD server. Beta or nightly builds might introduce new features but can also be less stable.
Disk Space: Ensure the server has sufficient free disk space. Running out of space can prevent save games from being written or lead to other unexpected errors.
Hardware Issues: While less common, underlying hardware failures (e.g., failing RAM, corrupted storage) can cause unpredictable crashes. If all software-related troubleshooting fails, consider running hardware diagnostics.
Admin command issues or difficulty managing the server remotely.
Admin Password: Double-check the admin_password in your openttd.cfg file. Ensure you are entering it correctly in the client's console.
RCON Configuration: If using RCON, verify rcon_password and rcon_port settings. Ensure the RCON client is configured to connect to the correct IP and port.
Permissions: On Linux servers, ensure the openttd user has appropriate read/write permissions to the server directory, especially for saving games and modifying configuration files.
When troubleshooting, adopt a systematic approach:
Isolate the problem: Determine if it's affecting all players or just one, if it's constant or intermittent, and if it started after a specific change.
Check logs: Server logs are your best friend for identifying errors.
One change at a time: When attempting fixes, make only one change at a time and test its effect before making another. This helps pinpoint the solution.
Consult the community: The OpenTTD forums and wiki are excellent resources. Many common issues have already been discussed and resolved by the community (OpenTTD Wiki).
By understanding these common issues and employing a methodical troubleshooting process, you can maintain a healthy and responsive OpenTTD server, providing a seamless experience for your players.
Performance Optimization Tips
Optimizing an OpenTTD server's performance is crucial for maintaining a smooth, lag-free experience, especially as your transport networks grow in complexity and your player count increases. While hardware plays a significant role, numerous software-side adjustments and best practices can extract maximum efficiency from your server resources. This section delves into actionable strategies for enhancing OpenTTD server performance.
One of the most impactful areas for optimization lies in server configuration parameters within the openttd.cfg file.
autosave_interval: While regular autosaves are vital for data integrity, frequent autosaves on large maps can cause momentary server freezes (stuttering) as the game state is written to disk. Consider increasing the autosave_interval (e.g., from 5 minutes to 10 or 15 minutes) during peak playtimes, or schedule them during periods of lower activity. Ensure your savegame_compression is set to a reasonable level; zlib is a good balance between speed and file size.
max_clients: Setting a realistic max_clients value prevents your server from becoming overloaded. If your hardware struggles with 16 players, reducing it to 12 or 8 can significantly improve performance for the remaining players.
max_companies: Similar to max_clients, limiting the number of active companies can reduce the computational load, as each company's AI and economic simulation consumes resources.
map_x and map_y: The size of your game map has a direct correlation with resource consumption. Smaller maps (e.g., 256x256 or 512x512) are significantly less demanding than very large maps (e.g., 2048x2048). If performance is a concern, consider starting with a more modest map size.
day_length: Increasing the day_length (making game days longer) can reduce the frequency of game ticks, which in turn reduces the computational load on the server. This can be a subtle but effective optimization for very busy servers.
NewGRF management is another critical aspect. While NewGRFs enhance the game's visual appeal and add new content, they can also be a source of performance degradation.
Minimize Redundancy: Only use NewGRFs that are truly necessary and avoid installing multiple GRFs that serve similar functions. Each active GRF adds to the server's memory footprint and processing overhead.
Choose Efficient GRFs: Some NewGRFs are more resource-intensive than others, particularly those with complex animations or extensive sprite sets. Research community recommendations for performance-friendly GRFs.
Pre-load GRFs: Ensure all necessary GRFs are correctly configured in openttd.cfg and loaded at server startup. Dynamic loading or unloading of GRFs during gameplay can cause instability or performance hitches.
Operating system and server environment optimizations can also yield significant gains.
Use a Lightweight OS: For dedicated servers or VPS, a minimal Linux distribution (e.g., Ubuntu Server, Debian Minimal) is generally preferred over a full desktop environment. These consume fewer system resources, leaving more for OpenTTD (Linux System Programming: Talking Directly to the Kernel and C Library).
Disable Unnecessary Services: Review and disable any non-essential services running on the server. Every background process consumes CPU cycles and RAM that could otherwise be allocated to OpenTTD.
Keep OS Updated: Ensure your operating system and all relevant drivers are kept up-to-date. Performance improvements and bug fixes are often included in updates.
Prioritize OpenTTD Process: On Linux, you can use the nice command to adjust the priority of the OpenTTD process, giving it more CPU time. For example, nice -n -10 ./openttd -D would give it a higher priority. On Windows, you can set process priority via Task Manager.
Dedicated Hardware: If possible, run OpenTTD on hardware dedicated solely to the server. Avoid running other demanding applications (e.g., web servers, databases) on the same machine, especially if resources are limited.
Network considerations are paramount for a smooth multiplayer experience.
Low Latency Connection: Choose a hosting provider with data centers geographically close to your primary player base to minimize network latency (ping). High latency leads to perceived lag, even if the server's simulation is running perfectly.
Sufficient Bandwidth: Ensure your server has adequate symmetrical bandwidth (upload and download). While OpenTTD's data packets are small, a high player count can still saturate a limited connection.
DDoS Protection: While not directly a performance optimization, DDoS protection prevents malicious attacks that can completely cripple your server's network connectivity and thus its performance.
Finally, regular maintenance and monitoring are key to sustained performance.
Monitor Resource Usage: Continuously monitor CPU, RAM, and network usage. Tools like htop, grafana, or cloud provider monitoring dashboards can help identify bottlenecks before they become critical.
Review Logs: Regularly check OpenTTD server logs for warnings or errors that might indicate underlying performance issues or impending problems.
Clean Up Old Saves: Periodically remove old or unused save games to free up disk space and keep your server directory tidy.
By implementing these performance optimization tips, you can significantly enhance the responsiveness and stability of your OpenTTD server, providing a superior and more enjoyable experience for all players. It's an ongoing process of monitoring, adjusting, and refining to match your server's specific needs and player community.
Technical Q&A
This section addresses common technical questions that arise during the setup, configuration, and maintenance of an OpenTTD server. The answers are designed to provide clear, concise, and authoritative guidance, drawing upon established computing principles and OpenTTD-specific knowledge.
Q1: What is the difference between the OpenTTD client and the OpenTTD dedicated server?
A1: The OpenTTD client is the graphical application that players use to interact with the game, whether in single-player mode or connecting to a multiplayer server. It includes the user interface, rendering engine, and local game logic. The OpenTTD dedicated server, conversely, is a command-line application designed to run without a graphical interface. Its primary function is to host the game world, manage the game state, process player actions, and handle network communication with connected clients. It does not render graphics or provide a direct visual interface for gameplay; instead, it focuses solely on the simulation and networking aspects (OpenTTD Wiki). This headless operation makes it ideal for remote hosting environments like VPS or dedicated servers, where graphical overhead is undesirable.
Q2: How do I make my OpenTTD server publicly visible in the in-game server browser?
A2: To make your OpenTTD server publicly visible, you need to ensure two main conditions are met. First, in your openttd.cfg file, the setting server_advertise must be set to true. This instructs your server to announce its presence to the OpenTTD master server list. Second, and crucially, your server must be directly reachable from the internet. This typically involves configuring port forwarding on your router (if hosting from a home network) to direct incoming traffic on the OpenTTD server port (default 3979) to the internal IP address of your server machine. Additionally, any firewalls on the server host or network must permit incoming connections on this port. If these conditions are met, the master server will periodically query your server and add it to the public list.
Q3: Can I run multiple OpenTTD servers on a single machine?
A3: Yes, it is technically possible to run multiple OpenTTD servers on a single machine, provided the machine has sufficient hardware resources (CPU, RAM, network bandwidth) to handle the combined load. Each server instance will require its own dedicated set of configuration files (e.g., openttd.cfg), save game directories, and crucially, a unique server_port number. For example, one server might run on port 3979, another on 3980, and so on. You would launch each server instance with its own configuration file and port specification. However, it's important to note that OpenTTD's game logic is largely single-threaded, so running many instances on a machine with limited single-core CPU performance might lead to bottlenecks. Careful resource monitoring is essential.
Q4: What are NewGRFs, and how do I install them on my server?
A4: NewGRFs (New Graphics Resources) are custom content packages that extend OpenTTD's gameplay by adding new vehicles, industries, buildings, terrain features, and other graphical elements. They are typically distributed as .grf files. To install them on your server, you first need to download the desired .grf files and place them in a designated newgrf subdirectory within your OpenTTD server installation (e.g., /opt/openttd_server/newgrf/). Next, you must inform the server about these GRFs by editing your openttd.cfg file. You'll add lines under the [newgrf] section, specifying the path to each .grf file, for example: newgrf = newgrf/my_train_set.grf. The order in which GRFs are listed can sometimes matter for compatibility. After modifying openttd.cfg, restart your server for the changes to take effect. All players connecting to the server will automatically download and use the specified NewGRFs.
Q5: My server is experiencing lag, but my CPU and RAM usage seem low. What could be the problem?
A5: If your server is lagging despite low CPU and RAM utilization, the bottleneck is most likely related to network connectivity or disk I/O.
Network Latency/Bandwidth: High latency (ping) between your server and players, or insufficient network bandwidth (especially upload speed), can cause perceived lag. Even if the server's simulation runs perfectly, delays in transmitting game state updates to clients will result in a choppy experience. Use network diagnostic tools like ping and traceroute to assess latency to your server from various client locations (Data Communications and Networking).
Disk I/O: While less common for continuous lag, slow disk I/O can cause intermittent stuttering, particularly during autosaves or when loading/saving large game states. If your server is using a traditional HDD instead of an SSD, upgrading to an SSD can significantly alleviate this.
Single-Threaded Bottleneck: Although overall CPU usage might appear low, OpenTTD's core game logic is primarily single-threaded. If that single core is maxed out, even if other cores are idle, the game simulation will slow down. Monitor individual core usage rather than just overall CPU utilization. A CPU with higher single-core clock speed is beneficial in this scenario.
Game State Complexity: Extremely large maps with thousands of vehicles, complex pathfinding, and numerous industries can inherently increase the computational burden on the game logic, even if the server hardware seems underutilized. Optimizing map size, vehicle limits, and NewGRF selection can help.