Subliminal
Bugsmashers

Star Citizen: Bugsmashers - Episode 40

4 January 201700:06:20137 linesWatch on YouTube ↗

Transcript — every row opens the video at that moment

  1. 00:00:06

    [Music] hey everyone welcome to bug Smashers I'm your host Mark aent I'm the gameplay programmer here at cig Los Angeles and I'm here to show you behind the scenes of some bugs and how we smash them let's take a look box bashes hey everyone we're here in my fancy dcy test level and we have a fun UI problem with the Moi glass as you can see I always use a weird screen resolution and it always tends to make the HUD go funky dunky you can kind of see it with the visor right now and when you pop up the mobiglass uh as you can

  2. 00:00:55

    see you the edges tend to get offset and cut um if I my resolution was a little bit wider I'd be able to see the actual extent of the Mobi glass uh so the UI guys were like well we can't have this we needed to work on well pretty much all resolution so that it scales correctly on the screen and so that's what the good old UI folks in UK office has done um so here is our original code uh for our mobiglass instance and we have a standard scale that the designer set up um which for on sense purposes worked for the scale that they were working in in their resolution however it doesn't work in this crazy resolution that I have of 1280 by 960 because I'm weird I like to see my code on my left

  3. 00:01:45

    and right side and it causes all sorts of fun problems such as this uh resolution Shenanigans so what the UI guys have done is based on the renderer um resolution or aspect uh they will scale it so it will scale down or up depending upon how crazy your screen width and hiar uh so let's activate that code to see what happens bam so we take our original scale uh we get the rendering and we scale it based on the renderer width and height so that um if the aspect is slightly wider or slightly uh taller it will try to focus it more onto the center of the screen all right let's hit the magic recode

  4. 00:02:33

    button and see what that does all right as you can see recod is finished and our scaling has worked pretty nicely in my crazy resolution it actually shrinks it down so that I can see the whole thing of U Mobi glass and the only other problem that um exists is here's the close button and as you can see it's not highlighting because I have to move it down bit where is it where is it somewhere around here there it is so as you can see there's quite a big offset from here to here um let's see what they did to fix that so here in Flash UI element this is where it takes the mouse input and sends it off to our flash elements um in this

  5. 00:03:22

    specific region of code it's getting our Mouse coordinates and it's getting the viewport of the renderer and The Flash and it's trying to um see where it should send the mouse inputs as you can see we have for our X and Y we're taking account the width and the height we're not taking in account the viewport offset which is the X and the Y so if that button was at 0 0 way up on the top we'd be able to click it because there was no XY offset however we have an X Andy offset um for where we are to where this button is and we're not taking of that offset so let's do that and see what happens this recode should go by pretty quickly but if we have a little box and we have another let say here we go box

  6. 00:04:12

    and we have another like we could use that square here um our Mouse input for that POS we should say for this position is going to be this x off set and that will be that position for this position right here it's going to be this x offset plus this size and what this code was doing was just taking count this position and not this offset so we do both of these and now we can click here all right recode has been done and we should be able to voila click on the magical button so now everything scales correctly and I can click on buttons as you would expect because well we're taking into account all the offsets hope you guys enjoyed woo so today's bug was something to do with the

  7. 00:05:01

    Mobi glass you know you pop it up and oh no if you have a crazy resolution the Mobi glass right in your face and you can't see on this side or this side because it's clipping or it's like really really really small um it was just a issue with not you know scaling the thing based on your resolution so the good old U UI programmers uh in the UK uh made it so that it scales depending upon your resolution and now it looks pretty great uh you if you do some crazy high resolution or some low resolution and it's not all open in your face or really really tiny and then the other thing that they fixed was they had a little button and if you clicked on the button it wouldn't you know work because it was actually offset and it was just a small little thing to take in account the position change of the uh flash so that it offset correctly so

  8. 00:05:50

    when you hit the button it's actually right here instead of down here hope you guys enjoyed until next time thank you for watching so if you want to keep it with a latest and greatest and Star Citizen of Squadron 42's development please follow us on our social media channels see you soon

Transcript from YouTube’s automatic captions — punctuation and Star Citizen jargon are approximate. The video itself is hosted by CIG on the official channel.

Squadron 42

LiveSQ42 Launch Subathon

$2,094of $3,000

Getting Sub to Manchester for the Squadron 42 launch

Next giveawaySubscriber Store pick
$6.27to go