playMaker

Author Topic: Perlin Noise Float  (Read 1682 times)

Red

  • Hero Member
  • *****
  • Posts: 563
    • View Profile
Perlin Noise Float
« on: June 03, 2015, 11:03:06 AM »
An action I whipped up the other day for use in a camera shake algorithm... I needed a random value to animate with and I found the perlin noise function.

*NOTE* At this time, the non-declared axis is a randomly chosen value. If the general consensus is that this should be given the option (such as a "use random" bool and a "choose value" float input) to choose where on the other axis this scans across, I can add that in (I think.)

How to use this action:
  • Choose which axis to scan across. This works in either the X or Y. This option is only in there so as to allow some additional variation on the output in case you use multiples of this action.
  • Set the output variable (Float.) *NOTE: At this time I haven't figured out how to make it only use a variable... If you know, please let me know as well as I think having it open to only producing a value and not depositing it into a variable is pretty counter-productive. If you know the action(s) I should reference, please let me know.*
  • Set the multiplier. This is for if you want to either amplify or diminish the value within the action so you can save yourself having to multiply it manually with another action. Just felt right to add it in.
  • Set the noise speed. This sets how fast the sampling will scan across the chosen axis.
  • Set whether this is every frame or only once. (So, if you wanted a random value only once, you can use this... But realistically, the "random float" is probably better... But hey, it's there in case you wanted to use this either only once or every frame.)

This only produces a positive value and if you leave the multiplier as 1 then it will only produce a value between 0 and 1.

If you have any tips, suggestions or critiques of this, feel free to let me know. Anything I can do to improve this action (and by extension my own knowledge/skills at coding) is more than appreciated.
« Last Edit: June 03, 2015, 11:14:26 AM by Red »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 14342
  • Official Playmaker Support
    • View Profile
Re: Perlin Noise Float
« Reply #1 on: June 03, 2015, 11:25:05 AM »
Hi,

 I made an action a while ago on perlin noise as well :) But your version has a multiplier, which is a great little plus.

 Bye,

 Jean

Red

  • Hero Member
  • *****
  • Posts: 563
    • View Profile
Re: Perlin Noise Float
« Reply #2 on: June 03, 2015, 11:30:54 AM »
Aaah, whoops! Didn't know that when I put this together.

mdotstrange

  • Hero Member
  • *****
  • Posts: 551
    • View Profile
    • Can't code? Who cares! Make games anyway!
Re: Perlin Noise Float
« Reply #3 on: June 03, 2015, 04:00:10 PM »
Cool  :) Thank you!
Indie game dev and instructor at the Strange School. Learn Playmaker at the Strange School!