One design principle can increase development speed for prototypes

One design principle can increase development speed for prototypes

Hyper casual prototypes demand speed. It's not about reinventing wheels but rather it's about reusing wheels that were once created by other developers or more importantly by you. It doesn't mean that you need to create full-fledged tools to reuse later. It is about making independent scripts that you can reuse later. If this can be made into a habit, it can take you a long way.

My favorite game design principle is the 'Single Responsibility Principle because I use it so much and it has led me to reduce my development time by a lot. What it basically means is that each script should have only one responsibility. For example, in a shooter game where the player moves forward and shoots automatically (Imagine Snakes vs Blocks), what we usually do for prototypes is that we create a Player.cs and put in the shoot, movement, and input code all in there. It's throwaway prototype code, right? What's the harm? But if we do this a bit differently there can be speed boosts later on. Instead of putting it all in there, we create a SwerveInput.cs to take the input from the user, a SwerveSideMover.cs that connects the input with the movement, a ForwardMover.cs, and finally an AutoShoot.cs that does the auto shoot. The idea is to make the scripts as independent as possible.

In the future when you are in need of a swerve input and movement system again you can just reuse the SwerveInput.cs and SwerveSideMover.cs scripts and get going. If you keep doing that for more and more prototypes at one point you will have different sorts of input systems and you can just keep reusing them in the future.

Taking it one step forward, you can keep all the scripts that you can later reuse on a separate folder with a separate assembly so that it doesn't contribute to the compile-time as there's a very little chance you will edit it again.

What if you need to enter some project-specific code there? Let's say in the AutoShoot.cs you need to instantiate a particle effect. Create an Action event, invoke it at the right time. Then you can create a project-specific script like AutoShootCommunicator.cs and then subscribe to the event and put project-specific code there.

When you start to follow these rules, it becomes a habit pretty soon and you start to create an arsenal of ready scripts made by you on earlier prototypes ready to go


要查看或添加评论,请登录

Rakib Jahan的更多文章

  • Reduce iteration time to speed up your workflow in Unity

    Reduce iteration time to speed up your workflow in Unity

    I am a hyper-casual game developer. More specifically, I create hyper-casual game prototypes.

    3 条评论
  • Replace "switch" with Scriptable Objects in Unity

    Replace "switch" with Scriptable Objects in Unity

    One of the design patterns in programming in Open-Closed Principle. It is part of the standard SOLID principles and…

    4 条评论
  • Zenject Dependency Injection, First Impression review

    Zenject Dependency Injection, First Impression review

    Dependency Injection is a very important concept in general, not just for games, but also for in general coding…

    4 条评论
  • Unity Game Programming: Bad Singletons

    Unity Game Programming: Bad Singletons

    If ( you only make short games || you don't care about clean code || you don't intend to make your code extensible)…

    8 条评论
  • Hyper casual Gameplay Good-to-Know's

    Hyper casual Gameplay Good-to-Know's

    This is a few list of features that I picked up or learnt along the way by myself or different articles, videos which…

  • InvokeRepeating VS Coroutine

    InvokeRepeating VS Coroutine

    For many, it is a lingering question. Should I use coroutine or InvokeRepeating? Performance wise it doesn’t matter…

    3 条评论
  • Speeding up UI workflow in Unity: DoozyUI + DoTween

    Speeding up UI workflow in Unity: DoozyUI + DoTween

    Unity asset store has a lot of assets. You can find assets for almost anything at this point.

  • Hyper Casual Game 1: Boomerang Throw

    Hyper Casual Game 1: Boomerang Throw

    Hyper casual games are cool! Fast prototyping, nifty mechanics, simple gameplay. The target audience is not specific.

  • Using Native C# Events in Unity

    Using Native C# Events in Unity

    EventSystem_Native Github: https://github.com/rakibj/Unity-Helper/tree/master/Assets/_UnityHelper/EventSystem_Native It…

社区洞察

其他会员也浏览了