The Dynamic Cockpit Project

Want to edit the game, build your own craft and missions? Here you'll find help, tools, guides and people to discuss with.
Post Reply

Re: The Dynamic Cockpit Project

User avatar
keiranhalcyon7
Lieutenant JG
Posts: 599
Joined: Tue Jan 02, 2018 6:41 am

Post by keiranhalcyon7 » Tue Aug 06, 2019 11:18 pm

The Firespray (another one with 8 cannons) and TIE Defender (to contrast with the B-Wing) may also be worth looking at.

User avatar
Darksaber
Vice Admiral
Posts: 10931
Joined: Mon Jan 10, 2000 12:01 am
Contact:

Post by Darksaber » Tue Aug 06, 2019 11:49 pm

Since when does the Firespray have 8 cannons??

There are 3 different laser versions Green, Red and Yellow

Green = Quad Green Lasers, Twin Ion Cannons = 6 + 2 Missiles
Red = Quad Red Lasers, Twin Red Turbo Lasers = 6 + 2 missiles
Yellow = Quad Yellow Lasers, Twin Ion Cannons = 6 + 2 Missiles

The Tie Defender has quad lasers and twin Ions + twin missiles
“You can please some of the people all of the time, you can please all of the people some of the time, but you can’t please all of the people all of the time”.”
- John Lydgate

Good Things Come To Those Who Wait....
Darksaber's X-Wing Station

User avatar
Driftwood
Admiral (Moderator)
Posts: 2174
Joined: Wed Oct 22, 2003 11:01 pm
Contact:

Post by Driftwood » Wed Aug 07, 2019 2:03 am

If you exceed 6 laser hardpoints (turrets dont count) the game loses the 7th and beyond hardpoints. Ion cannons similarly work as well, and multiple warhead launcher points are merely cosmetic in regards to where the missile fires from as you are limited to two different warhead launchers with 2x bays each.

Turrets are unlimited ammo (unless defined by hook otherwise), and there is only the Orwellian transports that feature an energy bar, that incidentally never depletes.

User avatar
keiranhalcyon7
Lieutenant JG
Posts: 599
Joined: Tue Jan 02, 2018 6:41 am

Post by keiranhalcyon7 » Wed Aug 07, 2019 9:48 am

Darksaber wrote:
Tue Aug 06, 2019 11:49 pm
Since when does the Firespray have 8 cannons??
Oh, sorry, it seems I'm remembering from DSUCP 2.5 (when it had 4 lasers & 4 ions), which is apparently the last time I flew it.
Last edited by keiranhalcyon7 on Wed Aug 07, 2019 9:34 pm, edited 1 time in total.

User avatar
Darksaber
Vice Admiral
Posts: 10931
Joined: Mon Jan 10, 2000 12:01 am
Contact:

Post by Darksaber » Wed Aug 07, 2019 1:36 pm

Ah yes your right, so I apologise too, I think I added two extra hardpoints to make it look like the Firespray was firing faster as in AOTC, so your right it did have 8 cannons, I removed 2 though for the latest versions i.e XWAUCPv1.6 and DSUCPv2.6

Just done a quick test

This is the current version of the Firespray Quad Lasers and Twin Ions, you see the 6 laser bars
slave01.jpg
And this is the older version with Quad Laser and Quad Ions and you see 8 laser bars
slave02.jpg
But if I add Quad Lasers and Sextuple (6) Ions all laser bars disappear
slave03.jpg
So basically the most you can have at one time is 4 of each laser type excluding Turret lasers, which don't have laser bars anyhow.

If you need more than 8 (4+4) lasers on a flyable ship I would say it's way over powered and unnecessary as the flyable version of the Lambda Shuttle is, just because the New Cannon law stats that the Lambda has 8 forward firing lasers and twin rear laser turret, doesn't mean to say it should have them in XWA for one thing it make this craft over powered and the balance in the mission is lost, making it harder if possible to complete the mission, the original TG Shuttle only has quad lasers, this should be the case for the XWAUP Shuttle!
You do not have the required permissions to view the files attached to this post.
“You can please some of the people all of the time, you can please all of the people some of the time, but you can’t please all of the people all of the time”.”
- John Lydgate

Good Things Come To Those Who Wait....
Darksaber's X-Wing Station

User avatar
Driftwood
Admiral (Moderator)
Posts: 2174
Joined: Wed Oct 22, 2003 11:01 pm
Contact:

Post by Driftwood » Wed Aug 07, 2019 7:29 pm

It's been a while, but I thought we reduced the cannons on the shuttle to fit the 4x laser indicator limitation already? Or split them into 4x4. Hmm.

Justagai
Cadet 1st Class
Posts: 218
Joined: Mon Dec 08, 2014 10:59 pm

Post by Justagai » Wed Aug 07, 2019 7:52 pm

Throwing my opinion here but I don't think there should be any added or removed weaponry or modification in stats for XWAUP base craft (unless its custom or just shifting hardpoints around). Simply put, it ruins the balance of the game.

User avatar
Darksaber
Vice Admiral
Posts: 10931
Joined: Mon Jan 10, 2000 12:01 am
Contact:

Post by Darksaber » Wed Aug 07, 2019 8:55 pm

True I totally agree, I think I'll revamp the shuttle to just have the quad lasers, and of course the option for turret version

It's too over powered at the moment with quad lasers and quad turbo lasers, then you have the turret

I have to apologise to blue_max for hijacking his thread, please if you think something needs changing with any or the XWAUCP or DSUCP craft please report it in the ***NEW*** DSUCPv2.6 Release *** NEW*** or create a new thread

-Thanks
“You can please some of the people all of the time, you can please all of the people some of the time, but you can’t please all of the people all of the time”.”
- John Lydgate

Good Things Come To Those Who Wait....
Darksaber's X-Wing Station

User avatar
Trevor
Lieutenant JG
Posts: 541
Joined: Thu Dec 04, 2014 7:11 pm

Post by Trevor » Wed Aug 07, 2019 10:20 pm

blue_max wrote:
Tue Aug 06, 2019 9:48 pm
Alright, I think I understand what you're proposing now, Trevor. I think it probably would work. In fact, I think we're more-or-less doing the same thing; but you're using the screen as a reference frame + formulas to compute the locations, whereas I'm using individual textures and pixel coordinates. I think each approach has its own merits.
Is that in your new method since your original method also used the screen as refrence frame but fixed it to absolute values.

As for using the original FB, agreed, this would simplify the equation and I didn't even think of it since I was already heading down the screen capture method.

also... perhaps I misunderstood your original issue regarding resolution and backbuffers…

Code: Select all

…
		viewport.Width = (float)this->_backbufferWidth;

		viewport.Height = (float)this->_backbufferHeight;

...
		step = "Texture2D displayWidth x displayHeight";
...
		textureDesc.Width = this->_displayWidth;

		textureDesc.Height = this->_displayHeight;
…
if ((width == this->_displayWidth) && (height == this->_displayHeight) && (bpp == this->_mainDisplayTextureBpp))
Is the backbuffer not in fact game res?

it seems as though the backbuffer accepts width and height in its initialise function (presumably provided by XWA engine) and all other buffers are = backbuffer.

if so, then we can already dispense with the preserve and game/screen multiplier since they would null out.

Trev

User avatar
blue_max
XWAU Member
Posts: 2295
Joined: Wed Mar 20, 2019 5:12 am

Post by blue_max » Thu Aug 08, 2019 12:17 am

The original problem was that auto-detection of HUD textures caused misalignment when pasting the HUD to the cockpit. That's why I switched to using screen-referenced, absolute coordinates. I've fixed both problems now by using scale-invariant coordinates measured with respect to the textures as seen by ddraw -- that's what I was referring to in my previous post.

Yes, the backbuffer width,height refers to screen coordinates. No, we can't ignore PreserveAspect ratio because the game still delivers coordinates using the in-game resolution, so a transformation must still take place. Anyway, this is not a problem anymore. Things seem to be working now even when the resolution changes. I've simplified the coordinates quite a bit and I've tried to follow your suggestions. The next release should work for everyone without having to touch coordinates at all. I'll try to release something this weekend.

User avatar
Trevor
Lieutenant JG
Posts: 541
Joined: Thu Dec 04, 2014 7:11 pm

Post by Trevor » Thu Aug 08, 2019 5:18 pm

That sounds fantastic! :)

Cant wait to see the simplified craft config and I might try my hand at a cockpit.

Trev

User avatar
blue_max
XWAU Member
Posts: 2295
Joined: Wed Mar 20, 2019 5:12 am

Post by blue_max » Fri Aug 09, 2019 6:28 am

UPDATE: I've updated how the coordinates look now. I'm using labels instead of numbers so that things make more sense.

Alright, here's a sample of how the coordinates look now:

Code: Select all

; Left Radar and Energy Recharge Levels
[XwingCockpit.opt,TEX00096]
cover_texture = DynamicCockpit\x-wing-left-radar-cover.png
cover_texture_size = 256, 256
uv_coords = LASER_RECHARGE_SRC, 220,11, 228,78
uv_coords = SHIELD_RECHARGE_SRC, 229,11, 236,78
uv_coords = ENGINE_POWER_SRC, 237,11, 245,78
uv_coords = LEFT_SENSOR_SRC, 40,28, 98,111; 0x0
erase_region = LEFT_SENSOR_REGION
The cover_texture_size field must come before any uv_coords. The available source elements are:

Code: Select all

; Available Source Names (use these labels with the uv_coords command):
; LEFT_SENSOR_SRC
; RIGHT_SENSOR_SRC
; LASER_RECHARGE_SRC
; SHIELD_RECHARGE_SRC
; ENGINE_POWER_SRC
; BEAM_RECHARGE_SRC
; SHIELDS_SRC
; BEAM_LEVEL_SRC
; TARGETING_COMPUTER_SRC
; QUAD_LASERS_LEFT_SRC
; QUAD_LASERS_RIGHT_SRC
; LEFT_TEXT_BOX_SRC
; RIGHT_TEXT_BOX_SRC
; SPEED_THROTTLE_SRC
; MISSILES_SRC
; NAME_TIME_SRC
; NUM_SHIPS_SRC
(I'll add more source elements later for dual lasers, etc) And the regions that can be erased are:

Code: Select all

; Available HUD regions (use these labels with the erase_region command):
; LEFT_SENSOR_REGION
; RIGHT_SENSOR_REGION
; SHIELDS_REGION
; BEAM_REGION
; TARGET_AND_LASERS_REGION
; LEFT_TEXT_BOX_REGION
; RIGHT_TEXT_BOX_REGION
; TOP_LEFT_REGION
; TOP_RIGHT_REGION
Last edited by blue_max on Sat Aug 10, 2019 7:20 pm, edited 1 time in total.

User avatar
ual002
XWAU Member
Posts: 983
Joined: Wed Sep 24, 2008 2:23 am

Post by ual002 » Fri Aug 09, 2019 3:55 pm

The progress here is looking phenomenal.
Image Image Image Image Image

User avatar
blue_max
XWAU Member
Posts: 2295
Joined: Wed Mar 20, 2019 5:12 am

Post by blue_max » Sat Aug 10, 2019 7:24 pm

ual002 wrote:
Fri Aug 09, 2019 3:55 pm
The progress here is looking phenomenal.
Thanks ual002. BTW, I believe you were one of the persons who requested support to move the HUD around. I haven't implemented that yet; but I was thinking of using normalized screen coordinates. So, maybe something like this:

Code: Select all

move_region = LEFT_SENSOR, 0.5, 0.8, 0.75, 1.0
Where the format is <HUD-Region-name>, x0,y0, x1,y1

The catch here is that I would have to use normalized (0..1) coordinates so that it works across multiple resolutions. So (x,y) = (0.5, 0.5) is the middle of the screen. (1,1) is the bottom-right corner, (0,0) is the top-left corner and so on. Does that make sense?

User avatar
ual002
XWAU Member
Posts: 983
Joined: Wed Sep 24, 2008 2:23 am

Post by ual002 » Sat Aug 10, 2019 11:04 pm

Yes. That does. And solves for the exact problem with said multiple resolutions. In my case, i can have 3 monitors and bring in the edge items a little closer to the center with a text file.

Scale is another thing that would be cool to implement as well, allowing me to have larger view finders if say I'm wearing oh I dunno, a TIE pilot helmet. :D
Image Image Image Image Image

User avatar
blue_max
XWAU Member
Posts: 2295
Joined: Wed Mar 20, 2019 5:12 am

Post by blue_max » Sun Aug 11, 2019 6:03 pm

Scale is really not a problem. Since you're specifying coordinates, you can make the HUD regions arbitrarily large (or even mirror them along any axis; but I don't think that's useful here):
Dynamic-Cockpit-Sample-8-move_regions.jpg
You do not have the required permissions to view the files attached to this post.

User avatar
ual002
XWAU Member
Posts: 983
Joined: Wed Sep 24, 2008 2:23 am

Post by ual002 » Mon Aug 12, 2019 1:27 pm

Much more useful on triple screen when you put the radar on the flanking monitors, but toward the edge closer to the middle and then ramp up the scale. So your center monitor isn't cluttered, but you do have that extra visual information on the edges.
Image Image Image Image Image

User avatar
blue_max
XWAU Member
Posts: 2295
Joined: Wed Mar 20, 2019 5:12 am

Post by blue_max » Tue Aug 13, 2019 8:03 am

Yes, that makes sense, ual002. I'll release something soon so you can try it out. BTW, this is how the TIE-Fighter cockpit looks like with DC enabled:
Dynamic-Cockpit-Sample-9.jpg
You do not have the required permissions to view the files attached to this post.

User avatar
Driftwood
Admiral (Moderator)
Posts: 2174
Joined: Wed Oct 22, 2003 11:01 pm
Contact:

Post by Driftwood » Wed Aug 14, 2019 1:59 am

Alright, so first question is the blue texture in the targeting/message screens (for example) generated by the engine? And if so, is there a way to change it?
If it's able to be changed to match a particular background, then I have a few ideas I'm tossing around for integration on the current project I want to resume cockpit wise.

Second question, can certain HUD elements be split in a particular manner? IE, can the top bar be split into three different sections and put wherever you want, separately?

Third, can any of the HUD elements be displayed multiple times if desired? (For "multi-crew" craft)

Fourth, this is probably not viable but I want to ask anyways; is there any way to project the ingame MAP into an on screen display within the cockpit? Regardless if this is "practical" for certain ships or not.

Fifth, how does this work with cockpits that use a single UV map based on a single texture for the entire mesh, or several meshes within an opt? For example the current Shuttle cockpit and gun turret opt for it?

Sixth, can the HUD elements be integrated into the relevant gunner opt as well? Such as, the shuttle or CORT gunner opts?

User avatar
blue_max
XWAU Member
Posts: 2295
Joined: Wed Mar 20, 2019 5:12 am

Post by blue_max » Wed Aug 14, 2019 5:46 am

Driftwood wrote:
Wed Aug 14, 2019 1:59 am
Alright, so first question is the blue texture in the targeting/message screens (for example) generated by the engine? And if so, is there a way to change it?
I'm not sure I followed you here. The blue background on the targeting computer on the image of the TIE Fighter cockpit is just a solid color that can be configured manually. The background texture for message boxes is the same one the game is currently using. I think I can replace these background textures with pretty much whatever I want. What do you have in mind?
Driftwood wrote:
Wed Aug 14, 2019 1:59 am
Second question, can certain HUD elements be split in a particular manner? IE, can the top bar be split into three different sections and put wherever you want, separately?
Yes, this is possible. Currently, the top bar is split in four regions: Speed & Throttle, Missiles, Name & Time and Number of Ships. You can put these 4 elements pretty much wherever you want. If you want a different split, it may also be possible. The main limitation here is that the relative font size may vary between different resolutions.
Driftwood wrote:
Wed Aug 14, 2019 1:59 am
Third, can any of the HUD elements be displayed multiple times if desired? (For "multi-crew" craft)
... and this is why it's great to listen to other people's ideas: Yes! This is currently possible! I haven't even though about this; but I just checked and it works. Fun!
Driftwood wrote:
Wed Aug 14, 2019 1:59 am
is there any way to project the ingame MAP into an on screen display within the cockpit? Regardless if this is "practical" for certain ships or not.
This is a good idea; but right now, this is not possible. When switching the map on, the cockpit disappears and viceversa. I think one way to implement this would be to check the positions of every ship by examining XWA's heap or data segment and then doing the rendering manually. This might be possible in the future.
Driftwood wrote:
Wed Aug 14, 2019 1:59 am
Fifth, how does this work with cockpits that use a single UV map based on a single texture for the entire mesh, or several meshes within an opt? For example the current Shuttle cockpit and gun turret opt for it?
This is completely texture-driven. Each texture can hold up to 8 individual HUD elements (this limit is more-or-less arbitrary). You have to make transparent holes in them so that they "show through". I'm sorry, I couldn't find the Shuttle cockpit. If you can direct me to that OPT I can take a look and provide a better answer.
Driftwood wrote:
Wed Aug 14, 2019 1:59 am
Sixth, can the HUD elements be integrated into the relevant gunner opt as well? Such as, the shuttle or CORT gunner opts?
I don't see why not. As I said, this is completely texture-driven. When I see a texture with DC activated, I replace it. Potentially, we could apply HUD elements to the exterior of ships (but that would be weird). The only restriction right now is that the name of the OPT must contain the word "*Cockpit" in it. But I can remove or extend that restriction to other OPTs. I think I've got to add "*Gunner" to the name of the OPTs to enable them...

User avatar
keiranhalcyon7
Lieutenant JG
Posts: 599
Joined: Tue Jan 02, 2018 6:41 am

Post by keiranhalcyon7 » Wed Aug 14, 2019 7:37 am

blue_max wrote:
Wed Aug 14, 2019 5:46 am
Driftwood wrote:
Wed Aug 14, 2019 1:59 am
Second question, can certain HUD elements be split in a particular manner? IE, can the top bar be split into three different sections and put wherever you want, separately?
Yes, this is possible. Currently, the top bar is split in four regions: Speed & Throttle, Missiles, Name & Time and Number of Ships. You can put these 4 elements pretty much wherever you want. If you want a different split, it may also be possible. The main limitation here is that the relative font size may vary between different resolutions.
I can shed some light on that. It all depends on the HUD scale factor (sf). sf < 1.2: 10 pixel font. 1.2 <= sf < 1.5: 12 pixel font. sf >= 1.5: 16 pixel font, with some corruption. (This is why the HUD scale factor threshold for seeing font corruption is >= 1.5.) The fonts themselves are in fonts.dat. (Note that some HUD texts, such as the name of the targeted craft and mission messages (in the middle of the view, not in the radio messages MFD display), apply an additional scale factor of 1.2, so for some HUD scale factors they will appear in the next size up from most other HUD texts. These texts do not appear to exhibit corruption, though, even when rendered in the 16-pixel font.)

The HUD scale factor is an exe-internal variable that depends on the chosen resolution; it is changeable via xwahacker. DSUCP 2.6 sets it to 2.0 for 1600x1200, 1.44 for 1152x864, and 1.0 for 800x600 and 640x480; I'm not sure if these are the factory values. The other two resolutions are not supported by xwahacker.
Driftwood wrote:
Wed Aug 14, 2019 1:59 am
Fifth, how does this work with cockpits that use a single UV map based on a single texture for the entire mesh, or several meshes within an opt? For example the current Shuttle cockpit and gun turret opt for it?
This is completely texture-driven. Each texture can hold up to 8 individual HUD elements (this limit is more-or-less arbitrary). You have to make transparent holes in them so that they "show through". I'm sorry, I couldn't find the Shuttle cockpit. If you can direct me to that OPT I can take a look and provide a better answer.
It's ShuttleGunner.opt. It only seems to install if you chose a shuttle install option with the turret enabled.

One issue with the current shuttle - and I'm assuming a little bit here by tying it to your earlier question about multi-crew craft, Driftwood - is that the copilot's station is the mirror image of the pilot's station, sharing the same texture, if I'm not mistaken. So all the HUD elements on that station would be mirrored.
Driftwood wrote:
Wed Aug 14, 2019 1:59 am
Sixth, can the HUD elements be integrated into the relevant gunner opt as well? Such as, the shuttle or CORT gunner opts?
I don't see why not. As I said, this is completely texture-driven. When I see a texture with DC activated, I replace it. Potentially, we could apply HUD elements to the exterior of ships (but that would be weird).
Applying HUD elements to ship exteriors, yes, weird. Arbitrary images, though? You could animate the billboards on Dunari's Casino...

User avatar
Will T
Galactic Empire
Posts: 1371
Joined: Thu Aug 19, 2004 11:01 pm

Post by Will T » Wed Aug 14, 2019 10:54 am

blue_max wrote:
Tue Aug 13, 2019 8:03 am
Yes, that makes sense, ual002. I'll release something soon so you can try it out. BTW, this is how the TIE-Fighter cockpit looks like with DC enabled:

Dynamic-Cockpit-Sample-9.jpg
So, dumb question as I'm not up to learning the ins and outs of this hook yet:

Doesn't the TIE cockpit already have elements modelled in that correspond to the HUD? Aren't there two dials at the top of the viewport meant to be the radar screens, with an oval display below that for the hull reading?

Is there a reason those don't work? It seems like the TIE is the easiest one to adapt to dynamic cockpits without cramming them all into the bottom half of the screen as the HUD elements already all have a place modelled and textured in.


Also, as this is my first time commenting on this I just want to say how incredible this little project is.

Having all these readouts finally feel like they're part of the cockpit in a 3D environment is pretty much a dream come true, and something that always seemed to be impossible. It'll be amazing to see that FAQ question "can't you make [the cockpits] even a little bit like the old X-Wing and TIE Fighter cockpits" finally disappear after like, 15 years. I don't envy you guys the work of figuring out the system and adjusting every one of those fantastic cockpits to work with this, but I can't wait to see the results.
Formerly known as The 95 Headhunter

User avatar
ual002
XWAU Member
Posts: 983
Joined: Wed Sep 24, 2008 2:23 am

Post by ual002 » Wed Aug 14, 2019 12:22 pm

@Will T, Darksaber removed those upper left/ upper right radar screen elements in the last major patch as they were mostly meant to align perfectly with the HUD overlay at the time. But since most people had wide screen resolutions, the eye point of the pilot seemed too far back in the cockpit necessitating a rework. That rework saw those screens removed. It may be something Darksaber would consider re-adding in some future update given the development of this project.

@blue_max, you tease me. How naughty. :D. No but seriously I feel like the top side of the center dash could use a monitor angled up at the pilot that had the center CMD info and a little extra room on the sides for any needed indicators. That would need a mesh adjustment though. But then again your solution on the control yoke is pretty inventive, I guess I just need to actually fly the cockpit with 6DOF to be able to actually provide functional constructive feedback.
Image Image Image Image Image

User avatar
ual002
XWAU Member
Posts: 983
Joined: Wed Sep 24, 2008 2:23 am

Post by ual002 » Wed Aug 14, 2019 12:27 pm

Also, all this talk about animated panels got me to thinking that I cant actually think of any cockpits as part of the upgrade project that have animated screens or indicators. Might be a cool immersion builder for future modelers. And I just mean simple stuff like aurebesh text scrolling, blinking lights, etc.
Image Image Image Image Image

User avatar
Driftwood
Admiral (Moderator)
Posts: 2174
Joined: Wed Oct 22, 2003 11:01 pm
Contact:

Post by Driftwood » Wed Aug 14, 2019 1:17 pm

That begs the question, how on earth would we utilize animated textures?

And, regarding hud elements on textures, could you expand the hook to include <craftname>gunner.opt, and <craftname>exterior.opt? The former would keep things consistent with the cockpit opts, and the latter would enable the HUD to be visible or panels to be made to allow 3rd person combat viable so the player can choose their pov.

Post Reply