Navigation

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

    Any recommendations for good game design books/websites?

    Help
    10
    15
    668
    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.
    • SteveZX81
      SteveZX81 F last edited by SteveZX81

      I spent countless hours at first, going through amazon, checking all the coding and beginners coding books but yeah, nothing really matches up with Fuze.
      We could do with someone writing a fuze book, make it a kickstarter project, I'd jump in!

      oh, I did buy one superb book on Amazon that is lovely to go with fuze but that's purely a book on Arcade fonts and not coding. ;)

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

        One thing I’ve found helps is to keep things consistent, like different functions for affecting the velocity vector of a thing (for example) should have the same inputs and outputs. Don’t have one take in an int and output a vector, and the next one take in a vector and just output a vector,y or whatever. Also keep your variable names consistent, and if you can, try to have a naming pattern so you’d be able to guess a variable name even if you forget. Make good use of bookmarks and comments, and mark things obviously with lots of ///////////////////s (for example) so you can spot them as you’re scrolling through.

        1 Reply Last reply Reply Quote 3
        • Jongjungbu
          Jongjungbu F last edited by Jongjungbu

          My rule of thumb for when to make a custom function is

          1. If the existing code block becomes extremely lengthy or verbose. Splitting it off into pieces makes it easier to digest and debug when necessary. For example, one function to handle turn-based RPG combat might be too long if it handles both player and enemies (and the results of their actions).

          2. If the code is going to be re-used a lot. For example, if you have an item and a spell and a temple and a fountain that can all heal a player, have one function to do the healing, in case you need to change healing later or debug it. Otherwise, any simple change in healing (such as renaming the health variable) will have to be changed in multiple code locations. A nightmare without a search option.

          Most of the time my functions return void. I might return true/false if the function is to check something: result = hasQuestItem(nItem)
          I rarely return more than a true/false due to potential issues with scope, and confusion/complexity with longer programs. It's much clearer to change a global variable than to return a local one.

          Of course everyone has a different coding style; these are just the way I go about it and only suggestions :)

          Martin 1 Reply Last reply Reply Quote 2
          • P
            petermeisenstein F @Tratax last edited by

            @Tratax I never designed games in fuze but for example you have to make something who makes the user addicted. Like in fortnite a battle pass. I mean yeah mario jump and run is fun and tetris is also cool but you really have to catch the user. Second point why should I play your game? So this is a question who a game maker has to ask himself. I mean making games is good keep doing but why should i play your mario clone if there is the original. You have to set yourself away from the others be unique but still keep the elemets who the user might be familiar with. Nobody would design a shooter where you have to shoot with the joycon pads. So please correcte me if i am wrong

            1 Reply Last reply Reply Quote 0
            • Martin
              Martin Fuze Team @Bl4ckM4ch1n3 last edited by

              @Bl4ckM4ch1n3 said in Any recommendations for good game design books/websites?:

              @Martin said in Any recommendations for good game design books/websites?:

              There's already a thread here somewhere with some more general resource links in it...

              I assume you mean this thread?
              https://fuzearena.com/forum/topic/536/some-pre-sales-questions/29

              No, I meant this one as it goes:
              https://fuzearena.com/forum/topic/1129/good-articles-found-on-the-web

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

                @Jongjungbu said in Any recommendations for good game design books/websites?:

                My rule of thumb for when to make a custom function is

                1. If the code is going to be re-used a lot.

                In general programming, my rule is if it is used more than once it should be a function. Code duplication for me is a no-no. Every bit of duplicated code is a chance to have a bug in more than one place.

                My last project was a little extreme however (Space Invaders). Apart from global variables and struct definitions I think everything is functions. Quite literally.

                1 Reply Last reply Reply Quote 2
                • PB____
                  PB____ last edited by

                  In addition, a reason to split up a function may be to reduce complexity. Even if you're only going to use the function at one place and for one purpose, separating your code into functions, can significantly reduce the cognitive load of your code.
                  For example, the following code is still quite compact, but if you need to change things, it may develop all sorts of branches and conditions quickly:

                  function checkEnemies()
                      int index = 0
                      for index = 0 to len(enemies) loop
                          var enemy = enemies[index]
                          if enemy.alive then
                              if enemy.attacking then
                                  enemyShoot(enemy)
                              endif
                              if enemy.hit then
                                  lowerEnemyHealth(enemy)
                              endif
                          endif
                      repeat
                  return void
                  

                  In this example I already used two functions, but there is still a lot you need to keep track of in your head, if you want to add another behavior for example:

                  • you are iterating over all the emenies
                  • do you only want to add behavior to alive enemies, or does it also apply to dead enemies?
                  • do you already have the if statement you want to add?

                  By splitting this up into smaller functions that only have a single task, you end up with more code, but you need to worry less about the context of execution for each function (it only needs to do exactly what it says it does):

                  function checkEnemies()
                      int index = 0
                      for index = 0 to len(enemies) loop
                          var enemy = enemies[index]
                          checkEnemy(enemy)
                      repeat
                  return void
                  
                  function checkEnemy(enemy)
                      checkEnemyShoot(enemy)
                      checkEnemyHit(enemy)
                  return void
                  
                  function checkEnemyShoot(enemy)
                      if enemy.alive and enemy.attacking then
                          enemyShoot(enemy)
                      endif
                  return void
                  
                  function checkEnemyHit(enemy)
                      if enemy.alive and enemy.hit then
                          lowerEnemyHealth(enemy)
                      endif
                  return void
                  

                  You could argue that it's bad for performance to check enemy.alive twice and having a larger call stack, but I'd argue that that impact should be hardly noticeable. While this is code where you may have more confidence about changing it. If you want to add a behavior, you could just add a new function and call it from checkEnemy

                  If possible it would also be helpful to keep code that is related other close to each other. Many languages support splitting up your source code in separate files. Even though you can't do that in FUZE you could try to think about how you would split up your source code in multiple files if you could, and then keep that code together, so it's more easy to find. If you're in a part of your code that does something related to it, then you're probably close to the code that you're searching :)

                  xevdev 1 Reply Last reply Reply Quote 3
                  • xevdev
                    xevdev F @PB____ last edited by

                    @PB____ I fully concur but I'm gunna steal emenies as my enemies from now on.
                    And thank you for pointing out the small overhead.
                    In one program I'm doing I'm calling a function in a function in a function a massive amounts of times every frame and I should know better !!!.

                    1 Reply Last reply Reply Quote 1
                    • PB____
                      PB____ last edited by PB____

                      Ideally calling a function should not have much overhead at all, so normally you should not feel bad about calling functions in functions. Although of course you can write very obscure code with many functions calls as well, so using functions is not a goal in itself either...

                      Now of course, we can't and shouldn't ever expect a professional grade coding environment from fuze (it's for recreational / educational use), so in Fuze the overhead of calling a function may be a bit higher. But still, most people aren't creating the next Zelda in Fuze either. So in my opinion, it's better to prioritize the skill to optimize code for maintainability over performance. Only when you do notice performance drops anywhere, then you should optimize for performance where required (and because you have maintainable code, and it's easy to make changes).

                      Now I don't mean to outpope the pope either. and I'm not saying that all the code that I've written is optimized for either maintainability or performance. Sometimes I just like to be a little creative with how I solve things in stead. I'm just giving my personal opinion on how priorities should be in an ideal world :)

                      EDIT: I feel like I should add to this. Of course, the skill to write well performing code is important too. And sometimes the performance is actually more important than the maintainability. For example, if you write a python interpreter, then performance would be of a higher priority compared to when you're writing a menu system :)

                      xevdev 1 Reply Last reply Reply Quote 3
                      • xevdev
                        xevdev F @PB____ last edited by

                        @PB____ I
                        I agree with your answer. Totally.
                        I love fuze.
                        I just want my program to run faster.
                        So I look for faster ways.
                        I'm just pushing it.

                        1 Reply Last reply Reply Quote 2
                        • First post
                          Last post