Felix Mochizuki's Forum Posts

  • Hi! I'm developing a game about exploring surreal dream worlds, the game is heavily influenced by Yume Nikki and the japanese RPG Maker games, and it's already available for purchase on Steam:

    https://store.steampowered.com/app/1446660/Ayu__The_Dream_Soul/

    I would love if you could check it out, I wish you all the best!

  • So, something interesting is happening, my game is using a save game system based on the "save state" event that Construct offers, but let's say that I want to add ANOTHER treasure chest for example (I say "another" because the map already has one), so I add a second one, and then I build this new version of the game, so I open the new version built, and when I load my game state, the second treasure chest isn't created... But then here's what I find interesting: If I create a completely NEW object (instead of placing another treasure chest, which is already in the game files) and place it on the map, this object WILL be loaded in my old save game, so how does this works? Why does this happen? Why adding another instance of the same object that is already within the game doesn't work and adding a completely new object does work?

    My goal is to add the second treasure chest and make it correctly spawn on previous versions save games, so what can I do to make it correctly spawn?

  • > So, I have a game that the "save game system" is saving .save files to %AppData% but I noticed it's extremely easy to manipulate these values, since the player can just edit the .save file and change the number inside, for example number of coins, how can I make it impossible for the players to edit the save files so easily?

    Generally speaking, DON'T USE plugin for such tasks. Build your own simple algorithm:- just make the save data so complicated that it is practically impossible for user to become oversmart

    Issue with plugin is that you can't be sure how it works. Even worse,you can't be sure that whether it will be maintained in the future.

    Just spend some time on a basic algorithm. Remember the task:- make the data unreadable to the user.

    Ok but how do I do it? I have no idea.

  • You can either store the information in a format that the user can't easily figure out or encrypt the information.

    To save in a format the player can't easily figure out, you would convert the data prior to saving to something like a bit stream. A bit stream is a line of 0s and 1s built from converting your information to bits, zero padding each piece so the stream has each piece of information in exactly the same location, then appending all together so it is one long line. You have to parse and convert this back to the actually data when the file is loaded. This type of save is still able to be edited by more clever users but it will be harder.

    Encryption may be easier if you use a plugin. There are couple encryption plugins. I haven't tried them but they may be what you are looking for. You simply run the encrypt action when saving. Then decrypt when loading. This will make the file nearly impossible to modify and if the user tries to edit it, it will most likely corrupt the file. The only way to see and change the file information is with the correct encryption key and algorithm.

    Thank your for the information, I found an encryption plugin called Forge which seems to be a good plugin and the most simple to use, however I'm still not sure how to use...

  • So, I have a game that the "save game system" is saving .save files to %AppData% but I noticed it's extremely easy to manipulate these values, since the player can just edit the .save file and change the number inside, for example number of coins, how can I make it impossible for the players to edit the save files so easily?

  • You do not have permission to view this post

  • Basically, I have a version of my game that I'm using the "Save and Load State" functions for the player to save and load his game, however, I'm planning on releasing a lot of updates for my game, but I noticed that if I add something new to the game map and then use the "Load State" function, the game won't have the things that were newly added because the state of the game was saved before adding these new things, so how can I "update" the player save game for future game updates?

  • > You should make a debug Text object on your screen and output "InventoryArr.AsJSON" to it.

    >

    > The inventory array is the sole determiner of the contents of your inventory.

    >

    > If it is blank, then you can track when it is getting items added to it and see why.

    >

    > When you open an empty inventory it should look like:

    {"c2array":true,"size":[0,1,1],"data":[]}[/code:2dzay5le]
    > Otherwise, you will get rogue items appearing in your inventory.
    > 
    > That was why I added my debug text objects also, because I had some issues getting the example to work properly.  Do a search in your C2 for "InventoryArr" and find anywhere you are pushing objects to the array; those are where your problems will be.
    > 
    > Also, be aware that you can still click on your "Equip_chest" even if it is 0 opacity or invisible.  So you should probably put another condition on that event, like:
    > [code:2dzay5le]If Equip_chest is visible[/code:2dzay5le]OR[code:2dzay5le]If Equip_chest opacity > 10[/code:2dzay5le]
    > 
    
    well, i have no idea what's happening  the debug text says the same thing as yours, and the only places where i used the "push" array command were in those places that the screenshot shows, plus i could see in the debug text that the array is passing the 25 slots, why is this happening?
    

    actually, MAYBE i've discovered what's the problem but i don't know how to fix it, the for loop "xLoop" end index is set to InventoryArr.Width-1 and that's causing to appear 2 itens everytime i open the inventory, if i change it to only InventoryArr.Width then it causes only 1 item to appear, if i set it to InventoryArr.Width-2 it causes 2 itens to appear too and the same goes if i set to InventoryArr.Width+1

  • You should make a debug Text object on your screen and output "InventoryArr.AsJSON" to it.

    The inventory array is the sole determiner of the contents of your inventory.

    If it is blank, then you can track when it is getting items added to it and see why.

    When you open an empty inventory it should look like:

    {"c2array":true,"size":[0,1,1],"data":[]}[/code:vo84webs]
    Otherwise, you will get rogue items appearing in your inventory.
    
    That was why I added my debug text objects also, because I had some issues getting the example to work properly.  Do a search in your C2 for "InventoryArr" and find anywhere you are pushing objects to the array; those are where your problems will be.
    
    Also, be aware that you can still click on your "Equip_chest" even if it is 0 opacity or invisible.  So you should probably put another condition on that event, like:
    [code:vo84webs]If Equip_chest is visible[/code:vo84webs]OR[code:vo84webs]If Equip_chest opacity > 10[/code:vo84webs]
    

    well, i have no idea what's happening the debug text says the same thing as yours, and the only places where i used the "push" array command were in those places that the screenshot shows, plus i could see in the debug text that the array is passing the 25 slots, why is this happening?

  • Make sure you InventoryArr is cleared and set to 0 X-size (Set Size 0,1,1) otherwise, the array value defaults to 0. Also, make sure you destroy all of the items sprites upon entering the inventory so that you display loop can work with a clear inventory.

    I actually had the same problem when I was testing this capx too.

    Another option is to exclude the 0 index from your items array and put a condition in your loop that bypasses any 0 values.

    > all the other items that i create are being created and deleted so fast that you can't even see it being destroyed and created again

    > I am not sure what this means?

    Keep in mind though, that every global event will run every tick (or as fast as possible); so if you have an unconditioned destroy event, it will continually destroy your items.

    again, now i've set the size to 0, 1, 1 and now it's the same as yours:

    prnt.sc/dhefll

    but it makes even less sense cause now it's already creating TWO itens when i open the inventory, and now i've uploaded a video example so you can see the two itens already being there and what i mean by "being created and destroyed very fast"

    sendvid.com/kdmfleaf

    (the red shit on the left is used to create more itens when clicked)

  • What if you were doing this with a collection of enemies? For example, imagine that I had 12 fox enemies with their own skins. Would this still seem appropriate?

    I guess I am wondering if there is any advantage of doing it one way?

    well there are tons of different cases with different solutions, for the player i just use the every tick

  • i tend not to use much behaviors, in this case i personally would do Every tick -> Set position of PlayerSkin to both HitBox.X and .Y

    of course, if that's what you want to do (it's what i could understand)

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • keep up the content!

  • wow, very helpful!

  • You have one Array (I'll call this ItemsArr) that contains all of your items and one Array (I'll call this Array InventoryArr for this post) for your inventory.

    When you want to add a new item to your inventory you push the item Id from the ItemsArr to the IventoryArr, like:

    IventoryArr: Push to front: ItemsArr.IndexOf("potion")[/code:4b9qp1hs]
    
    Then you loop through your InventoryArr again to display the new object in the inventory.
    
    So for example, let's say your ItemsArr looks like:
    
    ["potion","sword","armor","cape"]
    Idx: 0________1_______2_______3
    
    and your inventory array has a sword and armor and looks like this: 
    
    [1,2]
    
    When you use [code:4b9qp1hs]IventoryArr: Push to front: ItemsArr.IndexOf("potion")[/code:4b9qp1hs]
    
    Then your InventoryArr would look like:
    
    [0,1,2]
    
    If you then use [code:4b9qp1hs]IventoryArr: Push to front: ItemsArr.IndexOf("cape")[/code:4b9qp1hs]
    
    Your InventoryArr would look like:
    
    [3,0,1,2]
    
    Then to display items, you loop through your InventoryArr and pull items from your ItemsArr using the item IDs stored in your inventory array.
    
    The 5x5 is only a display change, not a fundamental data structure property.  So you would address the 5x5 property in your display loop using a row variable and incrementing it every 5.
    
    Like this: https://drive.google.com/open?id=0B-xiq ... jB6ZmtoaVk
    

    wow! you're really helping me out! i did the same thing as your events:

    prnt.sc/dh2ig5

    it's almost working as i wanted, however, i have no idea why when i open the inventory (the player has to press "I" for it to appear) there's already an item in the first slot!

    prnt.sc/dh2ils

    and it's even more bizarre that when i debug the game, i can see that not only this already created item but also all the other itens that i create are being created and deleted so fast that you can't even see it being destroyed and created again, how would i possibly fix those issues?