maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Games (https://talk.maemo.org/forumdisplay.php?f=12)
-   -   FreeSynd (Syndicate open source engine) port to maemo (https://talk.maemo.org/showthread.php?t=83470)

NerdKnight 2012-04-05 17:38

FreeSynd (Syndicate open source engine) port to maemo
 
I'm trying to port FreeSynd (reimplementation of engine for the classic Bullfrog game, Syndicate).
Freesynd depends on various SDL libraries: libSDL-1.2, libSDL_mixer, libSDL_image; the last two seem to be outdated in the maemo repos, so I managed to compile the game commenting some lines of code, the game runs but it is unstable, is someone interested in helping with this?

szopin 2012-04-05 18:19

Re: FreeSynd (Syndicate open source engine) port to maemo
 
Search the forum for sdlmixer, Aapo started a thread, though it was mostly about not playing ogg and such and only mp3, error I'm getting atm:
error: ‘Mix_LoadMUS_RW’ was not declared in this scope
There also is sdl1.3 package in repos, have you tried it? (gave me quite a lot of errors when compiling with 1.2 went ok, some time ago, not sure if this is good advice, but trying won't hurt)

AapoRantalainen 2012-04-05 18:33

Re: FreeSynd (Syndicate open source engine) port to maemo
 
There are newer sdlmixer, libsdl-mixer1.2.8-dev

I made for testing purpose newer sdl-image (1.2.10), not yet sure how it should be renamed so it can be installed parallel with old version (as there might be some differences).

Download debs: http://cc.oulu.fi/~rantalai/maemo5/

Code:

apt-cache policy libsdl-mixer1.2.8-dev libsdl-image1.2-dev
libsdl-mixer1.2.8-dev:
  Installed: 1.2.8-6maemo4
libsdl-image1.2-dev:
  Installed: 1.2.10-2.1

Code:

wget Freesynd-0.6
mkdir build
cd build
cmake ..
make

There were lots of warning: comparison is always true due to limited range of data type
Give this link to upstream: http://www.arm.linux.org.uk/docs/faqs/signedchar.php

szopin 2012-04-05 18:35

Re: FreeSynd (Syndicate open source engine) port to maemo
 
kudos
edit: if you can think of a way/script to perform testing if they are backwards compatible, count me in

szopin 2012-04-05 18:48

Re: FreeSynd (Syndicate open source engine) port to maemo
 
Aapo: just so you know Gigalomania fell prey to newer mixer (also couple of webos games sadly)

HolgerN 2012-04-05 18:52

Re: FreeSynd (Syndicate open source engine) port to maemo
 
You can also use libsdl-mixeroggwav1.2-dev instead of libsdl-mixer1.2-dev.

AapoRantalainen 2012-04-05 18:52

Re: FreeSynd (Syndicate open source engine) port to maemo
 
Quote:

Originally Posted by szopin (Post 1188535)
Aapo: just so you know Gigalomania fell prey to newer mixer (also couple of webos games sadly)

No sound? Or crash?

NerdKnight 2012-04-05 19:10

Re: FreeSynd (Syndicate open source engine) port to maemo
 
Quote:

Originally Posted by AapoRantalainen (Post 1188530)
There are newer sdlmixer, libsdl-mixer1.2.8-dev

I made for testing purpose newer sdl-image (1.2.10), not yet sure how it should be renamed so it can be installed parallel with old version (as there might be some differences).

Download debs: http://cc.oulu.fi/~rantalai/maemo5/

Code:

apt-cache policy libsdl-mixer1.2.8-dev libsdl-image1.2-dev
libsdl-mixer1.2.8-dev:
  Installed: 1.2.8-6maemo4
libsdl-image1.2-dev:
  Installed: 1.2.10-2.1

Code:

wget Freesynd-0.6
mkdir build
cd build
cmake ..
make

There were lots of warning: comparison is always true due to limited range of data type
Give this link to upstream: http://www.arm.linux.org.uk/docs/faqs/signedchar.php

Thanks!, it compiles with those libs, but when I try to build the deb package it fails with:
Code:

dpkg-shlibdeps: error: no dependency information found for /usr/lib/libSDL_mixer-1.2.so.0 (used by debian/freesynd/usr/local/bin/freesynd).
dh_shlibdeps: dpkg-shlibdeps -Tdebian/freesynd.substvars debian/freesynd/opt/freesynd/freesynd debian/freesynd/usr/local/bin/freesynd returned exit code 2

I think this is because of the package name.

szopin 2012-04-05 19:29

Re: FreeSynd (Syndicate open source engine) port to maemo
 
Disabling test-data made it run for me, sound intro mission choosing all works (not sure how to shoot yet), ctrl-c resulted in a megahalt though. Battery-forced reboot required. Very good-looking (especially as this game rocked)

NerdKnight 2012-04-05 19:47

Re: FreeSynd (Syndicate open source engine) port to maemo
 
Quote:

Originally Posted by szopin (Post 1188554)
Disabling test-data made it run for me, sound intro mission choosing all works (not sure how to shoot yet), ctrl-c resulted in a megahalt though. Battery-forced reboot required. Very good-looking (especially as this game rocked)

It shoots with right mouse button, I'll try to emulate this holding a key.

NerdKnight 2012-04-05 19:51

Re: FreeSynd (Syndicate open source engine) port to maemo
 
Quote:

Originally Posted by AapoRantalainen (Post 1188530)
There were lots of warning: comparison is always true due to limited range of data type
Give this link to upstream: http://www.arm.linux.org.uk/docs/faqs/signedchar.php

I got rid of all the warnings, I replaced the char declarations with signed char, and uint16 with int, hope this is ok.

szopin 2012-04-05 19:51

Re: FreeSynd (Syndicate open source engine) port to maemo
 
Quote:

Originally Posted by AapoRantalainen (Post 1188538)
No sound? Or crash?

forces removal (at least apt-get, though expecting dkpg to have same result)

NerdKnight 2012-04-05 20:55

Re: FreeSynd (Syndicate open source engine) port to maemo
 
I made some modifications to the code to emulate the right mouse button (holding x key) and esc key (pressing CTRL+q). Please tell me if there is another key that needs to be emulated.
Before uploading to extras-devel, we must resolve the following two problems:
  • deb bulding error with libsdl-mixer1.2.8-dev:
    Code:

    dpkg-shlibdeps: error: no dependency information found for /usr/lib/libSDL_mixer-1.2.so.0 (used by debian/freesynd/usr/local/bin/freesynd).
    dh_shlibdeps: dpkg-shlibdeps -Tdebian/freesynd.substvars

  • we need to upload Aapos's libsdl-image1.2-dev (v 1.2.10-2.1) to extras-devel

szopin 2012-04-05 21:07

Re: FreeSynd (Syndicate open source engine) port to maemo
 
Aapo needs to chime in, he didn't promote his ibsdlimage because of naming conventions/fear of backwards incompatibility. If we can somehow find a way to test 2.10 to confirm it doesn't break anything with previous packages this should be fixed. If no easy way to do it exist you can always include .so files for it and statically link.
Not sure how to deal with first problem though

Estel 2012-04-05 23:02

Re: FreeSynd (Syndicate open source engine) port to maemo
 
Quote:

Originally Posted by NerdKnight (Post 1188592)
I made some modifications to the code to emulate the right mouse button (holding x key) and esc key (pressing CTRL+q). Please tell me if there is another key that needs to be emulated.

Any chances of - instead of emulating anything - just respecting people's remapped keyboard? Personally, I hate when games emulate anything - either some important (at least for me) function is always left forgotten (see Jagged Alliance 2 and switching ground/ceiling levels...), or emulated function override special key, that I'm used to, due to personal hardware keyboard remap.

Remember, that using blue arrow + shift, we got plenty of "free keys", where we can emulate almost full-fledged desktop keyboard. for example, I've all F1-F12 keys mapped to upper row shift+blue arrow, right and middle mouse click (blue arrow +tap and shift+blue arrow+tap, respectively), TAB, all my national special characters, all symbols... Without sacrificing any single default key.

There really isn't any need to emulate anything - just make game aware of user's keyboard layout if it's possible, and everyone will be happy penguins.

/Estel

Ps.

Thanks for Your efforts, nevertheless!

daniel_m 2012-04-06 09:26

Re: FreeSynd (Syndicate open source engine) port to maemo
 
Well, I'd appreciate an emulated mouse button since I don't want to push 3 keys simultaneously just to get a right mouse click.
The only thing that bothers me with emulated keys is different keyboard layouts for different countries on the phone. Please make sure that you use keys that are in the same position on all N900 versions.
If the user is given the opportunity to change the key-mapping himself, things would be even sweeter ;)

vi_ 2012-04-06 09:34

Re: FreeSynd (Syndicate open source engine) port to maemo
 
Quote:

Originally Posted by Estel (Post 1188625)
...right and middle mouse click (blue arrow +tap and shift+blue arrow+tap, respectively)

What is this? witchcraft?

HOW DO YOU EMULATE MIDDLE+RIGHT CLICKS???

Please point me to the relevant information sources.

NerdKnight 2012-04-06 13:32

Re: FreeSynd (Syndicate open source engine) port to maemo
 
Don't worry, I'll add the key mappings to the game's config file.

NerdKnight 2012-04-10 18:50

Re: FreeSynd (Syndicate open source engine) port to maemo
 
Quote:

Originally Posted by szopin (Post 1188596)
Aapo needs to chime in, he didn't promote his ibsdlimage because of naming conventions/fear of backwards incompatibility. If we can somehow find a way to test 2.10 to confirm it doesn't break anything with previous packages this should be fixed. If no easy way to do it exist you can always include .so files for it and statically link.
Not sure how to deal with first problem though

Can you give me a clue on how to link the libraries statically?

The other approach could be commenting the code, so that doesn't need the new libraries. The newer libsdl-image is used only to load the mouse pointer image. The newer libsdl-mixer it's used apparently to load music in some cases, but with the code commented, the music it's still played (no crashes so far I tested). This way I could build a package and upload a first version to extras-devel, so others can test the game.

AapoRantalainen 2012-04-11 08:05

Re: FreeSynd (Syndicate open source engine) port to maemo
 
Quote:

Originally Posted by NerdKnight (Post 1190502)
Can you give me a clue on how to link the libraries statically?

Compile SDLmixer and SDLimage statically, and every other dynamically:

src/CMakeLists.txt
Code:

-target_link_libraries (freesynd ${PNG_LIBRARIES} ${SDL_LIBRARY} ${SDL_MIXER} ${SDL_IMAGE} )
+target_link_libraries (freesynd ${PNG_LIBRARIES} ${SDL_LIBRARY} )
+target_link_libraries (freesynd /usr/lib/libSDL_mixer.a -lvorbisfile -lvorbis -logg  -lsmpeg -lmikmod)
+target_link_libraries (freesynd /usr/lib/libSDL_image.a -ljpeg -ltiff)

On autobuilder you might need to add SDLmixer and SDLimage sources and compile them first (not sure where to put them so cmake finds them)

And dependencies are not
libsdl-image1.2-dev, libsdl-mixer1.2-dev,
but
libvorbis-dev, libsmpeg-dev, libogg-dev, libmikmod-dev

I have packed one libsdl-mixer, I compiled it without libmikmod, because it causes that game wants write zero length file to running directory (which needs write access). (I think it is know bug on libmikmod). If Freesynd is not even needing mikmod it could be wise to drop it.

[DarkGUNMAN] 2012-04-11 17:35

Re: FreeSynd (Syndicate open source engine) port to maemo
 
Quote:

Originally Posted by Estel (Post 1188625)
Any chances of - instead of emulating anything - just respecting people's remapped keyboard? Personally, I hate when games emulate anything - either some important (at least for me) function is always left forgotten (see Jagged Alliance 2 and switching ground/ceiling levels...), or emulated function override special key, that I'm used to, due to personal hardware keyboard remap.

Remember, that using blue arrow + shift, we got plenty of "free keys", where we can emulate almost full-fledged desktop keyboard. for example, I've all F1-F12 keys mapped to upper row shift+blue arrow, right and middle mouse click (blue arrow +tap and shift+blue arrow+tap, respectively), TAB, all my national special characters, all symbols... Without sacrificing any single default key.

There really isn't any need to emulate anything - just make game aware of user's keyboard layout if it's possible, and everyone will be happy penguins.

/Estel

Ps.

Thanks for Your efforts, nevertheless!


Hi Estel,

I would also be interested in how you have mapped the mouse buttons to the modifier keys.. I have already re-mapped my own keyboard with the Shift+Fn extras, and enabled full screen of applications using xbindkeys ctrl+up.

Which files need to be edited for mouse buttons?

Thanks, DG

Estel 2012-04-12 06:37

Re: FreeSynd (Syndicate open source engine) port to maemo
 
It's off-topic here, but may be useful for You and other people askign same question - just put:
Code:

# Shift+Tap=middle click; Fn+Tap=right click
"xdotool click 2"
m:0x1 + b:1 + release

"xdotool click 3"
m:0x80 + b:1 + release

...into Your xbindkeys config file. I'm using one from Easy Debian, yet, I'm quite sure it should work with Maemo's xbindkeys too.

/Estel

[DarkGUNMAN] 2012-04-12 06:48

Re: FreeSynd (Syndicate open source engine) port to maemo
 
Sorry, I PM'd you about this at the same time you replied in this topic.
Thank you for the guide!

NerdKnight 2012-04-14 07:15

Re: FreeSynd (Syndicate open source engine) port to maemo
 
Finally!, I could link the libraries statically, thanks Aapo.
I uploaded freesynd to extras-devel.

To play it you must copy the data dir from the original Syndicate game to /home/user/MyDocs/Games/syndicate, you can change this location from the config file.
The config file is generated the first time the game runs in /home/user/.freesynd/freesynd.ini

Have fun!

HolgerN 2012-04-14 11:46

Re: FreeSynd (Syndicate open source engine) port to maemo
 
Thank you for your work! The game is great. But can you optify the package completely? It takes 3MB of rootfs.

NerdKnight 2012-04-14 14:46

Re: FreeSynd (Syndicate open source engine) port to maemo
 
Quote:

Originally Posted by HolgerN (Post 1191988)
Thank you for your work! The game is great. But can you optify the package completely? It takes 3MB of rootfs.

Thanks, I haven't noticed that, I'll upload a new version soon.

OMOIKANE 2012-06-05 19:43

Re: FreeSynd (Syndicate open source engine) port to maemo
 
No objects positions on minimap. Is it known bug or can i do something?


All times are GMT. The time now is 18:57.

vBulletin® Version 3.8.8