Plugin support for linux?

Started by ernesti, Fri 08/04/2005 22:11:18

Previous topic - Next topic

ernesti

Hello!

Is there plugin support for linux coming up anytime soon? I run ags editor in wine windows emulator, and as it works 100% fine, there could be some sort of support for linux *.so or *.dll files, so the features could be extended, linux version still needs a video support.  I could code a video plugin, which uses mplayer to play the movie files. Plenty of games in Windows use Windows Media Player to play the movies, so it'd not be WEIRD to use mplayer as a player as it supports all the common formats.

Making it possible to use the linux plugins,  gives programmers endless possibilities and i assume that it doesn't require much work from the ags author and the linux runtime engine programmer to change the editor so that it could detect the functions in the linux library binary.   ::)  If it's not possible to read a linux library files in the editor, the user could define the functions to the script header for example.

i'm not asking to port the windows plugins to linux, as it is close to impossible.  :o I just want to make plugins of my own.  ;D

This is just the thing i want to use in the linux version.  I could make use of ags in multimedia presentations for example as it could have plugins for "flash", "mplayer", "sockets",  hoho in my mind i can see a "netplay" plugin... wheehehehh..   :o

I want i want  :o  :o

Dan2552

using mplayer probably would work

plugins, i'm sure there must be some way to make at least linux-only plugins?  :-\

Pumaman

Linux plugin support is a possibility for a future version; I don't think there had really been anyone wanting it before, so it hasn't been a priority. You'd have to ask EvilTypeGuy (the Linux port maintainer) about this.

scotch

I'd like it even though I don't use Linux currently, I'd still compile linux versions of my plugins so that the linux engine can play the games.

Radiant

If it's currently unfeasible to support Linux plugins, I would still appreciate a workaround so that the same AGS game file can be run on Linux; this would mean that any function calls to a plugin would have to be ignored (or replaced by stubs) instead of causing the game to crash.

How about this: you can write a function like this:
Code: ags

pluginfunction foo (int bar) {
// do whatever
// for instance give an error msg, or simply do nothing
}


This is treated as a regular function, EXCEPT that if a plugin is found and loaded that contains a function named foo, that function overrides this one.

Pumaman

Actually, this might already work. If you create a script module and put stub functions in there, I think the plugin should override them if present.

ernesti

 ::) I think AGS'd be the best game studio ever if the linux plugin support
was added.  It'd sure open plenty of possibilities. We'd not need to request
Chris over and over again to add some function this and that, because we could
make plugin of our own to do it.  It'd make ags more module- like , as its windows version
is today.

::) Too bad the ags games run badly in wine, so the native linux engine which supports
some sort of plugins is really more than needed at this time. And of course the editor support
for the other system's plugins. Well i'm not sure if the functions in linux library files can be
read automatically to the editor.. as it is Windows software. If so, could it be possible to define the functions
to the script headers?  :o

EvilTypeGuy

Quote from: ernesti on Fri 08/04/2005 22:11:18
Hello!

Is there plugin support for linux coming up anytime soon? I run ags editor in wine windows emulator, and as it works 100% fine, there could be some sort of support for linux *.so or *.dll files, so the features could be extended, linux version still needs a video support.  I could code a video plugin, which uses mplayer to play the movie files. Plenty of games in Windows use Windows Media Player to play the movies, so it'd not be WEIRD to use mplayer as a player as it supports all the common formats.

Can't use mplayer because of the license on it's code. I already looked into using it. The other problem in using mplayer is getting it's libraries to play nicely with Allegro. Allegro is a library with a very non-modern video architecture. Everything I've looked it suggests great difficulty in getting video playback working.

EvilTypeGuy

Quote from: scotch on Sun 10/04/2005 05:35:34
I'd like it even though I don't use Linux currently, I'd still compile linux versions of my plugins so that the linux engine can play the games.

Unfortunately, I would have to be the one to compile the plugins, as they have to be compiled on the same platform as the ags executable for them to be guaranteed to work correctly :(

Developing binary only applications for Linux is a royal pain in the unmentionables. The ABI for the standard C++ libary, and other libraries tends to vary greatly between platforms. I have yet to find a solution that doesn't leave some user complaining.

I also have some concerns on whether or not the typical type of plugins done for AGS can be used at all, since they often depend on DirectDraw or DirectX somehow. Examples of this might be the snow or rain plugins, and the flashlight plugins.

At the very least I'm happy that multi-language support works in the Linux version.

I have been up to my neck in work and university, so I've been in maintenace mode only for AGS. I hope to begin work on AGS again very soon (just as soon as finals are over...)

ernesti

#9
Ok.Ã,  I didn't mean that mplayer should be compiled in ags somehow. I'm sure it's not a license problem if the user has mplayer installed in the system and the appropriate codecs to play the video file.Ã,  I don't think it's allegro problem either, can't the engine just pause the game while the video is playing in mplayer, and then resume to the game?Ã,  It is possible to run some external program through a shell command, or is it?Ã, 

Is there some sort of compatibility layer, which could use any type of linux binaries? (same architecture)

Maybe you should provide information about the libraries and the versions and possible settings to use with them and the compiler.

It's up to the game developers to do that part if they desire to use plugins in their games.Ã,  It's totally fine with me if some game does not work with linux engine if there's Windows plugins used and no linux ports available.

The priority is that there'd be some support for the external linux plugins in the editor andÃ,  in the engine.Ã,  Ã, 

scotch

#10
Personally, I think compiling ogg theora into AGS, on all platforms, would be a nice move.Ã,  Aside from the cross platform advantage it gives everyone the ability to use movies in their games without worrying about what codecs are installed on the players system.Ã,  Theora is under a BSD type license like ogg vorbis, and it seems comparable to mpeg4/divx/xvid in video compression.
Another great thing that could come of AGS decoding movies internally is being able to play movies as part of the scene, on the background, for example.Ã,  I need this for the game I'm working on, and am in the process of writing a plugin to do it but I think it's so useful that it could be part of AGS.Ã,  It'd probably add 100kb or so to the exe size, I am not sure how much removing the current video system would save, but I expect it's not too much of an increase.

Edit: and more importantly, Gilbert could play movies in the dos engine!

Gilbert

If a game uses a plugin there's no support for it under Linux and DOS currently (unless something is done in the engines).

However, if it's just about playing a movie file, if it's a game you make yourself, you can always script it so it bypasses all PlayVideo() functions and if required, do some other stuff if the game's not running under the windows engine (like displaying some lines of texts to describe the story, etc.), just do something like:

if (system.os==2) PlayVideo(blah); //if running under windows
else {//if not windows
Ã, // do whatever you want
}

In fact, as people had discussed here already, as the windows engine is the main engine port (it's real[/] sad that the DOS engine is dead now, and the Linux is still not a main port), existing plugins were all compiled to be windows-dependent, even if the Linux engine would support plugins, these plugins still need to be upgraded (either recompiled to Linux binaries, or find some way to make platform-independent plugins).
My advice is, until now, if you really want your game to be played without any difference in either engine ports, don't use plugins.

Pumaman

Quote from: scotch on Wed 25/05/2005 11:58:53
Personally, I think compiling ogg theora into AGS, on all platforms, would be a nice move.  Aside from the cross platform advantage it gives everyone the ability to use movies in their games without worrying about what codecs are installed on the players system.

I agree. theora is only in Alpha status right now, but once it's formally released to version 1.0, I'll certainly look into adding it to AGS.

SMF spam blocked by CleanTalk