Author: DylWithlt
Introduction
As stated in the introduction there is one thing above all others that will help you in coding and in life that that is ⭐ problem solving ⭐. In this introduction to scripting we will first introduce you to the fine art of solving your own problems. The importance of this one article cannot be stressed enough, if you’re a clever person this will be the only article you will ever need from this server, but once you understand you’ll most likely want to use this server as the valuable resource that it is.
Solving All Your Problems
Now due to the nature of this type of article we have to keep it vague to be widely applicable to all problems. That being said without further adieu let’s begin.
Define Your Problem
“Know your enemy and know yourself and you need not fear the result of a thousand battles.” - Sun Tzu, Art of War.
The first step to solving your problem is understanding your problem. When approached with an obstacle you first come up with a problem statement. This is a broad idea of your goal written as simply as possible. Doing this step and figuring out how to word it will help your brain start to think of ideas.
Examples:
I want to make a fighting game.
I want to make realistic water.
I want to make a gun.
I want to get to the other side of a fence.
I want to make a game like soccer.
Refine Your Problem - Understand Your Constraints
Once you know what your problem is you should be able to make more specific inferences about it. Specific parts of it that you want as apart of your solution to have it fit exactly what you want. Understanding the nuances and specifics of what you’re trying to do will be vital when you consider methods of approach because some specifications may rule out certain things you can do. Understanding the constraints of what you need out of your solution is often much more important than what you’re actually trying to do, and especially if you’re communicating to others it will help them understand exactly what you want. This is the creative part of creation and problem solving.
Examples:
I want to make a fighting game with multiple characters and an emphasis on doing combos.
I want to make realistic water with an emphasis on how the water moves and a willingness to compromise on performance for visual fidelity.
I want to make a gun that can aim down sights, lean, and reload, I want to have projectiles that actually fly through the air.
I want to get to the other side of the fence and I want to be airborne while I'm doing it, I don't want to damage the fence in anyway.
I want to make a game like soccer with AI characters and a strong emphasis on realistic rules and an enjoyable dribble mechanism.
Research
This is the part where you save yourself time and effort. If you’re trying to solve a problem that’s already been solved then you can focus more on the creation rather than the details. Learning to make use of the resources available to you, such as this server, and google, and the developer hub, and anything else you can get your hands on is vital. Everyone who has ever made great things has learned from the people before them, that means looking up resources, or solutions to problems you may be having is apart of solving any problem. The more you know about your possibilities of approach the better your solution will be.
That being said there are DANGERS to research that can hurt you if you’re not careful. Not trying to understand your problem better from your research can result in you stealing work and using resources incorrectly which will not only result in you being worse at what you’re doing but it will also result in you not being able to solve your problems and or future problems because of it. Never use resources to solve your problems without first understanding them, always accept the possibility that a resource could be wrong or not up to date. You can use resources TO understand them just don’t use them to solve a problem without understanding them.
There are sections on the developer hub that are outdated and contradictory, there are public modules that have limitations, there are resources with large followings that will make your problem more difficult. Always think for yourself and your problems will become easier to solve over time.
Brainstorming
So you’ve scoured the internet, you’ve read and watched every relevant tutorial, you’ve defined your problem, you know exactly what you want to the most important details and now you’re ready to think about how you’re gonna fix the problem. In this step you should start theorizing possible solutions to your problems from a more technical stand point. Depending on how research went this can be the easiest step or the hardest step depending on how much thinking you have to do on your own.
If you’ve refined your problem statement enough you will have ideas on things that need to be completed. This is the step where you take that idea that you’re not sure how to solve and break it down into pieces that you MIGHT know how to solve. It starts with analyzing the different steps you definitely need a solution for to solve the larger problem. This is an amalgamation of the research you’ve done, your knowledge of the possibilities, the environment you’re working in, your creativity, and your understanding of the problem and its exact specifications.
Example 1:
I want to make a PB & J
I know in order to make a PB & J I'm definitely going to need peanut butter, jelly, and bread.
I know that in order to make bread I'm going to need to get it from somewhere so maybe I'll go to the store or maybe I could make my own with some flour, water, and yeast.
I know that in order to make jelly I'm going to need to either buy some jam at the supermarket or I can harvest some berries and crush it up and mix it with sugar myself.
I know that in order to make peanut butter I'm going to need to either buy some peanut butter at the supermarket OR I can harvest some peanuts from a plant and turn it into butter.
I also know that there needs to be some kind of assembly step in order to put these things together and that will require tools. I will most likely need a knife for that.
Identifying these requirements and potential solutions to them is how you’ll get what you want.
Example 2:
I want to make a shooter game.
I want it to be a top down shooter game that lets you pickup multiple kinds of weapons.
I want each weapon to fire differently.
I know that the player needs to spawn in.
I know that I will need to do something with the camera to make it top down.
I know that I want the player to face the mouse.
I know that I want I want bullets to come out of the gun.
I know I'll probably want enemies or other players.
I want bullets to do damage when they hit players.
I want mouse inputs to trigger firing.
I want bullets to do damage to players, most likely by getting the humanoid.
MORE RESEARCH
Now that you have solutions to everything you KNOW how to do and you know all the things you DONT know how to do it’s time to go back to research. Look up solutions or think of ideas for each problem you weren’t sure how to solve.
Implementation
It’s finally time to do something about this problem. You know the steps, you know the problems you have to solve and you can probably create a logical order in which they need to be solved. The final step is to try to put it into practice. Create your scripts, write the code, solve your problem. Get the ingredients, put them together, enjoy your PB & J.