Autor Tema: Releasing game with binaries and libraries included  (Leído 19905 veces)

Imerion

  • Jr. Member
  • **
  • Mensajes: 69
  • Karma: 3
Re: Releasing game with binaries and libraries included
« Respuesta #15 en: Octubre 19, 2009, 02:24:24 pm »
Citar
The packages in the PPA are RC10 now, and should've been RC9 by when you posted. Have you updated your system lately?

Also, are you saying that the packages from the PPA don't work at all or that they didn't work for the kind of install you're doing?

I did an update quite recently, but it seems the repository had been removed from my system for some reason. No idea how it happened, but it's fixed now. The packages worked fine all the time during development though, it was just this kind of install/packaging that did not work. (When I tried to put them in any other location than /usr/bin and /usr/lib).

Citar
You can have multiple packages, catering to all the needs of your customers. A package for someone who has the Bennu VM installed (multiplatform), a package for Windows user, a package for Linux user.

Sure, that could work. As it is now though, those with Bennu already installed can simply remove the folder bgdruntime to run it with their installed version instead.

Citar
Are you serious you call 100MB gigantic? In these times of terabytes? Just to visualize it: you can fit 10000 of those Java installs on a 1TB drive. That's just an argument for the sake of having an argument. Secondly, if you use your method, you get a 100MB 'gigantic' file for every piece of software that uses it. Of course it's easier to just include it in the package, but don't come with an argument about space usage then.

Sorry, I was not trying to argue, just explain how I feel. I do think 100MB is quite a bit for something I don't use and it's not really the actual space it takes up that is the problem. I just don't want to have loads of stuff lying around that is not used. My system is already full of packages which has been installed at one point but the program that needed them is removed since long. I know apt-get can clean out unused packages, but sometimes I have to track them down myself too. But as you said, some people prefer the other way. A good solution, which would not require multiple packages would be to include a link to the runtime installer and instructions in the ReadMe. I think Ill do that.

Citar
Most Windows installers clean up the filesystem very nicely and ask if you want to keep any files. The Windows Installer system is a handy tool for making installers. It provides a safe (well relatively... it's still Windows) environment, tracks changes and can create restore points automatically. If a Windows Installer did not do this right, it is because the *creator* of the installer didn't do it right. This doesn't mean *your* installer has to be bad. Their use in amateur games is of course limited, so an archive containing the game suffices.

I know they mostly work well, but sometimes, when I still used Windows, they would not work at all or leave lots of files behind. Not to mention menu entries and stuff like that. True, it is the creators fault. But I still prefer to do things myself and arrange my files the way I want them to be. Just extracting an archive and run the included files still feels like the most convenient way.

Citar
Well, I take it you're not a fan of a BennuGD.msi. Too bad really, I'm of the opinion it's the future. Maybe my views are too broad.

I haven't heard about it or used it actually, which is probably because I don't use Windows. Also, msi files have been known to work quite badly in Wine for some time. But I believe that has been fixed now though, so I could try it out.

Please don't take this as an argument, but one more reason I prefer this way of packaging is that I know it will always work. If I don't include the runtime and everyone uses the latest version installed on their computer, there is a risk my game will stop working if some update later on changes something in the runtime. This has happened to me with other programs. It's not a problem as long as long as Bennu stays 100% backwards compatible, but just a small change could break some part of the game. I guess that is inevitable though, because some time the OS will change so the old binaries and libraries won't run and so on. But it's still an issue.
Try my games : Neotron Games

Windgate

  • Hero Member
  • *****
  • Mensajes: 2930
  • Karma: 124
    • TRINIT Asociación de Informáticos de Zaragoza
Re: Releasing game with binaries and libraries included
« Respuesta #16 en: Octubre 20, 2009, 11:36:01 am »
Could you put here a link where we can download a VERY SIMPLE example that could run on Windows and Linux without a preinstalled Bennu???

For example, a Hello World that use mod_text...

I could fix all my videogame examples in order to make it "compatible" with Linux too...
Iván García Subero. Programador, profesor de informática, monitor de actividades culturales y presidente de TRINIT Asociación de Informáticos de Zaragoza. http://trinit.es

Imerion

  • Jr. Member
  • **
  • Mensajes: 69
  • Karma: 3
Re: Releasing game with binaries and libraries included
« Respuesta #17 en: Octubre 20, 2009, 02:20:21 pm »
Here you go : http://www.mediafire.com/download.php?ydzvwunim2i

It includes both runtimes and scripts to compile and run each of them.
Try my games : Neotron Games

Windgate

  • Hero Member
  • *****
  • Mensajes: 2930
  • Karma: 124
    • TRINIT Asociación de Informáticos de Zaragoza
Re: Releasing game with binaries and libraries included
« Respuesta #18 en: Octubre 20, 2009, 09:05:14 pm »
Tested on XP only... But it is OK and the .sh looks good too... I'll try it soon.

My idea is making all my examples compatible with Windows and Linux by this way, thanks.

And fell the karma Imerion, virgin no more ;D
Iván García Subero. Programador, profesor de informática, monitor de actividades culturales y presidente de TRINIT Asociación de Informáticos de Zaragoza. http://trinit.es

Imerion

  • Jr. Member
  • **
  • Mensajes: 69
  • Karma: 3
Re: Releasing game with binaries and libraries included
« Respuesta #19 en: Octubre 20, 2009, 09:31:16 pm »
Citar
My idea is making all my examples compatible with Windows and Linux by this way, thanks.

Sounds great! Tell me if you need anything more, like testing or something. And thanks for the karma. :)
Try my games : Neotron Games

Imerion

  • Jr. Member
  • **
  • Mensajes: 69
  • Karma: 3
Re: Releasing game with binaries and libraries included
« Respuesta #20 en: Octubre 22, 2009, 08:45:46 pm »
Sorry Windgate. I did some more testing, and it seems it doesn't work after all. The Linux .sh installer installed files in a different location than the repository packages did, so I was not able to make the program run as stand alone. It simply looked for the libraries in that other location instead. When I removed it, the game stopped working. I have tried so many things now I don't know what to do... I even compiled Bennu myself to see if it made any difference, but it didn't.

Does anyone have a working example of a stand-alone Linux app using the Bennu runtime in the way described in this thread?
Try my games : Neotron Games

Windgate

  • Hero Member
  • *****
  • Mensajes: 2930
  • Karma: 124
    • TRINIT Asociación de Informáticos de Zaragoza
Re: Releasing game with binaries and libraries included
« Respuesta #21 en: Octubre 22, 2009, 08:50:51 pm »
Oh, I didn't try it on Linux :(

The Windows .bat has a problem... It makes a cd bgd_win, and all INCLUDES must have a ../ before their path...

I have modified the .bat in order to avoid changing the paths:

Código: [Seleccionar]
@echo off

bgd_win\bgdc.exe main.prg

pause

bgd_win\bgdi.exe main.dcb
Iván García Subero. Programador, profesor de informática, monitor de actividades culturales y presidente de TRINIT Asociación de Informáticos de Zaragoza. http://trinit.es

Imerion

  • Jr. Member
  • **
  • Mensajes: 69
  • Karma: 3
Re: Releasing game with binaries and libraries included
« Respuesta #22 en: Octubre 22, 2009, 09:24:47 pm »
Yes, that is a better solution. I didn't get it to work properly for some reason. But that might have to do with Wine.

Perhaps the problem is that the Linux binaries point to a specific place where it looks for the libraries which is hard-coded or somehow compiled into the binaries? This seems to be the case, since the .sh installer only looks for the files in /usr/lib/bgd and the repository packages only looks in /usr/lib/bennugd. Perhaps it can be compiled to look at the place where it is currently located instead?
Try my games : Neotron Games

Windgate

  • Hero Member
  • *****
  • Mensajes: 2930
  • Karma: 124
    • TRINIT Asociación de Informáticos de Zaragoza
Re: Releasing game with binaries and libraries included
« Respuesta #23 en: Octubre 22, 2009, 09:30:03 pm »
I don't know dude, maybe Splinter would know about it... I'm a Linux N44B... :-[
Iván García Subero. Programador, profesor de informática, monitor de actividades culturales y presidente de TRINIT Asociación de Informáticos de Zaragoza. http://trinit.es

josebita

  • Administrator
  • *****
  • Mensajes: 4039
  • Karma: 257
    • BennuGD Mobile Worklog
Re: Releasing game with binaries and libraries included
« Respuesta #24 en: Octubre 23, 2009, 09:09:02 am »
Imerion, please have a look at my karaoke package (here)
Download it from the linux command line with:
[code language="Bash"]svn checkout http://bennugd-karaoke.googlecode.com/svn/trunk/ bennugd-karaoke-read-only[/code]

It contains all the binaries for Bennu RC8 inside a foler and a script to launch them.

PS: I also attacht the launch script:
[code language="bash"]
#!/bin/bash

CURDIR=$(dirname 0)
BINDIR=$CURDIR/bin
LIBDIR=$BINDIR/lib

export PATH=$PATH:$BINDIR
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$LIBDIR

if [ -f main.dcb ]; then
   rm main.dcb
fi

bgdc main.prg
if [ -f main.dcb ]; then
   bgdi main
fi
[/code]

PS2: Paths to the libs are not hardcoded in any way. It's just that you must put the path to the libs into the $LD_LIBRARY_PATH environment variable.
Also, my script above will prefer an installed version of Bennu, if available. If you want to always use the bundled Bennu version, you should switch the order of the vars, like this:
[code language="bash"]
export PATH=$BINDIR:$PATH
export LD_LIBRARY_PATH=$LIBDIR:$LD_LIBRARY_PATH
[/code]

The directory in which the system looks for Bennu modules is specified in /etc/ld.so.conf.d/bennugd.conf (or another file in the same path with a similar name) for a global installation. Both the official Bennu installer and my PPA packages use this way to let the system now where the binaries are. The exact name of the file may vary, though.
If you open that file, it says (for me, the contents will probably vary in your installation):
Código: [Seleccionar]
# BennuGD libs support
/usr/lib32/bennugd

So now, the system nows that it should look for libraries in the usual paths AND in /usr/lib32/bennugd (there's where I keep my Bennu libs).
There should be more config files in that folder, for other apps.
But there's no need to use this mechanism -which requires you to install the program with root privileges- if you use a script such as the one

I hope this clears the situation a bit.

[Sidenote] If you modify that file, you must tell the system to update the list of available libraries, by either rebooting (discouraged) or running, as root the following code
Código: [Seleccionar]
ldconfig
« última modificación: Octubre 23, 2009, 09:33:03 am por josebita »

Windgate

  • Hero Member
  • *****
  • Mensajes: 2930
  • Karma: 124
    • TRINIT Asociación de Informáticos de Zaragoza
Re: Releasing game with binaries and libraries included
« Respuesta #25 en: Octubre 23, 2009, 10:35:09 am »
So, it is possible?

Please, if anyone modifies the Imerion Hello World in order to have it running on Linux without a previous Bennu instalation...

I will change the .bat too, and INCLUDE will work now without prefixing all paths with ../
Iván García Subero. Programador, profesor de informática, monitor de actividades culturales y presidente de TRINIT Asociación de Informáticos de Zaragoza. http://trinit.es

josebita

  • Administrator
  • *****
  • Mensajes: 4039
  • Karma: 257
    • BennuGD Mobile Worklog
Re: Releasing game with binaries and libraries included
« Respuesta #26 en: Octubre 23, 2009, 10:58:51 am »
Chnaging the helloWorld RunLinux.sh script to this works for me:
[code language="Bash"]
#!/bin/sh

CURDIR=$(dirname 0)
BENNUDIR=$CURDIR/bgd_linux

export LD_LIBRARY_PATH=$BENNUDIR:$LD_LIBRARY_PATH
export PATH=$BENNUDIR:$PATH

bgdc HelloWorld.prg
bgdi HelloWorld.dcb
[/code]
I suppose the only problem is that Imerion wasn't using export with the PATH and LD_LIBRARTY_PATH vars.

Also, please note that even if you'reusing export, the environment is only modified for the script, the rest of the system will remain untouched (after you run the script, the system will not find bgdc anymore).

Imerion

  • Jr. Member
  • **
  • Mensajes: 69
  • Karma: 3
Re: Releasing game with binaries and libraries included
« Respuesta #27 en: Octubre 23, 2009, 01:38:45 pm »
Thanks josebita, this time it works for real! Adding export did the trick.
I understand the whole thing better now. I guessed they were not hard-coded, since different distros put things in different places. But /etc/ld.so.conf.d/bennugd.conf was the missing thing I was looking for. Perhaps you should put this in the documentation somewhere. (Or perhaps it already is, and I didn't look well enough.)

Anyway, thanks again to all who helped me with this. If you want to try the working game, it can be found here : http://neotron-games.blogspot.com/2009/10/railroad-rampage.html
Try my games : Neotron Games

josebita

  • Administrator
  • *****
  • Mensajes: 4039
  • Karma: 257
    • BennuGD Mobile Worklog
Re: Releasing game with binaries and libraries included
« Respuesta #28 en: Octubre 23, 2009, 07:04:42 pm »
It's always nice to help. Sorry I didn't reply before.
I'll give a look at the game once I get some free time :)