BVE WorldWide
Would you like to react to this message? Create an account in a few clicks or log in to continue.

How to place a route and AI trains in a single OpenBVE package?

2 posters

Go down

How to place a route and AI trains in a single OpenBVE package? Empty How to place a route and AI trains in a single OpenBVE package?

Post by Phonteus Nevolius Sun Jan 19, 2020 4:11 pm

I have written in another thread, but thought I'd start a separate one for this issue. Here's the problem I am facing. Please bear with me, it's a bit lengthy.

I have upgraded my Királyliget route to include 5 AI trains, which hopefully add some more fun to playing. Currently I am not able to place the whole project in a single package: I need one package for the route itself and a second separate package for the AI trains (also includes the driveable train).

Now users download the route and install it, but some of them don't download the train package - even though I specifically write on my website that they must also download the trains.

Now, if OpenBVE cannot locate the AI trains it simply crashes and creates a crash log in the Settings folder, saying it could not locate the AI trains.

Then the users come to me to say that my route doesn't work and it crashes OpenBVE - which is what is happening.

Because of all this, I'd really like to include the AI trains in the route package. That would stop this problem completely. However, there is no package type in OpenBVE which would support this, you either have a route package, or a train, or an other type, but no combined route and train.

In another thread Chris said OpenBVE looks for the AI trains in both the Train folder and the Object folder. In my personal experience it could not find the AI trains in the object folder, doesn't matter if the AI trains are in the root of Object or in a subfolder. This is true for any recent OpenBVE version. Hence the need for two packages.

How can I solve this problem? How can I put my route and AI trains in a single package? Would it be possible for OpenBVE not to crash in such situations, but give a message and then go back to the homescreen? Or would it be possible to place the AI trains within the route package, say the Object folder?
Phonteus Nevolius
Phonteus Nevolius

Posts : 120
Join date : 2017-10-05
Location : Hungary

https://phonteusnevolius.wordpress.com

Back to top Go down

How to place a route and AI trains in a single OpenBVE package? Empty Re: How to place a route and AI trains in a single OpenBVE package?

Post by leezer3 Sun Jan 19, 2020 8:01 pm

The 'correct' (well at least in package terms) solution would I suspect be to set the trains as a dependancy.

At the minute dependancies are 'soft' in that a package will still install when they're missing.
The probable solution I think is going to be to allow 'hard' dependancies where a package refuses to install without them present.
This of course doesn't stop them manually extracting the archive Sad

leezer3

Posts : 1955
Join date : 2011-08-23

http://www.bvecornwall.co.uk

Back to top Go down

How to place a route and AI trains in a single OpenBVE package? Empty Re: How to place a route and AI trains in a single OpenBVE package?

Post by Phonteus Nevolius Sun Jan 19, 2020 8:17 pm

I think instead of changing the system of dependencies just for this it could be easier to allow the AI trains to be placed inside the route, somewhere in the Object folder. Of course, within the route's folder. Is this possible? This would be the best option I think.

To give you an example, I would like to place my AI trains in the Railway/Object/Kiralyliget/AI_Trains folder. And then the AI_Trains folder would contain five train folders, with all the AI trains required by the route. This would eliminate the need for a separate train package completely, as they could be kept within the route package.
Phonteus Nevolius
Phonteus Nevolius

Posts : 120
Join date : 2017-10-05
Location : Hungary

https://phonteusnevolius.wordpress.com

Back to top Go down

How to place a route and AI trains in a single OpenBVE package? Empty Re: How to place a route and AI trains in a single OpenBVE package?

Post by Phonteus Nevolius Sun Jan 19, 2020 8:38 pm

I just found another argument that supports putting AI trains in the Object folder:

I have five AI trains in my current train package which install in the Train folder (using the package manager). The user arbitrarily selects one of these trains to drive along the route, goes to external view and sees that there is no locomotive, only cars.

I had to tell him that that particular train is only supposed to be an AI train and the locomotive is at the back of it because it has been designed as an oncoming train, moving "backwards" along the route.
Phonteus Nevolius
Phonteus Nevolius

Posts : 120
Join date : 2017-10-05
Location : Hungary

https://phonteusnevolius.wordpress.com

Back to top Go down

How to place a route and AI trains in a single OpenBVE package? Empty Re: How to place a route and AI trains in a single OpenBVE package?

Post by leezer3 Sun Jan 19, 2020 9:12 pm

Absolutely agreed on the issues you've got.
To be clear, the latest build fixes trains in the object folder, this appears to have been an oversight.
Unfortunately, the train related renovations are nowhere near complete at the minute & there are still a massive amount of existing internal code which means things just don't play as nicely as we want Razz

Some simple additions by the look of it to make life easier:

  • Allow the consist to be reversed in a TFO (dead easy)
  • Allow the reversing of a drivable consist from the main menu. (Probably be useful somewhere!)
  • Add something that allows a folder containing a train.dat to be ignored as a train by the in-game menu browser. (easy, but potentially dangerous)

leezer3

Posts : 1955
Join date : 2011-08-23

http://www.bvecornwall.co.uk

Back to top Go down

How to place a route and AI trains in a single OpenBVE package? Empty Re: How to place a route and AI trains in a single OpenBVE package?

Post by Phonteus Nevolius Sun Jan 19, 2020 9:26 pm

leezer3 wrote:To be clear, the latest build fixes trains in the object folder, this appears to have been an oversight.
Wonderful! I will upgrade my route to include the AI trains in the object folder once a new release is out. No need to hurry with it, I will keep explaining things to users until then.

Am I able to put AI trains in subdirectories of the Object folder?

One more thing: OpenBVE keeps giving a warning that TFOXML is not supported. It works, but this warning is still there (I have another thread about this but thought I'd drop it here too).

Notes on your additions:
- Ignoring train folders: no need for it if AI trains can be in Object folder.
- Allow the consist to be reversed in TFO: super useful.
Phonteus Nevolius
Phonteus Nevolius

Posts : 120
Join date : 2017-10-05
Location : Hungary

https://phonteusnevolius.wordpress.com

Back to top Go down

How to place a route and AI trains in a single OpenBVE package? Empty Re: How to place a route and AI trains in a single OpenBVE package?

Post by leezer3 Mon Jan 20, 2020 11:44 am

AI trains in subdirectories should work OK unless I've broken something I've not noticed.......
(For that matter, trains in subdirectories have always worked- Odakyfan used this with Chasanai)

The TFOXml message has been fixed (TLDR: The name was changed from the original proposition, but the error message wasn't), and we'll have reversal of consists working in a couple of days- I've got everything other than the bogies reversing nicely now, but they're slightly more complex.

leezer3

Posts : 1955
Join date : 2011-08-23

http://www.bvecornwall.co.uk

Back to top Go down

How to place a route and AI trains in a single OpenBVE package? Empty Re: How to place a route and AI trains in a single OpenBVE package?

Post by leezer3 Tue Jan 21, 2020 1:22 pm

OK, so I've implemented the following:

  • If a train is intended for AI use only, the train.dat may be renamed train.ai which stops it showing up as drivable in the main menu.
  • A new tag for TFOs: - This should be placed below the train folder name, and reverses the consist if set to true.
  • A checkbox toggle in the advanced train properties (not remembered), which lets you reverse the train consist.


This lot will probably be in tomorrow's build when I've tested them a little more.

leezer3

Posts : 1955
Join date : 2011-08-23

http://www.bvecornwall.co.uk

Back to top Go down

How to place a route and AI trains in a single OpenBVE package? Empty Re: How to place a route and AI trains in a single OpenBVE package?

Post by Phonteus Nevolius Tue Jan 21, 2020 9:50 pm

Chris, those are great additions.

Tonight I tested the AI trains placed inside the Object folder. I put my five AI trains in Railway/Object/Kiralyliget/AI-Trains and linked them in the XML files from there. They worked properly, I saw no problems and got no error messages.

I also checked log.txt, there were no more TFO not supported format messages, so that's good too.
Phonteus Nevolius
Phonteus Nevolius

Posts : 120
Join date : 2017-10-05
Location : Hungary

https://phonteusnevolius.wordpress.com

Back to top Go down

How to place a route and AI trains in a single OpenBVE package? Empty Re: How to place a route and AI trains in a single OpenBVE package?

Post by Sponsored content


Sponsored content


Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum