User Tag List

Page 1 of 2 1 2 LastLast
Results 1 to 10 of 19

Thread: Any tutorials on writing maintainable code in Fusion?

  1. #1
    Clicker Install Creator Pro
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    Darkhog's Avatar
    Join Date
    Jan 2009
    Location
    /dev/null
    Posts
    482
    Mentioned
    7 Post(s)
    Tagged
    0 Thread(s)

    Any tutorials on writing maintainable code in Fusion?

    Fusion lends itself so well to spaghetti code and I want to avoid it as much as possible. Any tutorials that would help me with that?

  2. #2
    Clicker Install Creator Pro
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)Firefly 3D Module (Steam)
    defisym's Avatar
    Join Date
    Jun 2017
    Location
    Asia
    Posts
    508
    Mentioned
    12 Post(s)
    Tagged
    0 Thread(s)
    Then it comes to software engineering...
    Something like low coupling, high cohesion, open close principle, etc.

    Remember: no sliver bullet.
    Remember: no matter how careful you designed, finally your code will be a mess (or to say rudely, a mountain of s***)

  3. #3
    Clicker Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    Volnaiskra's Avatar
    Join Date
    Jan 2014
    Location
    www.sprykegame.com
    Posts
    3,018
    Mentioned
    133 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by defisym View Post
    Remember: no matter how careful you designed, finally your code will be a mess (or to say rudely, a mountain of s***)
    I disagree with this. Code is like a room: if you have a messy mind, you'll have a messy room. If you have an organised mind, you'll have a tidy room. By default, I have a messy mind. The code in my game was a horrible bird's nest in the early years. It was so bad that I had to redo a lot of it because I didn't know how it worked, or couldn't prevent bugs. It was unpleasant, and my large project was at risk of becoming unmanagable. So out of sheer necessity, I had to learn to be much more organised - and I've gotten much better at this over time.

    I would say that my code is very well organised now. I can look at a section that I wrote 3 years ago and, though I can't even remember writing it, it only takes me a minute to understand how it works, because it's well organised, self-contained, and well commented. And because everything's as modular and compartmentalised as I can make it, changing one thing here rarely breaks another thing there (or at least, not drastically). I'm slowly nearing the end of the programming, and the most complicated work is behind me, so I expect the code will remain readable all the way till the end.

    It takes a fair bit of work and self-discipline to keep your code organised, but it's made my life much more enjoyable and has made the game better. And it's not super-complicated. You just have to always be mindful of future-you, and make sure that he will have everything he needs to understand what you're doing. So you comment everything, label everything, group things logically, color code things, write instructions for yourself where needed, etc.

  4. #4
    Clicker Install Creator Pro
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)Firefly 3D Module (Steam)
    defisym's Avatar
    Join Date
    Jun 2017
    Location
    Asia
    Posts
    508
    Mentioned
    12 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Volnaiskra View Post
    I disagree with this. Code is like a room: if you have a messy mind, you'll have a messy room. If you have an organised mind, you'll have a tidy room. By default, I have a messy mind. The code in my game was a horrible bird's nest in the early years. It was so bad that I had to redo a lot of it because I didn't know how it worked, or couldn't prevent bugs. It was unpleasant, and my large project was at risk of becoming unmanagable. So out of sheer necessity, I had to learn to be much more organised - and I've gotten much better at this over time.

    I would say that my code is very well organised now. I can look at a section that I wrote 3 years ago and, though I can't even remember writing it, it only takes me a minute to understand how it works, because it's well organised, self-contained, and well commented. And because everything's as modular and compartmentalised as I can make it, changing one thing here rarely breaks another thing there (or at least, not drastically). I'm slowly nearing the end of the programming, and the most complicated work is behind me, so I expect the code will remain readable all the way till the end.

    It takes a fair bit of work and self-discipline to keep your code organised, but it's made my life much more enjoyable and has made the game better. And it's not super-complicated. You just have to always be mindful of future-you, and make sure that he will have everything he needs to understand what you're doing. So you comment everything, label everything, group things logically, color code things, write instructions for yourself where needed, etc.
    Good architecture design only delays the arrival of the doom day. If the demand changes frequently (this is very common in indie game development, you will often come up new ideas and add new mechanisms halfway), or the logic is complex enough, or each module and feature’s development time is not that abundant, etc, all of these will eventually lead to inevitable chaos. The only solution is re-construction, from hierarchy level to code level. The cost is just acceptable for most of indie developers, who has plenty time to do so and doesn’t have a strict deadline.

  5. #5
    Clicker Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    Volnaiskra's Avatar
    Join Date
    Jan 2014
    Location
    www.sprykegame.com
    Posts
    3,018
    Mentioned
    133 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by defisym View Post
    ...you will often come up new ideas and add new mechanisms halfway....or each module and feature’s development time is not that abundant, etc......all of these will eventually lead to inevitable chaos.
    Throwing unexpected and complicated mechanics halfway into a project, spending too little time on features....these things aren't inevitabilities at all. They're just people being lazy and undisciplined. They're avoidable mistakes. If you have a chaotic mind or chaotic habits, you'll produce chaotic work. That's fine, but don't blame the universe for your own chaos.

  6. #6
    Clicker Install Creator Pro
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)Firefly 3D Module (Steam)
    defisym's Avatar
    Join Date
    Jun 2017
    Location
    Asia
    Posts
    508
    Mentioned
    12 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Volnaiskra View Post
    Throwing unexpected and complicated mechanics halfway into a project, spending too little time on features....these things aren't inevitabilities at all. They're just people being lazy and undisciplined. They're avoidable mistakes. If you have a chaotic mind or chaotic habits, you'll produce chaotic work. That's fine, but don't blame the universe for your own chaos.
    That's why indie developers need decades to release their project, including me.

  7. #7
    Clicker Install Creator Pro
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)Firefly 3D Module (Steam)
    defisym's Avatar
    Join Date
    Jun 2017
    Location
    Asia
    Posts
    508
    Mentioned
    12 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by defisym View Post
    That's why indie developers need decades to release their project, including me.
    Spent too much time to make code to be so called “neat and elegant”……

  8. #8
    Clicker Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    Volnaiskra's Avatar
    Join Date
    Jan 2014
    Location
    www.sprykegame.com
    Posts
    3,018
    Mentioned
    133 Post(s)
    Tagged
    0 Thread(s)
    It's better than letting your spaghetti code eventually outgrow your ability to manage it, leading to abandoning the project in despair. My project was in danger of that after the first couple of years.

  9. #9
    Clicker Install Creator Pro
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    Darkhog's Avatar
    Join Date
    Jan 2009
    Location
    /dev/null
    Posts
    482
    Mentioned
    7 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by defisym View Post
    Then it comes to software engineering...
    Something like low coupling, high cohesion, open close principle, etc.

    Remember: no sliver bullet.
    Remember: no matter how careful you designed, finally your code will be a mess (or to say rudely, a mountain of s***)
    Yeah, I already know about the general principles, but don't know how to apply them in Fusion due to the nature of the click code. Plus, I don't know how to use Fusion-specific features (that aren't in regular programming languages) to make the code even more maintainable.

  10. #10
    Clicker Install Creator Pro
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    Darkhog's Avatar
    Join Date
    Jan 2009
    Location
    /dev/null
    Posts
    482
    Mentioned
    7 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Volnaiskra View Post
    It's better than letting your spaghetti code eventually outgrow your ability to manage it, leading to abandoning the project in despair. My project was in danger of that after the first couple of years.
    Could you share your wisdom and how you organize your code? Because my current game has a likelihood of becoming such a mess.

Page 1 of 2 1 2 LastLast

Similar Threads

  1. Looking for Tutorials for 3D in Fusion
    By tobydavis in forum Fusion 2.5
    Replies: 0
    Last Post: 15th March 2020, 05:43 PM
  2. OpenGL Tutorials for Fusion 2.5
    By Akshay in forum Fusion 2.5
    Replies: 5
    Last Post: 17th May 2017, 06:30 PM
  3. Writing a language interpreter in Fusion
    By Hydra in forum Fusion 2.5
    Replies: 5
    Last Post: 5th March 2015, 09:06 PM
  4. Seeking more code-centric beginner's tutorials...
    By Wolfsong73 in forum Fusion 2.5
    Replies: 4
    Last Post: 18th November 2014, 12:02 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •