[Request] Automatic spectator script
Moderator: OpenTTD Developers
[Request] Automatic spectator script
I have no idea how "scripts" actually work and what they could do.
But is there a script or perhaps a way to write a "automatic spectator script"?
The idea is that someone would host a server and play like you normally would with your friends.
Then you'd have a separate client join and run the spectator script on that client.
The script would pan around the map and look at what everyone's doing, and also now and then show the stats of each player.
That client could then be streamed to Twitch (or similar) for everyone to enjoy.
Is this something a script could do?
But is there a script or perhaps a way to write a "automatic spectator script"?
The idea is that someone would host a server and play like you normally would with your friends.
Then you'd have a separate client join and run the spectator script on that client.
The script would pan around the map and look at what everyone's doing, and also now and then show the stats of each player.
That client could then be streamed to Twitch (or similar) for everyone to enjoy.
Is this something a script could do?
Keep it simple.
Re: [Request] Automatic spectator script
No, not using AI or Game Scripts of current official release versions.
- Game Script has an API to pan the view, but it only work in single player.
- AI doesn't have this API as they control companies. Also the AI code only runs on the server in multiplayer.
With the possibility of custom source code changes, it is possible you just have to figure out how to implement it. (this is not an offer to do it for you)
Edit: Also, note that there may be other solutions using console scripts or admin port that could solve your problem, but as you posted in the AI and Game Script sub forum, the answer focus on this area.
- Game Script has an API to pan the view, but it only work in single player.
- AI doesn't have this API as they control companies. Also the AI code only runs on the server in multiplayer.
With the possibility of custom source code changes, it is possible you just have to figure out how to implement it. (this is not an offer to do it for you)
Edit: Also, note that there may be other solutions using console scripts or admin port that could solve your problem, but as you posted in the AI and Game Script sub forum, the answer focus on this area.
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
Junctioneer (a traffic intersection simulator)
Re: [Request] Automatic spectator script
Good to know!
Is there perhaps some way to output information about the current game to a text file of some sort?
Perhaps the server could write each new event, along with its position and who created the event, to a log file.
Is there perhaps some way to output information about the current game to a text file of some sort?
Perhaps the server could write each new event, along with its position and who created the event, to a log file.
Keep it simple.
- planetmaker
- OpenTTD Developer
- Posts: 9432
- Joined: 07 Nov 2007 22:44
- Location: Sol d
Re: [Request] Automatic spectator script
You can do that via the admin port. One of its purposes is logging. SOAP is the incarnation I use for accessing it.Hezkore wrote:Good to know!
Is there perhaps some way to output information about the current game to a text file of some sort?
Perhaps the server could write each new event, along with its position and who created the event, to a log file.
OpenTTD: manual | online content | translations | Wanted contributions and patches
#openttdcoop: blog | wiki | public server | DevZone | NewGRF web translator
DevZone - home of the free NewGRFs: OpenSFX | OpenMSX | OpenGFX | Swedish Rails | OpenGFX+ Trains|RV|Industries|Airports|Landscape | NML
Re: [Request] Automatic spectator script
CityMania client has a spectator patch. You can select one player or whole company and it will continuously pan to a place of last action. It's not a particularly nice viewing experience as you only see the end result of each action not player's mouse or building process. But it's the best you can do without requiring players to run a heavily modified game or some video recording software.
Re: [Request] Automatic spectator script
Is there anywhere I can read about this "Admin Port" without looking at pure source code?
Any sort of documentation?
Any sort of documentation?
Keep it simple.
Re: [Request] Automatic spectator script
There is docs/admin_network.txt with protocol documentation.
On the wiki, you can find some starting points for libraries/utilities to use as is or to read in order to learn and build your own.
https://wiki.openttd.org/Server_admin_port
On the wiki, you can find some starting points for libraries/utilities to use as is or to read in order to learn and build your own.
https://wiki.openttd.org/Server_admin_port
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
Junctioneer (a traffic intersection simulator)
Re: [Request] Automatic spectator script
I've got a bot running that can connect and send and receive data.
But the data structure of each packet is a mystery.
Having to decode someone else code (in a different language) is quite the chore.
The wiki should really have a brief overview of each packet and its data structure.
But the data structure of each packet is a mystery.
Having to decode someone else code (in a different language) is quite the chore.
The wiki should really have a brief overview of each packet and its data structure.
Keep it simple.
Re: [Request] Automatic spectator script
I ended up creating an Admin Port library for the open-source language Monkey2
You can read more about it in this thread
You can read more about it in this thread
Keep it simple.
Who is online
Users browsing this forum: Majestic-12 [Bot] and 38 guests