Skip to main content

On Sale: GamesAssetsToolsTabletopComics
Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines
(1 edit)

I can tell you exactly what I have, I’m using the ninja multiconfig buildsystem which in turn uses gcc.

in a build folder in the base of the project I run

cmake .. -G"Ninja Multi-Config" -DGFX_ENV_VULKAN=1

then I run

cmake --build . 

If there are any dependancies missing, or an issue with the code, it should show up.

I actually didn’t expect people to build it from source, so I haven’t tested it on a fresh linux install or anything, so there might be something I have installed that i’m overlooking.

So I guess I will have to install "ninja-build" for this as well first...

So I installed "ninja-build" but it's just asking for a "build.ninja" file of which there is none in the project

That’s not supplied by the project, thats generated by cmake automatically if you pass the -G”Ninja Multi-Config” arg. Let me outline the exact commands(if using a fresh clone of the repo, and in it’s root):

mkdir build
cd build
cmake .. -G"Ninja Multi-Config" -DGFX_ENV_VULKAN=1
cmake --build . --config Release

~/jam2022/NoamZeise/TrailsOfThePharaoh/build$ cmake .. -G"Ninja Multi-Config" -DGFX_ENV_VULKAN=1
CMake Error: Could not create named generator Ninja Multi-Config
(+1)

Ok I have a fresh linux install, so I now have exact build instructions that work for fresh install on the repo. I also had a problem with a certain compiler, that is fixed now, so the code has changed slightly.

https://github.com/NoamZeise/TrailsOfThePharaoh

if you check the readme, it goes over everything I did to get it working step by step. Also if you aren’t using proprietary graphics drivers the vulkan version might not work.

So... the "Vulkan" attempt didn't really work out (see other posting). Now going OpenGL.

First attempt... Well, better start with a clean "build" folder :D

Second attempt... Well, readme tells me to generate and download "glad" header files. Oh well...


So... It's more or less what the pre-build version gave me. to get portaudio I had to downgrade jackd but to run jackd I had to upgrade it again, and when I start it the game crashes with some ALSA errors. And without jackd running even before that...

ALSA lib pcm_dsnoop.c:641:(snd_pcm_dsnoop_open) unable to open slave
ALSA lib pcm_dmix.c:1089:(snd_pcm_dmix_open) unable to open slave
ALSA lib pcm.c:2642:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear
ALSA lib pcm.c:2642:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe
ALSA lib pcm.c:2642:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side
Cannot lock down 82280346 byte memory area (Cannot allocate memory)
Cannot lock down 82280346 byte memory area (Cannot allocate memory)
ALSA lib pcm_oss.c:377:(_snd_pcm_oss_open) Unknown field port
ALSA lib pcm_oss.c:377:(_snd_pcm_oss_open) Unknown field port
ALSA lib pcm_usb_stream.c:486:(_snd_pcm_usb_stream_open) Invalid type for card
ALSA lib pcm_usb_stream.c:486:(_snd_pcm_usb_stream_open) Invalid type for card
ALSA lib pcm_dmix.c:1089:(snd_pcm_dmix_open) unable to open slave
Cannot lock down 82280346 byte memory area (Cannot allocate memory)
Segmentation fault (core dumped)

hm... the binary doesn't land in "builds/Release" but in "builds". if I go into "build/Release" apparently it works better (it can load textures and stuff), but is still unavle to do any sound and terminates:

failed to load audio data at audio/music/Trials of The Pharaoh Gameplay1.ogg

BTW: "Ninja Multi-Config" actually comes with with cmake 3.17 (and Ubuntu 20.04 has only 3.16... figures)

Ah, I had no idea. i’m using multi-config just so I can build debug or release, otherwise the main difference is the folder it builds to. It just seems that the audio is the main issue, you are getting a segfault when portaudio is initalising. I really don’t know what would cause that, I haven’t gotten that issue yet. Sorry, not sure what else I can do to help.

Thts probably explains why my directory structure ends up being slightly different. But it doesn't explain why loading the audio files gives different results and it then crashes when it attempts to actually play some music...

I added a bit of debug output and commented the exception out so it doesn't fail when loading the first file...

Loading audiodata: audio/music/Trials of The Pharaoh Gameplay1.ogg; frames: 6947987, channels: 2; sampleCount= 13895974
numread 6947904; frames 6947987
Loading audiodata: audio/music/Trials of The Pharaoh Gameplay2.ogg; frames: 5226003, channels: 2; sampleCount= 10452006
numread 5225920; frames 5226003
Loading audiodata: audio/music/Trials of The Pharaoh Gameplay4.ogg; frames: 4030355, channels: 2; sampleCount= 8060710
numread 4030272; frames 4030355
Loading audiodata: audio/music/Trials of The Pharaoh Intro.ogg; frames: 4923923, channels: 2; sampleCount= 9847846
numread 4923840; frames 4923923
...
ALSA lib pcm.c:8526:(snd_pcm_recover) underrun occurred
(+1)

It seems that libsndfile reads 83 less frames than expected every time you load a file, so when it is played there is an error as it accesses uninitalized memory.

I read over the libsndfile spec, it expects the info struct passed to sf_open to have a format value of 0. Maybe on my system it is set to zero automatically, but on yours it is uninitalized, so reads the wrong amount of frames.

if you place this line at the start of the AudioData(std::string filename) function that loads the audio:

//---snip---
AudioData(std::string filename)
{

   this->info.format = 0;  // <--- add this line

   SNDFILE* file = sf_open(filename.c_str(), SFM_READ, &this->info);
//---snip---

on my repo it would be line 35.

if that doesn’t work, here is a version of audio.h that doesn’t start portaudio or load any audio, the game is still completely playable. https://drive.google.com/file/d/1-0iQF-y4WovPo_n6aQFHmRLnNhTz-pyr/view?usp=sharing

Setting the `info.format` explicitly actually helped!

The game's running now and plays sound. I still get a lot of underrun messages from the ALSA lib though.

And some audio files seem to be different:

Loading audiodata: audio/vo/0-P2.ogg; frames: 252287, channels: 2; sampleCount= 504574
numread 252224; frames 252287
Loading audiodata: audio/vo/0-A2.ogg; frames: 212479, channels: 2; sampleCount= 424958
numread 212416; frames 212479

rounding error?

Not sure if that's correct

When I move that vertical block the angle of the ray changes so the reflected arrives a bit left or a bit right of the small scarab, but the rays emitted from it don't reflect the incoming ray's movement.

At some point I managed to get the whole level into some "semi-stable" state where it was flipping between the obstacles on and off and the ray could reach the target but not for a sufficient time to trigger the level finished... If it had been the intended solution I guess it would actually have registered the ray so I suppose that was just some edge case...

At this point it would actually be nice if there was some indication which of the levels one reached... ;)

Dispite the technical issues in getting the game running on my system (and some of them are still there, some of the VOs in the intro did not play), I love it. Especially that multi-refraction element is really cool!

(1 edit) (+1)

Wow! It’s mostly working. Thanks a lot for sticking with it, I still don’t know why some of the audio files don’t load properly (and this time it’s 63 frames too few, weird!). Now that I know what kind of problems the audio can cause on some systems, I will definitely try and make the audio playing header more robust.

Yeah, that level is probably the hardest (that isn’t the intended solution), I think there’s only 3 more levels after that. There’s a full run through of the game on the itch page for all of the solutions.

A level indicator is a good idea, I somehow didn’t think of that. The light rays still have a few issues, like the switching on/off. The reason the goal takes a few seconds to “charge” is to stop these issues being exploited to win by shining a laser over it quickly. Definitely not an elegant fix!