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 - galiksoft

#1
Hello everyone.

I would like to offer Android games for free, suported by ads (AdMob).
Is it possible to put AdMob (or whatever) ads in a android app made in GlBasic? How to do that?

I published already some games in Google Play (Android Market), like:
https://play.google.com/store/apps/details?id=com.galiksoft.kwirk
https://play.google.com/store/apps/details?id=com.galiksoft.kwirk2

but they are paid apps and they don't sell enough to make me rich (lol). Most people say that paid android apps don't have sucess, so the deal is to offer the app for free, suported by ads, so it will have much more installations and if the app get popular, the money return will be huge. That's what I want to do now. Please help me.
#2
I didn't try in an android phone because I don't have one.

I use GlBasic 10

" I have seen a similar issue which happens with poly vectors and you resize them bigger than original size..."
In this case, the images are resized smaller (very much) than the original size...

If I just draw the original image with original size, I don't get issues...

Maybe If I make a smaller original image, the resized image would look nice.
I will try that...

More suggestions?

Thank you
#3
Hi people.

My game uses some circular icons in top of the screen. They are 256x256 png images with transparency. I use polyvector comands to resize these icons to the proper relative size (this is an android game).
The final result are ugly borders. I know I must use SMOTHSHADING FALSE. I dit that, but they are ugly too...

I made a project to show for you see and help me. It just draw the wallpaper and put 3 icons (images) in top (with SMOOTHSHADING FALSE), and the same 3 icons in bottom with SMOOTHSHADING TRUE. As you can see, the images in top screen are better but the borders are not perfect...

How can I do to draw perfect icons and perfect borders?

Please download these project here:   http://galiksoft.is-great.org/bordas.zip
(if it doesn't work, copy the url and paste in the url bar of your browser...)

Thank you
#4
No real device.

Just AVD (Android Emulator) and Bluestacks.


The links works: Copy the url and paste it to the browser url bar...
#5
But if I convert to ogg format, I can't use playsound command because it only plays sounds in wav format...
#6
Hi people.

Why my explosion sound is incorrectly played in android? It is correctly played in windows.
Check the sound: http://galiksoft.is-great.org/explosion.wav

Make a simple project like this bellow and compile both for windows and for android and run it
Code (glbasic) Select

LOADSOUND "explosion.wav",1,1
PLAYSOUND(1,0, 0.5)
CLEARSCREEN RGB(255,0,0)
SHOWSCREEN
mousewait


As you can conclude, the explosion sound is not well played in android.
Why?
What can I do? I need exactly an explosion sound for my new bombs game.

Please help me
Thanks
#7
Thanks.

I'm going to convert to wav format, and use that command.
#8
Hi people.

I'm developping a bombs game but I found 2 problems.

I use a background music (mp3), a clock tik-tok when the bomb's time remaing counter is above 2 seconds, but when it reaches 2 seconds, the music must change to a fast alarm, i.e, another mp3 file. The sounds changes well, but at the change's moment, the mouse pointer disappear for a while and after that, it appear in another screen position. It seems like a lag caused by the music change.
I used STOPMUSIC before PLAYMUSIC "second_file.mp3" and I thought the problem was it; after I removed STOPMUSIC command, and the problem wasn't solved.
To make sure, the problem is not caused by my game code, I has a version with no sounds, so no calls to playmusic...and there are no problems!
How can I solve this problem?


Second Problem:
I use polyvector commands to draw the sprites. My sprites are pngs with transparency. I use this function:

Code (glbasic) Select

FUNCTION draw: polis%, xxx%, yyy%, mode, dimx%=0, dimy%=0
LOCAL originx%, originy%

GETSPRITESIZE polis, originx, originy

IF mode>0
dimx=mode*originx/100
dimy=mode*originy/100
ENDIF

STARTPOLY polis
POLYVECTOR xxx, yyy, 0, 0, RGB(255, 255, 255)
POLYVECTOR xxx, yyy + dimy, 0, originy, RGB (255, 255, 255)
POLYVECTOR xxx + dimx, yyy + dimy, originx, originy, RGB(255, 255, 255)
POLYVECTOR xxx + dimx, yyy,  originx,  0, RGB(255, 255, 255)
ENDPOLY
ENDFUNCTION


The images are drawn at right positions with right zoom, but they appear with a white border. I removed the ", RGB(255, 255, 255)" part, but the borders are still there... I don't want any border. I just want the visible part of the png, with no borders!
Help me please
#9
Hi. I'm using Z Project and so I draw everithing for one resolution with z_drawsprite. I use PNG images with transparency
If the ratio is 1:1 or under, all ok. But if the ratio is above 1:1, the images present white borders,  wich is ugly and I don't want these borders.
How to change that?
#10
Quote from: Wampus on 2012-Aug-02
There has to be an major bottleneck somewhere. Just has to be. To find out where it is you could use timers or the GLBasic's app profiling feature to discover where things get real slow. Once that is established you won't have to make guesses about what the problem could be. You'll know. Much easier to fix.

Fun game btw.

FINALLY I FIXED IT!!!
The problem is in drawing the walls ouline. Not the drawing process itself (I think), but the lot of condition test I use to know where to draw the line.
The outline is not necessary at all, so I removed this part, and now the buttons are responsive and the character move as it should do.

Check it again (kwirk FREE): https://play.google.com/store/apps/developer?id=GALIKSOFT
For people who had reported control and move problems, please test it now again.

I uploaded the new package (version 1.5) and I'm waiting right now for the refresh. If it is not version 1.5, do not install yet.
#11
Quote from: quangdx on 2012-Jul-31
replace all the sprite commands with polyvector.
i did this in my games and got a decent speed increase.

I did that and I don't see any improvement...

I conclude that GLBasic can't be used to make a decent game for Android. I will try another engine/language, maybe unity, or java itlsef...
#12
Quote from: MrTAToad on 2012-Jul-26
I had no control problems with your program.  However, the characters sprite does seem to move strangely...

If you refer to character moving up and down, it is right. I made that as simple and stupid animation, I think it is better than be parked...
#13
Quote from: dreamerman on 2012-Jul-25
But does it still consume so much cpu/gpu power on pc? First extensively test your code on pc, with all possible trick's then, check how much speed it gained on emulator/real devices. Use 'LimitFps -1' to unlock fps limiter, and see how many fps you will get on pc with particular changes.
'StrechSprite' shoudn't be used many times, specially on mobile devices. There can be also other small issues, for example float calculations # are of course slower than integer %, so they should be used only when necessary.
When it comes to drawing, you probably should use other commands than strechsprite for example:
Code (glbasic) Select
1. draw all graphic at desired res (let say 320x480) to offscreen texture (UseScreen cmd)
2. render that texture (with all game graphic) to screen with one strechsprite/polyvector

Of course also mouse position should be recalculated also..
Or use some already made custom functions like these from 'Z Project' by Ampos -> LINK

Today, I made that. Now I'm using only drawsprite commands, createscreen, usescreen, and finally only one stretchsprite to present graphics to real screen. In windows all ok. In Android, simply doesn't work. When I start the level, I get only a full black screen. I press the top-right corner, where I know the exit button should be, and I go back to inicial menu...
So, I can't see graphics, neither conclude if now the buttons are responsive...
#14
Quote from: dreamerman on 2012-Jul-25
That isn't problem of Android but more likely not properly written code. On my dual-core pc, controls are responsive but game takes 50% of cpu power, it shouldn't happen.
You should use at least Limitfps and Sleep commands:
Code (glbasic) Select
sub play:
Limitfps 30
   while quit=0
       gosub checkinput
       gosub showgraphics
       sleep 25
   wend
endsub


Or your main loop can be more sophisticated:
Code (glbasic) Select
sub play:
Limitfps 30
   while quit=0
curr_time# = GETTIMERALL()
IF (curr_time# - last_time# >= 33)
              gosub checkinput
              gosub showgraphics
   last_time# = curr_time#
ENDIF
       sleep 20
   wend
endsub


I don't have experience with current version of Android emulator, but add these changes and test how it will work.

Edit: Or maybe your drawing routines are messed up.. for example If your graphic covers whole screen don't use 'clearscreen' command, just draw new graphic over previous.

I made all these modifications and the game runs slow yet in Android Emulator....
Because in Android there are multiple resolutions I use stretchsprite commands instead of drawsprite. Is stretchsprite command so slow in Android to make the game been slow? As you can imagine, I use many times the command in the drawing sub. The cause would be that?
#15
Hi everybody.

I made a game in GLBasic 10, a kwirk clone. I compilled both to windows and Android. In windows everything is ok, but the Android users report big perfomance problems, mainly, the need for press several times in buttons, to the event be accepted...

Check the two versions, both free:
win: galiksoft.is-great.org/kwirkfree.zip   (copy and paste in url space of the browser)
android: https://play.google.com/store/apps/details?id=com.galiksoft.kwirkfree

The code structure is something like that:

gosub openlevel
gosub play
...
sub play:
   while quit=0
       gosub checkinput
       gosub showgraphics
   wend
endsub

...

sub showgraphics:
   //draw everything
   showscreen
endsub

...

sub checkinput:
   local mx,my,b1,b2

   mousestate mx,my,b1,b2

   if b1>0
      if mx>... and mx<... and my>... and my<...   //test is the button area was pressed, example: up button
           move(0,-1)
      endif
   endif
endsub

...

function move: %xx, %yy
   //check if the character can move
   //if it can move, refresh positions, move blocks or turn pieces if aplicable...
endfunction


Apparently this is the fine way to do, and in windows there is no problem.
But it Android, the game runs very slow...

I tought the problem would be in play sub, in the loop because the game is allways redrawing the screen and present it. I tried just redraw if there is a move, but that cause game crash in checkinput sub because of the mousestate command...

How can I improve the perfomance in Android?

i don't have an Android device but I got the same slow gameplay (with problems in accept button press) in Android Virtual Device, after compillation for Android.

Thank you in advance!