NewGRF, Gamescript or Source modification?

Forum for technical discussions regarding development. If you have a general suggestion, problem or comment, please use one of the other forums.

Moderator: OpenTTD Developers

Post Reply
abregado
Engineer
Engineer
Posts: 35
Joined: 02 Apr 2015 22:39

NewGRF, Gamescript or Source modification?

Post by abregado »

I've been thinking of a way to play games of TTD with friends from other timezones and came up with the following idea.

Run a dedicated server and modify it like this:
players can build while paused.
players cannot build build the game is running.
the server runs 1 year of game time at full speed every 16 hours.
after running this year of time, all vehicles are moved back to depots (to make sure they dont get in the way of construction) then the game is paused
dedicated server runs constantly, resetting at a fixed game date.

This way the players could log in and spend their cash/upgrade their network once or twice a day. Reducing the number of opportunities that each player can interact with the game (spend their money) while being flexable with WHEN they play should help with timezone balancing.

It also should help to make the game more balanced when playing with people who cannot play for exactly the same amount of time per play session.

Build speed will be less important than design skill.

My questions ares:
How much of this can be coded into a Gamescript/NewGRF and how much will need to rely on modifying and re-compiling the source code?
How much of this is even possible?
User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9432
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: NewGRF, Gamescript or Source modification?

Post by planetmaker »

abregado wrote: Run a dedicated server and modify it like this:
players can build while paused.
players cannot build build the game is running.
the server runs 1 year of game time at full speed every 16 hours.
after running this year of time, all vehicles are moved back to depots (to make sure they dont get in the way of construction) then the game is paused
dedicated server runs constantly, resetting at a fixed game date.

This way the players could log in and spend their cash/upgrade their network once or twice a day. Reducing the number of opportunities that each player can interact with the game (spend their money) while being flexable with WHEN they play should help with timezone balancing.

How much of this can be coded into a Gamescript/NewGRF and how much will need to rely on modifying and re-compiling the source code?
How much of this is even possible?
Basically no NewGRF or game script is needed, nor any OpenTTD source modifications, but only a custom-written control making use of the admin port interface.

The most difficult challange will be the "send vehicles back to depot" - and that's IMHO also the most questionable goal as I myself as player wouldn't want that and similar to disallow building when the game is running.

The admin port interface would be the method of choice to control whether the server is paused or not, if you want to go beyond a regime where it is simply unpaused when a player (or several) are online. Just make your admin port script sophisticated enough and it should suit your needs.

Allowing to build during pause is a simple setting which you can choose to activate. Disallowing building while the game is running sounds stupid to me, especially in conjunction with the approach to send vehicles back to depot. It makes any debugging on the players network a HUGE PITA. However you could do so with the same approach you control pause mode via the admin port interface, toggling the build restrictions, thus limiting the amount players can build in a given time slot. If you want to entirely forbid that, move all players out of their companies to spectator.

Resetting the server can similarily be handled by the admin port interface.
abregado
Engineer
Engineer
Posts: 35
Joined: 02 Apr 2015 22:39

Re: NewGRF, Gamescript or Source modification?

Post by abregado »

planetmaker wrote:Disallowing building while the game is running sounds stupid to me, especially in conjunction with the approach to send vehicles back to depot. It makes any debugging on the players network a HUGE PITA.
Yes, this was the biggest hurdle to design. The moving vehicles back to depot woud only be to assist with building while paused, and maybe to prevent one accidentaly Stopped vehicle from jamming the entire network.

It could be changed instead to allow the players to build while the simulation runs (every 16 hours for X time) but this may also give advantage to thos eplayers who play at exactly those times. Core design goal is to be Multi-Timezone balanced.

As the concept is designed to limited the number of Interactions that a player makes (effectivley making the game Phased-Based), having the game running when some/all players are joined wouldnt work. Unless there is some way of decoupling Date Advancement and simulation. If there was a way to keep the simulation running (ghost vehicles moving) but no cash is earnt or spent, and the date does not move forward, it would allow networks to be debugged.

Is such a thing possible? I know that modifying the speed effects the economy in bad ways...
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: No registered users and 24 guests