Linux packages for MeAndMyShadow

Re: Linux packages for MeAndMyShadow

Postby MCMic » 29 Apr 2011, 13:56

Default value should be current folder, and the make install should set the value.

(you can do something like install(code "[cmake code]") with cmake I think)
User avatar
MCMic
 
Posts: 723
Joined: 05 Jan 2010, 17:40

Re: Linux packages for MeAndMyShadow

Postby acme_pjz » 29 Apr 2011, 14:17

Hi,

Edward_Lii {l Wrote}:I think this is the best solution so far.
The config file should be placed inside the ~/.meandmyshadow/ folder, maybe it can contain more settings like sound enabled?


I think so, and it contains sound options, and so on ... (As for screen resolution, I have no idea :| )

But a big problem is if we put the path of the data folder in the config file, then every user should have the config file created during installing, or when a new user is created and plays meansmyshadow then the game can't get data folder from config file correctly ...

Edward_Lii {l Wrote}:...
And I think it should be able to changes this with a parameter, something like this:
{l Code}: {l Select All Code}
meandmyshadow --data-dir /usr/share/meandmyshadow


Agreed :cool:
Some of my open source games on GitHub
User avatar
acme_pjz
 
Posts: 665
Joined: 10 Dec 2009, 15:32
Location: PeeKing, China

Re: Linux packages for MeAndMyShadow

Postby Edward_Lii » 29 Apr 2011, 14:43

Hello acme_pjz,

acme_pjz {l Wrote}:I think so, and it contains sound options, and so on ... (As for screen resolution, I have no idea :| )

But a big problem is if we put the path of the data folder in the config file, then every user should have the config file created during installing, or when a new user is created and plays meansmyshadow then the game can't get data folder from config file correctly ...

That's indeed a problem, but where else should we place the config file?
Placing it in the same folder as the binary isn't the way it should be.
And putting it in the data folder is impossible since the config file is needed to retrieve the data folder.

Maybe we should make a system that creates a config file when starting meandmyshadow when there's no config file.
Then the problem is what path should we choose, the current directory can't be used because when a user runs meandmyshadow it's most likely not in the data directory.
From,
Edward_Lii
User avatar
Edward_Lii
MnMS Moderator
 
Posts: 777
Joined: 20 Dec 2010, 16:46

Re: Linux packages for MeAndMyShadow

Postby MCMic » 29 Apr 2011, 22:22

I think you should look what others project do. Probably a lot are easy to install and run with the datas in the right place.
User avatar
MCMic
 
Posts: 723
Joined: 05 Jan 2010, 17:40

Re: Linux packages for MeAndMyShadow

Postby Edward_Lii » 01 May 2011, 14:36

Hello all,

MCMic {l Wrote}:I think you should look what others project do. Probably a lot are easy to install and run with the datas in the right place.

I looked how SuperTuxKart did it and it's quite similar to what acme_pjz has built in:
{l Code}: {l Select All Code}
...

    if ( getenv ( "SUPERTUXKART_DATADIR" ) != NULL )
        m_root_dir= getenv ( "SUPERTUXKART_DATADIR" ) ;
#ifdef __APPLE__
    else if( macSetBundlePathIfRelevant( m_root_dir ) ) { /* nothing to do */ }
#endif
    else if(m_file_system->existFile("data/stk_config.xml"))
        m_root_dir = "." ;
    else if(m_file_system->existFile("../data/stk_config.xml"))
        m_root_dir = ".." ;
    else if(m_file_system->existFile(exe_path+"/data/stk_config.xml"))
        m_root_dir = exe_path.c_str();
    else if(m_file_system->existFile(exe_path+"/../data/stk_config.xml"))
    {
        m_root_dir = exe_path.c_str();
        m_root_dir += "/..";
    }
    else
#ifdef SUPERTUXKART_DATADIR
        m_root_dir = SUPERTUXKART_DATADIR ;
#else
        m_root_dir = "/usr/local/share/games/supertuxkart" ;
#endif

...

Basically it tries several directories and some additional things(, environment variable).

I think it's best if we remove the 0.1.1 release and release a 0.1.2 release.
I'll upload the .desktop file and the icon after that I'll try to package it again.
From,
Edward_Lii
User avatar
Edward_Lii
MnMS Moderator
 
Posts: 777
Joined: 20 Dec 2010, 16:46

Re: Linux packages for MeAndMyShadow

Postby acme_pjz » 01 May 2011, 17:16

Hi,

Edward_Lii {l Wrote}:...

I looked how SuperTuxKart did it and it's quite similar to what acme_pjz has built in:

...

Basically it tries several directories and some additional things(, environment variable).


Haha, the code I modified is exactly inspired by SuperTuxKart's code :)

Edward_Lii {l Wrote}:I think it's best if we remove the 0.1.1 release and release a 0.1.2 release.
I'll upload the .desktop file and the icon after that I'll try to package it again.


I think this time we should make sure there's no bad bug before a new release :)

BTW, due to the bad network speed of SourceForge, I can't upload the Windows binary to SourceForge directly :( Maybe I upload the binary to forum first?
Some of my open source games on GitHub
User avatar
acme_pjz
 
Posts: 665
Joined: 10 Dec 2009, 15:32
Location: PeeKing, China

Re: Linux packages for MeAndMyShadow

Postby Edward_Lii » 03 May 2011, 06:46

Hello acme_pjz,

acme_pjz {l Wrote}:Haha, the code I modified is exactly inspired by SuperTuxKart's code :)

That explains a lot! :D

acme_pjz {l Wrote}:I think this time we should make sure there's no bad bug before a new release :)

I somehow can't get it to run under Linux, compiling goes well, but it quits with "FATAL ERROR: Failed to load necessary files".
It can find the data path without problem and the loading of the resources goes well except the music.
This line causes the problem: (didn't even know there was background music! :p )
{l Code}: {l Select All Code}
music = Mix_LoadMUS((GetDataPath()+"data/sfx/music.mid").c_str());

I'm afraid this could cause problems on more Linux systems, maybe we should throw a warning when loading the background music fails?

acme_pjz {l Wrote}:BTW, due to the bad network speed of SourceForge, I can't upload the Windows binary to SourceForge directly :( Maybe I upload the binary to forum first?

If that's faster I'd say go ahead! ;)
From,
Edward_Lii
User avatar
Edward_Lii
MnMS Moderator
 
Posts: 777
Joined: 20 Dec 2010, 16:46

Re: Linux packages for MeAndMyShadow

Postby acme_pjz » 03 May 2011, 09:40

Hi,

Edward_Lii {l Wrote}:I somehow can't get it to run under Linux, compiling goes well, but it quits with "FATAL ERROR: Failed to load necessary files".
It can find the data path without problem and the loading of the resources goes well except the music.
This line causes the problem: (didn't even know there was background music! :p )
{l Code}: {l Select All Code}
music = Mix_LoadMUS((GetDataPath()+"data/sfx/music.mid").c_str());

I'm afraid this could cause problems on more Linux systems, maybe we should throw a warning when loading the background music fails?


After checking the file names I found that the source code writes "music.mid" but the actual file name is "Music.mid", and because the file name is case-sensitive under Linux so the game will refused to run under Linux :| ... I checked the SVN and thought that it's an old mistale ... so either change the file name to "music.mid" or change the source code to "Music.mid" ...
Some of my open source games on GitHub
User avatar
acme_pjz
 
Posts: 665
Joined: 10 Dec 2009, 15:32
Location: PeeKing, China

Re: Linux packages for MeAndMyShadow

Postby Edward_Lii » 03 May 2011, 10:31

Hello acme_pjz,

acme_pjz {l Wrote}:After checking the file names I found that the source code writes "music.mid" but the actual file name is "Music.mid", and because the file name is case-sensitive under Linux so the game will refused to run under Linux :| ... I checked the SVN and thought that it's an old mistale ... so either change the file name to "music.mid" or change the source code to "Music.mid" ...

I changed the file to music.mid since most file names are lowercase in M&MS so why not the music file?

Somehow it still doesn't work, I assume this is a problem with my setup, maybe wrong version of SDL_mixer?
So I think it would be best to keep the warning system when music.mid couldn't be loaded.

I'll upload a new archive ASAP, the same goes for the packages.

I think the next step will be a theme manager. :)
From,
Edward_Lii
User avatar
Edward_Lii
MnMS Moderator
 
Posts: 777
Joined: 20 Dec 2010, 16:46

Re: Linux packages for MeAndMyShadow

Postby acme_pjz » 03 May 2011, 11:08

Edward_Lii {l Wrote}:I changed the file to music.mid since most file names are lowercase in M&MS so why not the music file?

Somehow it still doesn't work, I assume this is a problem with my setup, maybe wrong version of SDL_mixer?


Because I changed the file name in source code to "Music.mid" in previous revision :| So the source code should be changed back to "music.mid" ...
Some of my open source games on GitHub
User avatar
acme_pjz
 
Posts: 665
Joined: 10 Dec 2009, 15:32
Location: PeeKing, China

Re: Linux packages for MeAndMyShadow

Postby Edward_Lii » 03 May 2011, 11:19

Hello acme_pjz,

acme_pjz {l Wrote}:Because I changed the file name in source code to "Music.mid" in previous revision :| So the source code should be changed back to "music.mid" ...

Oh, it works now! :)

I'll upload a new archive and make packages *again*. :|
From,
Edward_Lii
User avatar
Edward_Lii
MnMS Moderator
 
Posts: 777
Joined: 20 Dec 2010, 16:46

Re: Linux packages for MeAndMyShadow

Postby MCMic » 03 May 2011, 11:23

#0 0x08083d8f in POASerializer::ReadNode (this=0xbfffe27c, fin=..., objOut=0xbfffe238, bLoadSubNodeOnly=true) at /home/mcmic/dev/meandmyshadow/src/POASerializer.cpp:110

This is still an infinite loop for me.
User avatar
MCMic
 
Posts: 723
Joined: 05 Jan 2010, 17:40

Re: Linux packages for MeAndMyShadow

Postby acme_pjz » 03 May 2011, 12:18

MCMic {l Wrote}:#0 0x08083d8f in POASerializer::ReadNode (this=0xbfffe27c, fin=..., objOut=0xbfffe238, bLoadSubNodeOnly=true) at /home/mcmic/dev/meandmyshadow/src/POASerializer.cpp:110

This is still an infinite loop for me.


I'm sorry to hear that :( Please try to add a statment "if(c==EOF) break;" after line 111 "c=fin.get();" and have a test?
Some of my open source games on GitHub
User avatar
acme_pjz
 
Posts: 665
Joined: 10 Dec 2009, 15:32
Location: PeeKing, China

Who is online

Users browsing this forum: No registered users and 1 guest