I have tried this tutorial twice, I know how OOP works. The only problem is I can’t understand most of the cframe stuff.
should I learn linear algebra first before attempting this tutorial again?
I have tried this tutorial twice, I know how OOP works. The only problem is I can’t understand most of the cframe stuff.
should I learn linear algebra first before attempting this tutorial again?
It is good to get a hold of vectors, their operations, etc. since CFrames are closely tied with the concept of vectors.
Here is a good tutorial:
Also, it’d be good to brush up on matrices as well since there is an article on the Hub dealing with heavy CFrame matrix math.
are there any prerequisites for vector math? I haven’t taken calculus yet
You don’t need calculus or linear algebra/matrices, not at all.
You just need to have a good intuitive understanding of how vector math works, i.e. vector addition/subtraction, vector scaling, dot product, cross product. The best way to get that understanding is reading in any highschool- level maths textbook and/or [Khan Academy](are there any prerequisites for vector math?) and using what you learn to program games.
Honestly you could even make a placement system that uses almost no vector math just by using parts in grid that represents where things can be placed, and then placing things on whichever grid tile is being clicked.
Here’s a video that covers a lot of the math you’ll need to program games: Essential Mathematics For Aspiring Game Developers - YouTube
Yes, algebra, geometry and basic trigonometry. Introductory vector math is often categorized under linear algebra, but you don’t need the matrix interpretation stuff.
I’m interested in learning about vector scaling, dot product and cross product, do you think a pre-calculus base is enough for me to understand?
I’m not sure what pre-calc is because I didn’t have anything called that in my high school, but on the Khan Academy pre-calc course list, the only things you need are trig and vectors. If you’re familiar with everything in that course list then you’re more than set.
The only thing you really need linear algebra for with regards to something like a grid placement system is if you really care about and want to know the details of how rotation is represented by CFrames. There’s other ways of dealing with rotation built-into the CFrame class though so you pretty much never have to touch the matrix representation.
Those are defined using pretty simple algebra, the rest is just getting to understand what those things look like in 2D and 3D, or their geometric interpretations and in which situations they’re used.
But this is all kind of overkill if you just want to make a grid placement system.
I am still in middle school, I haven’t done any geometry, trigonometry, calculus etc. I was able to make a grid placement system for my old game. I don’t think you need any of those things, it’s mainly just using your scripting knowledge, some trial and error and you will figure out a way in no time.
You should be able to understand linear algebra pretty easily.
I don’t even think you really need to know linear algebra (basic lin algebra if that) I did a grid placement system except mine was on A GUI. Many complex game concepts do use linear algebra but I don’t feel it falls into that category.
Example here : https://gyazo.com/add2fafb1c04906702e6699ab3ce7dea
Grid placement systems revolve simply around rounding values and making sure the appropriate placement math lines up. The rounding up is important for grid placement in particular as if you have a slight deviation (A number that is in the form of a decimal) it will throw the placement or sizing of whatever your trying to do off.
You just need to be able to approximate where things should land based on your object sizes.
Things like math.clamp, math.floor, math.ceil helped me tremendously when making my view engine.
just to add to what I am talking about.
But if you wanted to figure out how big something would need to be relative to the size of your tiles you would simply do
math.ceil(inputsize / gapsize)
now that is only for one axis but I hope that helps.
than to figure out the position for one of the axis you would do something like this…
math.ceil((inputposition / gapsize) * gapsize)
I really hope that helps you get steered in the right direction, Best. Boston.