-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add: the ability to use multiple train plugins #541
base: master
Are you sure you want to change the base?
Conversation
First, a thought: Plugins tend to do two things, i.e:
I'm basically wondering whether a two-plugin approach would be better, one to simulate safety systems, and one to simulate traction modelling as reqiured. Secondary thoughts: |
In BVE5, it is common to have multiple safety devices as separate plugins. Also, as you say, I think it is better to add functions that can be shared by many trains such as wipers to the main program. |
That's interesting & a reasonable answer. In principle, I'd like to bring most code which requires a plugin into the main sim, but that's not going to be achiveable in the short (or probably longer term), and achieving exact prototypical behaviour is always going to to be a problem. |
That's the basic code for windscreen wipers. |
I think @leezer3 might favor an ats.xml file, since most of the new things are in XML now, and Newtonsoft.Json seems to be a heavy library (size after built is a little bit large, performance should be ok though) Supporting multiple train plugins is definitely a must-have from my perspective. |
Good point- We need to be consistant on formats. I really wouldn't reccommend YAML, syntatic whitespace is an absolute utter idiotic way of doing things. When I first started this 4+ years ago, we needed a consistant external format; BVE's internal formats have gotchas I'm still finding today.... IMHO, there's nothing wrong with redunancy either, as it clearly shows what's going on. TLDR: |
To be honest, XML is too verbose for humans to write. It's understandable to worry about more formats. |
The major verbosity is caused by the tag name being written twice. JSON is more concise at this. For me personally, I think JSON is a better choice, but XML is not that bad. Also parsing errors in some XML files seem uncaught, and will crash the simulator instead of reporting an error. Is that fixed now? BTW thanks for inviting me. |
Also, do you consider it necessary to implement a backward-compatibility plugin?
|
bad6395
to
438f090
Compare
In the .NET asseblies you can override the default size Panel (Panel = new int[newSize];), and can create a bigger size array. I use over 1000 size array as Panel, and it works absolutely perfect (also above 255). |
5f23a6d
to
a53fd14
Compare
This PR is an extension of the PR submitted to my repository of plugin that runs multiple train plugins.
s520/DetailManager_For_OpenBVE#1
This PR allows:
Here are some things to consider:
e.g. ats.json (Comments can not be used.)
cc @zbx1425