• Welcome to PiBoSo Official Forum. Please login or sign up.
 
March 28, 2024, 07:14:49 PM

News:

GP Bikes beta21c available! :)


Bug in output plugin _iState (in Draw()) ?

Started by HornetMaX, April 26, 2016, 08:18:03 PM

Previous topic - Next topic

HornetMaX

I print out the value of _iState in each Draw() call,  whenever it changes from one call to the other. The documentation for _iState says:

Quote_iState: 0 = on track; 1 = spectate; 2 = replay.

(except for KRP, which only mentions values 0 and 1 for on track and replay, strange).

I start GPB and start a testing session (offline):


  • When I go to track, state is 0 (OK to me).
  • If while on track I press ESC and click on "Replay", state is 2: seems wrong. Should it be 1 ?
  • If I go back to the pits and press ESC, state is 1 (OK to me).

Online the problem doesn't exist, as you can't press ESC and then click on replay (you have to go back to the pits).

If from GPB main menu I load a saved replay, state is 2 (which is OK).

Didn't check the other sims, I'm getting old and lazy.

PiBoSo


When going to replay from track during a testing session, the simulation is paused, so it's not possible to spectate.
The "Live" button is even hidden, so everything seems correct.
"La perfezione non è il nostro obiettivo, è la nostra tendenza".

HornetMaX

OK I see, thanks.

I was kinda hoping to use _iState to tell the difference between a replay/live spectating while in an event from a saved and loaded replay, but I see I can't do that.

Any reason why in a loaded replay some events (e.g. EventInit, TrackCenterline, ...) are not called ?

PiBoSo

Quote from: HornetMaX on April 27, 2016, 06:24:04 AM
OK I see, thanks.

I was kinda hoping to use _iState to tell the difference between a replay/live spectating while in an event from a saved and loaded replay, but I see I can't do that.

Any reason why in a loaded replay some events (e.g. EventInit, TrackCenterline, ...) are not called ?

If a replay is loaded then SPluginsRaceEvent_t -> m_iType sent to the "RaceEvent" function should be set to -1.
"La perfezione non è il nostro obiettivo, è la nostra tendenza".

HornetMaX

Quote from: PiBoSo on April 27, 2016, 09:56:58 AM
Quote from: HornetMaX on April 27, 2016, 06:24:04 AM
OK I see, thanks.

I was kinda hoping to use _iState to tell the difference between a replay/live spectating while in an event from a saved and loaded replay, but I see I can't do that.

Any reason why in a loaded replay some events (e.g. EventInit, TrackCenterline, ...) are not called ?

If a replay is loaded then SPluginsRaceEvent_t -> m_iType sent to the "RaceEvent" function should be set to -1.
Thanks, I may be able to work with that.

Still, it would allow to do more stuff if callabacks like EventInit, TrackCenterline etc were called during loaded replays, but no big deal.

PiBoSo

Quote from: HornetMaX on April 27, 2016, 12:13:57 PM
Quote from: PiBoSo on April 27, 2016, 09:56:58 AM
Quote from: HornetMaX on April 27, 2016, 06:24:04 AM
OK I see, thanks.

I was kinda hoping to use _iState to tell the difference between a replay/live spectating while in an event from a saved and loaded replay, but I see I can't do that.

Any reason why in a loaded replay some events (e.g. EventInit, TrackCenterline, ...) are not called ?

If a replay is loaded then SPluginsRaceEvent_t -> m_iType sent to the "RaceEvent" function should be set to -1.
Thanks, I may be able to work with that.

Still, it would allow to do more stuff if callabacks like EventInit, TrackCenterline etc were called during loaded replays, but no big deal.

TrackCenterline will be.
EventInit wouldn't make sense, because it is meant for telemetry only.
"La perfezione non è il nostro obiettivo, è la nostra tendenza".

HornetMaX

Quote from: PiBoSo on April 27, 2016, 01:02:37 PM
TrackCenterline will be.
EventInit wouldn't make sense, because it is meant for telemetry only.

Cool, thanks. It would be nice if there was an*Init() and a *Deinit() event common to both loaded replays and live sessions.
I can use TrackCenterline  as Init() (once it is available in loaded replays too), but I may miss a *Deinit() event for cleanup, deallocation etc.

PiBoSo

Quote from: HornetMaX on April 27, 2016, 01:27:25 PM
Quote from: PiBoSo on April 27, 2016, 01:02:37 PM
TrackCenterline will be.
EventInit wouldn't make sense, because it is meant for telemetry only.

Cool, thanks. It would be nice if there was an*Init() and a *Deinit() event common to both loaded replays and live sessions.
I can use TrackCenterline  as Init() (once it is available in loaded replays too), but I may miss a *Deinit() event for cleanup, deallocation etc.

RaceDeinit support is coming, too.
"La perfezione non è il nostro obiettivo, è la nostra tendenza".


HornetMaX

Quote from: PiBoSo on April 27, 2016, 01:02:37 PM
EventInit wouldn't make sense, because it is meant for telemetry only.

One thing though: in SPluginsBikeEvent_t we have m_iNumberOfGears and m_fMaxRPM. These could be useful also when spectating.
As we can have vehicles with different m_fMaxRPM and m_iNumberOfGears in the same event, it is probably a good idea to add them to SPluginsRaceVehicleData_t.

PiBoSo

Quote from: HornetMaX on May 10, 2016, 11:37:20 AM
Quote from: PiBoSo on April 27, 2016, 01:02:37 PM
EventInit wouldn't make sense, because it is meant for telemetry only.

One thing though: in SPluginsBikeEvent_t we have m_iNumberOfGears and m_fMaxRPM. These could be useful also when spectating.
As we can have vehicles with different m_fMaxRPM and m_iNumberOfGears in the same event, it is probably a good idea to add them to SPluginsRaceVehicleData_t.

Gotcha.
"La perfezione non è il nostro obiettivo, è la nostra tendenza".