Angband Forums

Angband Forums (http://angband.oook.cz/forum/index.php)
-   Development (http://angband.oook.cz/forum/forumdisplay.php?f=10)
-   -   SDL2 port when ? (http://angband.oook.cz/forum/showthread.php?t=9076)

t4nk September 24, 2018 17:11

Quote:

Originally Posted by shirish (Post 133417)
@t4nk, I just did that, see above ;)

Good. We still have enough time: I'll amend the pull request tomorrow :)

shirish September 24, 2018 17:20

@tn4k hope you are able to see my edited answer. It would be nice to have a windowed mode if possible, at least to show/share screenshots.

something like -
Code:

$ ./angband --windowed
Another one which might be of immense help is -

Code:

./angband --version
For the record apart from having skeleton as a wallpaper there isn't much difference in the SDL2 front-end.

Also there is no sound.

There also seems to be missing a debug-mode, something which tells what is going on :(

Maybe at configure time I need to add some -debugging symbols as well ?

t4nk September 24, 2018 17:27

Quote:

Originally Posted by shirish (Post 133420)
@tn4k hope you are able to see my edited answer. It would be nice to have a windowed mode if possible, at least to show/share screenshots.

Yes, I saw it. And there is a windowed mode! There is a menu in the top left corner with various functionality; clicking on "Fullscreen" toggles fullscreen on and off. Also, click on "Size" and "Move" buttons and drag the subwindows... Well, it shouldn't be hard to figure out (in my opinion :))

Code:

./angband --version
Menu -> "About". Also the "V" command in Angband :)

shirish September 24, 2018 17:33

right, my bad. So all looks good, except I don't hear either any sound or music :(

https://imgur.com/a/UGwkjEa

t4nk September 24, 2018 17:34

Quote:

For the record apart from having skeleton as a wallpaper there isn't much difference in the SDL2 front-end.
The main differences are: the easier to use menu, less nasty color scheme, different method for controlling subwindows position and size, ability to use resizable fonts (put them in angband/lib/fonts directory), multiple windows.

Quote:

Originally Posted by shirish (Post 133420)
Also there is no sound.

Did you enable it in options? ("=" -> "User interface options" -> "Use sound").
Sound is a bit problematic, because Angband uses MP3, which SDL2_mixer doesn't like very much. Alghough I'd expect Debian has it figured out (and used correct codecs when compiling SDL2_mixer...)

Quote:

There also seems to be missing a debug-mode, something which tells what is going on :(
Hmm... why would you want debug mode?

shirish September 24, 2018 17:42

Quote:

Originally Posted by t4nk (Post 133423)
The main differences are: the easier to use menu, less nasty color scheme, different method for controlling subwindows position and size, ability to use resizable fonts (put them in angband/lib/fonts directory), multiple windows.

right.

Quote:

Originally Posted by t4nk (Post 133423)
Did you enable it in options? ("=" -> "User interface options" -> "Use sound").
Sound is a bit problematic, because Angband uses MP3, which SDL2_mixer doesn't like very much. Alghough I'd expect Debian has it figured out (and used correct codecs when compiling SDL2_mixer...)

I can't see it in the menu, the options, it doesn't seem to be anywhere. I tried but perhaps I need a nudge to see in the right direction.



Quote:

Originally Posted by t4nk (Post 133423)
Hmm... why would you want debug mode?


t4nk September 24, 2018 17:52

Quote:

I can't see it in the menu, the options, it doesn't seem to be anywhere. I tried but perhaps I need a nudge to see in the right direction.
Press "=" in game, then "a" ("User interface options"), then "b" twice ("Use sound"). From a cursory look, the option itself can't be compiled out, so it should be there.
Angband's interface is far from ideal, don't you think? :) I imagine what many new players think when they try to figure out what to do with additional windows...

shirish September 24, 2018 18:15

Quote:

Originally Posted by t4nk (Post 133425)
Press "=" in game, then "a" ("User interface options"), then "b" twice ("Use sound"). From a cursory look, the option itself can't be compiled out, so it should be there.
Angband's interface is far from ideal, don't you think? :) I imagine what many new players think when they try to figure out what to do with additional windows...

The options don't seem to be saved :(

I did try to see if ~/.angband/Angband has any options although ideally it should be using ~/.config/angband/$whatever to be in-line with freedesktop specifications but that's something for another day.

see https://specifications.freedesktop.o...t/ar01s02.html for what I mean but as shared that's something that angband people might think of looking into.

FWIW, even after toggling sound=yes I don't get any sound and there is also no way to know if that option is being saved in-game.

That's the reason I was thinking of having a debug-mode so you could knwo what all is happening, for things like this.

t4nk September 24, 2018 18:35

Quote:

Originally Posted by shirish (Post 133426)
The options don't seem to be saved :(

Well, that's the standard Angband thing... they're saved in the character savefile (and, if you run configure --with-no-install, the savefile is in angband/lib/save).

Quote:

FWIW, even after toggling sound=yes I don't get any sound and there is also no way to know if that option is being saved in-game.

That's the reason I was thinking of having a debug-mode so you could knwo what all is happening, for things like this.
There are still some things we can do. We can look into object files:
Code:

ldd angband | grep mixer
and
Code:

nm angband | grep sound
(run them in the directory with the angband executable)

In any case, since there were some problems with compiling with sound initally, try to recompile:
Code:

make -f Makefile.sdl2 clean
SOUND=yes make -f Makefile.sdl2

Sound is a thing quite unrelated to main-sdl2.c... it doesn't require the SDL2 port at all and can work without it (still using the SDL2 library). I always suspected that Angband's sound doesn't work very well with SDL (either 1 or 2), but most people play without sound, so there weren't a lot of bug reports. Also, Angband on Windows uses the Windows method of playing sounds, instead of SDL.

shirish September 24, 2018 18:52

[QUOTE=t4nk;133428]Well, that's the standard Angband thing... they're saved in the character savefile (and, if you run configure --with-no-install, the savefile is in angband/lib/save). /QUOTE]

argh... that's horrible if I am seeing this right -

Code:

~/games/angband-t4nk074/lib/save$ file Shirish
Shirish: data

I was expecting a nice .json type file but it's not to be :(

Quote:

Originally Posted by t4nk (Post 133428)
There are still some things we can do. We can look into object files:
Code:

ldd angband | grep mixer
and
Code:

nm angband | grep sound
(run them in the directory with the angband executable)

In any case, since there were some problems with compiling with sound initally, try to recompile:
Code:

make -f Makefile.sdl2 clean
SOUND=yes make -f Makefile.sdl2

Sound is a thing quite unrelated to main-sdl2.c... it doesn't require the SDL2 port at all and can work without it (still using the SDL2 library). I always suspected that Angband's sound doesn't work very well with SDL (either 1 or 2), but most people play without sound, so there weren't a lot of bug reports. Also, Angband on Windows uses the Windows method of playing sounds, instead of SDL.

I find games boring without having their own sounds and music , makes for an immersive experience.

I did as you shared and this time did hear a thunder but that's about it.


Code:

~/games/angband-t4nk074$ ldd angband | grep sound
        libasound.so.2 => /usr/lib/x86_64-linux-gnu/libasound.so.2 (some memory address)


Code:

~/games/angband-t4nk074$ nm angband | grep sound
00000000000acd60 T init_sound
00000000000e6da0 T init_sound_sdl
00000000000ac740 t load_sound
00000000000e6c40 t load_sound_sdl
000000000005abf0 T message_lookup_by_sound_name
00000000000aca40 T message_sound_define
000000000005ac40 T message_sound_name
00000000001633e0 b message_sounds
00000000001633d8 b next_sound_id
00000000000acca0 T parse_prefs_sound
000000000003e150 T play_ambient_sound
00000000000ac8a0 t play_sound
00000000000e6b50 t play_sound_sdl
00000000000acdf0 T print_sound_help
00000000000acd40 T register_sound_pref_parser
000000000005ac70 T sound
00000000001389a0 d sound_names.7204
00000000001389a0 d sound_names.7212
00000000001633d0 b sounds
000000000013da60 d supported_sound_files
00000000000e6bc0 t unload_sound_sdl

Nice. So it seems we have sounds, but doesn't seem to have any background music, although you might be better judge of that. Is that it as far as music is concerned ?

@Magnate , hope you are following the thread, please input if you have any questions/queries about sound/music etc as you know the game much better than I do.


All times are GMT +1. The time now is 08:50.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2022, vBulletin Solutions Inc.