Dev Tutorial Making Splines (1 Viewer)

Creating splines is quite a simple process once you understand the basic logic behind them. Essentially, they are made up of a series of ‘from’ and ‘to’ co-ordinates.

In this guide, I’ll show you how to create a basic spline. From this, you will have the knowledge to create any spline.

Structure of a spline file
  • Height Profiles
    This lets OMSI know where the surfaces of the spline are, so that cambers can be properly applied. This affects how the spline is cambered.

  • Textures
    You list each texture in use in the spline here

  • Graphical Lanes
    This is the meat of the spline file, determining each face of the spline (i.e. what you actually see)

  • Paths
    AI paths are programmed into the spline file.

So, let’s make a simple pavement spline. It will be 3 metres in width, and will be 15cm in height, with a ped spline exactly in the middle, with kerb faces on both sides.

Open your Splines folder, and create the folder your spline will be located in. Create a subfolder called ‘texture’ (case sensitive), and put two textures inside (You can use any textures you wish for this, it isn’t important).

Then, create a new text document. Rename it to ‘Pavement.sli’ (you may need to change your settings to show file extensions).

Open this file in Windows Notepad (although we recommend getting Notepad++).

Note: In this guide, X refers to left-right, and Z to up-down.

Note: Trailing spaces (spaces at the end of a line), will break a spline. Make sure that you press enter to start a new line after the final character, never leave a space at the end of a line. Notepad++ can remove all trailing spaces for you by selecting Edit>Blank Operations>Trim Trailing Space.


We’ll start off by putting in the Height Profiles section:

Code:
---------------------------
      Height Profiles
---------------------------

[heightprofile]
-1.5
1.5
0.15
0.15

The values are as follows:
  • X from
  • X to
  • Z from
  • Z to
We do not need to include the subtitle (the text inside the dashes), but it’s best to put these in to keep the file as readable as possible.

So, in that tag, we’ve effectively drawn a line 3m wide, at 15cm in height. Note, if you were to do the X values as: FROM 0m, TO 3m, it will still produce a spline that looks the same as our example. The difference is that in our example, when you place the spline, the centre of the spline will be at the tip of the mouse, and the spline will rotate about that point in curves. In 0m-3m, the left side will be at the tip of the mouse, and the spline will rotate about its left edge.

We do not need to tell OMSI about any vertical faces, as it will not camber these anyway.

Now, the next section is straight forward.

Code:
---------------------------
         Textures
---------------------------

[texture]
Pavement.bmp

[texture]
Kerb.bmp

This is simply a list of the textures used in the spline. Remember, these must match the filenames exactly – they are case sensitive. Make sure you put the correct file extension on.

Next, we get onto the ‘Graphical Lanes’ – the faces of the spline. This is the part that most people struggle with, so read very carefully.

Start with this:

Code:
---------------------------
     Graphical Lanes
---------------------------

[profile]
0

The [profile] tag is saying which texture is in use for the face we are about to input. In this instance, it is saying ‘Texture number 1’ – referring to the list of textures we put in above. Note, the first texture in the list is referred to as ‘0’, the second as ‘1’, the third as ‘2’, and so on.

Now, we put the face itself in:
Code:
[profilepnt]
-1.5
0.0
0.0
3.0

Each [profilepnt] tag refers to a whole co-ordinate. Note, it is handled differently than height profile tags, which only use one. The first [profilepnt] tag is FROM, and the second [profilepnt] tag is TO.

So, the first [profilepnt] tag is structured as follows:
  • X from
  • Z from
  • Texture start
  • Times texture repeats every 10 metres
X from determines where along the width the spline this face starts. Z from determines where on the height of the spline this face starts. So, we’ve told OMSI to place a point at -1.5m, 0cm in height.

Now, texture start and texture end determine what segment of the texture file is used. The left edge of the texture file is 0, and the right edge is 1. You can use any number in between. Therefore, if you wanted to use only the second quarter of the texture, you’d use 0.25-0.5. We’re using the full width, so we’ll do 0-1.

The fourth value in the [profilepnt] tag determines how many times the texture will repeat every 10 metres along the length of the spline. So therefore, if it tiles too frequently, and the texture is squashed, we need to tell it to repeat less, so we enter a higher value. If the texture is stretched and doesn’t repeat often enough, we decrease the value.

So, a value of 1 will mean the texture repeats every 10 metres, a value of 10 will mean the texture repeats every metre. We’ll enter 3, which means the texture will repeat just under every 3 metres.

Note: It is important that the fourth value is the same in both [profilepnt] tags.

Now, let’s put the second [profilepnt] tag in:

Code:
[profilepnt]
-1.5
0.15
1.0
3.0

This tells OMSI to put a second point at X -1.5m, but now at a height of 15cm. It will draw a line between these two [profilepnt] tags, thus giving us a vertical face which will be our left kerb edge.

And that’s it for creating faces! We’ll put the remainder in here:

Code:
[profile]
1

[profilepnt]
-1.5
0.15
0.0
3.0

[profilepnt]
1.5
0.15
1.0
3.0

This was the top edge of our spline, going from -1.5m to 1.5m at a height of 15cm.

Code:
[profile]
0

[profilepnt]
1.5
0.15
0.0
3.0

[profilepnt]
1.5
0.0
1.0
3.0

And this was our kerb edge on the right side, going from 1.5m at a height of 15cm, to 1.5m at a height of 0cm.

A note on direction of faces:

Faces only have textures placed on one side. Where they go left to right, they appear on top. From right-to-left, they appear on the bottom. From bottom to top, they appear on the left, and from top to bottom, they appear on the right. This is useful to note if you are creating tunnels. If your texture appears on the wrong side of the face, simply switch direction.


Finally – we need to input paths that are on our spline:

Code:
---------------------------
          Paths
---------------------------

[path]
1
0
.15
1
2

The structure of this tag is as follows:
  • Type: 0 – cars, 1 – pedestrians, 2 – rail
  • Where on the X axis the path is - 0m is the centre of our spline
  • Where on the Z axis the path is – 15cm is the height of our pavement so we put 0.15
  • The width of the path
    • For cars, when they are turning, they will move over to the side – the wider the path is, the more they can move over. With pedestrians, they can walk anywhere in the width of the path. We'll just put 1m here.
  • Which direction the path goes in: 0 – forwards, 1 – backwards, 2 – both ways. As pedestrians can walk in either direction, we’ll put 2.
Your completed file will look like this:

Code:
---------------------------
      Height Profiles
---------------------------

[heightprofile]
-1.5
1.5
0.15
0.15

---------------------------
         Textures
---------------------------

[texture]
Pavement.bmp

[texture]
Kerb.bmp

---------------------------
     Graphical Lanes
---------------------------

[profile]
0

[profilepnt]
-1.5
0.0
0.0
3.0

[profilepnt]
-1.5
0.15
1.0
3.0

[profile]
1

[profilepnt]
-1.5
0.15
0.0
3.0

[profilepnt]
1.5
0.15
1.0
3.0

[profile]
0

[profilepnt]
1.5
0.15
0.0
3.0

[profilepnt]
1.5
0.0
1.0
3.0

---------------------------
          Paths
---------------------------

[path]
1
0
.15
1
2


And that’s it! Save your file and look at it in-game.

OMSI Spline Tutorial, OMSI Spline Tutorial English, OMSI English Spline Tutorial
 
Last edited by a moderator:

Advertisement

LondonBuses

Map Developer
Jul 24, 2017
56
2
64
28
United Kingdom
Thank you so much! . I have been making junctions in blender following Rhys tutorials so now to be able to make splines is amazing!! Thanks so much!,

Just need to work on creating custom objects and then once im happy with all that in a few months i will attempt bus development too
 

junaid1510

Join my discord: https://discord.gg/QB5bbH4gv9
Oct 20, 2016
465
6
471
23
Willesden, London
i dont think this was suppose to happen
upload_2017-10-17_11-47-32.png


how do i get the kerb texture on the to of the pavement?
upload_2017-10-17_11-53-4.png
 
Last edited by a moderator:

Advertisement

whistlehead

Alias Mr Hackenbacker
UKDT
Add-on London Team
Dec 10, 2015
1,714
41
3,549
Use DDS DXT5 if you can, it's far more efficient. I did a quick writeup on it the other day: Suitable lossless file format for repaints

Most of the time with transparent splines you want alpha mode 1 - this is simple cutout (on/off) alpha which is fast to render and has no render order problems. Alpha mode 2 is for semi transparent materials like glass, and in OMSI is very susceptible to incorrect render order issues.
 
  • Like
Reactions: Chuckinho
Use DDS DXT5 if you can, it's far more efficient. I did a quick writeup on it the other day: Suitable lossless file format for repaints

Most of the time with transparent splines you want alpha mode 1 - this is simple cutout (on/off) alpha which is fast to render and has no render order problems. Alpha mode 2 is for semi transparent materials like glass, and in OMSI is very susceptible to incorrect render order issues.

I might have a play with the Sydney Harbour Bridge with DDS DXT5 instead of tga and see if the performance shifts ;)
 

Advertisement

whistlehead

Alias Mr Hackenbacker
UKDT
Add-on London Team
Dec 10, 2015
1,714
41
3,549
I might have a play with the Sydney Harbour Bridge with DDS DXT5 instead of tga and see if the performance shifts ;)
In general you want to use DXT1 and DXT5 anywhere the compression artefacts don't noticeably affect perceived quality, if you aren't already (I'll admit, I've never looked at the texture files for the individual models in Manly) - I just expanded the post I linked to into a fuller explanation with a memory size comparison, if you're interested: Dev Tutorial - Texture Formats (Alternative title: Don't Use JPG)

I hope it makes a difference :) it's one of those things which is commonly known among game developers, but relatively unknown in the OMSI community which leads to a lot of unnecessarily inefficient models being made, when the fix is really simple. It doesn't help that OMSI will on the surface allow any format, which just encourages bad texturing practices
 
  • Like
Reactions: LT586 and Chuckinho
Right so I have got to grips with making splines with both Simple Spline Creator and straight from a text file and am most comfortable with setting spline in creator and then putting the data manually into a .sli.

So before I go full steam ahead creating a boulevardy thing, my question is, is it best to use the same file format for all textures (i.e all .dds) or is it sometimes more efficient to mix?
Also am I right in thinking that having everything on a single spline (pavement+kerb+double yellow+asphalt+anything+everything) is preferable to a blank spline (just pavement+asphalt+paths) with extra splines added as required, i.e central reservation, double yellows etc?
So I suppose the question is, is one fully "loaded" spline easier for Omsi to handle or multiple smaller splines which could all go in the "loaded" spline?

Edit: Supplementary Question
Is it possible to include trees in a spline, or is it possible to create a tree spline?
I know I can use attach to.
 
In find it easier if I am going to use a spline a lot to include lots of stuff like Fences, gutters etc. My roadway for the Sydney Harbour Bridge is one spline with fences, road lanes, train tracks and footpaths. IT was just easier than trying to coordinate everything separately 49 metres in the air.
hbpic.jpg


There is function under Objects tab to "~ to Spline" so you can repeat anything on a spline path. Saying that, repeating the same tree 20 times can look a bit repetitive and lazy.
Post automatically merged:
 
Last edited:
This thread is more than 7 months old.

Your message may be considered spam for the following reasons:

Users who are viewing this thread