Recent

Author Topic: Pac-Mac: a clone of the original game  (Read 4711 times)

Lulu

  • Sr. Member
  • ****
  • Posts: 405
Re: Pac-Mac: a clone of the original game
« Reply #15 on: January 29, 2026, 04:29:23 pm »
The libs libopenal.so and libsndfile.so are loaded dynamically using DynLibs.

Ooops, sorry for the noise  :-[ ...
(And great, I am fan of DynLibs vs external).
No problem my friend  :)
wishing you a nice life!
GitHub repositories https://github.com/Lulu04

Lulu

  • Sr. Member
  • ****
  • Posts: 405
Re: Pac-Mac: a clone of the original game
« Reply #16 on: January 29, 2026, 04:45:28 pm »
@Roland,
I think I've found the cause of the sound problem:
I forget (yes, again... :-[) to include a configuration file. In this file, there is the driver to use to play sounds by OpenAL-Soft.
On my virtual Ubuntu machine, this configuration file has been installed somewhere when I compiled the C library, so the lib can be able to retrieve it.

Please, download the attached file below into the Binary/ game folder, unzip and retry the game.
wishing you a nice life!
GitHub repositories https://github.com/Lulu04

Nimbus

  • Jr. Member
  • **
  • Posts: 87
Re: Pac-Mac: a clone of the original game
« Reply #17 on: January 29, 2026, 07:12:23 pm »
Cool, nice game @Lulu

Funny enough, I made it to the second level - then suddenly all ghosts except for the red one, just walked away off screen through the top wall :)

Lulu

  • Sr. Member
  • ****
  • Posts: 405
Re: Pac-Mac: a clone of the original game
« Reply #18 on: January 29, 2026, 09:36:42 pm »
Cool, nice game @Lulu

Funny enough, I made it to the second level - then suddenly all ghosts except for the red one, just walked away off screen through the top wall :)
Hi Nimbus, could you give me your screen resolution please ? I see the aspect ratio of the scene is wrong, normally its value must be 0.77 to respect the original game aspect ratio. And the size of the sprites are also wrong, pacman and the ghosts have the same size like the fruits.
I never tested OGLCScene on other screen than mine (an old 1280x1024, 96ppi). my bad...
I have some bugs to find...!
wishing you a nice life!
GitHub repositories https://github.com/Lulu04

Nimbus

  • Jr. Member
  • **
  • Posts: 87
Re: Pac-Mac: a clone of the original game
« Reply #19 on: January 29, 2026, 11:28:53 pm »
Hi Nimbus, could you give me your screen resolution please ? I see the aspect ratio of the scene is wrong, normally its value must be 0.77 to respect the original game aspect ratio. And the size of the sprites are also wrong, pacman and the ghosts have the same size like the fruits.
I never tested OGLCScene on other screen than mine (an old 1280x1024, 96ppi). my bad...
I have some bugs to find...!

Sure - it's an UHD (3480x2160) screen in Linux / X11, and my Lazarus is built with qt6 widgeset (not sure if it's relevant).
I had to comment out the fullscreen mode in the cfg file, cause the screen was quite distorted, and none of the buttons (which looked misplaced) worked - I imagine click coordinates were off somehow.
Could be just something specific to my system (GPU driver / window manager / widgetset etc.)

Lulu

  • Sr. Member
  • ****
  • Posts: 405
Re: Pac-Mac: a clone of the original game
« Reply #20 on: January 30, 2026, 11:18:26 am »
Sure - it's an UHD (3480x2160) screen in Linux / X11, and my Lazarus is built with qt6 widgeset (not sure if it's relevant).
I had to comment out the fullscreen mode in the cfg file, cause the screen was quite distorted, and none of the buttons (which looked misplaced) worked - I imagine click coordinates were off somehow.
Could be just something specific to my system (GPU driver / window manager / widgetset etc.)
I never used qt5 or 6, I have no solution, I'm sorry... I will spend some time on QT to try this widget set.
Thank you for your feedback!
wishing you a nice life!
GitHub repositories https://github.com/Lulu04

Fred vS

  • Hero Member
  • *****
  • Posts: 3876
    • StrumPract is the musicians best friend
Re: Pac-Mac: a clone of the original game
« Reply #21 on: January 30, 2026, 02:29:49 pm »
It works now, excepted sound. Even after I copied the SO files in executable's directory.

Hello Roland and Lulu.

The sound problem might be due to the audio system being used, which isn't defined in alsoft.conf.

In Lulu's alsoft.conf file, we find the following definition:
Code: Pascal  [Select][+][-]
  1. drivers = alsa, pulse, oss,

Mageia , afaik, uses PipeWire as its default audio driver. Adding it might solve the problem:
Code: Pascal  [Select][+][-]
  1. drivers = pipewire, alsa, pulse, oss,

You can also try all the installed drivers, starting with the default one (in this case, leave it blank):
Code: Pascal  [Select][+][-]
  1. drivers =

Hopefully this helps.
I use Lazarus 2.2.0 32/64 and FPC 3.2.2 32/64 on Debian 11 64 bit, Windows 10, Windows 7 32/64, Windows XP 32,  FreeBSD 64.
Widgetset: fpGUI, MSEgui, Win32, GTK2, Qt.

https://github.com/fredvs
https://gitlab.com/fredvs
https://codeberg.org/fredvs

Lulu

  • Sr. Member
  • ****
  • Posts: 405
Re: Pac-Mac: a clone of the original game
« Reply #22 on: January 30, 2026, 03:29:24 pm »
Hi Fred, thank you for your precious help!

I've compiled the lib myself, and if i remember well, I've failed to install pipewire on my virtual ubuntu 20.04 machine. So the lib provided with the game can not connect to pipewire.

Roland, the best thing is to compile the libs yourself from your machine.

The link to OpenALSoft repository: https://github.com/kcat/openal-soft
LibSndFile: https://github.com/libsndfile/libsndfile

wishing you a nice life!
GitHub repositories https://github.com/Lulu04

Fred vS

  • Hero Member
  • *****
  • Posts: 3876
    • StrumPract is the musicians best friend
Re: Pac-Mac: a clone of the original game
« Reply #23 on: January 30, 2026, 03:57:26 pm »
Hi Fred, thank you for your precious help!

With pleasure!

( But personally, I prefer PortAudio to OpenAl, which has many problems  :-X )
I use Lazarus 2.2.0 32/64 and FPC 3.2.2 32/64 on Debian 11 64 bit, Windows 10, Windows 7 32/64, Windows XP 32,  FreeBSD 64.
Widgetset: fpGUI, MSEgui, Win32, GTK2, Qt.

https://github.com/fredvs
https://gitlab.com/fredvs
https://codeberg.org/fredvs

Roland57

  • Hero Member
  • *****
  • Posts: 604
    • msegui.net
Re: Pac-Mac: a clone of the original game
« Reply #24 on: January 30, 2026, 04:44:34 pm »
Roland, the best thing is to compile the libs yourself from your machine.

I compiled both libraries. I have now the following files:

libopenal.so
libopenal.so.1
libopenal.so.1.25.1
libsndfile.so
libsndfile.so.1
libsndfile.so.1.0.37


I am not sure to know what to do with these files.
I tried to copy libopenal.so.1.25.1 in game directory and to rename it to libopenal.so (and the same for libsndfile), but I still get the "LibSndFile not found" message.

(I also modified alsoft.conf as suggested by Fred.)
« Last Edit: January 30, 2026, 04:46:34 pm by Roland57 »
My projects are on Codeberg.

Fred vS

  • Hero Member
  • *****
  • Posts: 3876
    • StrumPract is the musicians best friend
Re: Pac-Mac: a clone of the original game
« Reply #25 on: January 30, 2026, 05:10:18 pm »
Hello.

I try to compile Pac-Mac on LUbuntu Noble without luck.
I did install the ALsound package https://github.com/Lulu04/ALSound but while compiling there is that errors:

Code: Pascal  [Select][+][-]
  1. u_common.pas(116,87) Error: identifier idents no member "ASCII_SPACE"

I changed it with '  ' but there are still errors:

Code: Pascal  [Select][+][-]
  1. Button1 := TUIButton.Create(FScene);
  2. Error: u_panel_basepause.pas(50,38) Error: Wrong number of parameters specified for call to "Create"
  3. oglcUI.inc(1524,23) Error: Found declaration: constructor Create(TOGLCScene;const AnsiString;TTexturedFont;PTexture);

What do I miss?
I use Lazarus 2.2.0 32/64 and FPC 3.2.2 32/64 on Debian 11 64 bit, Windows 10, Windows 7 32/64, Windows XP 32,  FreeBSD 64.
Widgetset: fpGUI, MSEgui, Win32, GTK2, Qt.

https://github.com/fredvs
https://gitlab.com/fredvs
https://codeberg.org/fredvs

Fred vS

  • Hero Member
  • *****
  • Posts: 3876
    • StrumPract is the musicians best friend
Re: Pac-Mac: a clone of the original game
« Reply #26 on: January 30, 2026, 05:26:05 pm »
What do I miss?

Ooops, ok, I forgot to install this package: https://github.com/Lulu04/OGLCScene.
Now it  compiles ok, sorry for the noise ( but also no noise in the game, even after copy libsndfile.so in directory of binary ).

Also the window is very little on my 1400x900 screen but it works great, congrats.
« Last Edit: January 30, 2026, 05:32:22 pm by Fred vS »
I use Lazarus 2.2.0 32/64 and FPC 3.2.2 32/64 on Debian 11 64 bit, Windows 10, Windows 7 32/64, Windows XP 32,  FreeBSD 64.
Widgetset: fpGUI, MSEgui, Win32, GTK2, Qt.

https://github.com/fredvs
https://gitlab.com/fredvs
https://codeberg.org/fredvs

Nimbus

  • Jr. Member
  • **
  • Posts: 87
Re: Pac-Mac: a clone of the original game
« Reply #27 on: January 30, 2026, 05:30:41 pm »
Re sound: what worked for me is just symlinking the system (Debian 13) provided versions of libopenal and libsnd outright into to the Pacman binary dir,
Code: Pascal  [Select][+][-]
  1. libopenal.so -> /lib/x86_64-linux-gnu/libopenal.so.1
  2. libsndfile.so -> /lib/x86_64-linux-gnu/libsndfile.so.1

then it plays fine. Ones that came in the repository didn't work - perhaps due to an unmet dependency on libFLAC.so.8 in libsnd which I don't have.

However, I found the best way to play it on my mactine is to cross-compile to win64 and just use wine to run it :)
The sound works out of the box, the screen looks great, then game plays nearly flawless

Fred vS

  • Hero Member
  • *****
  • Posts: 3876
    • StrumPract is the musicians best friend
Re: Pac-Mac: a clone of the original game
« Reply #28 on: January 30, 2026, 05:55:31 pm »
Yep, now I have sound, after doing this:

Code: Pascal  [Select][+][-]
  1. $ sudo apt-get install libopenal-dev
  2. $ sudo apt-get install libsndfile-dev

 ;D

And very nice project. :)
I use Lazarus 2.2.0 32/64 and FPC 3.2.2 32/64 on Debian 11 64 bit, Windows 10, Windows 7 32/64, Windows XP 32,  FreeBSD 64.
Widgetset: fpGUI, MSEgui, Win32, GTK2, Qt.

https://github.com/fredvs
https://gitlab.com/fredvs
https://codeberg.org/fredvs

Lulu

  • Sr. Member
  • ****
  • Posts: 405
Re: Pac-Mac: a clone of the original game
« Reply #29 on: January 30, 2026, 05:56:08 pm »
Roland, the best thing is to compile the libs yourself from your machine.

I compiled both libraries. I have now the following files:

libopenal.so
libopenal.so.1
libopenal.so.1.25.1
libsndfile.so
libsndfile.so.1
libsndfile.so.1.0.37


I am not sure to know what to do with these files.
I tried to copy libopenal.so.1.25.1 in game directory and to rename it to libopenal.so (and the same for libsndfile), but I still get the "LibSndFile not found" message.

(I also modified alsoft.conf as suggested by Fred.)
Put a copy of libopenal.so and libsndfile.so in the game directory Binary/x86_64-linux/ this is where ALSound will look for them.
wishing you a nice life!
GitHub repositories https://github.com/Lulu04

 

TinyPortal © 2005-2018