A thought: Dynamic crosshair
A thought: Dynamic crosshair
- Vince T
- Posts: 14058
- Joined: Fri Apr 27, 2001 11:01 pm
- Contact:
OK picking up from another thread in the closed forum, I riased the idea to make the inertia effect work in exterior mode. However this would not be doable with blue_max's cockpit inertia hook.
Now, regardless of whether or not that could be done I had some more thoughts. One was to have the crosshair in Exterior mode. It would theoretically be possible but would pretty much stop working the moment you rotate the camera around the craft. So the only time where it would be correctly placed is when the player ship is blocking the view. Great idea Vince!
Now here's a new thought, which goes more into the direction of actual OPTing: In my thouhts one could actually place a singular face with crosshair texture in front of the Exterior OPT. You could take it one step further and add a series of such crosshairs to create a sort of target lead.
Now, thinking one step further, this goes once more into the hook department:
As the Dynamic Cockpit Hook incorporates the other HUD elements into the cockpit OPT, could it also project the crosshair onto the exterior?
Also, would it be possible to have individual crosshair designs on a per-ship basis?
Now, regardless of whether or not that could be done I had some more thoughts. One was to have the crosshair in Exterior mode. It would theoretically be possible but would pretty much stop working the moment you rotate the camera around the craft. So the only time where it would be correctly placed is when the player ship is blocking the view. Great idea Vince!
Now here's a new thought, which goes more into the direction of actual OPTing: In my thouhts one could actually place a singular face with crosshair texture in front of the Exterior OPT. You could take it one step further and add a series of such crosshairs to create a sort of target lead.
Now, thinking one step further, this goes once more into the hook department:
As the Dynamic Cockpit Hook incorporates the other HUD elements into the cockpit OPT, could it also project the crosshair onto the exterior?
Also, would it be possible to have individual crosshair designs on a per-ship basis?
You do not have the required permissions to view the files attached to this post.
Your ship, Captain. I need a drink. - Vince Trageton
Vince T's X-Wing HQ - where the bad guys get their gear
Vince T's X-Wing HQ - where the bad guys get their gear
- keiranhalcyon7
- Posts: 599
- Joined: Tue Jan 02, 2018 6:41 am
What if a hook could change the camera's notion of the ship's center point in exterior mode to get it out of the way of the crosshairs?
- Vince T
- Posts: 14058
- Joined: Fri Apr 27, 2001 11:01 pm
- Contact:
I wouldn't move the craft or its center. Thing is the lasers and warhead hardpoints are linked to the Base OPT, so if you move the Exterior, the weapons may be misalligned. Moving the PoV would be better, if that were possible. Ofc. you could simply slightly rotate the view and lock it again.
Your ship, Captain. I need a drink. - Vince Trageton
Vince T's X-Wing HQ - where the bad guys get their gear
Vince T's X-Wing HQ - where the bad guys get their gear
- Driftwood
- Posts: 2174
- Joined: Wed Oct 22, 2003 11:01 pm
- Contact:
As I recall I've brought this up to Blue Max previously and he seemed to think it was possible to overlay the HUD on the exterior view. However, the issue remains being the player POV being positioned immediately behind the ship and thus not very usable.
I think it's going to require Blue Max using math to work correctly though GT. I'm not 100% here, but I'm fairly certain that for the player the exterior opt overwrites the base opt on what's displayed, and somehow pulls the hardpoint data from the base opt. That shouldn't be a problem in and of itself, just starting out at the beginning of my train of thought. However, I think where it becomes an issue is that meshes have a collision "file" function whether the mesh is rendered or not, backface viewed, or not. I think the issue is that depending how far out the single face "reticle" mesh is located one would literally "run into issues" by potentially crashing into things, taking damage from explosions and lasers, ect. since I believe that the exterior opt replaces the physical base opt and inherits the stats for the player.
I think really somebody would need to render the HUD in 3rd person and then change the default exterior player POV via a hook cfg for X/Y/Z coordinates to up and slightly behind the craft similarly to the Rogue Squadron series ships, for instance to function as we'd like it to work ideally. Also it would be handy to tie in the VR/head tracking hook into this function as well since you would be able to dynamically change your viewpoint as within the cockpit. Non headtracking/VR players could obviously use a POV hat per normal to operate this function.
IMO trying to do it on a 3d model basis is going to have major unintended consequences unless there's a method yet undiscovered, or if there's no way to selectively remove collision and clipping from a given mesh, which incidentally if that's possible would open up major possibilities for atmospheric environment to orbital transitions as well as 3d represented ray shielding using slightly transparent and/or illuminated textures. I think that also perhaps begs some investigation if at all possible.
Personally I'd prefer a less invasive/more universal hook implementation of this since it could also be toggled on/off based on user preference, plus I think doing such a mundane edit to literally every opt in existence, in theory, would be a drag if there's a better way.
I think it's going to require Blue Max using math to work correctly though GT. I'm not 100% here, but I'm fairly certain that for the player the exterior opt overwrites the base opt on what's displayed, and somehow pulls the hardpoint data from the base opt. That shouldn't be a problem in and of itself, just starting out at the beginning of my train of thought. However, I think where it becomes an issue is that meshes have a collision "file" function whether the mesh is rendered or not, backface viewed, or not. I think the issue is that depending how far out the single face "reticle" mesh is located one would literally "run into issues" by potentially crashing into things, taking damage from explosions and lasers, ect. since I believe that the exterior opt replaces the physical base opt and inherits the stats for the player.
I think really somebody would need to render the HUD in 3rd person and then change the default exterior player POV via a hook cfg for X/Y/Z coordinates to up and slightly behind the craft similarly to the Rogue Squadron series ships, for instance to function as we'd like it to work ideally. Also it would be handy to tie in the VR/head tracking hook into this function as well since you would be able to dynamically change your viewpoint as within the cockpit. Non headtracking/VR players could obviously use a POV hat per normal to operate this function.
IMO trying to do it on a 3d model basis is going to have major unintended consequences unless there's a method yet undiscovered, or if there's no way to selectively remove collision and clipping from a given mesh, which incidentally if that's possible would open up major possibilities for atmospheric environment to orbital transitions as well as 3d represented ray shielding using slightly transparent and/or illuminated textures. I think that also perhaps begs some investigation if at all possible.
Personally I'd prefer a less invasive/more universal hook implementation of this since it could also be toggled on/off based on user preference, plus I think doing such a mundane edit to literally every opt in existence, in theory, would be a drag if there's a better way.
- keiranhalcyon7
- Posts: 599
- Joined: Tue Jan 02, 2018 6:41 am
Yeah, that's more or less what I was suggesting - don't change the engine's view of the craft's center, just have the exterior camera apply an offset, to both the camera's origin and rotation point. Combined with a version of cockpit momentum, I think a battlefront-like camera could be achievable.
- Vince T
- Posts: 14058
- Joined: Fri Apr 27, 2001 11:01 pm
- Contact:
The collision would be the least of our problems. You could simply shrink the respective meshes' hitbox to 0 and move it to the center of the craft.
Your ship, Captain. I need a drink. - Vince Trageton
Vince T's X-Wing HQ - where the bad guys get their gear
Vince T's X-Wing HQ - where the bad guys get their gear
- blue_max
- Posts: 2296
- Joined: Wed Mar 20, 2019 5:12 am
Would something like this work?
Proof that it's possible to dogfight with it:
https://www.youtube.com/watch?v=gw6nGer ... e=youtu.be
I essentially co-opted the hyperspace effect and rendered a circle at the center of projection instead. It needs to be calibrated once so that the FOV in the effect matches the actual in-game FOV. Also, you have to estimate target lead because you get no indication when you can hit your target otherwise (unless someone knows where XWA stores this information). And, well, the rest of the HUD would have to be rendered on first principles, from information stored in XWA's heap...
... but it's possible to dogfight even with very rudimentary HUD.
Proof that it's possible to dogfight with it:
https://www.youtube.com/watch?v=gw6nGer ... e=youtu.be
I essentially co-opted the hyperspace effect and rendered a circle at the center of projection instead. It needs to be calibrated once so that the FOV in the effect matches the actual in-game FOV. Also, you have to estimate target lead because you get no indication when you can hit your target otherwise (unless someone knows where XWA stores this information). And, well, the rest of the HUD would have to be rendered on first principles, from information stored in XWA's heap...
... but it's possible to dogfight even with very rudimentary HUD.
You do not have the required permissions to view the files attached to this post.
- JeremyaFr
- Posts: 4007
- Joined: Mon Jan 18, 2010 5:52 pm
- Contact:
Exterior View with HUD
You do not have the required permissions to view the files attached to this post.
- blue_max
- Posts: 2296
- Joined: Wed Mar 20, 2019 5:12 am
Very interesting, Jeremy; but the aiming reticle seems to be in the wrong position in that screenshot. Can it be used to aim properly?
- JeremyaFr
- Posts: 4007
- Joined: Mon Jan 18, 2010 5:52 pm
- Contact:
I need to compute the reticle position to render it at the right place.
- Vince T
- Posts: 14058
- Joined: Fri Apr 27, 2001 11:01 pm
- Contact:
God I'm so glad for the rock we kicked loose
Your ship, Captain. I need a drink. - Vince Trageton
Vince T's X-Wing HQ - where the bad guys get their gear
Vince T's X-Wing HQ - where the bad guys get their gear
- JeremyaFr
- Posts: 4007
- Joined: Mon Jan 18, 2010 5:52 pm
- Contact:
For now, there is a few bugs:
When you are in exterior mode, open the map and close the map, then the view goes back to cockpit view.
The same appears when you enter or exit hyperspace. The view goes back to cockpit.
When you are in exterior mode, open the map and close the map, then the view goes back to cockpit view.
The same appears when you enter or exit hyperspace. The view goes back to cockpit.
- keiranhalcyon7
- Posts: 599
- Joined: Tue Jan 02, 2018 6:41 am
Still, excellent work, Jeremy!
To the first order, the crosshairs should be placed at the intersection of the craft boresights axis and infinity. The far clipping plane may serve as an acceptable proxy. This point may or may not be on screen, depending on the degree of rotation the player has applied.
However, I would argue that a better place to put the corsshairs is on the boresights line at a distance away equal to the distance to the current target (or infinity/far clipping plane if no target is selected). This should alleviate the need to estimate how much to adjust your aim due to the camera's offset from boresights.
To the first order, the crosshairs should be placed at the intersection of the craft boresights axis and infinity. The far clipping plane may serve as an acceptable proxy. This point may or may not be on screen, depending on the degree of rotation the player has applied.
However, I would argue that a better place to put the corsshairs is on the boresights line at a distance away equal to the distance to the current target (or infinity/far clipping plane if no target is selected). This should alleviate the need to estimate how much to adjust your aim due to the camera's offset from boresights.
- JeremyaFr
- Posts: 4007
- Joined: Mon Jan 18, 2010 5:52 pm
- Contact:
Hello,
When MousePositionX and MousePositionY are equal to 0, the game doesn't recalculate the reticle position.
To force the game to recalculate the reticule position, I've added this code:
The game projects the vector (0; 0; 1000000) with the player object transform matrix.
The position is stored in these variables:
So it is not needed to manually compute the reticle position. The game can do it itself.
When MousePositionX and MousePositionY are equal to 0, the game doesn't recalculate the reticle position.
To force the game to recalculate the reticule position, I've added this code:
Code: Select all
xwaPlayers[currentPlayerId].MousePositionX = 1;
xwaPlayers[currentPlayerId].MousePositionY = 1;
The position is stored in these variables:
Code: Select all
// 0x068C52C
int s_V0x068C52C;
// 0x068C528
int s_V0x068C528;
- JeremyaFr
- Posts: 4007
- Joined: Mon Jan 18, 2010 5:52 pm
- Contact:
You do not have the required permissions to view the files attached to this post.
- blue_max
- Posts: 2296
- Joined: Wed Mar 20, 2019 5:12 am
Great work, Jeremy! Plus, I assume, you modified something else to make the game display the HUD in exterior view.
Where is this transform matrix?
Are these the offsets of MousePositionX and MousePositionY?The position is stored in these variables:Code: Select all
// 0x068C52C int s_V0x068C52C; // 0x068C528 int s_V0x068C528;
- blue_max
- Posts: 2296
- Joined: Wed Mar 20, 2019 5:12 am
I'm also adding inertia to the external view:
https://www.youtube.com/watch?v=nYYV9g2 ... e=youtu.be
I'm sure both Jeremy's external view HUD and the inertia effect can be combined.
https://www.youtube.com/watch?v=nYYV9g2 ... e=youtu.be
I'm sure both Jeremy's external view HUD and the inertia effect can be combined.
- JeremyaFr
- Posts: 4007
- Joined: Mon Jan 18, 2010 5:52 pm
- Contact:
Hello,
The transform matrix is stored at these offsets in the MobileObject structure:
The MousePositionX and MousePositionY variables are stored at these offsets in the Player structure:
The transform matrix is stored at these offsets in the MobileObject structure:
Code: Select all
/* 0x00C6 */ bool RecalculateTransformMatrix ;
/* 0x00C7 */ short TransformMatrixFrontX ;
/* 0x00C9 */ short TransformMatrixFrontY ;
/* 0x00CB */ short TransformMatrixFrontZ ;
/* 0x00CD */ short TransformMatrixRightX ;
/* 0x00CF */ short TransformMatrixRightY ;
/* 0x00D1 */ short TransformMatrixRightZ ;
/* 0x00D3 */ short TransformMatrixUpX ;
/* 0x00D5 */ short TransformMatrixUpY ;
/* 0x00D7 */ short TransformMatrixUpZ ;
Code: Select all
/* 0x01FD */ short MousePositionX ;
/* 0x01FF */ short MousePositionY ;
- DTM
- Posts: 2120
- Joined: Tue Apr 22, 2003 11:01 pm
- Contact:
You guys are amazing! I'm not a big fan of arcade games, but I have to admit that this is beautiful and my son will love it !!! Thanks, great job!
- Driftwood
- Posts: 2174
- Joined: Wed Oct 22, 2003 11:01 pm
- Contact:
You guys work fast and it looks very promising.
Also while MP isn't huge please try and make things not cause desync where at all possible to avoid mp conflict! I remember somebody mentioning that until BM fixed it, the joystick roll yaw axis fix desync Mp. I don't know how things would desync if both players have the same files though. Either way.
Just thought I'd mention this angle, Sp wise though obviously it'd be irrelevant.
Also while MP isn't huge please try and make things not cause desync where at all possible to avoid mp conflict! I remember somebody mentioning that until BM fixed it, the joystick roll yaw axis fix desync Mp. I don't know how things would desync if both players have the same files though. Either way.
Just thought I'd mention this angle, Sp wise though obviously it'd be irrelevant.