OpenTTD

Tasklist

FS#2155 - Console: heightmaps for dedicated server

Attached to Project: OpenTTD
Opened by Peter Henschel (Progman) - Sunday, 20 July 2008, 11:05 GMT
Last edited by andythenorth (andythenorth) - Saturday, 02 September 2017, 12:05 GMT
Type Feature Request
Category Core
Status With patch
Assigned To No-one
Operating System All
Severity Low
Priority Normal
Reported Version trunk
Due in Version Undecided
Due Date Undecided
Percent Complete 0%
Votes 4
Private No

Details

r13734

It is possible to generate a map on start of the dedicated server with a specific seed via -G, and you can load a game with -g. But its not possible to load a heightmap and let the server generate the cities and industries on it, althought a normal client can do it. So I request a feature which allowes a dedicated server to generate a map based on a heightmap.
This task depends upon

Comment by Der_Herr (Der_Herr) - Friday, 14 September 2012, 11:59 GMT
I attached a patch to enable a server to load heightmaps via console.

This patch is closely derived from the "newgame" console command with only small deviations.

It accepts bitmaps or pngs in the heightmap folder.

You can use the command like

a) newheightmapgame Test.bmp

this loads the heightmap from $OpenttdFolder/scenario/heightmap/Test.bmp

b) newheightmapgame

It works also on servers: rcon pw "newheightmapgame Test.bmp"

This answer is related to the forum post: http://www.tt-forums.net/viewtopic.php?f=33&t=62677
Comment by Thijs Marinussen (Yexo) - Friday, 14 September 2012, 20:14 GMT
Commented a bit too much on irc, adding it here so it doesn't get lost:

<Yexo> some comments: please check your comments for correctness / english: "Get heightmap file informations. It Only considers given paths."
<Yexo> GetFiosHeightmapItem <- I don't think that function belongs in console_cmds.cpp but rather in fios.cpp or something similar
<Yexo> +DEF_CONSOLE_CMD(ConNewHeightmapGame) <- comments above that are // style, not /** style like required
<Yexo> IConsoleHelp("Start a new gameusing a heightmap <- missing space
<Yexo> two lines further down the lines in the if-block are not indented properly
<Yexo> + //StartNewHeightMapGameWithoutGUI((argc == 2) ? <- don't add commented-out code
<Yexo> + IConsoleCmdRegister("newheightmapgame", ConNewHeightmapGame); <- only tabs at the beginning of the line, use spaces in all other places
<Yexo> how does this function behave when you're in the scenario editor?
Comment by Der_Herr (Der_Herr) - Friday, 14 September 2012, 21:33 GMT
I think i fixed all your points refering to the style.
The function works fine in scenario editor.
Comment by Der_Herr (Der_Herr) - Friday, 14 September 2012, 23:19 GMT
I think i fixed all your points refering to the style.
The function works fine in scenario editor.

Loading...