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@Tratax maybe this will help you out. If you find anything else that wasn't mentioned in the thread, let me (or us) know. I'm always curious about those things
-
Thanks all, ill check out the suggestions in the thread
I think my problem is a good one to have in that I'm quite comfortable in making a demo thanks to Fuze, its now just learning concepts of how do I design the "flow" of things (example.. a full 3d rpg is quite a massive project.. so how do I structure my functions? should they have individual purposes? when do I return values? is it ok to have everything return void? etc :)
-
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. ;)
-
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.
-
My rule of thumb for when to make a custom function is
-
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).
-
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 :)
-
-
@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
-
@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/29No, I meant this one as it goes:
https://fuzearena.com/forum/topic/1129/good-articles-found-on-the-web -
@Jongjungbu said in Any recommendations for good game design books/websites?:
My rule of thumb for when to make a custom function is
- 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.
-
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 fromcheckEnemy
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 :)
-
@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 !!!. -
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 :)
-
@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.