math

  1. figures

    2D topdown tile collision, keep moving if not blocked in one direction when moving diagonally

    Hi, So basically I used an example 2D tile collision method from medium.com and have made some slight changes to improve it for my situation. It works great for 32px x 32px sprite and 16px tileset. I'm trying to figure out what I need to do to add "wall sliding": What I mean is basically say...
  2. kamiyasi

    How to calculate a bell curve?

    I am trying to figure out the math for a Gaussian Function or Normal Distribution bell curve. This is the equation given for this, but I'm having trouble figuring out how to make use of it for my purposes. This is what I need to be able to do: Input the following values: The width of the...
  3. tomtinderbox

    GMS 2 How to calculate steps needed for lerp() to hit target value in step event?

    Greetings, I'll come in hard and true: I suck at mathematics. I know that: xx = lerp(xx, 10, 0.25); Can also be written as: xx = xx + ((10 - xx) * 0.25); Let's say I give xx a starting value of 100 in a create event and I put the lerp() function above in the step event. How can I calculate...
  4. Xor

    Discussion Interesting Math

    A couple days ago I asked the question "If there was a clock that halves it's speed every 12 hours, when would it reach midnight?". This spurred a long discussion about different ways to interpret the problem and a variety of answers. Which brings to my attention that there are several people...
  5. Freddie The Potato

    3D Find Intersection in Rectangular Prism With Directional Vector

    Hola! While writing a script to resolve 3D collisions, I encountered a problem and I can't quite figure it out! I have a rectangular prism with varying width, height and depth. I also have a point located within this prism (A) and a normalized directional vector (d). If a ray is cast from A...
  6. HayManMarc

    GMS 2 (SOLVED)Calling math wizards! (help making arc)

    Hey all, Are you ready? MATH CHALLENGE!! Are you excited? I hope you're excited. Actually, I'm hoping someone around here is great with maths and can help me out. I do okay with math, and can usually, eventually find the answer for things that are not too complicated, but this one is...
  7. PhallicSpleen

    [SOLVED] finding ellipse intersection with line

    I've been trying to figure this out for a while and haven't found the answer. Given: Height of ellipse, Width of ellipse, Xposition of vector, Ypostion of vector, Direction of vector. Find the distance to the edge of the ellipse starting at the vector (x,y) and moving in its direction. I've...
  8. mbeytekin

    quaternion to 2d angle

    I've a little personal project about converting mocap data from 3ds max ASE file to Spine skeletons. I have no idea about quaternion conversions and after searching forum I found quaternionGetx and other scripts by Slayer64 But after trying a lot of combinations couldn't get usable results...
  9. Binsk

    Asset - Scripts UBG Math [vectors, quats, and matrices]

    I don't know about you but I really get tired of re-implementing vector and matrix math for every 3D project started. This extension is my solution. I decided to make a professional library that integrates well as if included in the engine by default. You can purchase the extension via the...
  10. Divinik

    GML Make status bar stay the same size?

    I'm a bit of a math dummy, I was wondering if it was possible to make a, for example, health meter stay the same size, even if the character's max health went up?
  11. FloresSottile

    Random with memory

    I'm working on a game that helps kids develop math quickness in times table exercises and I'm trying to figure out what's the best approach to put on screen exercises randomly but with memory, so that every round a new exercise appears, but its multiples are different than the ones in the...
  12. P

    Need help with simple equation

    Hi everyone, I'm having completing what I feel is probably a simple equation to complete a simple action. What I'm trying to do is make a simple lighting system. I have an object "oLight" and as I walk past it, my shadow casts in the opposite direction. It works well, however, I'd like to make...
  13. Edwin

    GML Need help with comparing expressions.

    Hello, friends! I've got a little question about comparing values with if condition, so when I check the value if it's equal to 0, I check if it's value is equal to 0.0000 or it's value is between the 0.0000 and 0.9999? Some of my variables have non-integer values in my game. So if my first...
  14. Gasil

    GMS 2 (Solved) Help with a small math problem D':

    EDIT: Holy crap, my english is truly bad, I'm sorry about that. I meant this: Step Event. A = 15; B = 15; C = 20; if (A + B > C) { A += B - ...; } At the next step B is adding its value to A (15 + 15 = 30), however B will make A to become higher than C (30 > 20), and I don't...
  15. giraffeman210

    Drag And Drop Division symbol?

    I am using gms2 dnd and I know you can use * for multiplication but is there a symbol for division? I feel silly asking this but I can't find it for some reason Thanks!
  16. S

    GML Making mathematical graphs

    Hi there, I am using Game Maker 8.0 pro to build an evolution simulator. What I need to do now, is to write a script that could draw a cartesian graph (X-Y) from a table of values that are stored in a grid. It would be like turning the following into a continuous line on the screen: x y 1 10 2...
  17. MagnumVulcanos

    GMS 2 (Solved) Trignonometry butcher thread! I need help folks

    SOLVED! dsin is the function that should have been used instead of sin. Big difference it seems. I am at a loss, it might be because I am applying sin() wrong... I want to find a missing length of a triangle and I can't. I am checking: a = c·sin(A)/sin(C) But the other values don't add up...
  18. P

    Legacy GM 3D Bounding Box [SOLVED]

    I'm trying to create a function analogous to point_in_rectangle() for checking if an object is in a 3D area. My idea was to, first, check if the distance between the center of the region and the object being checked is less than or equal to one half of the diagonal of the cube (the diameter of...
  19. A

    GML Jump math

    Maybe someone with better maths skills than mine can help me figure this out. Basically, if I know my character sprite is 32x32 and my floor tiles are also 32x32, knowing that I want my jump duration to last exactly 1 sec (0.5 s to reach peak height) and I want to be able to jump 64 pixel high...
  20. Nabil Kabour

    Dividing Square/Rectangle into Multiple Squares of Random Side Lengths

    I want to divide a square or rectangle of an integer side length into a desired number of squares of random integer side lengths. I need this to create an effect where an object is shattered into multiple pieces. In the destroy event of the object to be shattered, multiple piece objects are...
Top