Dedicated server autopilot (current version: 2.0.4)

OpenTTD is a fully open-sourced reimplementation of TTD, written in C++, boasting improved gameplay and many new features.

Moderator: OpenTTD Developers

User avatar
Brianetta
Tycoon
Tycoon
Posts: 2566
Joined: 15 Oct 2003 22:00
Location: Jarrow, UK
Contact:

Post by Brianetta »

Unlikely. If autopilot recognises nothing at all, then it does nothing, but the game should cotinue to run. The game is quitting, without autopilot telling it to. I won't know why until tonight, when I get in.

Of course, if it really is broken, then I might have to expedite the release of autopilot 2...
PGP fingerprint: E66A 9D58 AA10 E967 41A6 474E E41D 10AE 082C F3ED
Picknicker
Engineer
Engineer
Posts: 20
Joined: 31 Aug 2006 15:28

Post by Picknicker »

Brianetta wrote:Unlikely. If autopilot recognises nothing at all, then it does nothing, but the game should cotinue to run.
Yes, but autopilot (Expect) starts openttd and sice MiniIN -r6027 crash openttd probably after start over autopilot. Without autopilot works this version of openttd perfectly :cry:
I think, autopilot or Exept is not the problem. Why crasht openttd suddenly after start over autopilot......

cu
Picknicker
Last edited by Picknicker on 11 Sep 2006 18:10, edited 1 time in total.
richk67
Tycoon
Tycoon
Posts: 2363
Joined: 05 Jun 2003 16:21
Location: Up North
Contact:

Post by richk67 »

OK - just to be absolutely clear:

DO NOT USE r6027. Any games saved with r6027 WILL NOT WORK.

Please download the latest SVN and compile it. It has the most sync with trunk, and bug fixes.

Are you trying to start your server with a particular game? Have you tried creating a new .cfg file? (since at r6027 old TGP was removed and at r6028 new TGP was synced from trunk - both of these changed the settings saved in the .cfg file)

My bet is you have an old .cfg that is no longer compatible, and that MiniIN is dying in dedicated mode because it is trying to access info that is not in the .cfg.
OTTD NewGRF_ports. Add an airport design via newgrf.Superceded by Yexo's NewGrf Airports 2
Want to organise your trains? Try Routemarkers.
--- ==== --- === --- === ---
Firework Photography
Picknicker
Engineer
Engineer
Posts: 20
Joined: 31 Aug 2006 15:28

Post by Picknicker »

richk67 wrote:OK - just to be absolutely clear:

DO NOT USE r6027. Any games saved with r6027 WILL NOT WORK.

Please download the latest SVN and compile it. It has the most sync with trunk, and bug fixes.
Yes i know, current i use MiniIN-r6362.
without autopilot MiniIN-r6362 works great.
Only a start with autopilot work not.

version <= r5838 works with autopilot,
version >= r6027 works not with autopilot.
richk67 wrote: Are you trying to start your server with a particular game? Have you tried creating a new .cfg file? (since at r6027 old TGP was removed and at r6028 new TGP was synced from trunk - both of these changed the settings saved in the .cfg file)

My bet is you have an old .cfg that is no longer compatible, and that MiniIN is dying in dedicated mode because it is trying to access info that is not in the .cfg.
I start server with a new game - no savegame. The cfg was firstly from old version, now i have deleted old cfg file. But it does not work yet with autopilott & new cfg file.
Carnalito
Engineer
Engineer
Posts: 6
Joined: 05 Sep 2006 13:01

Post by Carnalito »

Greetings. Im new om theese forums, and i saw this little script of yours, COOL!

I've tried to get it running without luck so far. Im using Expect 5.21 for Windows and this is what happens;

E:\TTD>expect autopilot.txt
bad option "equal": must be compare, first, index, last, length, match, range, t
olower, toupper, trim, trimleft, trimright, wordend, or wordstart
while executing
"string equal "$arg1" "load" "
(file "autopilot.txt" line 52)

What does this mean?

Any help would be appriciated!
Oldskool TTD Guru ;)
Carnalito
Engineer
Engineer
Posts: 6
Joined: 05 Sep 2006 13:01

Post by Carnalito »

Ok those lines were obviously for the loadgame option, removed them and this comes up;

E:\TTD>expect autopilot2.txt
Starting new game
exp_spawn ./openttd -c openttd.cfg -D


*** AUTOPILOT ENGAGED ***

syntax error in expression "true"
while executing
"while true {
if $recount_trigger {
set auto_flag 1
exp_send "echo recount clients\n"
set recount_trigger false
}
expect {
..."
(file "autopilot2.txt" line 74)
Oldskool TTD Guru ;)
User avatar
glx
OpenTTD Developer
OpenTTD Developer
Posts: 622
Joined: 02 Dec 2005 15:43
Location: Drancy(93) - France
Contact:

Post by glx »

autopilot doesn't work with windows version of OpenTTD, because there's no real console.
User avatar
Brianetta
Tycoon
Tycoon
Posts: 2566
Joined: 15 Oct 2003 22:00
Location: Jarrow, UK
Contact:

Post by Brianetta »

As glx says. You can try rewriting or rebuilding openttd such that it's a console application (which it is on every other supported platform) or running it on any other platform.

The next version will actually give a proper error message about this if run in Windows.
PGP fingerprint: E66A 9D58 AA10 E967 41A6 474E E41D 10AE 082C F3ED
Carnalito
Engineer
Engineer
Posts: 6
Joined: 05 Sep 2006 13:01

Post by Carnalito »

Ummm so an autopilot when running Windows is just out of the question ?
Oldskool TTD Guru ;)
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Post by DaleStan »

With the prebuilt binaries, yes.
With a VC debug binary, or a release binary built from properly modified source, it shouldn't be a problem.
To get a good answer, ask a Smart Question. Similarly, if you want a bug fixed, write a Useful Bug Report. No TTDPatch crashlog? Then follow directions.
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
Carnalito
Engineer
Engineer
Posts: 6
Joined: 05 Sep 2006 13:01

Post by Carnalito »

So is there a remote chance for a mortal like me to sort this out ? :)

This function is just too uber to miss out 8)
Oldskool TTD Guru ;)
User avatar
Brianetta
Tycoon
Tycoon
Posts: 2566
Joined: 15 Oct 2003 22:00
Location: Jarrow, UK
Contact:

Post by Brianetta »

Probably not, unless you're competent in C. The trouble stems from the console code. There's some precompiler code that checks to see whether the target platform is win32, and if it is, it compiles in some code that creates a new window for the dedicated console. This window cannot be read by Expect, and this is the root of the problem.

I've talked to a couple of the devs about this, and they say it's something to do with the way the Visual C makes a project - overarching and wide definitions of a project, such as "console application" and "GUI application." It seems that a program which is both is not made easy. GUI applications aren't given standard input and output, which is why this extra window is opened up.

Whether removing this precompiler code and compiling it under some different environment (perhaps gcc under Cygwin?) will get rid of the problem, I have no idea. I'm not a C programmer (well, not since about 1995) and I have never used a Windows based C environment. Perhaps if somebody here with the relevant experience wants to look at it, there could be an autopilot for Windows servers. Until then, I'm afraid there's very little chance of being able to put something together.
PGP fingerprint: E66A 9D58 AA10 E967 41A6 474E E41D 10AE 082C F3ED
Carnalito
Engineer
Engineer
Posts: 6
Joined: 05 Sep 2006 13:01

Post by Carnalito »

That makes me a saaaaad panda :cry:
Oldskool TTD Guru ;)
MiG
Engineer
Engineer
Posts: 1
Joined: 30 Aug 2006 22:38

Post by MiG »

Me too. Like most of us I've been playing this game for aeons, and only recently I was introduced to OpenTTD and internet multiplay.
Would love to have the autopause function on Win32 because occasionally the last player forgets (and next thing we know we're twenty years further)...
User avatar
Brianetta
Tycoon
Tycoon
Posts: 2566
Joined: 15 Oct 2003 22:00
Location: Jarrow, UK
Contact:

Post by Brianetta »

Another approach, of course, is to patch the game so that it has its own autopause.
PGP fingerprint: E66A 9D58 AA10 E967 41A6 474E E41D 10AE 082C F3ED
User avatar
glx
OpenTTD Developer
OpenTTD Developer
Posts: 622
Joined: 02 Dec 2005 15:43
Location: Drancy(93) - France
Contact:

Post by glx »

I made a patch to convert windows version of OpenTTD into a console app and I think it should work with autopilot.

There is one UNSOLVABLE problem with it: a console popup and close before the game window if run from explorer (with double-click).
It's a bit annoying, but there's no other way if you want a "real" console.

EDIT: I tried with autopilot and it works (needed to do small changes :) )

To run it, install ActiveTcl and run "tclsh autopilot.txt" from a command shell (in openttd dir of course :D )
Attachments
win32console_3.diff
makes openttd a console app
(4.78 KiB) Downloaded 343 times
autopilot.txt
autopilot 1.3 for windows
(6.39 KiB) Downloaded 349 times
Last edited by glx on 08 Sep 2006 00:40, edited 1 time in total.
User avatar
Brianetta
Tycoon
Tycoon
Posts: 2566
Joined: 15 Oct 2003 22:00
Location: Jarrow, UK
Contact:

Post by Brianetta »

Interesting. I don't have a Windows dev environment, so if you'd test it with Expect I'd be grateful.
PGP fingerprint: E66A 9D58 AA10 E967 41A6 474E E41D 10AE 082C F3ED
User avatar
glx
OpenTTD Developer
OpenTTD Developer
Posts: 622
Joined: 02 Dec 2005 15:43
Location: Drancy(93) - France
Contact:

Post by glx »

I've added a modified autopilot.txt in my previous post.
Carnalito
Engineer
Engineer
Posts: 6
Joined: 05 Sep 2006 13:01

Post by Carnalito »

So how do i use this .diff thing ? 8)
Do i need to compile it or something?
Oldskool TTD Guru ;)
User avatar
Brianetta
Tycoon
Tycoon
Posts: 2566
Joined: 15 Oct 2003 22:00
Location: Jarrow, UK
Contact:

Post by Brianetta »

glx wrote:I've added a modified autopilot.txt in my previous post.
I see you changed the \n to \r after each command that the autopilot sends. Was that necessary? If so, I shall modify the new version appropriately. I'd have thought that the actual correct behaviour in Windows would be to send both.

Any reason why you changed the expect_out array index from 0 to 1 and added parentheses?

That's handled rather differently in 2.0 in any case.
PGP fingerprint: E66A 9D58 AA10 E967 41A6 474E E41D 10AE 082C F3ED
Post Reply

Return to “General OpenTTD”

Who is online

Users browsing this forum: No registered users and 16 guests