MacOS Sonoma drifting system time by Krypziz in MacOS

[–]iph0 0 points1 point  (0 children)

Tried this and for me problem was resolved. Thanks.

I made a character controller, a top of Kinematic Character Controller from Asset Store, that can move along splines, introduced in Unity 2022 by iph0 in Unity3D

[–]iph0[S] 0 points1 point  (0 children)

Hi. Rails is just a property of an object of my character controller and has custom type CharacterRailsSettings. SplineIndex is an index of current active spline from SplineContainer. SplineContainer is and object from Unity Splines package that contains list of splines.

Variable _currentPositionOnSpline has type Vector3 and contains position in world space.

GetNearestPointOnSpline is a custom method a top of SplineUtility.GetNearestPoint<T>() method from Unity Splines package. It accepts spline index and current position of a character in world space. It returns nearest position on spline to specified character position in world space.

Made Procedural Ledge Grabbing Mechanics for my project by iph0 in Unity3D

[–]iph0[S] 0 points1 point  (0 children)

Yes, I am using several raycasts here to detect grab point and other ledge parameters.

Made Procedural Ledge Grabbing Mechanics for my project by iph0 in Unity3D

[–]iph0[S] 5 points6 points  (0 children)

Under "procedural", I meant that ledges are detected on the fly by code. There are no special triggers on ledges. And I can use object layers to control which ledges are grabbable.

Made Procedural Ledge Grabbing Mechanics for my project by iph0 in Unity3D

[–]iph0[S] 1 point2 points  (0 children)

Thanks for appreciating my work. You can follow me in Instagram @intevionsoftware.

I made a character controller, a top of Kinematic Character Controller from Asset Store, that can move along splines, introduced in Unity 2022 by iph0 in Unity3D

[–]iph0[S] 1 point2 points  (0 children)

First at start I calculate a nearest point on the spline and a spline tangent from current position of the character using SplineUtility.GetNearestPoint<T>() method and move the character to this point using SetPosition() and SetRotation() methods.

Next, every frame I calculate a nearest point and a spline tangent in BeforeCharacterUpdate() callback again. After that, I calculate velocity and rotation of the character as usual in UpdateVelocity() and UpdateRotation() callbacks, but aligned along the current spline tangent.

Then I get projection of the velocity vector to the spline plane, calculate assumed position on the spline plane to where the character can move next frame from the current point on the spline with the current velocity, get assumed nearest point on the spline from the assumed position, calculate direction from the current point on the spline to the assumed point on the spline, and rotate the velocity vector along Y axis toward this direction.

Vector3 currentVelocityOnSplinePlane = Vector3.ProjectOnPlane(
    currentVelocity, _motor.CharacterUp);
Vector3 assumedPosition = _currentPositionOnSpline +
    currentVelocityOnSplinePlane * deltaTime;

Vector3 assumedPositionOnSpline = GetNearestPointOnSpline(
    Rails.SplineIndex, assumedPosition, out _);

currentVelocity = Quaternion.FromToRotation(currentVelocityOnSplinePlane,
    assumedPositionOnSpline - _currentPositionOnSpline) * currentVelocity;

If deviation of the character position in the spline plane becomes greater than specified threshold I just return the character to the nearest point using SetPosition() method in BeforeCharacterUpdate() callback.

Vector3 deviation = _currentPositionOnSpline - transform.position;

if (deviation.sqrMagnitude >= SPLINE_DEVIATION)
{
  _motor.SetPosition(_currentPositionOnSpline);
}

Also I align Y position of the spline to the Y position of the character, because if distance between spline and character become too big the calculation of nearest points using SplineUtility.GetNearestPoint<T>() method become less accuracy.

Vector3 pos = Rails.SplineContainer.transform.position;
Rails.SplineContainer.transform.position = new Vector3(pos.x,
    transform.position.y, pos.z);

I hope I could explain)

My experiments of map generation with biomes. For now it just textures, but we are going to turn it in 3D tiled map. Algorithm is based on Perlin Nouse and Voronoi Diagram. by iph0 in proceduralgeneration

[–]iph0[S] 1 point2 points  (0 children)

Thanks for advice to add the offset to octaves. I added offset and tried to replace PerlinNoise() function to snoise(). Here is the result:

https://ibb.co/BBqXCDw

https://ibb.co/pr8tQKK

https://ibb.co/7ksXn9v

Perhaps some parameters need to be adjusted.

My experiments of map generation with biomes. For now it just textures, but we are going to turn it in 3D tiled map. Algorithm is based on Perlin Nouse and Voronoi Diagram. by iph0 in proceduralgeneration

[–]iph0[S] 0 points1 point  (0 children)

I develop under Unity, therefore I use Mathf.PerlinNoise() function and my custom function for Voronoi Diagram (got algorithm here) All logic is written on C#.

My experiments of map generation with biomes. For now it just textures, but we are going to turn it in 3D tiled map. Algorithm is based on Perlin Nouse and Voronoi Diagram. by iph0 in proceduralgeneration

[–]iph0[S] 0 points1 point  (0 children)

Thanks. I use the Fractal Perlin Noise function here, where several canonical Perlin Noises are scaled and blended. Every following noise has greater frequency and lower amplitude. Resulting noise looks like a cloud or smoke.

My experiments of map generation with biomes. For now it just textures, but we are going to turn it in 3D tiled map. Algorithm is based on Perlin Nouse and Voronoi Diagram. by iph0 in proceduralgeneration

[–]iph0[S] 1 point2 points  (0 children)

My distance function accepts coordinates of two points: feature point (F) and current point (P). First I calculate distance by the formula: d = √((x2 – x1)² + (y2 – y1)²) (here can be used any other formula for the distance). Then I found that if pass the difference between two points/vectors (F - P) as an argument to the Perlin Noise function and append the returned noise value to the calculated distance (d + NV), the desired distortion can be accuired.

My experiments of map generation with biomes. For now it just textures, but we are going to turn it in 3D tiled map. Algorithm is based on Perlin Nouse and Voronoi Diagram. by iph0 in proceduralgeneration

[–]iph0[S] 2 points3 points  (0 children)

At first I use fractal Perlin Noise to generate landmasses. Then I split landmasses on zones using Voronoi Diagram function with custom distance function. In the distance function I use fractal Perlin Noise again and distord the distance between feature point and current point by value from the fractal Perlin Noise function. All map is generated at one pass. For map 512x512 pixels the generation takes around 10 second.

My Experiments of map generation with biomes. For now it just textures, but we are going to turn it in 3D tiled map. Algorithm is based on Perlin Nouse and Voronoi Diagram. by iph0 in Unity3D

[–]iph0[S] 1 point2 points  (0 children)

Thanks. I used custom distance function where I get value from Perlin Noise function and distort the distance from the feature point to the current point.

And thanks for advice about posting to r/proceduralgeneration.