Navigation

    Fuze Arena Logo
    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Popular
    • Users
    • Groups
    • Help
    • Discord

    New to Fuse4-want a Faery Tale Adventure like game

    General Discussion
    17
    186
    25251
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • tdg8934
      tdg8934 @Spacemario last edited by tdg8934

      @Spacemario thank you for your kind words. I have changed around the instruments (ie saw) or melody channels for the best sound so all the channels (0-3? are heard) but I can keep playing with it. Currently I’m working on the GUI menus at the bottom .

      Spacemario 1 Reply Last reply Reply Quote 1
      • PickleCatStars
        PickleCatStars F last edited by

        Sticking to 4 channels is probably going to give it a nice retro sound. Like pixel art, but for your ears!

        1 Reply Last reply Reply Quote 1
        • Spacemario
          Spacemario F @tdg8934 last edited by

          @tdg8934 You should do a new video-- I'd love to hear the overworld song, but sounding correct with all of the channels :D

          tdg8934 1 Reply Last reply Reply Quote 1
          • tdg8934
            tdg8934 @Spacemario last edited by

            @Spacemario I’ll work on that note music this weekend. But I have discovered another issue I need some direction on first.

            tdg8934 1 Reply Last reply Reply Quote 0
            • tdg8934
              tdg8934 @tdg8934 last edited by

              Ok so for a while I have noticed in my game that it crashes after a few minutes of playing the note music. I get a system error that kicks me out of Fuze and back to the Nintendo Switch main screen. It’s a black screen with a message that says “The software was closed because an error occurred “ [OK ]

              I trouble shooted my program by commenting out the play music function in the main program loop. This time as no note music was playing and not touching anything, a couple of minutes later I get a Fuze Stack Overflow error.

              My Animated knight function was the culprit. Stack overflow, too many functions called, maximum memory for variables exceeded. (Context: A3777000)

              Any ideas what to do next?

              pianofire 1 Reply Last reply Reply Quote 0
              • PickleCatStars
                PickleCatStars F last edited by

                Sounds like your function has a bug. Check your loops?

                1 Reply Last reply Reply Quote 0
                • pianofire
                  pianofire Fuze Team @tdg8934 last edited by pianofire

                  @tdg8934 Is it possible that you are creating new sprites using createSprite without first freeing the memory using removeSprite? This can lead to memory leaks.

                  If you go to Settings -> Preferences -> Show FPS + Memory Meter When Running Programs

                  and change it to Yes this will display the amount of free memory when you program is running which should show if there is a leak

                  tdg8934 2 Replies Last reply Reply Quote 1
                  • Martin
                    Martin Fuze Team last edited by

                    If you are using loadAudio() then there is a memory leak each time you press + to run your code. Technically the leak is when you go back to the editor. This is fixed in the next release. It's not going to be causing things to crash when the program is running but it won't help if you are also running out every time you stop / start. Right now, there is nothing you can do about this bug aside from come out of Fuze once in a while or not load audio!. Apologies for the inconvenience on that one.

                    tdg8934 1 Reply Last reply Reply Quote 2
                    • tdg8934
                      tdg8934 @pianofire last edited by

                      @pianofire this really helped me identify the function loosing memory . Thank you

                      1 Reply Last reply Reply Quote 0
                      • tdg8934
                        tdg8934 @Martin last edited by

                        @Martin thank you but I did not find and code that used the load audio routine

                        1 Reply Last reply Reply Quote 0
                        • tdg8934
                          tdg8934 @pianofire last edited by

                          @pianofire this is the function I made that is loosing memory .

                          loop
                          clear()
                          DrawMap()
                          centreSpriteCamera(knight.x, knight.y)
                          UpdateSprites()

                          KnightWalk()
                          :
                          //Draw 9 arrows for direction
                          Arrows(800,1040,red,green,blue,0)
                          Arrows(750,990,red,green,blue,90)
                          Arrows(850,990,red,green,blue,-90)
                          //6 more arrow function calls
                          :
                          playMusic()

                          update()
                          repeat

                          :

                          Function Arrows(trx,try,col1,col2,col3,rot)
                          gw=1950/30
                          gh=1080/30

                          shape1=createTriangle(gw/3+trx, gh/3+try, gw/3+gw/3+trx, gh/3+try, gw/2+trx, gh-gh/3+try)

                          setVertexColour(shape1,0,col1)
                          setVertexColour(shape1,1,col2)
                          setVertexColour(shape1,2,col3)

                          rotateshape(shape1,rot)
                          drawShape(shape1)
                          //update()
                          return void

                          Even with 1 Arrows function call looses memory slowly and it crashes

                          In the knightWalk function it also calls the Arrows function to highlight the direction when the knights button are pressed. Currently those Arrows function calls are commented out. However, it would look like this:
                          Arrows(800,1040,red,white,blue,0)

                          So it appears my function Arrows is too complicated and looses memory

                          1 Reply Last reply Reply Quote 0
                          • n_yohan
                            n_yohan last edited by

                            This post might help...

                            https://fuzearena.com/forum/topic/107/stack-overflow-with-controls-n/8

                            tdg8934 1 Reply Last reply Reply Quote 0
                            • vinicity
                              vinicity F last edited by

                              I think you are losing memory because you are not doing deleteShape() on your arrows after you have drawn them.

                              This is a serious bug in Fuze, since memory allocated for shapes is not returned even after you quit your program (same as with audio files).

                              Willpowered 1 Reply Last reply Reply Quote 2
                              • tdg8934
                                tdg8934 @n_yohan last edited by

                                @n_yohan thanks but adding another update() or sleep(0.0001) or smaller causes the music and character movement to be very slow and not realistic to use. As well also causes the memory loss and eventual crashing- just slower.

                                pianofire 1 Reply Last reply Reply Quote 0
                                • pianofire
                                  pianofire Fuze Team @tdg8934 last edited by

                                  @tdg8934 I think that @vinicity has spotted the leak. Add a deleteShape(shape1) after drawShape(shape1)

                                  tdg8934 1 Reply Last reply Reply Quote 1
                                  • tdg8934
                                    tdg8934 @pianofire last edited by

                                    @pianofire @vinicity

                                    Thank you! That did the trick. All is fully functional again - back to normal. I’ve learned so much with the members and staff in this forum. Great work!
                                    8B16DFB5-D3A3-4C69-864F-D74258119191.jpeg

                                    tdg8934 1 Reply Last reply Reply Quote 5
                                    • tdg8934
                                      tdg8934 @tdg8934 last edited by

                                      If you notice on the last screen capture there is now a colorful “Action” menu box displayed with selectable smaller menu boxes (ie Inventory, Pause, Take, Look...). I’m able to select each menu box (into high-lighted black boxes with red letters) using the control buttons l, lz, r and rz when pressed. However there are 11 menu boxes and not enough control buttons (as I’m using 4 buttons also to control the animated knight walking).

                                      Does anyone have ideas or code to share on how I might cycle through 1 or 2 buttons to have them go through the menus. I was thinking a counter but when the button is released have it count and move to the next menu box. Is that the right way to handle a situation like this?

                                      thanks - Tim.

                                      Spacemario waldron tdg8934 3 Replies Last reply Reply Quote 1
                                      • Spacemario
                                        Spacemario F @tdg8934 last edited by

                                        @tdg8934 It's been a while since I've played the Mega Drive version... how did that work? The Genesis only had three face buttons, yet I remember it having the little boxes, and I recall the control scheme working just fine.

                                        I actually have a copy of the Genesis port sitting around my basement somewhere...

                                        1 Reply Last reply Reply Quote 1
                                        • waldron
                                          waldron F @tdg8934 last edited by

                                          @tdg8934 you could have a box (invisible sprite or area) where your inventory is and detect some form of collision while in there just call the collision and put the controls needed in there that will allow you to use one button for multi purpose. There may be a better way but its worked for me.

                                          1 Reply Last reply Reply Quote 1
                                          • Willpowered
                                            Willpowered Fuze Team @vinicity last edited by

                                            @vinicity said in New to Fuse4-want a Faery Tale Adventure like game:

                                            I think you are losing memory because you are not doing deleteShape() on your arrows after you have drawn them.

                                            This is a serious bug in Fuze, since memory allocated for shapes is not returned even after you quit your program (same as with audio files).

                                            We're aware of this and have a fix coming your way soon for shape memory not freeing at program end. In your programs however it's always possible to leak memory if you createShape with no deleteShape!

                                            tdg8934 1 Reply Last reply Reply Quote 3
                                            • First post
                                              Last post