RetroBASIC

Retrogamecoding(.org) => EGSL => Topic started by: Luposian on May 31, 2013, 07:03:52 pm

Title: Question regarding EGSL w/ Haiku R1A4.1...
Post by: Luposian on May 31, 2013, 07:03:52 pm
I am playing Brickmaster and Astrorocks on Haiku R1A4.1 (latest official Alpha release).  There are pink squares behind the ship and asteroids, in Astrorocks. and the brick area of Brickmaster is a pink rectangle behind the bricks.  Any idea what is causing this?

If I were to hazard a guess, based on my limited understanding of graphics, I'd say the area around these objects is supposed to be invisible (like a green-screen in movies), but is being misinterpreted, and therefore showing up.  But as to why pink?  I have no clue.

Were these games written to work in Alpha 4, but the .1 revision changed some graphic aspects?  Hoping someone has some answers.
Title: Re: Question regarding EGSL w/ Haiku R1A4.1...
Post by: Cybermonkey on May 31, 2013, 07:30:54 pm
Yes, that's always the issue with Haiku. I think Brickmaster is source code only, so try to change the very first scirpt line from
Code: [Select]
screen (800,600,0 ...to
Code: [Select]
screen (800,600,32, ...If this doesn't work try to change the 32 to 24. I can't remember the correct value right now and haven't a Haiku installation nearby. (But it also depends on your desktop resolution).
Title: Re: Question regarding EGSL w/ Haiku R1A4.1...
Post by: Luposian on May 31, 2013, 07:40:31 pm
Yes, that's always the issue with Haiku. I think Brickmaster is source code only, so try to change the very first scirpt line from
Code: [Select]
screen (800,600,0 ...to
Code: [Select]
screen (800,600,32, ...If this doesn't work try to change the 32 to 24. I can't remember the correct value right now and haven't a Haiku installation nearby. (But it also depends on your desktop resolution).

Is there source code for Astrorocks?  If not, there is no way to "fix" it.  I downloaded the binary of Brickmaster, off of Haikuware, but I know I can get the source code for Brickmaster here.

Thanks for the tip.  I will try it out, provided EGSL works as expected, in A4.1.  I know it no longer works in the most recent Haiku nightlies of gcc2hybrid.  :'(
Title: Re: Question regarding EGSL w/ Haiku R1A4.1...
Post by: Luposian on May 31, 2013, 08:43:17 pm
Ok, this is interesting... upon running one of the sample programs in EGSL ("AnimationTest"), everything looks/moves fine, EXCEPT the mouse pointer!  The mouse pointer has a pink square behind it!  I changed the last number on the line you told me to change, from 0 to 32, and then to 24, all with no difference!  The only thing I could otherwise look into, is the mouse pointer .png file, but I can't figure out where that is!  Where is /data/bluepointer.png?  This is strange... so very strange.

Hey, wait a second... upon looking at the bricks.png file in the source code for Brickmaster... the background is pink!  This is the actual color in the .png file!  Is this a mistranslation of the .png file by Haiku R1A4.1 or was this the intended "background" that was supposed to be rendered invisible?  I know .png is supposed to support an "alpha channel" (or something like that, as I recall)... is that pink area supposed to be that?  Something weird is going on.

"Curiouser and curiouser"... as Alice would say.
Title: Re: Question regarding EGSL w/ Haiku R1A4.1...
Post by: Luposian on May 31, 2013, 10:16:23 pm
Ok, I just zipped and sent the entire Brickmaster /data folder to myself and viewed the .png files with Windows 8's Paint.  The selected area around the images are all PINK!  So, it definitely isn't a .png mistranslation or something.  But, then, what is causing the game to display this "extra" information that, obviously, shouldn't be shown?  I'm going to look at Astrorocks for Windows and see what it's data images look like... if THEY are pink, then I know some code is not working in Haiku.

Just downloaded it (Windows version of Astrorocks) and the sections behind the rock and ship .png ARE pink!  But the game plays perfectly, with no pink (and vastly faster, too, but I'm running Haiku R1A4.1 on a Pentium 4 Celeron (single core)).  So... now we have to figure out what is causing the difference... is the source code identical or is the source code for the Windows version different, because the images are the same.
Title: Re: Question regarding EGSL w/ Haiku R1A4.1...
Post by: Cybermonkey on June 01, 2013, 07:10:42 am
The pink is called a colourkey. In EGSL you can use any colour as this. So normally it doesn't matter if it's pink, blue or black or anything else. A colour set with colourkey() should be transparent. I'll look at home into the Haiku version. I only had that issue using a wrong colour depth.
Oh, and please, no double posts for the same question ...
Title: Re: Question regarding EGSL w/ Haiku R1A4.1...
Post by: lelldorin on June 01, 2013, 10:20:09 am
Brickmaster is running on Haiku alpha 3 correctly.

the pink color is good, because you need to use a color for transparency that are not used in any other way into the game, because you can get something more to be tranparency as you wish.

So use a color that are not used in any other place is the correct color :-)... yes and it is like the blueblox (green whatever) into the movie-world.

I will try on Haiku alpha 4 too, i know that i have this problem with the "pick the stick" example of cvirus too.

Greetings Lelldorin
Title: Re: Question regarding EGSL w/ Haiku R1A4.1...
Post by: lelldorin on June 01, 2013, 10:41:50 am
Hmmm, this is interesting, i have tried Brickmaster and some other Examples on Haiku Alpha 4.1 and now they are running without any graphic failure.

And now tried the binaries from Haikuware: Brickmaster went fine, but Astrorocks has some problems, because then you move the spaceship the sound is broken and the transparency is sometimes not in function (pink screen).

@Luposian: Do you use the Alpha 4 or the Alpha 4.1 of Haiku? it can be a problem with the png librarie of Haiku.
Title: Re: Question regarding EGSL w/ Haiku R1A4.1...
Post by: Cybermonkey on June 01, 2013, 02:48:56 pm
With my installations of Haiku I can not duplicate the error. Look at my attached screenshots, everything works fine.
Title: Re: Question regarding EGSL w/ Haiku R1A4.1...
Post by: Cybermonkey on June 01, 2013, 02:57:37 pm
Now try the following code and post a screenshot, please:
Code: [Select]
screen (640,480,32,"Colorkeytest on Haiku")
cls()
colourkey (102,49,113)
test1 = createimage (64,64)
startimagedraw (test1)
colour (102,49,113)
fillbox (0,0,64,64)
colour (255,255,0)
fillcircle (32,32,20)
stopimagedraw()
colourkey (202,49,113)
test2 = createimage (64,64)
startimagedraw (test2)
colour (202,49,113)
fillbox (0,0,64,64)
colour (255,255,0)
fillcircle (32,32,20)
stopimagedraw()

putimage (200,200,test1)
putimage (100,100,test2)
sync()
key=inkey()
closewindow()
(Actually you should only see two yellow circles on a black background ...)
Title: Re: Question regarding EGSL w/ Haiku R1A4.1...
Post by: Luposian on June 01, 2013, 03:17:12 pm
Brickmaster is running on Haiku alpha 3 correctly.

the pink color is good, because you need to use a color for transparency that are not used in any other way into the game, because you can get something more to be tranparency as you wish.

So use a color that are not used in any other place is the correct color :-)... yes and it is like the blueblox (green whatever) into the movie-world.

I will try on Haiku alpha 4 too, i know that i have this problem with the "pick the stick" example of cvirus too.

Greetings Lelldorin

Note I said I am running Haiku R1A4.1, not R1A3.  A lot can change 1.1 versions later.  But thanks for the clarification on the pink in the graphics.  Something isn't hiding it correctly...
Title: Re: Question regarding EGSL w/ Haiku R1A4.1...
Post by: Luposian on June 01, 2013, 03:20:32 pm
With my installations of Haiku I can not duplicate the error. Look at my attached screenshots, everything works fine.

Are you running R1A4.1 (the latest official Alpha release)?  This is the exact version I am running.
Title: Re: Question regarding EGSL w/ Haiku R1A4.1...
Post by: Luposian on June 01, 2013, 04:41:32 pm
Now try the following code and post a screenshot, please:
Code: [Select]
screen (640,480,32,"Colorkeytest on Haiku")
cls()
colourkey (102,49,113)
test1 = createimage (64,64)
startimagedraw (test1)
colour (102,49,113)
fillbox (0,0,64,64)
colour (255,255,0)
fillcircle (32,32,20)
stopimagedraw()
colourkey (202,49,113)
test2 = createimage (64,64)
startimagedraw (test2)
colour (202,49,113)
fillbox (0,0,64,64)
colour (255,255,0)
fillcircle (32,32,20)
stopimagedraw()

putimage (200,200,test1)
putimage (100,100,test2)
sync()
key=inkey()
closewindow()
(Actually you should only see two yellow circles on a black background ...)

It worked.  Don't have time right now to post an image, but I tested this code and it worked.  Took out the colorkey lines and the squares show up.  Now, the question is... why isn't it working in Brickmaster or Astrorocks?  Have you examined every line of code?  Is the Alpha (number) set correctly?  Is the colorkey (x, y, z) set correctly?  There must be a logical explanation.

The only difference is that you're dealing with graphic primitives and not graphic images.  Try using one of the graphic images (with pink) from Brickmaster and see what happens.
Title: Re: Question regarding EGSL w/ Haiku R1A4.1...
Post by: Cybermonkey on June 01, 2013, 04:50:25 pm
Well, it happened what I posted before: no pink. BTW, I am using the latest release of Haiku Alpha 4.1. Have you donwloaded the games from egsl site or haikuware? If the later on, please try the version from here: http://www.egsl.retrogamecoding.org//pages/showcase.php
Title: Re: Question regarding EGSL w/ Haiku R1A4.1...
Post by: lelldorin on June 01, 2013, 10:03:26 pm
Here a screenshot of the astrorocks version from EGSl Website:

Haiku alpha 3

Title: Re: Question regarding EGSL w/ Haiku R1A4.1...
Post by: Luposian on June 01, 2013, 10:17:46 pm
Here a screenshot of the astrorocks version from EGSl Website:

Haiku alpha 3

Boy, that looks REALLY messed up.  At least, in Haiku R1A4.1, there is only a small square of pink, not a huge square of purple!
Title: Re: Question regarding EGSL w/ Haiku R1A4.1...
Post by: Luposian on June 01, 2013, 10:42:44 pm
Well, it happened what I posted before: no pink. BTW, I am using the latest release of Haiku Alpha 4.1. Have you donwloaded the games from egsl site or haikuware? If the later on, please try the version from here: http://www.egsl.retrogamecoding.org//pages/showcase.php

Ok, here is what I did. I installed Haiku R1A4.1. I then downloaded (using lelldorin's optionalpackage installer (a YAB program he recommended)), sdllibs and lua. I downloaded the current version of EGSL w/ IDE.  Then downloaded Brickmaster (source code version from here) and Astrorocks (I think from here, but maybe from Haikuware).

Should I simply reinstall Haiku and try again?  Tell me exactly what software to download, in what order. If it works for you, then it should work for me.
Title: Re: Question regarding EGSL w/ Haiku R1A4.1...
Post by: Luposian on June 02, 2013, 04:03:30 am
My sincerest apologies... I assumed my Haiku install was set to either 24 or 32-bit color.  IT WAS SET TO 16-BIT!!!  Upon changing it to 32-bit color (the only other option higher), and changing the one line in Brickmaster to 32, the pink completely disappeared!  I can't believe I've been fighting this problem the entire time, while having the wrong screen resolution bit-depth!  ARRRRGH!  I feel like such an idiot!  *kicks self in head, with steel-toed boot, several times*

Just out of curiosity, had I set the line to "16" (with the system in 16-bit color mode), would that also have worked?  I'll assume the answer to that question is "yes".

But, this might be a lesson for others as well... to make sure it's asked, "What color bit-depth is your screen resolution set to?".  That would have settled this problem a looooong time ago!  :D
Title: Re: Question regarding EGSL w/ Haiku R1A4.1...
Post by: Luposian on June 02, 2013, 04:13:50 am
Ok, just tried Astrorocks, and it plays fine, except there is a tiny tinge of pink around the larger asteroids.  Also, when I get hit by a rock, a massive pink square appears (and shrinks down) along with my ship explosion.  What is causing that?  Is this game expecting a 24-bit color depth?  If so, I don't have that option.  It's 8-bit, 15-bit, 16-bit, or 32-bit.
Title: Re: Question regarding EGSL w/ Haiku R1A4.1...
Post by: Cybermonkey on June 02, 2013, 10:30:53 am
EGSL works correctly only with 24 or 32 bit depth. If your desktop is 32 bit you can also open a screen in 24 bits with EGSL:
Code: [Select]
screen (800,600,24,"My screen")
Title: Re: Question regarding EGSL w/ Haiku R1A4.1...
Post by: Luposian on June 02, 2013, 03:49:22 pm
EGSL works correctly only with 24 or 32 bit depth. If your desktop is 32 bit you can also open a screen in 24 bits with EGSL:
Code: [Select]
screen (800,600,24,"My screen")

Well, that answers one part of my question, but what about the tinge of pink around the medium size asteroids and the huge pink square that appears when my ship explodes?


And, finally, why are all the EGSL games I play (not just Astrorocks... Wallman and Brickmaster as well!) so slow on a single core Pentium 4 Celeron in Haiku R1A4.1?
Title: Re: Question regarding EGSL w/ Haiku R1A4.1...
Post by: Cybermonkey on June 03, 2013, 07:51:32 am
And, finally, why are all the EGSL games I play (not just Astrorocks... Wallman and Brickmaster as well!) so slow on a single core Pentium 4 Celeron in Haiku R1A4.1?
That's because SDL is not hardware accelerated (I think that's not possible on Haiku anyway) and the complete script is computed at runtime. So imagine the CPU has to calculate the game logic and the graphics at the same time. I recommend at least a dualcore for smooth game play.
Title: Re: Question regarding EGSL w/ Haiku R1A4.1...
Post by: Luposian on June 04, 2013, 06:37:02 am
Ok, this is weird...

I am trying to compile (build) an executable from the Brickmaster source code version.  I can click on the joystick and test/play the program just fine, but when I click on the little cubes icon (to build), it tells me this:

Can't find file /boot/apps/EGSL_IDE/data/bin/egsl/EGSL_1.6.0/egsl

But, that's the EXACT path to that very file!  It's telling me it can't find it, but it's right there!  And "makeexe" is right there with it, too!

What's going on and why?
Title: Re: Question regarding EGSL w/ Haiku R1A4.1...
Post by: Cybermonkey on June 04, 2013, 09:36:24 am
Hm, I don't know since I didn't code the IDE. I am using the command line version of EGSL on Haiku. Maybe Lelldorin can help you.
Title: Re: Question regarding EGSL w/ Haiku R1A4.1...
Post by: lelldorin on June 04, 2013, 03:05:01 pm
Hm, I don't know since I didn't code the IDE. I am using the command line version of EGSL on Haiku. Maybe Lelldorin can help you.

Hmm, here on my Hiaku system it runs fine, please re-setup the egsl version in the settings.
Title: Re: Question regarding EGSL w/ Haiku R1A4.1...
Post by: Luposian on June 04, 2013, 09:49:41 pm
Hm, I don't know since I didn't code the IDE. I am using the command line version of EGSL on Haiku. Maybe Lelldorin can help you.

Hmm, here on my Hiaku system it runs fine, please re-setup the egsl version in the settings.

I don't know what you mean by that.  Do you mean delete/reinstall it?  Are you running R1A4.1, specifically, as I am?  Small changes can cause big problems between versions.  Even point releases.
Title: Re: Question regarding EGSL w/ Haiku R1A4.1...
Post by: lelldorin on August 01, 2013, 08:37:52 pm
Ok i mean to change in EGSL IDE into the settings and then changing the egsl version from egsl_1.6.0 to egsl_1.6.0. It can be that your settings file does not have the right egsl version stored.

The problem with the pink backgrounds are fixed. I test some examples and change there source to make them running on Haiku.