MonoGame.SplineFlower - Create wonderful smooth Bézier-, CatMulRom- and Hermite-Splines!

Awesome thank you very much :slight_smile:

New packages up!

Try it with version 1.3.0.1:



Nice one mate, all working now :slight_smile:

If your curios, we are going to use it for creating attack patterns in a side scrolling shoot em up. Exactly the tool we needed you had made!

1 Like

Nice to hear!

Feel free to share your creations :slight_smile:

Just a heads up really. The splines are working nicely, but I am unable to target android / ios using the nuget package due to the fact the dll’s are compiled to target .net framework 461. It seems that xamarin is effectively locked down to 4.5 (or at least it is inadvisable to use any higher)

I think I would need to move / port the project to .NetStandard to properly support multiple target frameworks.

You could download the source code from GitHub, add the needed libraries to your xamarin project, change the .NetFramework version and see if it works for you.

1.4.0 - Find Nearest Point on Spline Feature!


Yeah, time for a new update!

Hello folks!

Long time since we last talked about this spline library, but finally… something new!

Watch the video first:

When working with splines in game or software development, it’s often important to get the nearest point on a spline from a specific position in the world / render view.

But why?

Imagine the following scenario in a game:

You have 2 different spline tracks and you want an enemy unit to travel on both, but this unit does not start on any of the two splines. It starts from somewhere in your game world.

How can this unit reach both splines now?

Easy… by finding the nearest point from his position to the first spline and then finding the nearest point from spline 1 to spline 2 from his position on spline 1.

This is just one example. You could also use this technique to let particles flow into the direction of a spline and if they reach it, let them travel along the spline… and so on…

So, a quite useful feature when working with splines and here it is :slight_smile:

I hope it makes you happy.

Have a nice day and stay away from the corona! :mask:

:: Marcel, Sandbox Blizz



PS: Stay tuned again for more interesting stuff in the future! :sunglasses:


Changelog:

  • Added FindNearestPointOnSpline feature and sample project.
  • Added “Extensions class” to support spriteBatch overloads with additional drawing capabilities.
  • Added a test Transform in the TransformControl to have a dummy transform for additional user interaction in the sample projects.
  • It’s now possible to adjust the accuracy of the FindNearestPoint function from within the sample control.
  • The GitHub-Release rar-file now containing not only the lib binaries but also the editor and sample projects - already pre-compiled, so that the user can directly start and run the samples or the editor; no compilation needed!
2 Likes

1.5.0 - Polygon Stripe Feature!


Hey ho everyone!

You heard not much of me in the past months. I don’t want to write a long wall of text, so I will do it the “changelog-way”:

  • I had an accident.
  • I injured my back and left hip.
  • I had much pain.
  • I’m now feeling alright again.
  • I’m just having low pain in the moment.
  • I’m starting to go back to work (this means I will slowly start to work on my development projects too)
  • I already did an update to the MonoGame.SplineFlower project.

Okay, this is done. This is feeling great now :slight_smile:


Now let’s take a look at the update:

As you can see, it’s possible now to create a polygon stripe and bend a regular Texture2D around the spline track / control points.

Changelog 1.5.0:

  • It’s now possible to change the CatMulRom-State of a spline anytime in the editor (vice-versa).
  • The setup class now initializes 3D graphics related stuff for the new PolygonStripeControl.
  • Added road texture and road spline json data.
  • Reworked the TransformControl to return WorldUnits if wished.
  • Removed old Functions class and added new Utils project to the solution.

Nuget’s updated as well.

In the GitHub release section you will find the binaries and the compiled executables of the samples- and editor projects.

I hope you enjoy this update.

I try to get back on the track in the moment and… yeah… what’s the best possible way if not by building road tracks with MonoGame.SplineFlower!? :sunglasses:

Cheers
:: Marcel


4 Likes

glad you’re feeling better! :slight_smile:

1 Like

Thank you very much. This means alot to me :fist: :slightly_smiling_face:

You are alive… Now Get Coding!

[That sucks, but good that you are doing fine now.]

:sake:

1 Like

Yo dude hope nothing serious! glad your Ok! keep safe man ^_^y love your tools!

1 Like

@MrValentine @DexterZ

Thank you very much both of you! Really appreciate that. :sparkling_heart: :slightly_smiling_face: :fist:

No, nothing serious. Don’t worry. It was just painful and took a while to heal. It’s still not over but it’s much better than before.

I can tell you what happend, but it sounds boring if you hear it. Actually it was nothing special.

I just tried to rotate-push a 60kg washing machine on rubber pads into its final position. By that I also pushed out a bundle of nerves out of my back. Yeah, not just 1 nerve… It was a whole bundle…

My back started to swell and every single move hurt alot. Even doing nothing hurt and breathing. After the initial day my left hip suddenly started to hurt even more than my back. Both the bundle of nerves in my back and in my left hip started to inflame.

Yeah, 4 weeks of pain and literally lying in the bed was all what was possible for me. That sucked alot, bacause I am an active person normally.

However, after the 4 weeks I went for a physio-therapy because I could’t lift my left leg higher than about 3-5 cm. It was nearly locked in position.

Now after all that time, i’m feeling great again. Well, great is maybe a bit exaggerated, but it’s much better than before. Just a bit pain and full movement capabillities.

But I need to do things slowly to not put things under
unnessecary stress. This means I shouldn’t sit or stand for a long time. On the other hand I need to train the muscles there to strengthen them to hold the nerves in position.

In the moment I have also the problem that I am moving to a different location, but I have great people helping me.

I also really appreciate your words. This makes me proud to be a MonoGame member :wink: and it helps to get through this.

I wish you all the best too!

In the meanwhile I will do some smaller projects. Also to get programming practise again for my main project.

However, thank you very much again!

Love you all :green_heart:

:: Marcel

2 Likes

Hello!

Was looking forward trying to make curved lines with SplineFlower, but I get the following message:

"System.IO.FileNotFoundException: 'Could not load file or assembly ‘MonoGame.SplineFlower.Utils, Version=1.5.0.0, Culture=neutral, PublicKeyToken=null’. "

  • trying to do the, Setup.Initialize(graphics.GraphicsDevice) - in the method Initialize().
    Following the GameTest-example…

The SplineFlower.Utils is not included in the SplineFlower.dll: Any ideas?
Thanks…

It’s there:

https://github.com/sqrMin1/MonoGame.SplineFlower/tree/master/Utils

Great, thank you a lot:

But how do I reference it?

I would presume that it was included in the Monogame.SplineFlower.dll…

That, I don’t know, I am not that far with tinkering right now…

I will take a look at this soon. Currently pretty busy.

1 Like

The problem should be fixed now. Please install the newest nuget package(s).

https://www.nuget.org/packages/MonoGame.SplineFlower/
https://www.nuget.org/packages/MonoGame.SplineFlower.Content/
https://www.nuget.org/packages/MonoGame.SplineFlower.Content.Pipeline/

1 Like

2.0.0 :champagne: - Complete Overhaul + Hermite Splines!

Breaking Changes: this update is not compatible with older versions of this library!

  • Added the missing “AddCurveRight” override in the HermiteSpline class.
  • Initial setup initialization in all sample controls.
  • Added a new PolygonTextureTest spline and texture called “RaceTrack.json” (CatMulRomSpline) and “roadTexture.png” (Texture2D).
  • Added more possibilities of showing or hiding specific elements of a spline (Lines, Points).
  • The selected tangent text is now drawn directly inside the HermiteSplineControl instead as a forms label.
  • The game project now includes spline json data generated with the revised MonoGame.SplineFlower library update. It defaults to the HermiteSpline test now and loads it as an xnb file with the ContentManger to show that it can handle the latest additions and changes to the library and the pipeline.
  • Updated the samples project to work with the new MonoGame.SplineFlower update.
  • Based on the revised library update the MonoGame.SplineFlower.Content.Pipeline library now reflects the latest changes and additions.
  • New spline type: HermiteSpline! (basically a CatMulRomSpline but with “Bias” & “Tension” parameters as well as moveable Tangents, which gives more precise control over the curve of this spline.
  • Complelty revised the MonoGame.SplineFlower library and gave it more structure and encapsulation, which makes it way easier now to understand and use the library as well as adding new spline types.
  • Updated AssemblyInfo
  • Solution upgraded to support Visual Studio 2019

Heyya, here is finally the update I wanted to do for a longer time now: it’s nothing less than a complete overhaul of the library.

It should be easier now to understand and use it. Unfortunatley this makes it incompatible with older versions. Espacially your generated splines will not likely to load.

However, adding new spline types is now a breeze. That’s why a new spline type is already included with this update; the Hermite Spline!

Let’s take a look:

The Hermite Spline is basically a CatMulRom Spline, but you have more control over it by setting “bias” and “tension” values. On top of it there a moveable tangents (the orange handles in the animation), which makes it possible to control the curve more precisely.

And this is what gives you design and typography powers now. Look at this:

Things like that are created in minutes. Try it for yourself with the included samples and editor project!

I also reworked the PolygonSpline sample a bit, by adding a new road texture and some checkboxes to enable or disable specific visual elements of the spline:

BTW: the MonoGame ContentManager is fully supported!

Load a spline simply like this:
MySpline = Content.Load<SplineBase>(@"HermiteTest");

Nugets are fully generated and uploaded for the ease of integration!


Phew… now I have this library in a state I always wanted it to be. It is ready for further production in other projects. This is incredible if you think about the fact that this library exists since Aug 14, 2018.

But it is definitley worth the time.

My intention is to implement the MonoGame.SplineFlower library into the Mercury Particle Sandbox:

… and let thousands of particles flow on the splines.

Feel free to click on the link above to find out more about my particle sandbox!

And feel free to follow the further development process of my projects here in MonoGame or via steam dev, steam news, twitter, indiedb or even youtube.

Thank you very much for your support and have a nice day! :sun_with_face:

:: Marcel :heart:

2 Likes