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 ... 28
1
Off Topic / Re: Glbasic to Nintendo Switch?
« on: Today at 12:35 PM »
SmileBasic looks like something interpreted, and from what I see it can't produce standalone apps, only launched from app player. I'm more curious what's the current state of HTML5/JS development on Switch, either pure canvas or WebGL / WebAssembly based, as JS is sufficient for most 2d games. Yes Nintendo has more closed platform than others, and surely game needs to be accepted by big N, for example on Xbox Series there is an 'dev mode' on normal consoles that you can use to port some games, and most likely they don't have such rules/requirements for games.
Of course it would be great to have Switch as additional platform on GLBasic, but this would be surely a lot of work, and NDA implies some restrictions for all such tools.

2
Rather small update than some super changes.
'BR Logic Pack' started as 6 puzzle games pack, now there are 9 games, and I plan to add at least 2 more.
3 'new' games are:
- Pixel Village - build walls and roads with nice pixel based sprites,
- Dungeon Slider - move wizards in dungeon and collect potions,
- match 3 - classic game with some variations,
- additionally few other games got new playing modes,
Game is also available on itch.io, You can download and check it out for free, Steam version will get new additions earlier and currently supports achievements and leader boards (for now only sends user score, but all code for online high score is already in game and awaits for larger update).
trailer for current version:


Current main project is clone of Solomon's Key game with rather old school pixel-art graphic (based on itch / devmarket assets due to limited founds :D), many things are done: most graphics, core mechanics, menus, Steam achievements + leader boards, map editor with sharing levels online (classic web-based not Steam Workshop), some requires more work: additional game modes, boss logic, atm. has no music/sound and needs some polish before I will share proper gameplay video.

Another large project that's currently in limbo is an 2D RTS game (viewed from side, not top), won't say to much but I have basic prototype, and final product will be interesting. Have some nice ideas for it but, this would require redesign from ground to use threads, remaking my gui system, polish pathfinding and so on. Will get to work on this after finishing current things. Don't wont say to much as it's still early stage.

3
Where did you get all those various maze generating algorithms?
for me most understandable and competent sources were those:
https://weblog.jamisbuck.org/2011/2/7/maze-generation-algorithm-recap.html
https://professor-l.github.io/mazes/
https://www.astrolog.org/labyrnth/algrithm.htm
I didn't implement all of algorithms found on those websites as not all were optimal/interesting and could be used as base for something more in game based environment.

@erico
Generally I also do something different from classic algorithms, or rather don't care which things from particular method are useful in current situation, as level generation is kind a different thing and needs more complex solutions. Some example can be multi-stage generation with way-points navigation using A-star pathfinding and so on.
Bridges/tunnels can be done in several ways, depending on what is required in game, either pre-calculate their positions and use some modified algorithm or place them in main loop using some markers (tiles counter from last bridge and similar) as I made in last algorithm in attached code (Growing Tree) - yet this implementation isn't best, bridges aren't evenly distributed on whole map.


4
I'm currently playing with some maze generation algorithms for my logic/puzzle game pack, didn't see any such topic here on forum, so I thought that sharing this could be a good idea. Some maze generation examples available on web have nice visualization, just hope that my would be sufficient to show how each algorithm work. Project includes implementation of several most common maze generation algorithms like: Binary Tree, Sidewinder, Hunt&Kill, DFS/Backtracker, Eller, Prim, Growing Tree. Some were modified to add difficulty variation - mostly length of walk in current direction.
One major addition would be bridges (paths above/beneath another), those simple algorithms have limited possibilities for that, and needs to be used in combination or as addition to some other techniques - like regions, pre-calculating bridge positions and so on. Last algorithm - Growing Tree has basic bridge logic implemented.

One thing that code can be a little messy, most time I use Javascript for such prototyping and code was ported to GLB to share on forum (GLB is also target/final language). Feel free to modify, and new functions.

Controls:
-+ -> switch algorithm
[] -> change map width
<> -> change map height
space -> generate maze
escape -> end

5
Off Topic / Re: Glbasic to Nintendo Switch?
« on: 2022-Jul-20 »
It's great idea but I doubt that NDA/license will allow you to publish some sources and info from their repository in 'limited open source' project as GLB. For example RayLib unofficially supports Switch, but it requires to cooperate with someone (don't remember know who atm, most likely author of RayLib- RaySun). Maybe this would be better option (than Unity) for your Spectrum Next projects.
From what I know Switch uses proprietary Nvidia API similar/based on OpenGL/Vulkan - called NVN, most likely it comes with it's own license, there are some reverse engineered open source projects that gives some idea how it works. But due the nature of the device itself, as it's a console, it will be more targeted to certain things.
On other hand there is a port of SDL for Switch, but I'm not sure if it could be used for commercial games, if so, that would be easier way for GLB to support that platform.

6
First it depends what such call returns, is it html code with encoded image, raw jpeg or something.
Check 'programmer console/options/view' in your browser what does it do after going to this site, or use http debug tool/spy like Fiddler to get all needed info, as it may require to use some specific http headers to force some behavior. If you would need to get that image asynchronously best would be custom http handing code with network commands. If you would have any problems let us know.

7
Little late but, that's most likely related to the way how GLB IDE handles project compiling - all projects are compiled in same directory "%Temp%\glbasic", each time it should be cleared but if you will open second editor window/instance and run/compile project then some files may left or some mismatch may happen. (this is the way how I encountered such issue many times while working in my editor)
Other possible reason for this could be saving project files with different encoding (like with utf8 BOM or something, not sure how does it look atm) by editing it in for example notepad++, if such issue would appear only after changing target platform or some project setting it can be called a bug.
If you encounter it again, I advise to clear temp dir manually, and restart editor then compile project again.

8
There should be option to add GLB/project path to exclude/ignore category so you won't be bothered by this again.
It's happening to many dev tools, such AV sandboxes/capture/heuristic systems runs app in restricted environment, when it check that app isn't malicious it gets restarted with all rights, the issue is that after compilation such app is flagged as new entry so it needs to go through this procedure again.

9
There were some generals language fixes/additions from v12 to v14, so that's why I advised it not sure how core Mac stuff changed between them.
I'm curious if newer MacOS systems can run such old OpenGL code with some tweaks, or only Metal stuff is allowed, as it would be nice to have proper MacOS app that would run normally - even in some compatibility layer on newer M1 devices, mainly because that would give additional platform for Steam store build, Apple store is out of reach (html5 target could be used as workaround).
That's something to test some day, in better times :>

10
Is this issue appearing in every project or only on selected - like your games that are using Steamworks for something? I didn't encountered this on my pc. Are you sure that GLB compiles project two times?
One thing that first appeared in my mind is either anti-virus software or some smart screen filter in Windows, because normally (specially due to heuristic) they can cause issues during compilation or running newly created app with 'unknown' tool. So normally I add GLB/project path to exceptions in such software.
One workaround can be to use GLB editor that's free of Steam overlay - navigate to GLB path and launch 'EditorE.exe'.

11
btw. wasn't v14 or v15 last version to support MacOS? You just needed to download additional platforms from GLB website in zip packages. As I'm curious later (post v12) additions/updates were also added to Mac part as core code for iOS/Mac still exists in GLB source, so maybe it could be possible to prepare Mac project with newer GLB version with some changes to platform.ini or something.
So you are running your project on M1 mac? Are there any graphical issues/glitches?

12
Off Topic / Re: Covid
« on: 2022-Mar-24 »
Sad to hear that covid hit You so hard :( I hope that your recovery will go smoothly and without further issues.
Best of All for You and Your Family in those harsh days.

ps. lung infections and breathing problems are the most serious complications after this disease, and they are even more damaging for kids, so hopefully that all your family will now have some extra immunity beyond vaccines.

13
Updated to latest Steamworks 1.53a.
Support for Steam Leaderboards added, partially tested, I would need to have much more entries on high scores with different players, but didn't encounter issues for moment on limited leaderboards. Major thing is automated downloading user avatars and pasting them on GLB sprite-atlas (thanks to great FASTMEM2SPRITE by Qedo), that allows to use them directly in game with DrawAnim/PolyVector. Didn't test it in proper game yet, not sure about possible conflicts in inline declarations, but I will work on this soon.

As the way how everything works in Steamworks - is provided by Steam Client app and can be async retrieved during main loop, this is proper way to implement this feature in your game:
1. create leaderboards on steamworks app page,
2. in-game-code set leaderboards names, additional info - to download avatars
Code: (glbasic) [Select]
mySteam.addLeaderboard("new_levels")
mySteam.addLeaderboard("classic_levels")
// if you want to use avatars create sprite for storing them - should be large to contain hundreds small avatars
mySteam.setLeaderboarOptions(1, 1)
CREATESCREEN 10, 10, 1024, 1024
mySteam.setAvatarsBufferInfo(9, 10)
3. fetch leaderboards main handles - provided by Steam
Code: (glbasic) [Select]
mySteam.leaderboardPrepare()4. refresh leaderboards - after loading initial game data, and successfully obtaining leaderboard handles
Code: (glbasic) [Select]
mySteam.leaderboardRefresh(-1) // can be called in some longer intervals to get current highscore5. when all info for entries of some leaderboard is downloaded (score is available right away, but nicks/avatars can be async) callback function is called, so you can update highscores info on screen
Code: (glbasic) [Select]
FUNCTION StatManager_LeaderboardReady%: handle AS int64, tab_id%, top_or_near%
    LOCAL i1%, pid%, tnick$
       
    IF (top_or_near% = 0)
    FOR i1% = 0 TO mySteam.leaderboards[tab_id%].top_count% - 1
        pid% = mySteam.leaderboards[tab_id%].top_entry[i1%].id_onlist%
        tnick$ = mySteam.usersinfo_list[pid%].nickname$
        STDOUT "position: " + i1% + ", score: " + mySteam.leaderboards[tab_id%].top_entry[i1%].score% + " - " + tnick$ + "\n"
    NEXT
    ENDIF

ENDFUNCTION
6. upload new score with
Code: (glbasic) [Select]
mySteam.uploadHighscore(leaderboard_id%, user_score%, "")
I'll add leaderboards to my published game to test it properly on larger scale, and will try to fix any possible encountered issues.
Achievements and leaderboards can be attracting factor is some cases (rare achievements hunters and so on), another thing that could be interesting is support for Steam Matchmaking to simplify or rather have compatible lobby/invite handling for games with multiplayer, but this is rather just for consideration, as I don't plan to work on this.
If you have suggestions for usefully Steam API functions to test let me know.

14
If you only changed fps without addressing reason why that black frame appears it still may be there but just visible for shorter time so not so notable/easy to spot. I would advise to find why it's appearing.
Such languages as German should be fairly easy as (not sure) all letters are in extended ASCII, but French/Spanish would require some work to get have all letters.

There is quite a lot of thing to talk about when considering online highscore, but generally You need server with PHP and sql, don't have any specific tutorial but most info you can find here: w3schools
On one hand such solution is simple to implement and easy to maintain, but on other it's easier to hack (plain http request can be catch) without some kind of encryption of additional score verification.
You can consider two approaches:
1. simplest, just store each new uploaded score (nickname, score, number of words etc.), show 10 best, clear rest one of couple days,
2. store each user data separately, update user best score and show 10 best users, this way you can easily count users, active users and so on,
Below you can find some really simple highscore system for first option, in mysql admin create sql table 'highscores' with 3 fields - 'id' (autoincrement), 'nickname', 'userscore', modify and place those 3 php files on your server (for easier testing you can use local http server, for example xampp for windows)
Note some functions can have different name depending on your server specification and supported PHP/sql version, and most likely there are some typos here as this is fast modification of my older highscore system so take that in mind.

dbase.php - keep username, password in a separate file
Code: (glbasic) [Select]
<?php
$db_user 
"your_user";
$db_pass "your_password";
$db_serv "localhost"; // for localhost tests
$db_name "your_db_name";
?>

add_score.php - user to upload new scores
Code: (glbasic) [Select]
<?php
error_reporting
(0); // use this for public version
//error_reporting(E_ALL); // use this for developing and testing
header("Content-Type: text/html; charset=utf-8");
header("Access-Control-Allow-Origin: *");
header("Access-Control-Allow-Methods: GET"); // it can be POST instead, depends on your needs

require("db_base.php");
$link mysqli_connect($db_serv$db_user$db_pass$db_name);
if (
mysqli_connect_errno()) {
    
printf("Connect failed: %s\n"mysqli_connect_error());
    exit();
}

if (!isset(
$_GET['score']) || !isset($_GET['nick'])) {
printf("Not all variables were set in GET/POST request.");
exit();
}

$nick mysql_real_escape_string($_GET['nick']);
if(
is_null($nick)) $nick="Anonymous";
$pkt = (int)$_GET['score'];

$idzapytania mysqli_query($link"INSERT INTO highscores (nickname, userscore) VALUES (`".$nick."`, `".$score."`)");

mysqli_close($link);
?>

fetch_highscore.php - get current best 10
Code: (glbasic) [Select]
<?php
error_reporting
(0);
header("Content-Type: text/html; charset=utf-8");
header("Access-Control-Allow-Origin: *");
header("Access-Control-Allow-Methods: GET");

require(
"db_base.php");
$link mysqli_connect($db_serv$db_user$db_pass$db_name);
if (
mysqli_connect_errno()) {
    
printf("Connect failed: %s\n"mysqli_connect_error());
    exit();
}

$score_count 0;

$out_str "retrieving_info<br>\n";

$idzapytania mysqli_query($link"SELECT nickname,userscore FROM highscores ORDER BY `userscore` DESC LIMIT 10");
while ($wiersz mysqli_fetch_row($idzapytania))
{
$score_count=$score_count+1;
$out_str.="score_entry,id='".$score_count."',nick='".$wiersz[0]."',points='".$wiersz[1]."'<br>\n";
}
mysqli_close($link);

$out_str.="scores_count=".$score_count."<br>\n";

echo 
$out_str;
?>
It should give you some idea how that should look like, and you can upgrade this and modify to your needs, also such example will show you what php/sql things you need to know to work with this.
This file will print 10 best scores in plain txt file formatted like this:
Code: (glbasic) [Select]
retrieving_info<br>
score_entry,id='1',nick='player_1',points='12312'<br>
score_entry,id='2',nick='player_2',points='4234'<br>
score_entry,id='3',nick='player_3',points='342'<br>
scores_count=3<br>
that you later need to parse with GLBasic, but this is rather simple with basic InStr/Mid$ functions.

To send new score use NETWEBGET$(server$, path$+"add_score.php?nick=" + usernick$ + "&score=" + userscore%, 80, 1024, 5000)
To get 10 best score use result$ = NETWEBGET$(server$, path$+"fetch_highscore.php", 80, 4096, 5000)   - 4096bytes should be enough for 10 entries, later you can parse result$ to get all entries.
This is easy way, you can add asynchronous http handling to not block app workflow, additional encoding and so on..


15
Thing about fullscreen mode/resolution, consider that someone can play on laptop with 14'' display so it's better to have fullscreen option or for example tablets (I know that such Windows devices aren't popular but you know), and same goes for resolution, there is plenty of high resolution that just 1280x720 windowed mode without scaling would be to small. It's not matter to focus on such high resolution devices, but just let them be able to test and play your game :)

60fps is just better, and GLB is fast enough to do it on weak gpu's.

I played only in English (not native language), top score 459, but I must say that I focus more on technical aspect of games not on puzzles itself :D And it was most likely balanced, found some 5-6 letter words, most were 3-4 letters, but in general such are just easier to found, so I may say that this was balanced. Additional difficult modes may give some variation, specially with additional game mode.

Thing about additional languages, you could use font with extended ASCII (256 characters) to have some german/spanish specific letters. If you will stick to those couple languages that should be sufficient, but for other languages with specific symbols some tricks would need to be used to have all letters/symbols (as currently GLB doesn't support unicode font rendering).

Pages: [1] 2 3 ... 28