Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags

8-bitsloth

15
Posts
3
Topics
3
Followers
A member registered Oct 22, 2021 · View creator page →

Creator of

Recent community posts

Thanks so much! Really appreciate it :)

Thank you!

Thank you so much! Glad you enjoyed :)

Sure, it's not literally a game about space or outer space. I think the theme for "space" is a bit more metaphorical, which is what my game is following. Throughout the game, the player explores and dives into the ocean, talks to NPCs, gets upgrades, etc. but all within the confines of one "space" since they aren't exiting or entering other rooms. Hope that helps :)

Thank you!

(1 edit)


Hi all,

Just published my first game on itch and wanted to share here if anyone wanted to check it out! Dive is an indie, adventure RPG game where you dive to ocean floor to collect ingredients for a remedy to cure your mother's sickness. Along the way, you'll catch different fish, upgrade your abilities, and talk to characters like the wise Fisherman above.

All the pixel art, sound effects, and music are original and created or recorded by me!

Here's the game page - play in browser, on mac or windows: https://bitsloth.itch.io/dive

Thanks for reading!

bitsloth

(1 edit)

Hi all,

Just wondering - are older game allowed to be submitted? For example, I just published my game on itch today, but it's one I've been working on since May of this year on and off. Is this allowed? Also wondering this for other game jams in general as well as specifically for this one.

Thanks,

bitsloth

This worked, thank you so much!! I used your code as a starting point and incorporated it into my existing code:

if room = rm_start {
    if keyboard_check_pressed(ord("D")) {
        ini_open("../options.ini");
        // debug purposes: delete section if exists
        if ini_section_exists(global.section) {
            ini_section_delete(global.section);
            show_debug_message("data section deleted");
        }
        ini_close();
    }
     
    if keyboard_check_pressed(ord("Z")) {
        global.sfx = "blip"; // sfx global var used in switch case
    
        // ini check code
        ini_open("../options.ini");
        show_debug_message("ini successfully opened"); // console message
        if ini_section_exists(global.section) {
            if (ini_read_real(global.section, global.key, -1) = global.val) {
                global.firstTime = false;    // used in other code to display/hide screen
                show_debug_message("section AND key exist - RETURNING PLAYER");
            } else {
                global.firstTime = true;
                ini_write_real(global.section, global.key, global.val);
                show_debug_message("section exists BUT key DOESN'T (I think?)- NEW GAME");
            }
        } else {
            global.firstTime = true;
            ini_write_real(global.section, global.key, global.val);
            show_debug_message("section DOESN'T exist - NEW PLAYER");
        }
        ini_close();
        room_goto(rm_game);
    }
     
    if keyboard_check_pressed(vk_escape) {
        game_end();
    }
}

Some really weird things were happening, like the INI section would never truly delete. I kept pressing "D" in-game and would keep getting that message over and over again, which seems impossible since it only runs if the section exists. So every time I reuploaded the zip for my game, I'd have to change the global.section string name to something different, because the previous section would still exist even after I'd deleted it.

There was also an issue with starting a new game, where I had to delete both the key and the section and do a check for that. Not completely sure why I had to do some of the things I had to do, but I ended up with three different states - returning players, players who started a new game in-game, and completely new first-time players.

Quick question - wondering if you've ever run into this: do you have to randomly generate save file names? Mine is just hardcoded into my game:

save_file = "dive-bitsloth-fIt0QNLgfAlboxByK9zdWOKRXRvzbMWeafIm4Q6LLlV9vykE5T.save";

If that save file is hosted on itch's servers, wouldn't all users be pulling from the same one? The thing is though, I tested it on two laptops (using the secret url, still unpublished) and got two separate, correct save instances for each user, so it does seem to work, though I'm confused as to how! Let me know if you've got any experience with this :)

Thanks for all the help! Your advice and coding insights have been really valuable. I'm going to try exporting to Mac and Windows too so I may bother you about that as well ;). I recently found out that you need a (paid) apple developer account for mac exports, so that's unfortunate.

Will add you on discord when I get a chance!

Ok that makes sense, thank you! So I'm running into a bit of an error trying to do this, as it seems my "options.ini" is in the "html5game" directory. Here's some pics of testing on localhost:

So my game is trying to grab "options.ini" from inside the html5game, but I know that it's not actually in that directory, but rather on the same level based on the image below from one of my previous zip exports.


This is just some test code I have in a "Key Press - P" in my gameManager object.

ini_open("options.ini");
if ini_section_exists("DisplayName") {
show_debug_message("section exists");
}
ini_close();

However, I have a feeling this is different from what you were suggesting. Is this what you meant by reading the filename - the "options.ini"? Or did you mean I should "ini_open" my save file, the "dive-bitsloth-50char" file? Sorry, first time working with ini files so I'm not too familiar with how this all works haha. I'm a little confused how checking a section in the ini file relates to whether a save file exists. Would this be a custom section I'm creating myself?

Gotcha, so I tried loading the game (which reads from the phantom file) as soon as it enters the room, but then the game just freezes. Getting this error:

However, I think I know what's going on! I was doing some research earlier tonight and starting looking into the actual errors themselves. 403 is a permissions error, which I think means my game isn't able to access the save file on the remote server. So what I believe is happening (just an educated guess) is that somehow, the game thinks a save file exists, but when it goes to grab it from itch's remote server, it doesn't actually exist so is producing the errors above. I checked GMS2's documentation for "file_exists" and found something really interesting: https://manual.yoyogames.com/GameMaker_Language/GML_Reference/File_Handling/File...

They specifically say:

"Note that the function can only be used to check local files, but not any files stored on a remote server."

So I'm assuming that's the error, since the way I'm checking save files is using that function. However, I do know that you're also using that same function in your code and it's working, so I'm really not sure what's going on 😅.

Yup, exactly. This is the one that's showing up:

Game Room

which should only appear if a saved file was found. I've tried doing the "Start New Game" option which finds and deletes the current save file, but it doesn't really do anything and I still see this screen. Also, the 50-char randomly generated string for the save file variable was a pretty new addition, but after uploading that and running for the first time, same problem. There shouldn't be a duplicate of it on itch's server I believe.

(1 edit)

Hey FieryLion,

Hope all is well and thank you for the in-depth code. Apologies for the late response as I haven't gotten a chance to work on this till now. Your code was helpful, but I'm actually saving my game in a bit of different way. I write all the information into a data structure first, then push to array. Then using "json_stringify" I turn the array into a json string and save to a temporary buffer that includes my save file. 

Here's my code after I've determined which values I want to save:

// STEP 3 - JSON STRINGIFY data (convert from array to string)
var json_string = json_stringify(save_data);
// STEP 4 - BUFFER: create, write, save, delete
// (size is string length+1, buffer_fixed means size of buffer doesn't change, alignemnt is 1)
var temp_buffer = buffer_create(string_byte_length(json_string)+1, buffer_fixed, 1);      
buffer_write(temp_buffer, buffer_string, json_string);    // write our json_string to the buffer in string format     
buffer_save(temp_buffer, working_directory + "Saves/" + global.save_file);      
buffer_delete(temp_buffer);     
temp_buffer = -1;    // reset to -1      
show_debug_message("Game saved! " + json_string);

When loading files, it's the same process but backwards. Read from the buffer, then "json_parse", then pop values off the array and back into the objects. After working on this tonight, I feel like I've tried everything. With and without "working directory" and also using a save folder like:

if (file_exists(working_directory + "Saves/" + global.save_file)) {
...
}

Also, here's the name of my save file currently:

global.save_file = "dive-bitsloth-fIt0QNLgfAlboxByK9zdWOKRXRvzbMWeafIm4Q6LLlV9vykE5T.save";

I've tested this locally and other than some visual glitches, the saving works functionally. The screen that's coming up can only possibly appear if a save file exists, which I don't see how is possible if it's my first time running the game and have never saved before on itch's server. At this point I'm thinking there's something wrong with itch's CDN as my game saves perfectly on my local server and the 3rd set of characters is a randomly generated 50-character string. Not sure what else to do at this point.

Thanks for all the help so far,

bitsloth

Oh, good point. But yeah, just using classic Chrome without incognito mode.

Hey FieryLion, thanks so much for the response! Tried both things you suggested and neither have worked for me yet. Tried naming my file something very specific, like "dive-bitsloth-129304878321094" and no success. I also tried creating a new directory called "Saves/" and using working_directory like you suggested - no luck there either. I may be coding it wrong, so will take another look, but is there anything else you know of I could try?

Thanks!

(3 edits)

Hey everyone,

This is my first time uploading a game on itch, and I'm running into kind of a weird bug and looking for some insight! So, for some background, I created my game in Gamemaker Studio 2 and exported it as HTML5 as a zip file. Inside the zip file is just the classic index.html file, options.ini, favicon.ico, and a folder called html5game with all my assets (textures, sprites, sounds, etc.). I think this is what you normally get when you export as HTML, so everything should be good there.

When I run the game on itch, the start screen loads just fine and functionally works. When I press [Z] to advance from the start room to the game room, that's where I start running into issues. Here's some screenshots below:

Start screen

In the start screen/start room

-

Game Room

The Interstitial screen that changes based on if you're a new or returning player

-


In the black screen/headphones picture above, the player is now in the game room ("rm_game" in GMS2), but I've placed what I've been calling an "Interstitial" screen as the top layer in the GUI to see if you're a new player or returning player. This specific Interstitial screen gets shown for returning players, since there's a "Saved file found" in the option on the right. But this specific screen isn't supposed to show up unless a save file exists - which is weird because if this is the first time I'm running this game, there shouldn't be an existing save file. When I try the option on the right, it just loads into a black screen. When I start a new game with the left option, it goes back to the start room (which should happen) but when I advance with [Z] I just get this same exact screen, and am back at square one. Also, the game is extremely laggy at this point.

I'm thinking it might be a problem with the way i'm save/loading. I followed shaun spaulding's save/load method here (Save / Load tutorial) which I think is pretty standard, and called my save file "dive.save" and saved it in a global variable called save_file.

Here's the error I'm getting in the console when it hits the interstitial screen. There's a huge number of requests being made, and it seems like my browser is hitting up itch's CDN (where my game files are hosted) multiple times without success. I think a 403 is a permissions denied error.


In any case, sorry for the super long post, and any help is greatly appreciated!

Thanks so much,

bitsloth