• Welcome to PiBoSo Official Forum. Please login or sign up.
 
March 28, 2024, 01:56:41 PM

News:

World Racing Series beta14 available! :)


Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - HornetMaX

16
Plugins / Re: MaxHUD plugin
August 04, 2022, 09:46:11 PM
Quote from: Rox75009 on August 04, 2022, 10:07:04 AMHowever, I would love to get the Map of the MaxHUD plug-in to work with my code. I could I retrieve it (and play with the parameters) ? What kind file is it ?

(I am not so great at coding but with some explanation, I could get it I think)

Many thanks!
Hi there, not sure what you mean exactly but I suppose you want to have something similar to the HUDMap widget (i.e. a 2d or 3d representation of the track).

GPB passes to the plugin the centerline of the track. The format is relatively simple: a bunch of SPluginsTrackSegment_t, each of them being either straight segment or an arc (part of a circle).

Relevant code in the output plugin example from PiBoSo:
typedef struct
{
int m_iType; /* 0 = straight; 1 = curve */
float m_fLength; /* meters */
float m_fRadius; /* curve radius in meters. < 0 for left curves; 0 for straights */
float m_fAngle; /* start angle in degrees. 0 = north */
float m_afStart[2]; /* start position in meters */
float m_fHeight; /* start height in meters */
} SPluginsTrackSegment_t;

/*
_pRaceData is a pointer to a float array with the longitudinal position of the start / finish line, splits and speedtrap.
This function is optional
*/
__declspec(dllexport) void TrackCenterline(int _iNumSegments,SPluginsTrackSegment_t *_pasSegment,void *_pRaceData)
{

}
17
Plugins / Re: MaxHUD plugin
July 05, 2022, 11:14:53 AM
@iNsane: short answer, no not possible.

With significant work I could "cut" the track more precisely at the border, but this would work for a specific shape of the "window" (e.g. rectangular or round). I don't see any way I could make this generic (as in "you can define your own weird-shaped mask in a .tga") with what GPB allows in terms of quad rendering to output plugins.

As a reminder, everything you see in MaxHUD is done with text and manually created quads. There's no higher-level rendering feature like masks, viewports, thick lines etc. Everything is rectangles/triangles ...
18
I read the article and 2 others referenced by the same source (visordown): not a single spec of the engine.
Power ? Torque ? Mileage ? Emissions ? Nothing. Just the weight of the bike (113Kg, nice) and the cost (30K GBP ...).

Had to look elsewhere to find: 75bhp.

MCN doesn't seem over-enthusiast about the engine (here).

Will ask my journo pal if he has more info about it.
First sight: gimmick. It looks nice, it has "2-strokes" appeal (to some), but doesn't really make sense.

19
Plugins / Re: MaxHUD plugin
March 31, 2022, 08:46:53 PM
Quote from: Vini on March 30, 2022, 09:32:54 PM
Quote from: HornetMaX on February 15, 2022, 11:16:58 PM
Quote from: Vini on February 15, 2022, 03:29:38 PMYou sure? Because beta20's default UI is able to show it in replays now.
I've seen no changes in the output plugin interface.
How does MaxTM read these values, though?
MaxTM logs stuff only while riding, not while spectating or watching a replay.
While riding the rear brake is available in the telemetry (SPluginsBikeData_t, m_fRearBrake).
While spectating/replay there's no telemetry (no SPluginsBikeData_t), you only receive some bike data (SPluginsRaceVehicleData_t, at lower frequency compared to telemetry).

typedef struct
{
int m_iRaceNum; /* race number */
int m_iActive; /* if set to 0, the vehicle is not active and the following fields are not set */
int m_iRPM; /* engine RPM */
int m_iGear; /* 0 = Neutral */
float m_fSpeedometer; /* meters/second */
float m_fThrottle; /* 0 to 1 */
float m_fFrontBrake; /* 0 to 1 */
float m_fLean; /* degrees. Negative = left */
} SPluginsRaceVehicleData_t;

Never understood why there's no rear brake there (GPB and MXB), only one brake for KRP (while in telemetry you have two) and no handbrake for WRS. Weird.
20
It seems to me that you could:
  • Assign a dedicated UUID to your input plugin, so that there are 2 devices (the real joypad and the input plugin)
  • Have your input plugin "read" values from the joypad, alter them and expose the modified values to GPB. Easy thing to try: multiply the values by 2 (cap where necessary, of course).
  • To avoid binding problems, disable all relevant inputs of the gamepad using joysticks.cfg. This way when you move a stick GPB will only see your input plugin move (not both the input plugin and the pad) and bind correctly.
21
Quote from: Nihil on March 03, 2022, 06:21:54 AMAnyway, results -
As you remember I wanted to have this input plugin pretend to be the controller, so both it and the controller would be bound to lean or throttle and mix inputs.
So I gave my input plugin the same UUID as the gamepad.
That didn't work.

1. Plugin does not appear in calibration screen. even when working and transmitting data.

So we can stop here.

I'm not sure giving your plugin the same UUID as the pad is a good idea. One of the two U is for "Unique".
I think your plugin should be seen as a separate device, even if it actually takes some inputs from the pad and alters them. GOB must think you have 2 independent devices connected.

That said, as in GPB you cannot select which device to use (when assigning inputs you just move your input device and GPB detects that automatically), I 'm not sure how that will work. Maybe with one of GPB .ini files ? Di dyou check in the Documentation section ?

This in particular: https://forum.piboso.com/index.php?topic=9789.0
22
Quote from: PiBoSo on March 02, 2022, 11:29:02 PMThe "Update" function is called before the GetNumControllers and GetControllerInfo polling.
It is used in the XInput plugin to handle hot-plugging and returning the correct number of connected controllers.
But why separating Update() from GetNumControllers() ?
The comments seem to indicate Update() is called every rendering frame (so high freq) but GetNumControllers() only every few secs. Couldn't one do whatever is done in Update() directly into GetNumControllers() ?

Quote from: PiBoSo on March 02, 2022, 11:29:02 PMThe "Reset" function is called before a control is queried and is used by the "minput" plugin to reset the position to zero and allow the mouse to be assigned.
I.e. called before GetControllerData() ?



@Nihil: Just noticed: you must probably fill _psInfo and _psData, not assign a new address. I.e. something like "psInfo->m_iNumSliders = 0;" etc.
23
Plugins / Re: MaxHUD plugin
March 02, 2022, 03:40:14 PM
Quote from: javiliyors on January 15, 2022, 11:52:12 PMI think the race times doesn't work fine. Durong the race the times going crazy in the standings

Hmm I wondering maybe the problem wasn't in my plugin:

Quote from: PiBoSo on January 15, 2022, 11:52:12 PM* GPB / MXB: fixed the race standings and gap
24
In case it helps, I use SFML for joypad related stuff. No need to write your own low-level one.
25
If you're not even seeing your custom input device in the calibration thing (Settings/Inputs tab, Calibration button) then that's already a problem.

@Vini: I don't think what you suggest is needed or any cleaner. Input plugin feature of GPB + a way to get telemetry from the bike (e.g. via the proxy plugin) should be enough and doesn't require anything external. My understanding is that if you manage to create an input plugin, it will be visible to GPB as an independent input device: if your input plugin actually uses a physical pad, both will be visible to GPB. Not sure how to assign what to what but ...

P.S.
At some point I had in mind to create an input plugin to distort the X-Y limitations of joypads (in some cases you can't get max X and max Y at the same time) but then I dropped the idea.
26
I never tried input plugins so I can easily be wrong on the below:
  • I'm not sure you're populating the fields m_aiButton and m_aiDial (in mydata) correctly: I suspect they should not be really "chars" ... I guess they are in fact integer numbers (as the prefix m_ai* indicates), for the status of each button.
  • In myinfo m_szName is set to "XInput": bad idea. This should be the name you give to your custom controller (I think), so call it "MyOwnController" or something special.
  • Do you actually see your own controller in GPB settings page ?

@PiBoSO: what's the intended usage of Update() and Reset() calls ?
27
I'm not sure of what you're trying to achieve here.

An input plugin is to send data from a device to GPB, not the other way around.
You don't need to create one for an XBox gamepad as GPB already supports gamepads.


Quote from: Nihil on February 27, 2022, 02:26:14 PMAlso, am I using the data structures / populating _psData correctly?
I'd say no. In GetControllerInfo you declare myinfo as a local variable (hence allocated on the stack) but then you pass its address back to GPB: that address is garbage as soon as the execution leaves your function. I'd expect GPB to crash badly.

Same thing in GetControllerData. Plus, in GetControllerData you have twice a return statement, the first one being even before assigning _psData...
28
Plugins / Re: MaxHUD plugin
February 15, 2022, 11:16:58 PM
Quote from: Vini on February 15, 2022, 03:29:38 PMYou sure? Because beta20's default UI is able to show it in replays now.
I've seen no changes in the output plugin interface. This is the data structure SPluginsRaceVehicleData_t:

typedef struct
{
int m_iRaceNum; /* race number */
int m_iActive; /* if set to 0, the vehicle is not active and the following fields are not set */
int m_iRPM; /* engine RPM */
int m_iGear; /* 0 = Neutral */
float m_fSpeedometer; /* meters/second */
float m_fThrottle; /* 0 to 1 */
float m_fFrontBrake; /* 0 to 1 */
float m_fLean; /* degrees. Negative = left */
} SPluginsRaceVehicleData_t;
29
Plugins / Re: MaxHUD plugin
February 14, 2022, 10:16:15 PM
Quote from: Vini on February 12, 2022, 09:58:39 PMCould you add the rear brake input to the speed widget?
Yeah that's easy. However it will work only when riding the bike: when spectating live/replay the rear brake info is not passed (not sure why but that's it).
30
Plugins / Re: MaxHUD plugin
February 08, 2022, 12:02:04 PM
Quote from: Vini on February 08, 2022, 11:25:10 AMSo it hasn't changed from the beta?
Right, rumble profiles values have the same interpretation as in the beta.

To be honest I can't remember but I think some parameters may have been renamed between 2.2.6beta and 2.2.6.
So yeah, better start from scratch and manually copy the values of the profiles you had in the beta.