Latest Posts

Topic: ? Map preview in game

dreieck
Avatar
Joined: 2018-08-25, 11:48
Posts: 48
Ranking
Pry about Widelands
Posted at: 2018-09-05, 16:56

Hello.

I think I do oversee this, or I am running with problematic configuration:

(How) is it possible to get a preview of a map when selecting a map to play in the game?

And can the executable wl_map_info be used for this (to get it outside the game)? -- Currently, wl_map_info fails with

[...]
ObjectManager: ouch! remaining objects
lastserial: 11754
Exception: flags: 

UnhandledVersionError: This game was saved using an older version of Widelands and cannot be loaded anymore, or it's a new version that can't be handled yet.

Packet Name: MapFlagPacket
Saved Version: 1
Current Version: 2.
SoundHandler closing times 1, freq 22050, format 32784, chan 2
SDL_AUDIODRIVER alsa

(And it does not provide help on how to use it and what it does.)

The preview in game does neither occur in build 19 (binary from Arch Linux), nor in development build (r8807, built locallly on my machine).

I have read that there is some python script which does this functionality for the website; (where) can I find it in the source tree when compiling with -DOPTION_BUILD_WEBSITE_TOOLS=ON? -- Since I don't see any meaningful differences in installed files with or without this option.

Edited: 2018-09-05, 16:59
Top Quote
GunChleoc
Avatar
Joined: 2013-10-07, 15:56
Posts: 2626
Ranking
One Elder of Players
Location: RenderedRect
Posted at: 2018-09-05, 18:18

Exactly, use DOPTION_BUILD_WEBSITE_TOOLS=ON?. You already found the correct executable; you can't run it on games though, only on maps.


Busy indexing nil values

Top Quote
kaputtnik
Avatar
Joined: 2013-02-18, 20:48
Posts: 1523
Ranking
One Elder of Players
Location: Germany
Posted at: 2018-09-05, 18:23

I am not sure what you mean with "The preview in game does neither occur in build 19 (binary from Arch Linux), nor in development build (r8807, built locallly on my machine)." If you start a new game, there will be no preview of the map (although i would like that face-smile.png ). A preview will only be shown, if you try to continue a saved game.

wl_map_info can only be run on a map, not a savegame. It looks like you have run it on a saved game?

Some clarifying about the additional executables:

  • wl_map_info /path/to/mapname creates two files in the folder of the map: mapname.png (the image of the map) and mapname.json which contains some data about the map. This executable is used on the server if one is uploading a map.
  • wl_map_object_info /path/to/directory is used on the server as well, to strip out all the info you can find in the Encyclopedia. On the server this is executed once a day to keep the encyclopedia up to date.

Top Quote
dreieck
Avatar
Joined: 2018-08-25, 11:48
Posts: 48
Ranking
Pry about Widelands
Posted at: 2018-09-05, 19:06

GunChleoc wrote: Exactly, use DOPTION_BUILD_WEBSITE_TOOLS=ON?. You already found the correct executable; you can't run it on games though, only on maps.

Ah; I was expectin something in python, as I did infer from this old thread.

kaputtnik wrote:

I am not sure what you mean with "The preview in game does neither occur in build 19 (binary from Arch Linux), nor in development build (r8807, built locallly on my machine)." If you start a new game, there will be no preview of the map (although i would like that face-smile.png ). A preview will only be shown, if you try to continue a saved game.

wl_map_info can only be run on a map, not a savegame. It looks like you have run it on a saved game?

Some clarifying about the additional executables:

  • wl_map_info /path/to/mapname creates two files in the folder of the map: mapname.png (the image of the map) and mapname.json which contains some data about the map. This executable is used on the server if one is uploading a map.
  • wl_map_object_info /path/to/directory is used on the server as well, to strip out all the info you can find in the Encyclopedia. On the server this is executed once a day to keep the encyclopedia up to date.

Thanks for giving usage details.

I did run it on a map.

Ah OK, thanks to the description you gave, I now know that it tries to create files where the map is located (and not in the directory where it was invoked from, as I would have expected). Of course this did not work, since were the maps are installed a regular user cannot write (it is installed using package management, and not in the user's directory). Can there be a second argument where one can specify a directory where to create the files? Would be much more convenient.

Anyway, now I first symlinked, then copied a map file to a directory where I can write. Problem persists.

wl_map_info ./concentric\ rings.wmf produces the following on stdout (and nothing on stderr):

selected language: en
using locale en_US
Graphics: Try to set Videomode 1x1
Graphics: OpenGL: Version "2.1 Mesa 18.1.7"
Graphics: SDL_GL_RED_SIZE is 8
Graphics: SDL_GL_GREEN_SIZE is 8
Graphics: SDL_GL_BLUE_SIZE is 8
Graphics: SDL_GL_ALPHA_SIZE is 0
Graphics: SDL_GL_BUFFER_SIZE is 24
Graphics: SDL_GL_DOUBLEBUFFER is 1
Graphics: SDL_GL_DEPTH_SIZE is 24
Graphics: SDL_GL_STENCIL_SIZE is 8
Graphics: SDL_GL_ACCUM_RED_SIZE is 0
Graphics: SDL_GL_ACCUM_GREEN_SIZE is 0
Graphics: SDL_GL_ACCUM_BLUE_SIZE is 0
Graphics: SDL_GL_ACCUM_ALPHA_SIZE is 0
Graphics: SDL_GL_STEREO is 0
Graphics: SDL_GL_MULTISAMPLEBUFFERS is 0
Graphics: SDL_GL_MULTISAMPLESAMPLES is 0
Graphics: SDL_GL_ACCELERATED_VISUAL is 1
Graphics: SDL_GL_CONTEXT_MAJOR_VERSION is 2
Graphics: SDL_GL_CONTEXT_MINOR_VERSION is 1
Graphics: SDL_GL_CONTEXT_FLAGS is 0
Graphics: SDL_GL_CONTEXT_PROFILE_MASK is 2
Graphics: SDL_GL_SHARE_WITH_CURRENT_CONTEXT is 0
Graphics: SDL_GL_FRAMEBUFFER_SRGB_CAPABLE is 0
Graphics: OpenGL: Double buffering enabled
Graphics: OpenGL: Max texture size: 8192
Graphics: OpenGL: ShadingLanguage: "1.20"
**** GRAPHICS REPORT ****
 VIDEO DRIVER x11
 pixel fmt 370546692
 size 640 360
**** END GRAPHICS REPORT ****
Style Manager: Loading templates/default/init.lua ... took 5ms
Style Manager: Reading button styles ... took 9ms
Style Manager: Reading slider styles ... took 0ms
Style Manager: Reading tabpanel styles ... took 1ms
Style Manager: Reading editbox styles ... took 0ms
Style Manager: Reading dropdown styles ... took 0ms
Style Manager: Reading scrollbar styles ... took 0ms
Style Manager: Reading style templates took 15ms
**** SOUND REPORT ****
SDL version: 2.0.8
SDL_mixer version: 2.0.2
**** END SOUND REPORT ****
Reading Elemental Data ... took 9ms
 Reading Player Names And Tribe Data ... took 0ms
 Reading Port Spaces Data ... ┏━ Running Lua for world:
┃    Resources: 1ms
┃    Terrains: 12ms
┃    Immovables: 218ms
┃    Critters: 95ms
┗━ took: 327ms
Loading the world took 347ms
took 347ms
 Reading Heights Data ... took 4ms
 Reading Terrain Data ... took 11ms
 Reading Map Objects ... took 339ms
 Reading Player Start Position Data ... took 0ms
 Reading Resources Data ... took 16ms
 Reading Map Version Data ... took 1ms
 Reading Allowed Worker Types Data ... took 2ms
 Reading Allowed Building Types Data ... took 5ms
 Reading Node Ownership Data ... took 5ms
 Reading Exploration Data ... took 17ms
 Reading Flag Data ... WidelandsMapLoader::load_map_complete() for 'concentric rings' took 763ms
ObjectManager: ouch! remaining objects
lastserial: 11754
Exception: flags: 

UnhandledVersionError: This game was saved using an older version of Widelands and cannot be loaded anymore, or it's a new version that can't be handled yet.

Packet Name: MapFlagPacket
Saved Version: 1
Current Version: 2.
SoundHandler closing times 1, freq 22050, format 32784, chan 2
SDL_AUDIODRIVER alsa

'concentric rings.wmf' is a proper map, I can load it and play it.

Edited: 2018-09-05, 19:55
Top Quote
dreieck
Avatar
Joined: 2018-08-25, 11:48
Posts: 48
Ranking
Pry about Widelands
Posted at: 2018-09-05, 19:27

Follow-up: Just found out that the map needs to be unziped first. So you cannot use a single-file .wmf-map, but it must be unziped to a directory (convention seems to be that the directory name also ends in .wmf). Hmpfg'gl.

OK, but adding an option to save the map preview somewhere else should not bee that difficult. Maybe I extend the programme by that.

Anyway, what is the reason that there is no map preview when starting a new game? Anything special, or just "no one did implement it up to now"? Especially since a minimap.png seems to be already existinh in the map files, as I found out after unziping, so it just needs to be displayed.

Edited: 2018-09-05, 19:30
Top Quote
GunChleoc
Avatar
Joined: 2013-10-07, 15:56
Posts: 2626
Ranking
One Elder of Players
Location: RenderedRect
Posted at: 2018-09-06, 10:41

Original motivations not to include it might have been:

  1. Not enough screen space on small displays
  2. Keep the map a surprise
  3. Nobody implemented it

Busy indexing nil values

Top Quote