plane icon Welcome to Microsoft Flight Simulator’s SDK Q&A Platform!

You have questions regarding the SDK? DevMode Tools? SimConnect? You would like to submit an idea for future improvements, seek help or exchange knowledge? You’re in the right place.


Please take a moment to read the platform’s guidelines before you get started!


question

sonicviz avatar image
sonicviz asked sonicviz commented

Does js DataStore work seemlessly on XBox?

Hello!


Does anyone know if the .js DataStore persistant storage API works on XBOX for .js apps as well?

I've written a UI utility addon https://sonicviz.com/project/aircraft-manager/ that uses DataStore for a couple of features on PC (it's great!) and I'm trying to assess whether this will also work on XBOX as is, or it will hit hurdles when/if it gets to testing.

Can't find any documentation on this (though I see some is coming on the UI side in SU12), and I don't wish to assume anything.

Related on the UI front, does anybody know if there is much usage of KBM on the XBOX?

I know MSFS officially supports KBM, I'm just wondering how much of the XBOX player base use them as well as controllers.

Thanks!

#UI #DataStore

xbox
10 |10000

Up to 5 attachments (including images) can be used with a maximum of 4.8 MiB each and 23.8 MiB total.

sonicviz avatar image
sonicviz answered

Anyone have any experience with javascript on XBox?

10 |10000

Up to 5 attachments (including images) can be used with a maximum of 4.8 MiB each and 23.8 MiB total.

dga avatar image
dga answered runshotgun commented

@sonicviz,
The JS Datastore writes to the savegame which is cloud synced. I don't believe there are restrictions to it on Xbox.
One piece of advice: Writing too much data into one key:value pair can corrupt the savegame. I don't know the exact limit but I would try to stay under 200 characters per value to be safe ;-)


1 comment
10 |10000

Up to 5 attachments (including images) can be used with a maximum of 4.8 MiB each and 23.8 MiB total.

runshotgun avatar image runshotgun commented ·
By savegame do you mean everything or only the key that was being saved?
0 Likes 0 ·
sonicviz avatar image
sonicviz answered sonicviz edited

Thanks for the details.

>>One piece of advice: Writing too much data into one key:value pair can corrupt the savegame. I don't know the exact limit but I would try to stay under 200 characters per value to be safe ;-)

Is that an Asobo or Microsoft unknown?

Do you mean corrupt savgame on both XBox and PC, or just XBOX? I assume you mean both as it's using the same cloudsave mechanism I guess, but I don't like to assume anything anymore!

Is it possible to get more clarity on the character limit?

Always nice to know the exact limits and constraints, but I can stay under that.



10 |10000

Up to 5 attachments (including images) can be used with a maximum of 4.8 MiB each and 23.8 MiB total.

FlyingRaccoon avatar image
FlyingRaccoon answered

Hello @sonicviz

I ran some tests with keys and values exceeding 256 characters and didn't notice any problem so I'd say there's no known limitation.
Let us know if you encounter any issue.

Regards,
Sylvain

10 |10000

Up to 5 attachments (including images) can be used with a maximum of 4.8 MiB each and 23.8 MiB total.

sonicviz avatar image
sonicviz answered dga commented

@FlyingRaccoon

Thanks for testing!
I did run stress tests of about 300 keys with 1000 character values (just random data gen) and did not encounter any issues, but that's not to say I won't once it's in the wild. Users do unanticipated things. I thought 300 was enough, but then one test user popped up with ~488 aircraft in his collection.


Maybe I'll bump it up a little from the 200 ch you initally advised then, but not too much.


Thanks again.

1 comment
10 |10000

Up to 5 attachments (including images) can be used with a maximum of 4.8 MiB each and 23.8 MiB total.

dga avatar image dga commented ·
Interesting. Maybe it is not an issue anymore.

It was about two years ago we had this happen to us, so maybe something changed in the meantime.

0 Likes 0 ·
runshotgun avatar image
runshotgun answered

Before building our products I tested it up to 1Mb without issues.

That being said, putting a reasonable cap on it would make sense to prevent abuse.

10 |10000

Up to 5 attachments (including images) can be used with a maximum of 4.8 MiB each and 23.8 MiB total.

sonicviz avatar image
sonicviz answered sonicviz edited

@runshotgun Sounds logical, and good risk management.


Edit: fixed issue with dataStorage initialisation in flight mode issue I was having with toolbar extension for https://sonicviz.com/2023/01/30/location-manager-for-msfs/ , so deleted that long winded explanation I made on it. It seems in flight mode it takes a little longer for onStorageReady and I had to change the order of data initialisation for my UI.

Onwards and upwards!


10 |10000

Up to 5 attachments (including images) can be used with a maximum of 4.8 MiB each and 23.8 MiB total.

sonicviz avatar image
sonicviz answered sonicviz commented

@FlyingRaccoon

The referenced link below says all three Simvars are settable in ft (link below), but from my testing it appears PLANE ALTITUDE is working in metres, not feet. I'm also not sure if the two AGL ones work properly. Could you please confirm if this is so? Thanks!

  • PLANE ALTITUDE
  • PLANE ALT ABOVE GROUND
  • PLANE ALT ABOVE GROUND MINUS CG


ref: https://docs.flightsimulator.com/html/Programming_Tools/SimVars/Aircraft_SimVars/Aircraft_Misc_Variables.htm

2 comments
10 |10000

Up to 5 attachments (including images) can be used with a maximum of 4.8 MiB each and 23.8 MiB total.

FlyingRaccoon avatar image FlyingRaccoon ♦♦ commented ·

Hello @sonicviz

Please post in a dedicated question as this has nothing to do with JS DataStore on Xbox.
Tag me and I'll answer you there.

Regards,
Sylvain

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 5 attachments (including images) can be used with a maximum of 19.1 MiB each and 23.8 MiB total.