Copying layers between sessions?

2995Valliant

Well-known member
Is it possible to create a layer, and then copy it into multiple sessions?

Example:

I've got a route I've had for some time, to which I've now added seasonal textures textures, and spedtrees. This leaves me with a number of items (ie bales, combine harvesters etc) that I don't want in the autumn/winter sessions, so no problem, move them into a layer, BUT I do want them in about 20 (summer) of the 60 odd sessions I' created.

I realise I could leave them in a layer in the route, and remember to set them invisible, just wondering if there is another way I've missed?

Regards,

Anthony
 
The route actually contains all the layers in TRS 2009/2010. The session contains only the consists, the active industry (and station) settings and the settings for various rules etc - that has not changed since TRS 2004. TRS 2009/2010 adds layer visibility and locked/unlocked status to a session when it is saved. It does not separate different layers into different sessions - all layers stay with the route layout.

Making the summer layers visible and the winter layers invisible when saving the session called "summer" and then reversing the settings when saving the session called "winter" is currently the only way of creating summer and winter sessions. Both sessions would use the same layout with all the layers present, but with different layers invisible and visible.
 
Thanks for the reply.

It is definitely possible however to put scenery in a session layer, or sublayer - I do it regularly with basemaps. I'm just trying to figure out a way of copying this session sublayer between sessions.

Regards,

Anthony
 
It is definitely possible however to put scenery in a session layer

What TRS 2009/2010 calls a "session layer" is just a name for a layer and the contents of any layer, including the session layer, are saved with the route. Only consists and the properties of industry active assets that are in a layer will be stored in a session. Landforms, water levels, sky, etc are all stored in the route layer. You could also put everything else (track, buildings, etc) in the route layer as well and this would make TRS 2009/2010 no different from TRS 2004/2006.

I am currently building a route that will use different layers to represent different eras - the 1960s and the 2000s. I will (when finished) create a session called 1960s that will have the 1960s layer visible and the 2000 layer invisible. Another session will be created that will have the 2000s layer visible and the 1960s layer invisible. The route layer contains all the assets that are common to both eras. There have been issues with the operations of signals and junctions that are present in one layer but not the other and I have had to devise some work-arounds.
 
Okay, bear with me here in case I'm missing your point :)

Editing a session, and adding, lets say, a couple of buildings into that session doesn't cause TRS to re-save the route as far as I can tell, just the session (although point changes and one or two other things do require a re-save of the route).

Regardless of the detail as to what is saved where, imagine your route has three sessions, two of which are set in the 2000's and the route and sessions are all but complete when you realised there's a new industrial estate built in 2005 that you've missed altogether. Obviously you can build this in one of the 2000 era sessions.

Do you then a) delete the other session (which has hundreds of AI movements) clone the first session and spend hours re-programming the AI, b) build the industrial estate for the second time in the second session, or c) ask the same question as me.

There's always option d) have a cup of tea.

Regards,

Anthony
 
I have found a way round it, I think.

Set up sublayer in the sessions layer, copy the items you want to into this layer. Save session (doesn't require a route save unless any of the items in question have been moved out the route layer) and exit Trainz.

In CMP, open the session that you have just created in explorer, and copy the profile.obs and profile.lyr into whichever sessions you require that layer in.

These two seem to keep all the layer and item information - happily the rolling stock is stored in a separate file. So far, it doesn't seem to have broken anything....

Regards,

Anthony
 
There's always option d) have a cup of tea.

You forgot e) have something stronger.

I had a look at my profile.lyr file and, apart from a few control characters (which may reflect locked/unlocked and visible/invisible status), all it contains is the names of the two non-route layers in my layout - no assets, consists, industry settings, etc. At just 1kb in size (and most of that unused) there is no room for anything else.

I think the confusion here is over the differences between what is saved in the layout (ALL the layers and all their assets, the landforms, the textures) and what is saved in the session (the consists, rule settings, visibility of each layer and the industry settings).

Forget, for the moment, that Auran has given one layer the name "session" - a source of some of the confusion in my opinion. When you move, delete or add an asset in any layer it will alter the layout and does cause the route to be resaved.

In most ways TRS 2009/2010 behaves exactly the same as TRS 2004/2006. In TRS 2004/2006 if you added, deleted or moved an asset in any session you had created for a route, then it altered the route layout and that change would appear in every session you had created for that route. So deleting a house in the 2000 summer session of your route would delete the same house in the 2000 winter session and the 1960 session. This caused a lot of confusion to Trainzers back then too.

In TRS 2004/2006 if you changed the properties of an industry asset (e.g. changed the products it produced, changed the number of passengers per hour) in a session (say 2000 winter) then that change only occurred in that session - the same industry in the other sessions would not have its properties altered. This again caused a lot of confusion back then.

Exactly the same is true for TRS 2009/2010 - the only difference is that layers allow you to create a route that can have different assets in different sessions. When you create and save a session based on the layout, you specify which layers and therefore which assets will be visible in that session. Create and save another session and you can specify that a different set of layers and assets will be visible. All the sessions will still use the same layout. All the assets are still stored in the layout while the assets properties are still stored in the sessions.

It is exactly the same with consists - although in some ways I find this harder to get my head around. Experience has shown me that the best option is to continue the practice set by TRS 2004/2006 and place consists in their separate sessions. I.e. do not save a session that also contains the consists for all the other sessions stored in their invisible layers. Placing consists in different layers in any session will lead to problems. See the thread experimenting with layers for the whole sad tale.

In answer to your question about what to do with the new 2005 industrial estate, I would simply add it into the existing 2000 session and add additional consists as needed or reprogram the AI for some of the existing consists.

I hope this helps.

Peter Ware
 
Copying the profile.lyr alone doesn't do it - that made the new sub layer show up in layers panel, as a child of the session, but not the contents of said layer.

The profile.obs file however was bigger in the session to which I'd added, and once this was copied over, the objects relevant to the newly added layer were visible.

Given that this was all done via CMP, without opening the route for edit, I'd be surprised if it was altering the route file. I'm not convinced that you can't store assets in a session. I'll set up a blank baseboard and session later, then clone it and go on a tree planting spree in a session layer, and then compare the various file sizes.

As for "In answer to your question about what to do with the new 2005 industrial estate, I would simply add it into the existing 2000 session and add additional consists as needed or reprogram the AI for some of the existing consists.": That's a lot of AI programming in my case, as I'd have to re-make 20 or so sessions of 3-4 hours duration each.

Option "E" is definitely a valid one, but it's the wrong time of day over here!

Regards,

Anthony
 
Last edited:
Result as follows:

One baseboard new route. Plant approx 7000 speedtrees (8fps :D) in a session layer.

Have a look in CMP - profile.obs in the session in now 422kb.

Back in game, merge that layer into the route layer. Create a new session layer.

Look in CMP - profile.obs for the new session is now only 1kb, but the mapfile.obs has jumped form 1kb to 422kb.

That says to me that scenery object placements ARE being stored in the session layer.

For the record, fps was the same in both trials, so there's no performance hit for doing it.

Regards,

Anthony
 
OK but all the layers are still stored in the route.

I think we are arguing symantics here (and getting confused in the process).

Your original question that started this thread was about moving layers to sessions. Layouts/Routes have layers, sessions do not.

The session layer and the session asset are two completely different things and are saved quite separately - it is unfortunate that the same name is used in both cases. I always delete or rename the session layer in any layout I create so that it all makes better sense to me.

Your mapfile.obs contents jumping to 422kb tells me that all the assets are in one of the route layers (regardless of what they are called) and are part of the route, not the session. Have you opened your session object (not the layout/route object) in CMP, what files sizes does it show - although I know nothing about how speedtrees would affect sessions or layouts.

I hope this unconfuses things - or I am getting more confused.

Peter Ware
 
Hi,

I'll try to better explain what I've done. It's not just semantics, it's key to what I'm trying to do in between drinking tea and the odd bit of work :)

Create a one baseboard blank route with an empty session to go with it.

In CMP, open the session, and note the size of the profile.obs and profile.lyr sizes. Recommit, and open the route, note the mapfile.lyr and mapfile.obs file sizes.

Go back into the game, open the session, and working in the session, add lots of objects (I just happened to pick a tree). Save session.

Go into CMP, open the route and layer again. You will notice the the size of the profile.obs file on the layer session has increased, while that of mapfile.obs file on the route layer has stayed the same. That says to me that the data pertaining to those added assets is being stored in the session, not the route.

If you now go back into the game, and merge that session into the route layer, when you go back and look in CMP you will discover that the profile.obs file in the session is down to what it was initially, but the size of the mapfile.obs in the route has gone up by the same amount.

It is definitely possible to have child layers to the session layer - add a load in game, and then look at the session profile.lyr it's file size will have increased. I do agree though that all the assets associated with this profile.lyr will be stored in the session profile.obs, which is what I think you're driving at regarding the route layers.

What it means is that there is a way of copying child layers of the session layer between sessions by copying and pasting the profile.lyr and .obs between sessions opened in Explorer. It would be nice of Auran could implement it via the game interface rather than in Explorer, but hey, I'm happy, I don't have to add 2-300 summer specific items to 20 odd sessions, or remember to set the visible properties of a route sub layer before starting a session.

I fear I've repeated rather than clarified above, so if you like, PM me an email address and I'll send you a cdp of the 1 baseboard map in various states to illustrate my point.

Regards,

Anthony
 
I think I have solved it!!!!

I think I see the problem - your definition of a session is different from mine.

To me, a session is the file TRS 2004/2006/2009/2010 creates that contains all the AI instructions, the consists, the drivers, the industry settings and a few other things. The "session" (my definition) is different from the route and has its own .cdp file when uploaded to the DLS. This "session" file does not contain any layers.

To you (I believe), a session is anything in the session layer (or layers) of a route. It contains all the assets and sub-layers that you have added to the session layer. What I believe you are calling a "session" is just one of the layers contained in the route file.

When you open a "session" for editing in TRS 2004-2010 you are in fact opening a "route" (through the route file) with all its assets (and layers in 2009/2010) AND you are also opening the "session" (through the separate session file) with all its AI commands, drivers, industry settings, etc. Make a change to the route (e.g. move a house) then you will have to re-save both the route file and the session file. Make a change to the session (e.g. fire one of the drivers) then you will only be asked to re-save the session file - the route file has not changed.

You cannot create a session file without first creating a route file, but you can have a route file with no session file (there will be no consists and the industry assets will have their properties set at their default values). If you select Edit a Route instead of Edit a Session in TRS 2004-2010, edit the route and save it you will discover that all the sessions you have created from that route will lose all their industry settings.

Now your original question about copying layers to multiple sessions did not make any sense to me because, in my definition, sessions do not contain layers, only routes contain layers.

Now my brain is hurting - fortunately its late enough here for me to get something stronger than a cup of tea.

Peter Ware
 
Hi Peter,

I agree with you definitions, that's not the issue. A route is a route, with its own kuid, and is a another asset with its own kuid, which requires the route to function, no arguments there.

My point is that a session can contain layers, and objects, seperate from (although requiring as a dependency) the route.

This means that you can put objects that you only want to appear in certain circumstances into the relevant session(s).

My problem is that I have about 60 sessions for a particular route, and 20 of those where I want the same extra objects included, so I was looking for a lazy way to place those asssets across the 20 sessions by initially putting them in a session sub-layer, and dropping that layer into all the sessions. Obviously once its in the session, it can be merged into the top layer of the session as the separation is no longer required.

Regards,

Anthony
 
We seem to be making progress ...

My point is that a session can contain layers, and objects, seperate from (although requiring as a dependency) the route.

This means that you can put objects that you only want to appear in certain circumstances into the relevant session(s).

To be honest I have never seen any evidence of that. The route I am working on has two "session layers" with a very large number of assets divided between them and the "route layer". The route asset file is huge (33MB and still not finished) while the two session asset files I have created are quite small (I am unable to give figures as I am currently away from my Trainz computer). The significant difference between the sizes indicates to me that all the assets are in the route asset file, not the session asset files.

My problem is that I have about 60 sessions for a particular route, and 20 of those where I want the same extra objects included,

My solution, and the one I am currently using (admittedly with just a paultry 2 sessions and 3 layers), is to place all the common assets in one layer (the route layer) and separate the unique assets to their individual session era layers. So I would put all those "same extra objects" in the one layer and make that layer visible in all the sessions that need them.

Early on in the project I found that I was getting too confused by sub-layers and merging layers so I settled on deleting the supplied session layer, then creating a new layer for each unique set of assets and using the supplied route layer for everything else. Keeping it simple has so far worked but I have had problems caused by not remembering which layer I was working in and have ended up planting entire forests in the wrong layer.

Peter
 
Back
Top