Git Product home page Git Product logo

Comments (7)

denilsonsa avatar denilsonsa commented on June 24, 2024

We could draw some inspiration from rrdtool when building such feature. Collecting and storing data on each refresh would lead to out-of-memory quickly. Collecting every second would be nice, but also only delay such problem.

AFAIK, rrdtool uses circular buffers with different granularities. For instance, we could have buffers of 512 samples (just an arbitrary amount), where one is for the latest 512 (real-world) seconds, another for the latest 512 minutes… Or something. Or maybe this is overdesigning the solution.

Another interesting issue is how to combine several samples into a lower-granularity one. What if we are reducing 60 seconds of samples into a single 1-minute sample? If this is speed, should we get the average? The median? The middle sample? Or the maximum?

We should also take care of what happens when the game is paused (i.e. the user has paused it, or is at the job menu, or any event the causes the in-game clock to stop). That means avoiding JavaScript setInterval or setTimeout to collect samples, instead collecting them every "x" in-game time period. Also, what about in-game sleep and in-game ferry? Most likely, they will introduce a gap to the graph (which makes sense).

Well, just some ideas to help implementing this. ;)

from ets2-mobile-route-advisor.

mike-koch avatar mike-koch commented on June 24, 2024

Hmm... you bring up a very good point about memory consumption. Perhaps we only hold so many data points (such as 100)? I don't know what the limit is, so testing in that department would be needed.

In terms of time scale, would we use game-time as our time axis? Or real-world time? Game-time would be more appropriate IMO, but it may be harder to utilize.

from ets2-mobile-route-advisor.

mike-koch avatar mike-koch commented on June 24, 2024

Maybe it's time to create a website that curates this data and allows the user to view a long-term tachograph? We could even look at various trends among users and see where people drive most, most common cargo, etc. Almost sounds like World of Trucks on steroids πŸ˜† Of course that idea would be way out-of-scope for this skin.

from ets2-mobile-route-advisor.

Koenvh1 avatar Koenvh1 commented on June 24, 2024

In my personal example, I removed the items if it went over 50. Alternatively, we can blur old data, i.e. taking the average of ten datapoints and treating that as one datapoint. The advantage is that it consumes less memory while still retaining the whole picture. The disadvantage is extra work and possibly less performance. This is basically what @denilsonsa suggested, but I was thinking about a more gradual approach. (A bit like the game 2048, the memory stays the same, but the amount goes up.)

As for when to collect the data: If I am not mistaken, the telemetry data includes the current time. We can use that as the x-axis, because if we do, the game being paused is not a problem anymore.

Of course we could create a VTC, with driver logging, lorry details, leaderbords, database breaches and whatnot. But personally, I don't really think that that should be done through ETS2 Telemetry Server, but rather using its own plugin.

from ets2-mobile-route-advisor.

mike-koch avatar mike-koch commented on June 24, 2024

The server also has a paused property available, telling us immediately if the game is paused or not. We could use that as well to avoid collecting the same data point over and over again when it isn't necessary.

Of course we could create a VTC, with driver logging, lorry details, leaderbords, database breaches and whatnot. But personally, I don't really think that that should be done through ETS2 Telemetry Server, but rather using its own plugin.

Not really sure if we even need to discuss this topic right now (since this isn't even skin-related), but the telemetry server can send a POST request to an arbitrary URL defined in the .config file. So it could be pretty simple to use the ETS2 Telemetry Server πŸ˜‰

from ets2-mobile-route-advisor.

denilsonsa avatar denilsonsa commented on June 24, 2024

The server also has a paused property available, telling us immediately if the game is paused or not. We could use that as well to avoid collecting the same data point over and over again when it isn't necessary.

Either that, or we could just compare the current time to the time of the latest sample; and only collect it if the difference is greater than <x>. Maybe both (collect a new sample if the game is not paused AND the time difference is greater than a certain amount).


Regarding a website, it makes sense to reuse the ets2-telemetry-server infrastructure to send data to a remote server. However, I believe it should be done in a separate skin, a very barebones skin that people should run on their desktop browser. Maybe even reduce skin the refresh/poll rate to once or twice per second.

This barebones skin would grab data from the game (through the telemetry server JSON URL), process it, aggregate it, and send it periodically (a couple of times per real-world minute?) to a remote server. Doing this in a (dedicated) desktop browser is much better than giving even more work to the mobile device.

from ets2-mobile-route-advisor.

mike-koch avatar mike-koch commented on June 24, 2024

The telemetry server supports "broadcasting" the telemetry data to an external URL every X number of seconds (between 1 and 86400). However, there is no way to "aggregate it", which would help cut down on bandwidth consumption. At the same time though, I feel that opening a skin is a bit of extra work that the user really shouldn't have to do. It would be ideal to have the server auto-aggregate and push the data every so often.

from ets2-mobile-route-advisor.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.