WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Game 0 A. D.  (Read 2433 times)

Offline polikuo

  • Hero Member
  • *****
  • Posts: 719
Game 0 A. D.
« on: March 20, 2022, 05:35:51 AM »
Hi all

I managed to compile the game 0 A. D. on pi4 aarch64 13.1
It took me 2~3 hours to build and 16G of storage (probably more during compilation)

The game is playable, I think... never played it before.
I only checked the tutorial, running directly from the build directory rather than as tcz extensions.
I tried to emulate that with linking but it refuses to run.
That's why I'm not sure if it will run as tcz.

Anyway, here are some questions I'd like to ask.

Directories:
Does TC use a dedicate directory for games ?
I think Debian use /usr/games
So do we use /usr/local/games ?
or just the regular /usr/local/bin /usr/local/lib /usr/local/share/0ad/data

Sound problem:
I can play sound with alsa in firefox.
Thought about pulseaudio so I start that as well.
Yet no sound from 0ad, this is what I get in terminal
Code: [Select]
TIMER| InitVfs: 816.296 us
Writing the mainlog at /home/tc/.config/0ad/logs/mainlog.html
TIMER| CONFIG_Init: 5.89178 ms
[ALSOFT] (EE) Failed to set real-time priority for thread: Operation not permitted (1)
[ALSOFT] (EE) Failed to set real-time priority for thread: Operation not permitted (1)
Sound: AlcInit success, using OpenAL Soft
I think that message comes from openal
Any ideas ?

Splitting:
On other distros, they split the program into two (0ad, 0ad-data)
Why do they do that ? ???
I think they depend on each other so why splitting ?
Should we do that as well ?

Size:
I haven't found a clear way to pass compile flags, so I passed non.
Consider that this is a game, which means performance matter more than size.
I think I'll just leave it as it is, or should I at least try ?
The raw size of un-stripped binaries add up around 1G
The data takes more, 3G

Offline gadget42

  • Hero Member
  • *****
  • Posts: 780
Re: Game 0 A. D.
« Reply #1 on: March 20, 2022, 06:07:04 AM »
question(s) aside, they have an interesting history:

https://play0ad.com/about/the-story-of-0-a-d/

sharing is caring
The fluctuation theorem has long been known for a sudden switch of the Hamiltonian of a classical system Z54 . For a quantum system with a Hamiltonian changing from... https://forum.tinycorelinux.net/index.php/topic,25972.msg166580.html#msg166580

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11594
Re: Game 0 A. D.
« Reply #2 on: March 20, 2022, 10:43:26 AM »
Hi polikuo
... Does TC use a dedicate directory for games ? ...
Not that I'm aware of.
The  q3ademo.tcz  uses  /usr/local/bin/q3demo  and places the rest of its files in  /usr/local/games/q3demo/.
Some programs contain all of their files in one directory, /usr/local/thunderbird, /usr/local/firefox/.

Quote
... Yet no sound from 0ad, this is what I get in terminal ...
You probably should not be seeing those messages any more:
Quote
This is no longer an error message with commit 834800c. It'll still warn, but warnings are off by default for release builds.
Found here:
https://github.com/kcat/openal-soft/issues/554
The last line said  Sound: AlcInit success, using OpenAL Soft  so  openal  claims it is working.

Quote
... I think they depend on each other so why splitting ? ...
One probably contains the game engine, and the other contains maps and scenery. Yes, you need one of each, but
not necessarily those exact files. For example, you can use different data files with that game engine.

Quote
... The raw size of un-stripped binaries add up around 1G
The data takes more, 3G
I would certainly try to strip the binaries. Placing them in  .tcz  form should shrink them down some.

Offline polikuo

  • Hero Member
  • *****
  • Posts: 719
Re: Game 0 A. D.
« Reply #3 on: March 20, 2022, 11:55:16 AM »
Hi Rich
Thanks for the input  :)

Hi polikuo
... Does TC use a dedicate directory for games ? ...
Not that I'm aware of.
The  q3ademo.tcz  uses  /usr/local/bin/q3demo  and places the rest of its files in  /usr/local/games/q3demo/.
Some programs contain all of their files in one directory, /usr/local/thunderbird, /usr/local/firefox/.
I guess I'll use '/usr/local/games/0ad' then ~

Quote
Quote
... Yet no sound from 0ad, this is what I get in terminal ...
You probably should not be seeing those messages any more:
Quote
This is no longer an error message with commit 834800c. It'll still warn, but warnings are off by default for release builds.
Found here:
https://github.com/kcat/openal-soft/issues/554
The last line said  Sound: AlcInit success, using OpenAL Soft  so  openal  claims it is working.
The openal-soft is a freshly built one, following the instructions from 7.x x86_64
Did I missed something ?  :-\

Quote
Quote
... I think they depend on each other so why splitting ? ...
One probably contains the game engine, and the other contains maps and scenery. Yes, you need one of each, but
not necessarily those exact files. For example, you can use different data files with that game engine.

Quote
... The raw size of un-stripped binaries add up around 1G
The data takes more, 3G
I would certainly try to strip the binaries. Placing them in  .tcz  form should shrink them down some.
So I should do the splitting then ~
I'm not sure how much it can be shrunk, it's a big game after all ~

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11594
Re: Game 0 A. D.
« Reply #4 on: March 20, 2022, 12:11:47 PM »
Hi polikuo
Interesting, the commit shows the error messages changed don't match the reported messages in the github thread.
https://github.com/kcat/openal-soft/commit/834800c817b3a7b799fc387b51777d555494f91a

Offline polikuo

  • Hero Member
  • *****
  • Posts: 719
Re: Game 0 A. D.
« Reply #5 on: March 20, 2022, 01:47:13 PM »
Hi polikuo
Interesting, the commit shows the error messages changed don't match the reported messages in the github thread.
https://github.com/kcat/openal-soft/commit/834800c817b3a7b799fc387b51777d555494f91a

I see, I'm using the 1.21.1 tar ball from the release tag.
I'll rebuild it with the latest commit to see if it helps.

Offline polikuo

  • Hero Member
  • *****
  • Posts: 719
Re: Game 0 A. D.
« Reply #6 on: March 23, 2022, 04:38:23 PM »
Hi, just some follow-up I'd like to share.

I've recompiled the openal extension and now the sound works.
At first, I had no sound at all, but it turned out pulseaudio was outputting to a different sound card.
After some tweaking and testing, I'm now sure that it can run on alsa only.
Of course, you could use pulseaudio if you really want to.  ::)

I decide to split the game into 3 part, the main engine, the data and the locale.
The data extension is optional.
You can download that from the official page and soft link to the system.
I check what's so heavy in the data file and that is a zip file called public.zip
That zip file alone takes 3G of storage, so I give up on shrinking the data files.

Here comes the fun part.
The un-stripped main engine takes around 847.0M (du -bhd0 topdir)
After stripping those binaries, I get 23.8M
That's some serious stripping right there  :o

The game is playable on raspberry pi 4 with default setting.
You can turn down the graphical details for FPS just like any modern game.
I'm no expert in tuning though, so no comment on that.

P.S. Do you think I should submit the source codes ? (1.3G)