andreashauschild / openttd-server

Docker container for hosting multiple openttd service instances
Apache License 2.0
18 stars 3 forks source link

How do I load custom packages? #4

Open zazzn opened 1 year ago

zazzn commented 1 year ago

Since I can't run the game to and download the items, I'm trying to add a few changes.

base graphics set Abase gfx new GRF ontario townnames

Help is appreciated! ;)

andreashauschild commented 1 year ago

Hi Zazzn, at the moment you can't upload grf content within the server ui. But you can create a random game in the openttd-server admin gui and then install online content via the terminal:

Execute the following commands:

content update Wait until "Content server connection closed" is printed in the console.

content select 55570001 55570001 is the id of ontario town names https://bananas.openttd.org/package/newgrf/55570001/2017-12-09T20:58:42+00:00

content download

Now the oppenttd game within the container has the grf you want to use.

Next steps are:

  1. Create a game with your local openttd game (not openttd-server)
  2. Generate a mpa with ontario file names and save it.
  3. Upload your save game to openttd server
  4. Create a new server and use this savegame as start save game.
  5. Now you can use this map as start savegame on openttd-server.

I tried this and it worked.

See here how to install online content with terminal: https://wiki.openttd.org/en/Manual/Dedicated%20server#installing-online-content

I hope the helps :)

Furthermore i think the graphic sets are only on your client and not on the server side, but i am not 100% sure about that.

Thebys commented 8 months ago

Hello! I'd like to thank you for this project, seems to be the best there is.

However I am also struggling with adding newgrfs. I've tried the instructions in this thread, and some common troubleshooting and googling, but still can't get it to work.

Observations:

Questions:

I know it may be difficult or impossible to do much about this, sadly it is outside my skillset to try, but it would be so good to have! Any help, context and support is very welcome and appreciated, keep up the good work and all the best for 2024 <3

EDIT: Managed to patch my container to work to that all created servers will have prepared newgrf files available.

andreashauschild commented 8 months ago

Hi TheBys,

Thank you for your detailed input and the proposed solution, which seems quite straightforward. Given that it only requires basic Docker skills, it should be feasible for a user to execute a Docker copy command. I will attempt to replicate your solution, and if it functions as described, I will include it in the README. Additionally, I am considering implementing a multi-file upload feature for NEWGRF files on the server. This would also benefit players who do not have access to the Docker container, especially if it's hosted remotely.

Thebys commented 8 months ago

Thank you! You are correct that patching a container is no big deal (once you figure out how). Having the ability to upload newgrf files through the interface would be very welcome indeed, my bounty offer stands, but it could also potentially allow for some poisoned or just incompatible uploads, might be good to have a delete option or talk directly with BaNaNaS. It still won't solve the need for config, but it'l make the whole process a lot easier. My most recent experiment was to patch also "ai" and "game" directories, which supply computer opponents and game scripts, it may be worth adding these as well.

andreashauschild commented 8 months ago

I would implemented a basic file browser that allows users to navigate the entire game directory. This includes the ability to upload files or ZIP archives (with the ZIPs being unpacked into the current directory). Additionally, I plan to add functionality to delete files and directories within the game directory. To address concerns about accidental damage to the installed game, I am also considering implementing a 'factory reset' feature, which would restore the game completely. Currently, my spare time is limited, so I anticipate completing this feature within the next two months. However, as the implementation is not overly complex, it might be finished sooner than expected.

I greatly appreciate the bounty and am pleased to accept it. This support is instrumental in covering ongoing expenses such as my web server, Docker Hub, and similar costs. Thank you for your contribution to sustaining these essential services. :)

I recently explored BaNaNaS, a feature I wasn't aware of while primarily playing vanilla OpenTTD. While the idea of integrating it seems appealing, it appears to be a long-term goal. From what I've seen, there isn't an easily accessible API for integration, or perhaps I need to investigate further. For now, I believe implementing a file browser offers the most flexibility and can be accomplished more quickly.