Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - Miroslav-Stimac

#1
Hello,

Thanks for all your advices!

About my game:
It has no scrolling, but there can be many sprites moving on the screen, up to 30 sprites.
The game is optimized for 60 FPS.
The sprites are seperate PNG images that I load with LOADSPRITE or LOADANIM. The background of a level is one big PNG image.

If I use the Z Project and optimize the graphics (background images and sprites) for 1920 x 1080, will there be performance issues on slow Android smart phones with only one CPU core?
I read that the Z Project uses faster strech methods than when scaling the whole virtual screen.
But would it be fast enough?

Best wishes,
Miroslav
#2
Hello,

I know that there are many postings about the screen resolution. I read many of them but did not find enough information.

My situation:
I programmed a 2D game that is already almost completed. I used DRAWSPRITE, DRAWANIM etc. and all the sprites are optimized for a resolution of 800x480.
Now I want that the game runs in FULLSCREEN on all devices.

I tried to use create a virtual screen of the size 800 x 480 created with the command CREATESCREEN and resize it to full screen by using STRETCHSPRITE and GETDESKTOPSIZE.
Of course, it looks not nice when having a big PC display.
Therefore I decided to use 1920 x 1080 as standard resolution and shrink the screen to the display resolution of the device by using STRETCHSPRITE and GETDESKTOPSIZE.
It seems to work on PC, but when trying an Android smart phone with a display resolution of 800 x 480 it does not work. I just see a part of the screen insted of the complete screen. The shrinking seems not to work on Android 2.3.x.

My questions:

1. What do you think about my idea to use 1920 x 1080 as standard resolution and to shirnk it to the device resolution?

2. Are the compatibility issues?

3. Are there performance issues on smart phones?

4. There are several different ratios between width and height of various screen resolutions. What is better: to resize to full screen even if this means to distort the graphics in case of some resolutions or to use black borders? What looks better?

My target devices are Windows PC, iOS and Android 2.3 and newer.

Thanks for any advices in advanced! :-)

Best wishes,
Miroslav
#3
Strange, a friend of mine and I see differences between the .PNG file in our Opera browser, where it looks as nice as it looks in Paint .NET, and in the game running with GLBasic, where the antialiasing is not good.
But we have NVidia graphic cards, not AMD Radeon. Maybe that is the difference.
As I mentioned, when I change the graphic card driver settings to maximum quality, then it looks better. But the default settings are causing bad quality antialiasing in GLBasic.
Maybe your AMD Catalyst drivers have by default better antialiasing settings.
Is there any way by using GLBasic to force using the best graphic device settings respectively to use high quality software antialiasing as it is the case in Photoshop and Paint .NET?
Software antialiasing may be slow, but we have only 2D animations. Such games ran fast even on 15 years old computers.

Best wishes,
Miroslav
#4
Hello,

The hint regarding the graphic card settings was great!
Now I changed the graphic card setting to maximum antialiasing quality and it really looks better (not as good as in Paint .NET, but still better than before)!
But this is no solution for my problem. How shall I make sure that the antialiasing looks so good on all systems including mobile devices such as Android smart phones?
How can I set the quality setting of the graphic hardware to maximum in GLBasic for all platforms?

The more I experience OpenGL with PC and Android, the more I understand why many developers prefer standard console hardware such as Playstation 3, XBox 360 and Nintendo Wii. There they know what hardware and settings are default and can optimize the games for the platforms.

It is very difficult to make sure that all players on various systems experience the same graphics quality of a game, especially in case of Android where there are so many different devices.

Here is the original PNG:


Is there any way to make it suitable and nice for all platforms?

Best wishes,
Miroslav
#5
Thanks for your fast response. I also had a similar idea, but I think that Paint .NET uses only GDI (Win32 API) respectively GDI+ of the .NET Framework. I looked at the change log of Paint .NET. They only mention that the Text Tool (a tool in Paint .NET) may use DirectDraw if it is available, otherwise it uses GDI. They do not mention DirectX regarding any other tools and I do not use the Text Tool to create the sprite .PNG file. I have the same problem with Photoshop. The sprite looks the same (good) in both: Paint .NET and Photoshop.

May it be really a disadvantage of OpenGL?

Best wishes,
Miroslav
#6
Now I tried SMOOTHSHADING FALSE
Sadly it looks even worse than before.

Yeah, I know that there may be problems when zooming or rotating a sprite because OpenGL has it's own methods and algorithms that do this, but I neither rotate nor zoom the sprite. I just draw it on the screen by using the GLBasic method DRAWSPRITE.

Let me exactly describe what I do:
I create respectively import the sprite in Paint .NET (or Photoshop, the results look the same), test it on the background image and it looks nice. Then I save the sprite as a .PNG file with 32 Bit, close it, open it again and test it again in Paint .NET and it still looks nice.
After that, I load it in GLBasic with LOADSPRITE, use ALPHAMODE -1 respectively ALPHAMODE -0.999 and draw it with DRAWSPRITE on the background image. I also tried the ALPHATESTING settings and the SMOOTHSHADING FALSE setting, as described in the previous posts. Whatever I do, it does not look as nice as in Paint .NET.
I just want to draw the PNG sprite exactly the same way as I see it in Paint .NET respectively Photoshop. All the alpha blending information is saved in the alpha channel of the .PNG file, or?
Why is it not drawn 1 to 1 as it works in Paint .NET?
I am quite confused...

Best wishes,
Miroslav
#7
Hello,

Thanks for the fast answer.
I tried it with Alphatesting False and Alphamode -1.
Now It looks a little bit better, but it is still not good. When I zoom it, I see that there are a few more transparent pixels when using Alphatesting False than there were before, but still there are not as many as in Paint .NET.
What else could I try?

Best wishes,
Miroslav
#8
Hello,

I have a problem with the antialiasing of some sprites.
To describe the problem, I added two images (the bottom one is just zoomed to show the differences).

I have a small sprite that is saved with Paint .NET (also with Photoshop, it does not matter) as a PNG file with 32 Bit and alpha channel.
It is the sprite on the left side of the images and it looks nice, the antialiasing is good. I simply pasted it in a new Paint .NET layer above the blue background that is the same one as in my GLBasic game.

The right sprite is the sprite that is drawn in GLBasic with Alphamode -0.999 (I cut it out of a screenshot of the game). In the game I use the same PNG file as the one I opened in Paint .NET.
As you can see the sprite drawn in GLBasic has no good antialiasing... the antialiasing is simply too "weak", the outline is not soft. The Paint .NET sprite has more transparency.

I tried all alphamode values from -1 to +1 by increasing step 0.001 and I was not able to find any value that makes the sprite look as good as in Paint .NET.
I also tried to change alphatesting (-1.000, -0.999, -0.998 ... 0.998, 0.999, +1.000), but it did not solve the problem, too.

How can I tell GLBasic to draw the Sprite in the same way with the same alpha mode settings as Paint .NET and Photoshop do?

Thanks for any hints!

Best wishes,
Miroslav


#9
Off Topic / Re: Raspberry Pi
2012-Aug-23
Hello,

Would it be easy to make GLBasic runnable on the Raspberry Pi?
I do not think only about compiling games that run on Raspberry Pi, but also to be able to run GLBasic on the Raspberry Pi and develop software by using GlBasic on the Raspberry Pi.
The Raspberry Pi is meant to be used for education, especially for kids and young people. Many kids like games and programming games is a nice start to learn programming in general. I think that GLBasic could become a wonderful programming language on the Raspberry Pi.

Currently I think that there is only Python with Pygame that is meant to develop games on the Raspberry Pi. Of course, C respectively C++ could be used, too, but that is too difficult for many people and I think that many kids would prefer a simple, yet powerful programming languages that enables them to create nice games. GLBasic may be perfect, or?
Furthermore, if Raspberry Pi becomes famous, then it may increase the popularity of GLBasic, too.
What do you think?

Best wishes,
Miroslav
#10
Good evening,

I have an idea: would it be nice to have some kind of "small object oriented programming" by using types?

Here is an example:

TYPE Monster
     HitPoints%
     Speed%
     Strength%
     Statima%
ENDTYPE

TYPE Hydra INHERITS FROM Monster
    NumberOfHeads%
ENDTYPE

TYPE Medusa INHERITS FROM Monster
    ChanceToTurnToStone#
    LengthOfHair%
    NumberOfSnakes%
ENDTYPE

In the example the Hydra would have the additional variable NumberOfHeads% and the Medusa would additionally have ChanceToTurnToStone#, LengthOfHair% and NumberOfSnakes%.

This would make the code better structured and easier to read by the programmer.

What do you think about the idea?

Best wishes,
Miroslav
#11
Hello,

I and a friend of mine are developing a game with GLBasic primary for the Android platform.
Now we are thinking about the business model.
Either we would set a specific price for the game or we would set it as a free game where the players could buy in-game item for real money.
The second alternative would be our favorit, but we do not know whether this is possible with GLBasic.

Is there a way to program In-App payment and purchase of in-game items with GLBasic regarding the Android platform?

Best wishes,
Miroslav
#12
I am just wondering why this is so. When I open the picture in the picture viewer of the device then it looks nice (I think it is 24 bit color depth; or at least it looks so). But when it is displayed in the game, then it looks like 16 bit color depth. Is it a driver problem or OpenGL or SDL?
How does the picture viewer show the picture?
Not via OpenGL and SDL, or?

I am totally new to Android. In fact, I do not like Android tablets, but iPad is too expensive and Windows 8 will need some time to arrive. So I have to survive with Android until I see some not too expensive alternatives.
#13
Thanks for the fast answers. What exactly is the reason for the 16 bit color depth on some Android devices?
Is it the OpenGL, the SDL or the GPU driver?

Cya,
Miroslav
#14
Thanks for the fast answers. Ok, I will try to use the BOXCOLL function. It should be acceptable.

But I think that I found an other Android 2.3 related bug. Please take a look at my newest thread regarding bad quality of background pictures in the English GLBasic forum.

http://www.glbasic.com/forum/index.php?topic=8064.0

Best wishes,
Miroslav Stimac
#15
Hello,

I have a PNG picture that is my game background with a resolution of 800 x 480. I use 8 bit color depth per channel. In PNG there are four channels, so the total color depth is 32 bit. The picture shows the sky with very soft color gradients from dark blue to light blue.

When I use this picture in my GLBasic game and compile it for Windows 7 or Windows 8, then everything looks perfect. But when I compile and run it on Android 2.3, then I see that the color gradients from dark blue to light blue are not soft anymore. It looks like 16 bit color depth. There are many lines of colors. It remembers me of old games in the 90s when I used a Voodoo 3 graphic card that could not display more than 16 bit color depth in 3D. However, my GLBasic game is 2D.

I also tried to use BMP and JPG with a color depth of 24 bit and it did not help, too. Now I am using the newest version of GLBasic. I tried it with Android 2.3 on a Lenovo Ideapad A1 and on a Samsung Galaxy S Plus. In both cases I have the same ugly gradients.

Is this a bug in GLBasic?
Why does the background picture look perfectly in Windows, but ugly on Android devices?
By the way, if I open the picture in the picture viewer of the Samsung Galaxy S Plus, then it looks nice. This means that the device can display the picture perfectly, but something is wrong when the picture is displayed by GLBasic.

Maybe it is a bug in the OpenGL driver. But it sounds strange that it happens on both devices that I have. Did somebody else try to use such pictures in GLBasic games and compile them for Android devices?

Best wishes,
Miroslav Stimac