Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with compilation #43

Closed
Nikita-Sherstnev opened this issue Jun 11, 2022 · 18 comments
Closed

Problem with compilation #43

Nikita-Sherstnev opened this issue Jun 11, 2022 · 18 comments

Comments

@Nikita-Sherstnev
Copy link

I have a problem with compilation. I use Manjaro 64 bit.

fallout2-ce/src/audio_file.cc:95:29: error: cast from ‘FILE*’ to ‘int’ loses precision [-fpermissive]
95 | audioFile->fileHandle = (int)stream;

@alexbatalov
Copy link
Owner

x64 is not yet supported, use x86 toolchain and libraries

@Nikita-Sherstnev
Copy link
Author

I compiled it and ran. Very cool! But when I enter the temple map become black and textures are lagging.

@JanSimek
Copy link
Contributor

It is a bug that happens if you are using a custom resolution from f2_res.ini instead of the default 640x480.

@Nikita-Sherstnev
Copy link
Author

There is another problem: I can't save game and in the game folder appears files with Windows paths like "data\proto".

@alexbatalov
Copy link
Owner

I think I've fixed problem with tile borders (tried on 2560x1440). Please elaborate on textures lagging. Last time I checked linux I had no problems on 1024x768 (1 vcpu, 2 gb ram).

@Risu
Copy link

Risu commented Jun 11, 2022

Arroyo temple after new commit (2a9e00d):

Thread 1 "fallout2-ce" received signal SIGSEGV, Segmentation fault.
fallout2-ce/src/object.cc:794
794 int q = _light_get_tile(elevation, objectListNode->obj->tile);

But the game resolution has to be set large like 1920x1080 to SIGSEGV happen.

backtrace:

0x5661c659 in _obj_render_pre_roof (rect=0xffffcb7c, elevation=0)
at fallout2-ce/src/object.cc:794
794 int q = _light_get_tile(elevation, objectListNode->obj->tile);

[0] 0x5661c659 in _obj_render_pre_roof (rect=0xffffcb7c, elevation=0)
at fallout2-ce/src/object.cc:794
[1] 0x56654edc in tileRefreshGame (rect=0x569f27f0 , elevation=0)
at fallout2-ce/src/tile.cc:596
[2] 0x56654a66 in tileWindowRefresh ()
at fallout2-ce/src/tile.cc:487
[3] 0x56654d2c in tileSetCenter (tile=28707, flags=1)
at fallout2-ce/src/tile.cc:557
[4] 0x5660efe8 in mapHandleTransition ()
at fallout2-ce/src/map.cc:1221
[5] 0x5660b838 in mainLoop (fpsLimiter=...)
at fallout2-ce/src/main.cc:345
[6] 0x5660b32b in falloutMain (argc=1, argv=0xffffcd94)
at fallout2-ce/src/main.cc:182
[7] 0x56658c7b in main (argc=1, argv=0xffffcd94)
at fallout2-ce/src/win32.cc:89

Edit: issue fixed by 96771e9

@Nikita-Sherstnev
Copy link
Author

I think I've fixed problem with tile borders (tried on 2560x1440). Please elaborate on textures lagging. Last time I checked linux I had no problems on 1024x768 (1 vcpu, 2 gb ram).

I was able to move anywhere in screen, character and cursor behaved like this:
image

Now game just crashes when I enter the temple with res 1920x1080.

@alexbatalov
Copy link
Owner

Please check if this one is fixed. There are rendering artefacts when map is out of bounds (corners on high resolutions), but they do not affect gameplay. We'll fix them later by rewriting tile rendering layer.

@Risu
Copy link

Risu commented Jul 12, 2022

In README.md there is typo in "sudo apt install libsd2-2.0-0" - should be libsdl.
When compiling under Ubuntu based distro there are errors in "tile.cc" regarding missing math.h include.
Sound is working in 64 bit executable. In 32 bit I got audio init error, probably some i386 sdl2 sound related library is missing in my distro.

alexbatalov added a commit that referenced this issue Jul 12, 2022
@alexbatalov
Copy link
Owner

alexbatalov commented Jul 12, 2022

Typo fixed, thanks. Which Ubuntu version do you use? There are no missing includes complaints in CI (Ubuntu 20.04). In fact there was an include for math.h, but I think I removed it during headers cleanup. I've checked sound both architectures on virtualized Ubuntu, works for me. Since it fails on initialization I guess there is a problem in the SDL implementation and/or underlying driver. I will add error reporting from SDL to see what's going on.

@Risu
Copy link

Risu commented Jul 12, 2022

20.04 FOCAL, "make" does not like atan2 in tile.cc, including math.h is fixing this thing.
Regarding sound in 32bit I already checked before and sdl error was showing "dsp: No such audio devicesoundInit: Unable to init audio engine". I can control this with env variables like AUDIODEV and SDL_AUDIODRIVER, but switching to pulse or alsa only changing sdl error message. As result I think some i386 sdl2 audio libraries are missing on my system. But I am not concerned about this since 64 bit works fine.
Edit: Yep, the 32bit release from github working fine with sound.

@TerminalHash
Copy link

Don't playing music, video and in-game/menu sounds plays very well.
Artix Linux x86_64.

@alexbatalov
Copy link
Owner

I guess this is a path issue. First check music_path1 in your fallout2.cfg, it's case-sensitive. Then in this directory (DATA/SOUND/MUSIC) try renaming 07DESERT.ACM to 07desert.ACM (music used in the main menu).

@JanSimek
Copy link
Contributor

At least in the GOG version the filename 07desert.ACM is correct. However, in case you don't know, this specific file is not packed inside master.dat like the other sound files but it's on its own in the sound\music directory so you have to copy the directory to music_path1 location. I just found that out.

If that doesn't help, you can try enabling sound debug messages in the fallout2.cfg:

[sound]
debug=1

@alexbatalov on an unrelated subject, have you thought about using spdlog or simply creating a logging class that could handle different levels of messages severity info/warning/error/debug, origin and file output?

@alexbatalov
Copy link
Owner

Haven't thought of. I'm not sure we need fully featured logging solution. This is only a game, not a mission critical service where you probably want to log every single action, and logs are either the only way to understand what's going on or a way to monitor healthiness of the service. You have to be reasonable on who's the audience of this different levels of messages. For bug reports maximum verbosity will likely be needed to understand the problem. What's the use for minimum verbosity log?

@JanSimek
Copy link
Contributor

Minimum verbosity log lets you quickly check for basic info like where files were loaded from or in this case a colourful warning message should be displayed about the missing 07desert.ACM instead of it being hidden under a sound debug configuration option. I think Falltergeist does it well.

@TerminalHash
Copy link

Steam version have 07desert.acm, not 07desert.ACM. After renaming music works.

@TerminalHash
Copy link

Also, this ugly resizing it's normal? %)
Videos:
Снимок экрана от 2022-07-21 23-05-03

Menu:
Снимок экрана от 2022-07-21 23-05-08

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants