News:

The Forum Rules and Guidelines
Our forum has Rules and Guidelines. Please, be kind and read them ;).

MUD-client-like (multi-world) admin tool?

Started by knotwork, December 01, 2020, 07:32:54 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

knotwork

I have already been informed that the admin tool for performing admin actions on headless servers is not currently available for Extended.

But (1) maybe while it needs work anyway is a good time to imagine or propose extended functionality; and (2) I probably largely dove into Extended's section on some kind of idea that since I might well need whatever transport baron game I end up using for my intended purposes to be extended in some way in order to make it the best game for the job, I might as well check in with the folks who are already in the process of extending what would normally be one of the prime candidates for the job.

So. It has been suggested elsewhere that a tool used by admins of headless servers to avoid having to fire up an entire GUI-client might be my best approach toward using this kind of game for the purposes I intend.

Meanwhile I have been thinking "what if one merely wanted to run two or more online instances and try to start to simulate some kind(s) of interaction between/among them?"

For both purposes, it seems to me, a feature I see in my MUD client, that I have actually never used even though for a long long time I wrote my MUD-scripts with an eye to accomodating it, is that a MUD client can connect to more than one world simultaneously. (Lots. Maybe even a "ridiculous" number.)

So, knowing that MUD clients anticipate use-cases in which one would want to do that, I thought well gosh golly would not an admin tool for a transport-baron-type game also reasonably want to be able to do that?

With such a tool one could have an entire server-farm of servers all working toward simulating the maps they are running being in some sense neighbors.

I read in some post or other that one can delete a car that is clogging traffic in a city. If one could also delete, say, a public bus or plane or train or somesuch at the edge of one map while bringing just such a vehicle into existence on other - preferably at a map edge, preferably an edge purporting to be "the direction of that other map", well that could be the start of something interesting, could it not?

-MarkM-

prissi

Simutrans and OpenTDD are not server-client games. The client has the full calculation that the server does (actually more, since on top of calculating the map it calculates and displays the graphics). Thus the traffic requirement are very low after the initial gamestate has been transferred, since only user interaction must be transferred. All objects follow their deterministic behavior. As such, there is no possibility of a server only implementation without a full redesing of either Simutrans or OpenTTD.

As a side effect, a very low end v-server happily serves 16 players (or more, since player can share slots) on a 4 million tile map (at least in standard), because it must meet the lower common denominator of all clients that connect to it. So if the client with the double core Intel Atom can connect, the server has to be about 2/3 as strong only (due to the lack of graphic routines).

You can also play on your "server" and poeple connect to you. The "load game as server" switch will do that. Even local commands are queued in the deterministic command processing queue and are sent out at to be executed at a certain frame on all clients (by the clients and the server).

knotwork

So the console admin tool isn't just connecting to a console but actually runs the entire simulation locally like the GUI clients, just "headlessly"?

Even if that is the case though, if the tool really can be run on a console, maybe even an actual MUD-client could ssh into that console and the tool likely not even bother to notice the keyboard the keystrokes are coming from happens to be remote?

-MarkM-

jamespetts

There is a console administrative tool called nettool, and it is currently available for Simutrans-Extended. The tool is a very small application that interfaces with Simutrans (whether Standard or Extended) running as a server and sends it commands, e.g., to list the currently playing clients, to send a chat message in game, to save the game state, to kick and/or ban a player, to lock/unlock a player company or to terminate the game.

There does not seem to be any immediate need to expand this functionality, at least, not a need that is more pressing than the need to progress towards game balance and all the features inherent in that.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Mariculous

I agree with a single point:
Being able to enter tose nettool commands directly into the console of any (or at least the headless) simutrans instance would be pretty nice.
But it's not mandatory. It's just nice-to-have if anyone is interessted in impleminting this.

knotwork

Well that sounds great! From the sound of it I can have a MUD client ssh in to two or more machines, and on each fire up Simutrans or Simutrans-Extended, fire up the nettool, and proceed to muck about that way.

I think there had been some confusion due to there also being a bot tool using "Squirrel", mayhap that is what I'd been told was not currently working for Extended.

Thanks! I shall have to give this a whirl now! :)

-MarkM-

jamespetts

Yes - the "Squirrel" scripting does not work in Extended, but the nettool functionality does.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

knotwork

 Ah. Well nettool was easy, but I see what you mean about it being simple. Looking at the code of simutrans there do not appear to be a bunch of more-interesting / more-useful commands in there that nettool is not choosing to expose to its user, either.

Oh well. Evidently it must have been OpenTTD that I was running when I found a whole quite powerful-seeming text-console one could pop up within the GUI. I was imagining nettool being something like that. :(

Hmmm, I guess I will have to look into grep-ing or awk-ing savegame files to get at things like how much money each company has, as the command nettools claims will give detailed information on a particular company only gives the rather sparse summary that getting the list of companies already gave.

(I had imagined you'd ask for the list to know how many there are and maybe a few clues to help decide which might be worth asking for the detailed information about, but no.)

I don't suppose Squirrel scripts would be allowed any means of writing to disk, would they? They are probably sandboxed for security, unable to touch the machine the server is running on, so unable to write a list? Or can they maybe write to the log or something like that?

-MarkM-

jamespetts

I do not know much about the Squirrel scripting interface, I am afraid, as this is not something that has ever worked fully with Extended. There have been some abortive attempts to integrate this; you could always have a go at that if you think that that would help.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Mariculous

Quote from: knotwork on December 01, 2020, 03:42:09 PMgrep-ing or awk-ing savegame files
The most human-readable savegame format supported is XML, but these saves are massively huge and not pretty readable too.
I don't think grep, awk or any other text-based tools will work well.

Vladki

Quote from: knotwork on December 01, 2020, 07:32:54 AMI read in some post or other that one can delete a car that is clogging traffic in a city. If one could also delete, say, a public bus or plane or train or somesuch at the edge of one map while bringing just such a vehicle into existence on other - preferably at a map edge, preferably an edge purporting to be "the direction of that other map", well that could be the start of something interesting, could it not?
Private cars clogging a city, are not so important. They are somewhere between an eye-candy and a nasty stuff. All they do is delay your road transport. Therefor the ability to delete them is sometimes necessary to get rid of deadlocks. But the do not carry any goods or passengers. (Well they carry passengers that did not use public transport). Their effect on player's revenues is only indirect. Appearing or disappearing (public) player vehicles would be really weird. (You can delete your own vehicle if it is badly stuck, but that means selling it on spot and the cargo is lost.)

What would be imho more feasible, is passengers and cargo magically appearing at a station (space-port).  But I cannot imagine how to route them TO that station. Each passenger and piece of cargo has its destination, so there would have to be some factory at least accepting goods (and visitors), to make the routing. Therefore I suggest that OpenTTD would be better, as it allows you to deliver the goods wherever you like to.

knotwork

Yes, I am going to have another look at OpenTTD certainly.

But also look into what the mod pack things are capable of too.

Along the way I wondered if maybe the "play by email client for the Galactic Milieu" chose to cast players as ship-captains able to just go from place to place as they chose putting things on each place's markets at prices of their own choosing and buy up anything on those markets that they figure they could get a higher price for somewhere else to actually greatly simplify their task, not having to figure everything out to make the environment work, letting the players make a mess of it all if they chose, IT did have those same players doing the building of the industries too afterall.

But I googled terms like "Maerchant Prince" that I recalled or thought I recalled from at least one of Poul Anderson's interstallar space  settings having somehow an impression that he had based them on some historical period and didn't really come up with any major tradition of independents doing their own wheeler-dealer thing, R. Buckminter Fuller's "pirates" view of things to the contrary.

A lot of results I found actually made it sound like the folks owning all these factories and hiring you-lot to do their fetching and carrying would be the "tycoons", "Barons of Industry" and such. Though in looking to set this kind of game into an interstelllar backdrop I suppose the kind of folks I was thinking of as tycoons would be ones who buy up planetoids, planets and such and get you lot to come in and terraform them for them. :)

-MarkM-

prissi

The scripting system has more or less access to many itnernal tools and functions and thus could in principle even generate a new world with predefined parameters from a standard seed (There are two, one determines the map, and the second the city locations etc.)

knotwork

#13
Aha! Generating worlds from seeds, now that is right out of my Apple-IIe playbook! :)

I had been thinking look at those depots, how do all those vehicles get there? Those industrial-vehicle suppliers are smooth operators! Maybe those are a deus ex machina just begging for a "UFOs and black helicoptors" explanation, maybe the depots are a good place to start; maybe I can make an industrial-vehicles pak that keeps track of total sales and the mysterious "who-ever it is that is out there" can vie with one-another picking which modes of locomotion to buy into the importing of; maybe even which brands of which modes.

Then at the end of the game - or a possibly a periodic accounting in the case of endless games - they can compare their sales-figures and settle any side-wagers they might sportingly have made among themselves.

I had fired up OpenTTD again by that point, so had just used their look at online content button and grabbed a bunch of plugins for them, setting AIs against one-another; so went to go get pak128 for Simutrans and discovered oops there does not seem to be a built-in update-and-upgrade in my (Ubuntu 18.04 LTS) Simutrans client. I found it anyway, somewhere where the pak descriptions were largely not in English, but it got an error trying to load. I found what seemed to be the same list, in English, but it seemed to link to the same version on Sourceforge. So I am presently momentatily derailed by the attempt to get a working pack to start attempting small modifications of to dip my toes into the water so to speak.

However just reading up on how to make a pak led me to think it does not seem itself to provide scripting, so I had arrived back at the idea of looking into that Squirrel thing that unfortunately would by the sound of it only work on non-Extended Simutrans for now. But hey, non-Extended is what Ubuntu sees fit to provide, so maybe I can just go ahead on that angle for now and worry about getting it to work under Extended later when if nothing else I'd be more familiar with what it was that needed to be gotten working...

So thanks for that, from seeds I can create billions of entire galaxies full of worlds if I choose to do so! :) Though truth to tell I had to break up the 36-character string co-ordinates I was using (and still use actually to set co-ordinates for the FreeCiv worlds in the Galactic Milieu) into smaller pieces for the IIe's 6-byte reals to digest them piece by piece into distance calculations, and needed to make a tiny simple assembly-language "use a sequence of 36 arbitrary bytes as seed" random-number generator.

I am off to go look at that Squirrel thing again... :)

Though I did discover that there is or had been a pak with an automobiles industries chain so would be interested in finding out where, if anywhere, one gets hold of paks that work with Ubuntu's off-the-shelf Simutrans 120.2.2

-MarkM-

Vladki

Quote from: knotwork on December 02, 2020, 03:02:57 AMThough I did discover that there is or had been a pak with an automobiles industries chain so would be interested in finding out where, if anywhere, one gets hold of paks that work with Ubuntu's off-the-shelf Simutrans 120.2.2
at least pak128 and pak128.britain have automobile industry.

knotwork

pak128 hasn't worked for me. I do have a working pak128.Britain though so great.

Can only the pak tool unpack the contents of a pak or is it really ultimately just a zip or gz or somesuch that one can actually unpack with a normal archive-unpacker of some kind? Most curious but if I won't need the tool until ready to re-pack...

Hmm file doesn't seem to recognise it (the files in pak128.Britain) as any known form of compression, so maybe I need to get source code for those files separately somehow/somewhere? Since presumably what I'd be doing is changing source code then eventually running the tool on them to recompile / repack / re-whatever?

-MarkM-

jamespetts

Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.