GLBasic forum

Main forum => Off Topic => Topic started by: Hatonastick on 2008-Aug-28

Title: Woo hoo! Running my little program on Linux.
Post by: Hatonastick on 2008-Aug-28
I guess this is GLBasic related, but didn't think it really fitted in with the usual questions and answers since it's neither.  I'm just sharing my elation at getting my first (very alpha) little GLBasic test program running under Linux (erm not that it was hard mind you - I love GLBasic!).  Last night, on a whim, I turned a spare old Dell desktop PC into a Linux box.  I've decided that I want to try my hand at developing small games for Windows, Linux and MacOS (will need to track down a MacOSX box next).  I haven't touched any UNIX or UNIX-like operating system in some time (only one other time in 8 years, but all it did was sit there and gather dust); which is sort of odd as I used to be a Systems Administrator for an IT company that wasn't big on MS products.  Glad to see I haven't completely forgotten how to use a shell command-line, not that you seem to need it anywhere near as much these days.  Anyway I like the fact that my program looks exactly the same on both my WinXP and Linux systems, despite one having a NVIDIA card and the other some dang awful Intel integrated video chipset.  Got to love GLBasic. :good:
Title: Re: Woo hoo! Running my little program on Linux.
Post by: Kitty Hello on 2008-Aug-28
how soothing. Thanks for sharing.
Title: Re: Woo hoo! Running my little program on Linux.
Post by: Kuron on 2008-Aug-28
I am glad to hear it.  I am looking forward to trying my GLBasic stuff under Mandriva  =D  You give me reassurance that all will be well.

I do wonder about OS X though since I do not have access to a system for testing...
Title: Re: Woo hoo! Running my little program on Linux.
Post by: Wild_Duck on 2008-Aug-29
I run GLBasic on XP and err..vista on my laptop with Ubuntu 8.04 on both of them. The only thing thats not 100% (on Ubuntu)is the Help(menu or F1)but hovering over a command gives the syntax so its near enough.
Title: Re: Woo hoo! Running my little program on Linux.
Post by: Hatonastick on 2008-Aug-29
Yeah, I wish I still had access to a Mac myself for testing purposes.

So far I think the only trouble (if it can be called that) I've had with Ubuntu was getting the latest stable version of Code::Blocks running under Ubuntu.  Had some mucking about because Code::Blocks uses a newer version of WxWidgets than my version of Ubuntu had in the "official" packages.  Got it all working now though.  My only interest in Code::Blocks, a GNU C compiler and a return to C programming for me is for a couple of small DLL's I'm looking at writing to go with a couple of my GLBasic games.  Hmm although I may be able to avoid that if I can do as much as possible in GLBasic itself.  The two DLL's I was looking to write myself just add a couple of encryption routines (not just TEA/XTEA which are fairly straight forward in almost any language) and some raw simple TCP/UDP networking commands (to supplement NETWEBGET).
Title: Re: Woo hoo! Running my little program on Linux.
Post by: Kuron on 2008-Aug-29
Hmm... You bring up a point.  I think I will stick with releasing Windows only versions.  I am too unfamiliar with Linux to provide tech support if people run into problems running the game/app.  I would not be good at deciphering what runtimes are missing and how they should be installed.  The same goes for OS X.
Title: Re: Woo hoo! Running my little program on Linux.
Post by: Ian Price on 2008-Aug-29
Quote from: Kuron on 2008-Aug-29
Hmm... You bring up a point.  I think I will stick with releasing Windows only versions.  I am too unfamiliar with Linux to provide tech support if people run into problems running the game/app.  I would not be good at deciphering what runtimes are missing and how they should be installed.  The same goes for OS X.

I said the same to someone that wanted B'lox! ported to OSX and Linux - I couldn't offer support on those formats, hence my decision not to compile for them.
Title: Re: Woo hoo! Running my little program on Linux.
Post by: Kitty Hello on 2008-Aug-29
You might get support for these platfoms here, though.
Title: Re: Woo hoo! Running my little program on Linux.
Post by: Kuron on 2008-Aug-29
Hmm... Gernot makes a good point.
Title: Re: Woo hoo! Running my little program on Linux.
Post by: Hatonastick on 2008-Aug-29
Gernot makes a very good point as the GLB forums are a good place to test things before you do a full release to the public ie. the Beta Test forum.

Ian if you want to have a go at getting your game to run under Linux, I'd be happy to test it and provide feedback if you like - as I'm sure others will too.  Can't hurt to try it at least once. :)

I more setup a Linux box because a) I miss having some form of UNIX machine around and b) I'm playing with the idea of writing a server for one of my games and using GLB as the client which uses information from the server.  Not an MMO, more along the lines of information sharing such as the way BBS door games used to handle things.  Could probably get away with PHP, SQL and a webserver.  That could be interesting - only ever set those up for other people, never done any development with them. =D
Title: Re: Woo hoo! Running my little program on Linux.
Post by: Ian Price on 2008-Aug-29
Last time I tried, B'lox! wouldn't compile to OSX. Haven't tried for Linux though. Nope, still can't
Quote
/cygdrive/c/Program Files/GLBasic/Compiler/platform/Mac/Bin/../libexec/gcc/i686-apple-darwin8/4.0.1/ld: for architecture i386
/cygdrive/c/Program Files/GLBasic/Compiler/platform/Mac/Bin/../libexec/gcc/i686-apple-darwin8/4.0.1/ld: table of contents for archive: /cygdrive/C/Program Files/GLBasic/Compiler/platform/Mac/OSX/Lib/libGLBasicUni.a is out of date; rerun ranlib(1) (can't load from it)
/cygdrive/c/Program Files/GLBasic/Compiler/platform/Mac/Bin/../libexec/gcc/i686-apple-darwin8/4.0.1/ld: table of contents for archive: /cygdrive/C/Program Files/GLBasic/Compiler/platform/Mac/OSX/Lib/libpng_uni.a is out of date; rerun ranlib(1) (can't load from it)
collect2: ld returned 1 exit status
/cygdrive/c/Program Files/GLBasic/Compiler/platform/Mac/Bin/../libexec/gcc/powerpc-apple-darwin8/4.0.1/ld: for architecture ppc
/cygdrive/c/Program Files/GLBasic/Compiler/platform/Mac/Bin/../libexec/gcc/powerpc-apple-darwin8/4.0.1/ld: table of contents for archive: /cygdrive/C/Program Files/GLBasic/Compiler/platform/Mac/OSX/Lib/libGLBasicUni.a is out of date; rerun ranlib(1) (can't load from it)
/cygdrive/c/Program Files/GLBasic/Compiler/platform/Mac/Bin/../libexec/gcc/powerpc-apple-darwin8/4.0.1/ld: table of contents for archive: /cygdrive/C/Program Files/GLBasic/Compiler/platform/Mac/OSX/Lib/libpng_uni.a is out of date; rerun ranlib(1) (can't load from it)
collect2: ld returned 1 exit status
powerpc-apple-darwin8-lipo: can't open input file: /cygdrive/c/WINDOWS/TEMP/cccP39bV.out (No such file or directory)
*** FATAL ERROR - Please post this output in the forum

Linux just compiled fine though.
Title: Re: Woo hoo! Running my little program on Linux.
Post by: Kuron on 2008-Aug-29
FWIW, I get similar when I try to compile any of the examples for OSX.
Title: Re: Woo hoo! Running my little program on Linux.
Post by: Kitty Hello on 2008-Aug-30
Something seems broken.
I try to fix it, when I update the WIZ support (soon). Is that OK?
Title: Re: Woo hoo! Running my little program on Linux.
Post by: Kuron on 2008-Aug-30
I am not losing any sleep over it  :good:  That sounds fine to me  =D
Title: Re: Woo hoo! Running my little program on Linux.
Post by: Hatonastick on 2008-Aug-30
Quote from: Ian Price on 2008-Aug-29
Last time I tried, B'lox! wouldn't compile to OSX. Haven't tried for Linux though. Nope, still can't
Linux just compiled fine though.
Could I please try the Linux version out and see how it goes?  Assuming you don't mind me trying it out.  I only remember playing the beta under Windows.  Was B'lox the one my cousin helped out with the Japanese to English translation?
Title: Re: Woo hoo! Running my little program on Linux.
Post by: Ian Price on 2008-Aug-30
Very good news :)

HOAS, no that was a completely different puzzle game. The game you are thinking of was Guru Logic Champs (which I still haven't actually released, despite it being pretty much complete, with over 100 puzzles)

Here's B'lox! Linux edition - http://www.iprice.remakes.org/stuff/Blox_linux.rar
Title: Re: Woo hoo! Running my little program on Linux.
Post by: Hatonastick on 2008-Aug-30
Cool!  I remember this one.  I like these sorts of puzzle games too. :)  Ok it works well, although there were a couple of very minor issues and one really odd graphical glitch - which may have nothing to do with your game, or GLB.  Some sprites have what looks like a pink, vertical morse code down the edge of the border of the sprite.  The cause could be anything from my dodgy Intel graphics card, to an issue with the SDL libs (or maybe the PNG lib) I have installed.  I'm pretty sure it's not anything to do with your game code or sprites as different sprites are affected by this glitch every time I run the game ie. not a consistent glitch.  The only program I've written and used as a test has no such issue, but since it only has one sprite it's not much of a test. :)  Going to try turning a sample GLB game/program into a Linux binary and try that out.

Other than that it runs extremely well.  So if you make sure all filenames are lower case (actually all you need to do is rename the directory DATA to data), free the mouse pointer (stuck inside the window - guessing it was for the GPX?), make sure the executable has the executable flag set (whoever turned it into a package for you would do that), turn it into a Debian package, shove it into the games section on something like the Ubuntu file repository (not sure what the requirements are for that) and you'd have your first distributed game on the Linux platform.  When you want to and are ready for that sort of thing, that is.

PS. I now have the Blox game tune stuck in my head. =D
Title: Re: Woo hoo! Running my little program on Linux.
Post by: Ian Price on 2008-Aug-30
Err... That's why I'm sticking to Windows and GP2X only for now, methinks.

Cheers HOAS.
Title: Re: Woo hoo! Running my little program on Linux.
Post by: Hatonastick on 2008-Aug-30
Not a problem. :)  I hope to see your (and other Retro Remakes programmers) games running on Linux boxes one day though. :)

I'd be interested to find out if anyone else running Linux has the same issue, even though honestly the most likely candidate is my PC's graphics card.
Title: Re: Woo hoo! Running my little program on Linux.
Post by: Kuron on 2008-Aug-31
QuoteSome sprites have what looks like a pink, vertical morse code down the edge of the border of the sprite.
I am curious if this issue would happen on your hardware if the sprites were using 0,0,0 for their transparencies?
Title: Re: Woo hoo! Running my little program on Linux.
Post by: Schranz0r on 2008-Aug-31
PNG?
PNG use alphatransparence or indextranceparence
default transparence is RGB(255,0,128)
Title: Re: Woo hoo! Running my little program on Linux.
Post by: Hatonastick on 2008-Sep-01
Quote from: Kuron on 2008-Aug-31
QuoteSome sprites have what looks like a pink, vertical morse code down the edge of the border of the sprite.
I am curious if this issue would happen on your hardware if the sprites were using 0,0,0 for their transparencies?
Hmm that might explain something.  My little demo program ran fine without corruption on the Linux box, and that does use 0,0,0 for the transparency (it's a PNG as well).  Might change it and try again.

[Edit]: Doesn't seem to make any difference.  My demo just has one sprite and it turns around (I'm working on Time Pilot clone again, but this time in GLB), so it wasn't much of a test of my machine.  Ians game has lots of moving sprites (especially on the title screen), so I'm not surprised my graphics card fails this.  I honestly suspect its this particular Intel graphics card and its limited OpenGL support that is the issue. ie. not the fault of Ians game, GLB, or the SDL libraries GLB uses.  It handles actual 3D well enough for such a low end card (I've got the OpenGL rubiks snake screen saver running which uses semi-transparent 3D animated objects and it runs around 30 fps), I think it's just not so hot on bitmaps/billboards/3D sprites.

I'd like to hear from someone else who's running Linux and tried out GLB games to really put the matter to rest though.  Am I the only one who's had corruption issues from moving (the issue only occurs when the sprites are moving) PNG sprites (with transparency) under Linux?
Title: Re: Woo hoo! Running my little program on Linux.
Post by: Moru on 2008-Sep-01
Try the bitmap fonts and see if you get any artifacts around the edges of the letters. I have been working hard for removing those especially around italic fonts. Download from my homepage http://gamecorner.110mb.com/ (http://gamecorner.110mb.com/)

Just some tips while I remember them:

When using LOADANIM, make sure all edges are free from pixels that isn't the transparency color because this will be antialiazed onto all sprites around. For example if you have a transparency of black and have a pink square in the animation, all blocks that sits next to this block will have a pink border in that direction. (At least on my grafics card)
See the picture below for example. The B would have a pink border to the right if loaded with black transparency.

If you grab your sprites yourself, draw the background color one pixel bigger than you expect to grab (0,0 - 34,34) and then grab from 1, 1, 32, 32. This makes rotations look better without artifacts on the edges.

I'm not sure how this works for blocks that isn't supposed to have transparent edges though, that you have to test for yourself :-)

See the picture below: First cell is with alpha channel, the rest with normal colors

[attachment deleted by admin]
Title: Re: Woo hoo! Running my little program on Linux.
Post by: Ian Price on 2008-Sep-01
HOAS - Here is a WIP of Guru Logic Champs - http://www.iprice.remakes.org/stuff/Guru%20WIP.rar

The object of the game is to cover the light squares with blocks, which you fire out of a cannon. You have only enough blocks to cover all the squares and no spares, so you have to make use of each and every one. Blocks will stop moving when they collide with a wall or another block (like B'lox! funny enough).

Controls -

Move left and right with LEFT and RIGHT cursors
Fire block with UP cursor
Suck block with DOWN cursor
Rotate board by 90degrees clockwise or anti-clockwise with Z and X
Space to start
Use cursors on puzzle select screen plus PAGE UP and PAGE DOWN to select puzzle sets.

There are about 100 puzzles, and everything is pretty much in with the exception of sound and music. The game is totally silent IIRC.

Have fun. :)
Title: Re: Woo hoo! Running my little program on Linux.
Post by: Kitty Hello on 2008-Sep-01
That game is cool. I could spend hours on it.
Title: Re: Woo hoo! Running my little program on Linux.
Post by: Hatonastick on 2008-Sep-01
Top stuff!  I really like this game!  :good:  It's come a long way since the last demo I saw.  I'm pretty sure I'd gotten to play a demo before, but most of the puzzles hadn't been done.  With sounds and catchy tunes, I can see this being a hit.
Title: Re: Woo hoo! Running my little program on Linux.
Post by: Hemlos on 2008-Sep-09
If you use (255,0,128) as a transparency, and want to antialias....make the antialias on a black background first, then fill the outside.

SETTRANSPARENCY RGB(0,0,0) is a wonderful feature
Title: Re: Woo hoo! Running my little program on Linux.
Post by: Billamu on 2008-Sep-10
For anti-aliasing artifacts... Back in my Amiga days I would draw my sprites with a dark or light grey edge, depending on the background. If you're rendering graphics you can render to a grey background and then do an Aliased fill to RGB(255,0,128) for the background again.

Meddling with threshholds in Gimp is also extremely helpful too. The idea is to make the artifacts look like a natural mixture between your sprite and the background... more than half the time. If there are extreme colour changes in the background then this technique won't work.