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.


Messages - dreamerman

Pages: 1 2 [3] 4 5 ... 22
31
hm.. serious problems :/ Not sure if I get all right.
does calling sdl to stop music/sound before calling GLB_ON_PAUSE also causes issues? If not, this could be an option to stop audio like this by automatic, and the in main game loop dev would just need to check ismusicplaying after getting resume flag from GLB_ON_RESUME.

What's currenlty needed to target Android from GLBasic - Android Studio surely, and some specifi JRE, JDK or something? Rather for curiosity, and just to see if my chinese device has some additional debug options ;-) Ah and can I install those tools in any directory or it need to be specific, like "C:\Android_crap\" ?

Below will be deleted after gettint resposne:
Other thing: is there way to get current GLB source (as downloads from GLBasic Dev ┬╗Sourcecode) point to old source version without those bat scripts for autoupdate.

32
Hi, unfortunatelly during final release tests of my project I encoutered serious bug in Steam version v16.
Trying to load sprite larger than 128px from shoebox will fail with fatal error like this:
Code: (glbasic) [Select]
Error: 3. Not a JPEG file: starts with 0x02 0x00This wasted me couple of hours figuring what's wrong with my game, as that info is outputted in stderr stream so wont appear in editor, and I forgot to include stderr in *bat file for outputting stdout..
Problem appears in v16 (Steam version), I checked and v15 ofc is working properly.
Simple project to show the issue. Baisically put larger sprite like 1024x1024px in shoebox then:
Code: (glbasic) [Select]
SETSHOEBOX "Media.sbx", ""
LOADSPRITE "sprite.png", 0
Will crash app... Hope that this will be an easy fix ;-)


33
From what I remember my standard A* has some issues, and JPS wasn't perfect.. With proper usage this could handle hundreds of moving units, and not interactive maps can use region based optimizations. hm.. better benchmark is needed, with proper map view like in rts games and moving units.. I will revisit this for my upcoming project :-)

ps. any one knows some nice free sprites (not rip-offs) that could be used in next benchmark/showcase project?

34
Ah yes, forgot about that, forum was move to other hosting last year so many attachments were broken during that or something like this..
Here is working version, checked, compiles with latest GLB, yet some my routines may be not so efficient as they should be, and You need to fix font size, as for some reason it's to large now.. :-)

35
Hey,
I have checked out both Your available games with Android 9 powered device. Played couple minutes and found some issues:

Spot Race:
in game - minimize game, music stops - that's ok, yet when returning to game it goes directly to game, shouldn't it show pause screen or something
in pause - minimize game, music goes on, after returning to game it looks like music stops for few milliseconds and then starts playing again
saw one interactive add, it was playing without problems, so it's ok.

Greedy Mouse:
music doesn't stop when app is minimized, both for in-game and in-pause screen,
second issue: going to pause screen makes music a bit louder, resuming game get it back to proper volume
didn't see any admob advertisement for couple minutes of gameplay,

Beside that everything looks fine, Greedy Mouse is just not my cup of tea, but it's good game and it feels that a lot effort was put into making it.
Spot Race is very good little game, one thing that few times I had problem with distinction of some symbols. Surely it will stay on my device for playing it in future ;-)

36
For me Android dev tools are .. lets say that for example Symbian OS / Windows Phone dev tools were much better, almost out of box everything worked, proper debugger and so on.. At least for indie/single developer.
Let's say that even Phonegap/Cordova tools advaised to use older gradle 2.4 and not update some SDK/Studio stuff when I was doing some Android project :DD

So there was no changes in that core part of GLB backbuffer flipping, drawing and handling pause?
I didn't work with android from some time, that logcat file is from adb? Not sure if that applies to all but some smartphones have many options in hidden 'dev mode' for debugging, like warning levels - warn/info/debug/verbose..
Some day day I will need to download that Android Studio to look into it :D

37
Announcements / Re: The Outhouse
« on: 2020-Apr-26 »
Like that art :-) Such restricted visuals show what can be achieved with good idea and proper work.
Good luck with it! Thing about that, I saw that You have also other games on itch.io, and I'm curious does itch is kind of rewarding platform in both terms of $$ and constructive/inspirational feedback?

38
Nice to see new features :-)
I've only briefly looked as example source, didn't play with it but noticed that it BT part detects my android phone, so few questions emerged:
is this bluetooth feature restricted in any way or it just pure bt interface that can be used in any way and does it have some special hardware requirements like Bluetooth v 4.0 or whatever?

My two cents on mouse wheel, whatever are system hardware specifications, differences and changes between their API updates those functions should give consistent, same kind of results in GLB, will it be integer range like -120 to 120, or float -1.0 to 1.0 it's secondary matter, just one type/range for all systems.

Camera usage can be interesting for some projects..

39
Yeah, quick looks it seems that standard manual / help file doesn't have that info, but it's in online manual.
Quote
flt# = NUMBER(str$)

Explicitly convert a string or any other number into a floating point number.

LOCAL n# = NUMBER("1.23") * 100.0

40
Yeah this can cause some unexected behaviour (I overlooked such things so many times :D), and this applies in general to any programming language, it's always advised to use proper type casting in calculations.
In GLBasic it's easy to avoid, as You mentioned type order is important so all what you need to do to get proper ## result is add "1.0 *" before rest of calculation.
In C++ you will get same problems without proper type casting.
Code: (glbasic) [Select]
FUNCTION test_int_float%:
LOCAL ga% = 5, gb% = 911, gc% = 15, gd% = 2, gm# = 1.1
LOCAL result1#, result2#
INLINE
int a = 5, b = 911, c = 15, d = 2;
double m = 1.1, resultf;
result1 = b / a / c * d * m;
result2 = double(b) / double(a) / double(c) * double(d) * m;
ENDINLINE
DEBUG "results, 1: " + result1 + ", 2: " + result2 + ", pure glb: " + (1.0 * gb / ga / gc * gd * gm) + "\n"
ENDFUNCTION
Not sure if that isn't specified in one of tutorials, but it could be.

41
@spacefractal
Thanks, but there is no need for deleting previous posts, I like to have all of them for tracking and archive reasons ;-)

@MrPlow
Generally whole Steam API can be used, yet this project will be rather limited to stats/achievements part and some basic utility functions that are needed to have those features. Currently I'm not even bothering with 'Avarage' type of UserStats, next thing to implement would be leaderboards, and this also doesn't seem to be difficult. Core stuff like RunFrame() functions can be used to add other features if someone needs, both Callback's and CallResult's responses seems to work properly so there should be no problem. I will try to keep Stats_manager type/object simple and fairly clean.

Currently using dll's exported function through Declare seems more reliable to me, so for now I will stick to it. Possible test with native C++ interfaces may be done in future, yet as this solution is sufficient for me (at least for know) I have no need to push on that. If someone needs, additional functions can be easily added, for example to launch web-browser in Steam overlay just this:
Code: (glbasic) [Select]
Steam_API_SteamFriends_ActivateGameOverlayToWebPage("https://www.glbasic.com/forum/index.php")

42
In order to keep all things in one thread and keep it clean I will edit my first post with latest info, for archive reasons I've copied my initial post to my previous response.

And here is todays update.
As I'm getting closer with larger update to my Steam game, I was looking on few things that were hard to implement earlier, one of them were Steam Achievements.
Making it short, there are two ways to use Steam API: a) including it as C++ headers and using directly in inline or b) calling functions that are exported from dll.
a) may be more clean looking, yet it needs latest GLB version, and I still have some issues with either wrong calling convention, pointers or whatever.
b) could be more limited as probably not all functions can be used this way, but still it's a good solution.
After trying to get a) work I turned into option b) and.. Ehm it was supposed to be short ;-) Soo.. I made some help functions and here it is, an 'easy' way to add Steam Achievements to Your game.
Yeah, it isn't clean code, not bullet-proof, and have some issues and it's under constant development so it will fit my needs. Most important thing is that, user stats and achievements are working with it, tested on live app.

Take note, that if You will run project from Steam version GLBasic editor it will inherit its app_id, so You want be able to test it properly, not sure if putting 'steam_appid.txt' into project exe path should fix that, but You may need to either grab STDOUT to file or use alternative editor/older version.
Also read this: https://partner.steamgames.com/doc/features/achievements
Some example template to give Your an idea how to use it:

Code: (glbasic) [Select]
GLOBAL mySteam AS stats_manager_object, i1%
mySteam.Init(1)      // after Init this will also request FOR current stats from Steam
i1% = mySteam.addAchievement("achiev_10_games_played")
mySteam.addUserStat("games_played", 10, 0, 0, i1%)
i1% = mySteam.addAchievement("achiev_10000_enemies_destroyed")
mySteam.addUserStat("enemies_destroyed", 10000, 0, 1, i1%)   // frequently changed value
// requestCurrentStats() was called internally in Init()
SETLOOPSUB "GLB_ON_LOOP" // set main loop FOR app
END   // exit app

// GLB_ON LOOPS
SUB GLB_ON_LOOP:
  mySteam.RunFrame()
   // after game played
   IF (match_finished) THEN mySteam.updateUserStat(-1, "games_played", 1, 1)   // increment by 1
   // OR you can do it manually
   IF (enemy_destroyed)
     INC mySteam.userstat_list[1].value_curr_int%
   ENDIF
   // IF You changed value manually THEN update it once per second - when calculation FPS
   IF last_fps_time - GETTIMERALL() >= 1000
     mySteam.updateUserStat(1, "", 0, 0) // update destroyed enemy counter
     // call only IF an achievement was unlocked - TO show it
     IF mySteam.status.achievement_was_unlocked% = 1 THEN mySteam.storeUserStats(0)
   ENDIF 
  IF KEY(01) THEN END // IF escape KEY THEN END app
ENDSUB
called on pausing AND before app exit
SUB GLB_ON_PAUSE:
// you need TO have them both AS RunFrame will call them when user open overlay
ENDSUB
// called on restoring app
SUB GLB_ON_RESUME:
ENDSUB
// called before app axit
SUB GLB_ON_QUIT:
  mySteam.Shoutdown()
ENDSUB


ps. download link in first post.
ps2. I rushed this a little just to post it today.

43
GLBasic - en / Re: SDL2 access inline?!
« on: 2020-Apr-20 »
omg  :giveup: How could I missed that  :blink: really :lol:
But there is some problem, FORCEFEEDBACK isn't working with my x360 controller, if I'm getting it properly a 'FORCEFEEDBACK 0, 500, 1, 1' should do rumble effect but it does nothing. Ofc checked other possible parameters and same result, also tried example from help file and this also doesn't work, tried with GLB 14, 15 and newest 16, no luck.

44
GLBasic - en / Re: SDL2 access inline?!
« on: 2020-Apr-18 »
No problem, it looks that my problem got solved, after 'verifying' my code with C++ test project from SDL2 source.. and replacing batteries in gamepad to fully charged ones :D Still few times it had same problem, nevertheless, it's great to add some kind of force feedback/rumble effects to GLB projects. I will need to do some small project with examples.

Edit:

Proper project will come later, now what's need to be added to test haptics:
'global' variables in SDL2_Window type:
Code: (glbasic) [Select]
#include <stdio.h>      // for printf
SDL_Joystick *myJoystick = NULL;
SDL_Haptic *myHaptic = NULL;
Init subsystems:
Code: (glbasic) [Select]
SDL_InitSubSystem(SDL_INIT_JOYSTICK);
SDL_InitSubSystem(SDL_INIT_HAPTIC);
after Init if window is created:
Code: (glbasic) [Select]
// Open the device
myJoystick = SDL_JoystickOpen(0);
printf("Haptic Init\n");
myHaptic = SDL_HapticOpenFromJoystick(myJoystick);
if(myHaptic == NULL)
{
printf("Error in opening Haptic Device (i.e. Rumble)\n");
printf(SDL_GetError());
}
else
{
printf("Haptic Device (i.e. Rumble) Opened\n");
}
printf("Number of Haptic Devices: %1d\n", SDL_NumHaptics());
printf("Controller is Haptic?: %1d\n", SDL_JoystickIsHaptic(myJoystick));
if (SDL_HapticRumbleInit( myHaptic ) != 0) printf("SDL_HapticRumbleInit error: %1d \n", SDL_GetError());
basic rumble effect:
Code: (glbasic) [Select]
FUNCTION RunRumble%:
INLINE
if (SDL_HapticRumblePlay( myHaptic, 0.25, 2000 ) != 0) printf("%10d \n", SDL_GetError());
ENDINLINE
ENDFUNCTION
change CloseWindow to clean after additional stuff:
Code: (glbasic) [Select]
FUNCTION CloseWindow:
INLINE
SDL_JoystickClose( myJoystick );
SDL_HapticClose( myHaptic );
ENDINLINE
self.running = FALSE
ENDFUNCTION
Test your gamepad from main loop with: Win.RunRumble()
Hopefully this can be used without all that window/rendered related stuff, thanks again :-)

Edit2:
It looks like only 'JOYSTICK' and 'HAPTIC' subsystems are needed so it's great, only small piece of coded needed for nice rumble effects :-)

45
GLBasic - en / Re: Drag and drop in Windows
« on: 2020-Apr-18 »
Some workaround is to use SDL2 functions, thanks goes to Schranz0r, get his code from this post: https://www.glbasic.com/forum/index.php?topic=11401.msg100530#msg100530
And add:
in SDL2_window.gbas -> FUNCTION CreateFromGLBasicWindow
after inits add this line:
Code: (glbasic) [Select]
SDL_EventState(SDL_DROPFILE, SDL_ENABLE);in same file add those two functions to SDL2_Window type
Code: (glbasic) [Select]
    FUNCTION EventFileDrop:
INLINE
return events(eventHandle).type == SDL_DROPFILE;
ENDINLINE
    ENDFUNCTION
   
    FUNCTION GetDroppedFile$:
        LOCAL ret$
        INLINE
            char* dropped_filedir;
            dropped_filedir = events(eventHandle).drop.file;
            ret_Str = dropped_filedir;
            SDL_free(dropped_filedir);
        ENDINLINE
        RETURN ret$
    ENDFUNCTION
in main file (SDL_calls.gbas) change PollEvent loop for something like this:
Code: (glbasic) [Select]
WHILE Win.PollEvent()
IF Win.EventKeyDown()
IF KEY(1) THEN Win.CloseWindow() // Close window on ESCAPE-Key
INC counter, 1
ELSEIF Win.EventFileDrop()
LOCAL file$ = Win.GetDroppedFile$()
ENDIF
WEND
It's working, sorry that I doesn't provide clean source, but I'm playing around with other SDL functions so my test project is a complete mess :D
If You need only drop file support maybe there is no need to create SDL window and so on, 'SDL_INIT_EVENTS' could be sufficient to work with drag&drop, not sure.

Pages: 1 2 [3] 4 5 ... 22