Our rules have been updated and given their own forum. Go and look at them! They are nice, and there may be new ones that you didn't know about! Hooray for rules! Hooray for The System! Hooray for Conforming!
Our new Indie Games subforum is now open for business in G&T. Go and check it out, you might land a code for a free game. If you're developing an indie game and want to post about it, follow these directions. If you don't, he'll break your legs! Hahaha! Seriously though.

[Programming] Thread: Restricting masking of red pandas since 2013.

1356713

Posts

  • bowenbowen Registered User regular
    Ah man, I hate writing hit tests for UIs.
  • JasconiusJasconius bird internet Saint Petersburg RussiaRegistered User regular
    edited May 2013
    my hit tests are pretty rudimentary rectangle tests. I don't do byte sample for transparent pixels and stuff

    fortunately XNA has a very robust Rectangle class which helps you through the basics

    the biggest bitch is that XNA is resolution agnostic, or more appropriately, resolution retarded, so you have to do all scale factoring and everything yourself if you want to support more than one resolution AT ANY POINT in the future

    so I have to write an elaborate system to calculate the "actual" real estate my views were taking up on a monitor based on the current resolution of the window, etc


    ie, if a button is "50 pixels wide", but running at 70% of the optimal resolution... it's actually located at X, Y, and is W,H big

    yup


    the real pain will come when I have to do text label cropping and such, because you don't render text with spatial dimensions. you just give it a font and a string and XNA decides what to do... so cropping and word wrapping must be written from scratch
    Jasconius on
  • bowenbowen Registered User regular
    Luckily that should only pertain to UI objects Jasc. The actual physical 3d objects should resize depending on the camera's "size", right?
  • JasconiusJasconius bird internet Saint Petersburg RussiaRegistered User regular
    edited May 2013
    bowen wrote: »
    Luckily that should only pertain to UI objects Jasc. The actual physical 3d objects should resize depending on the camera's "size", right?

    Let me correct myself

    for RENDERING, XNA handles the sizing

    I don't have to TELL my button to render smaller to fit into the window

    however, I do have to take into account the window size when assessing mouse clicks

    so if I say a button is 50,50,200,50 (x,y,w,h)

    when I read a mouse click at 45,45... if my window is smaller than the resolution at which I assume when I program my interface, that click may very well be valid, so I have to account for that, because MonoGame (and I assume just window frameworks like TK in general), report "real" pixels when taking mouse input.

    So once you get into that, AND a 5-deep hierarchy of nested GUI assets that may have scale factors applied to them.... it gets intense
    Jasconius on
  • InfidelInfidel It's not Infidel, it's INNNNNFIDELRegistered User regular
    Isn't it easier to just translate the event first instead of your objects?

    One x/y coord to scale, versus all the xywh of your interaction areas.
    Play D&D 4e? :: Check out Orokos and upload your Character Builder sheet! :: Orokos Dice Roller
    The PhalLounge :: Chat board for Phalla discussion and Secret Santas :: PhallAX 2013
    Critical Failures IRC! :: #CriticalFailures and #mafia on irc.slashnet.org
  • bowenbowen Registered User regular
    Infidel wrote: »
    Isn't it easier to just translate the event first instead of your objects?

    One x/y coord to scale, versus all the xywh of your interaction areas.

    Seems easier if I'm understanding him right. Work with the "screen" object before the render? Not sure how that applies, I've never really delved too deep past a fixed aspect with rendering.
  • bowenbowen Registered User regular
    Or do a depth test, get everything within X/Y and determine which one's topmost via your Z axis, or something.
  • JasconiusJasconius bird internet Saint Petersburg RussiaRegistered User regular
    Infidel wrote: »
    Isn't it easier to just translate the event first instead of your objects?

    One x/y coord to scale, versus all the xywh of your interaction areas.

    well I have to account for internal scales too (a button sized to 0.5 scale, for example), so I just lumped it into the hit test on the views themselves, rather than have it in two different places

    because I have to position and lay everything out based on a one-true-resolution, I thought it was also reasonable to treat the mouse clicks similarly everywhere except the ugly internals of the interactive GUI objects


    this is similar to how apple does it with the Retina vs. Non-Retina programming... your events and GUI layout are all based an identical scale of numbers. they do all the conversion behind the scenes

    It just so happened I base mine on the maximum possible scale, and they base theirs on the lowest
  • bowenbowen Registered User regular
    That makes sense I think.
  • JasconiusJasconius bird internet Saint Petersburg RussiaRegistered User regular
    It's potentially not the best solution, but it's code that certainly requires no maintenance. It is what it is and it's internally consistent.

    Frankly if there's anything that I could do differently it would go far beyond how to deal with translating mouse coordinates

    I really burn with the desire to have a full fledged GUI editor so I can start drag and dropping controls rather than spamming F5 while adjusting pixel values 3 or 4 units at a time
  • bowenbowen Registered User regular
    Could always make one!
  • JasconiusJasconius bird internet Saint Petersburg RussiaRegistered User regular
    first I have to do stuff like "scrolling text box"

    and

    "an 4x strategy game AI that the player can play against"
  • urahonkyurahonky Registered User regular
    Infidel wrote: »
    What kind of tasks are you tracking? Specifically developer tasks? Bug fixes / QA involvement?

    Really just developer tasks. We can really make anything (like flyspray, bugzilla, etc) do what we need it to do, though. And yeah JIRA was mentioned because that's what our contractor uses, but we don't have any money for that.
  • bowenbowen Registered User regular
    I've found I just need to have bullet points I can mark complete, and go back to if I need it.

    Almost no one makes something that simple.
  • PhyphorPhyphor Registered User regular
    The real trick is developing something that handles aspect ratio changes. Will your game run on my 3240x1920 display? (or my 3340x1920 display with bezel compesnation?)

    A lot of commercial games wont!
  • urahonkyurahonky Registered User regular
    Phyphor wrote: »
    The real trick is developing something that handles aspect ratio changes. Will your game run on my 3240x1920 display? (or my 3340x1920 display with bezel compesnation?)

    A lot of commercial games wont!

    I love that Dungeon Defenders actually lets you type in a number for the resolution.
  • PhyphorPhyphor Registered User regular
    edited May 2013
    I've taken to playing in windowed mode where I need to. Sometimes forced by the commandline simply because I have my monitors in portrait orientation and a lot of games really don't like seeing 1080x1920 instead of 1920x1080 in their resolution list.

    Also, there's a funny effect where some games autosize to a low resolution and actually start, but display in triplicate - one per monitor
    Phyphor on
  • JasconiusJasconius bird internet Saint Petersburg RussiaRegistered User regular
    Phyphor wrote: »
    The real trick is developing something that handles aspect ratio changes. Will your game run on my 3240x1920 display? (or my 3340x1920 display with bezel compesnation?)

    A lot of commercial games wont!

    It would handle that if my graphic assets were vector

    It's just not worth the pain.

    MonoGame's answer is to letterbox the stage
  • bowenbowen Registered User regular
    Phyphor wrote: »
    I've taken to playing in windowed mode where I need to. Sometimes forced by the commandline simply because I have my monitors in portrait orientation and a lot of games really don't like seeing 1080x1920 instead of 1920x1080 in their resolution list.

    Also, there's a funny effect where some games autosize to a low resolution and actually start, but display in triplicate - one per monitor

    Now you've got me trying to question how to handle that. I probably won't, but still that's a super niche issue that I'm surprised isn't addressed at the engine level.
  • PhyphorPhyphor Registered User regular
    Jasconius wrote: »
    Phyphor wrote: »
    The real trick is developing something that handles aspect ratio changes. Will your game run on my 3240x1920 display? (or my 3340x1920 display with bezel compesnation?)

    A lot of commercial games wont!

    It would handle that if my graphic assets were vector

    It's just not worth the pain.

    MonoGame's answer is to letterbox the stage

    As long as you don't crash. I'm looking at you bunch of EA games!
    bowen wrote: »
    Phyphor wrote: »
    I've taken to playing in windowed mode where I need to. Sometimes forced by the commandline simply because I have my monitors in portrait orientation and a lot of games really don't like seeing 1080x1920 instead of 1920x1080 in their resolution list.

    Also, there's a funny effect where some games autosize to a low resolution and actually start, but display in triplicate - one per monitor

    Now you've got me trying to question how to handle that. I probably won't, but still that's a super niche issue that I'm surprised isn't addressed at the engine level.

    Windowed mode. I can fit a 1920x1080 window trivially, but not in fullscreen
  • bowenbowen Registered User regular
    Pft you act like I hate windowed mode!

    I hate games that don't have windowed mode, it baffles my fucking mind that they don't. I remember in the haydays of directX though, the calls to draw full screen exclusive and windowed mode were slightly different, so most didn't bother.
  • PhyphorPhyphor Registered User regular
    Yeah, back in the days of dx7 it was a pain, but now? Super easy to do, as long as you write your window creation logic properly to let you make a window with the proper class and such
  • PhyphorPhyphor Registered User regular
    Though when a game runs fullscreen it looks super nice since it's basically a 40" high-res TV taking up most of my field of view
  • urahonkyurahonky Registered User regular
    So I'm trying to get Eventum installed and the installation guide says:
    Anyway, all you should have to do is place the Eventum files in a directory that is viewable from the web, and open it up with your browser. Eventum should redirect you to the installation screen, and it will try to guess some of required parameters, like path in the server and etc.

    I have Tomcat7 running on this machine. I copy the folder to the webapps directory... However the problem is that there is no WEB-INF in the Eventum directory. Does that mean I have to make it? I've never seen anything like this before.
  • bowenbowen Registered User regular
    I assume when its making assumptions on your installation environment, it's assuming you're running apache2 with php in some capacity.
  • JasconiusJasconius bird internet Saint Petersburg RussiaRegistered User regular
    edited May 2013
    Aspect and resolution adjustment is pretty fluid in MonoGame from a "is it possible without crashing" point of view

    but really a truly aspect independent game requires a ton of UI forethought

    and in a game as menu-driven as mine that's pretty hard to achieve

    AngryBirds for example would be much easier to aspect-ratio adapt than, say, Rome: Total War

    in other words... it's all about the assets, not the code
    Jasconius on
  • InfidelInfidel It's not Infidel, it's INNNNNFIDELRegistered User regular
    It's not a Java app, it's a PHP app.

    Install Apache/MySQL/PHP stack, put in web folder, browse.
    Play D&D 4e? :: Check out Orokos and upload your Character Builder sheet! :: Orokos Dice Roller
    The PhalLounge :: Chat board for Phalla discussion and Secret Santas :: PhallAX 2013
    Critical Failures IRC! :: #CriticalFailures and #mafia on irc.slashnet.org
  • bowenbowen Registered User regular
    Java :rotate:
  • urahonkyurahonky Registered User regular
    edited May 2013
    Haha wow. For some reason I kept thinking Tomcat was like the web service that did it all. Somehow forgetting it's Java based.
    urahonky on
  • PhyphorPhyphor Registered User regular
    Jasconius wrote: »
    Aspect and resolution adjustment is pretty fluid in MonoGame from a "is it possible without crashing" point of view

    but really a truly aspect independent game requires a ton of UI forethought

    and in a game as menu-driven as mine that's pretty hard to achieve

    AngryBirds for example would be much easier to aspect-ratio adapt than, say, Rome: Total War

    in other words... it's all about the assets, not the code

    Yeah, but it is possible even in those games. A lot of games have UI anchored to corners, in which case it still can be, or anchored to a side, in which case you just need a bit of extra work to draw filler (or use the space by resizing sub-components), or there's arbitrary positioning UI in which case it should still work. Essentially there's less physical space taking up the UI, but they take up the same pixels. Quite a few games do something like this (notably Paradox games, which all seem to work properly if they're even remotely recent)
  • InfidelInfidel It's not Infidel, it's INNNNNFIDELRegistered User regular
    Jasconius wrote: »
    Aspect and resolution adjustment is pretty fluid in MonoGame from a "is it possible without crashing" point of view

    but really a truly aspect independent game requires a ton of UI forethought

    and in a game as menu-driven as mine that's pretty hard to achieve

    AngryBirds for example would be much easier to aspect-ratio adapt than, say, Rome: Total War

    in other words... it's all about the assets, not the code

    Totally. Aspect ratio is a design challenge, not a technical one.
    Play D&D 4e? :: Check out Orokos and upload your Character Builder sheet! :: Orokos Dice Roller
    The PhalLounge :: Chat board for Phalla discussion and Secret Santas :: PhallAX 2013
    Critical Failures IRC! :: #CriticalFailures and #mafia on irc.slashnet.org
  • urahonkyurahonky Registered User regular
    Installing XAMPP now... I hate having two different web services on one machine.
  • InfidelInfidel It's not Infidel, it's INNNNNFIDELRegistered User regular
    urahonky wrote: »
    Installing XAMPP now... I hate having two different web services on one machine.

    Not a web service!

    A web server! :rotate:
    Play D&D 4e? :: Check out Orokos and upload your Character Builder sheet! :: Orokos Dice Roller
    The PhalLounge :: Chat board for Phalla discussion and Secret Santas :: PhallAX 2013
    Critical Failures IRC! :: #CriticalFailures and #mafia on irc.slashnet.org
  • bowenbowen Registered User regular
    You're a web service.
  • urahonkyurahonky Registered User regular
    That's what I meant to type :P My brain's fried because I miss the good ole days when I could just double click an .exe and it installs for me.
  • urahonkyurahonky Registered User regular
    Hmm. I always thought Apple products were supposed to be intuitive... But if you type "reboot" into Google, look at the top search results. :P
  • DelmainDelmain Registered User regular
    urahonky wrote: »
    Hmm. I always thought Apple products were supposed to be intuitive... But if you type "reboot" into Google, look at the top search results. :P

    Is this something other than the TV show for you?

    Because that show was awesome
    Torak - Elcor Vanguard
  • urahonkyurahonky Registered User regular
    Oh God... Nostalgia..
  • Monkey Ball WarriorMonkey Ball Warrior A collection of mediocre hats Redmond, WARegistered User regular
    Only ever watched that on the TV's hanging overhead in the cafeteria at the college I went to on my first attempt right after high school (~2002).

    I was majoring in Astrophysics, and oh man what a fiasco that was.
    [47 6F 6F 64 20 4A 6F 62 21 0]
  • MadpoetMadpoet Registered User regular
    urahonky wrote: »
    Do you guys have any suggestions on a good, lightweight, cheap tracking tool my team can use? We'd like to be able to put all of our tasks on this site so we have an idea what we need to do and what we need to work on before x Date. We'd prefer nothing that requires a Server.

    Sounds like you have one already, but in case it doesn't work out, Jira has a cloud version at 10 users for $10/mo. It goes up dramatically if you add user 11, but for small teams it's unbeatable.
Sign In or Register to comment.