Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Tiler Kiwi
Feb 26, 2011
Thanks for the replies. The Qud thing sounds interesting, I think I remember reading something similar to the concept before, but I'm big on anything that can enable more emergent / encapsulated behavior instead of having to manually tweak a bunch of things. I'm aiming for a great deal of procedural generation, which means I've been giving a lot of hoots lately about more emergent behavior in systems, so the idea of having a foo defined by combining behaviors of other foo instead of having to make each and every one and having to worry about consistency in interactions sounds appealing and is something I've been aiming for.

e: The "Orc Cleric" problem sound suspiciously similar to the deadly diamond issue with multiple inheritance, actually.

Tiler Kiwi fucked around with this message at 11:09 on Jun 19, 2018

Adbot
ADBOT LOVES YOU

Angryhead
Apr 4, 2009

Don't call my name
Don't call my name
Alejandro




"The Qud thing" is this:
https://www.youtube.com/watch?v=U03XXzcThGU

Probably inspired a whole generation of roguelike developers (I know it inspired me a lot!)

Rocko Bonaparte
Mar 12, 2002

Every day is Friday!
Regarding my situation with Sprites and messing around with them: I looked over my own code and I think the stuff asking for a Sprite is mostly just playing with the RectTransform so it doesn't really even care of it's a Sprite. So I should be able to pass along all kinds of crazy poo poo for it to manage so long as it has a RectTransform. This gives me some leeway to, say, provide a texture with a shader to gray it out, or a parent object that puts a red X over a child sprite, or other things.

What would be the proper way to do this if I didn't have all this handling logic in play? I'm using this in my ring menu, which is basically just a bunch of 2d overlaid on a canvas at the front of the screen. Should I use a raw image or what? I'm going to just bumble with it a bit tonight but my time's short at night so I always try to get a shortcut from the thread.

Minorkos
Feb 20, 2010

Programming novice here, I'm messing around with Unity for the first time and I started thinking about how to implement line of sight in a top-down 2D game. That lead me to reading about how raycasting works, and that lead me to read about space partitioning. I was unable to find how exactly the two interact with each other, so is this how quadtrees work with raycasting?



Player P fires a raycast to the direction of O
Game checks if there are any colliders in the red... node?
-> Yes, so it checks if there are any colliders in the blue node that the ray was launched from
-> No (let's assume the player isn't a collider), so it moves on
Ray enters a second blue node, so it checks if there are colliders in it
-> Yes, so it checks if there are any colliders in the orange node that the ray entered
-> Yes, so it checks if there are any colliders in the green node that the ray entered
-> No, so it moves on
Ray enters a third blue node, so it checks if there are any colliders in it
-> Yes, so it checks if there are any colliders in the orange node that the ray entered
-> No, so it moves onto the next orange node, checks if there are colliders
-> No, so it moves onto the 3rd orange node, checks if there are colliders
-> Yes, so it checks if there are colliders in the green... leaf? that the ray entered
-> Yes! The game makes a broadphase check and whatever other checks it needs to check if the ray hit the object

Let me know if I got it totally wrong or something. I don't even really need to implement anything like this in my project, but I still found it interesting.

Also, does Unity do any space partitioning on its own when you implement its own raycasting?

Edit: Oh oops, I kind of made redundant nodes in my image. Imagine there are other objects in the green leaves to justify the extra nodes

Minorkos fucked around with this message at 08:08 on Jun 20, 2018

xgalaxy
Jan 27, 2004
i write code

Minorkos posted:

Programming novice here, I'm messing around with Unity for the first time and I started thinking about how to implement line of sight in a top-down 2D game. That lead me to reading about how raycasting works, and that lead me to read about space partitioning. I was unable to find how exactly the two interact with each other, so is this how quadtrees work with raycasting?



Player P fires a raycast to the direction of O
Game checks if there are any colliders in the red... node?
-> Yes, so it checks if there are any colliders in the blue node that the ray was launched from
-> No (let's assume the player isn't a collider), so it moves on
Ray enters a second blue node, so it checks if there are colliders in it
-> Yes, so it checks if there are any colliders in the orange node that the ray entered
-> Yes, so it checks if there are any colliders in the green node that the ray entered
-> No, so it moves on
Ray enters a third blue node, so it checks if there are any colliders in it
-> Yes, so it checks if there are any colliders in the orange node that the ray entered
-> No, so it moves onto the next orange node, checks if there are colliders
-> No, so it moves onto the 3rd orange node, checks if there are colliders
-> Yes, so it checks if there are colliders in the green... leaf? that the ray entered
-> Yes! The game makes a broadphase check and whatever other checks it needs to check if the ray hit the object

Let me know if I got it totally wrong or something. I don't even really need to implement anything like this in my project, but I still found it interesting.

Also, does Unity do any space partitioning on its own when you implement its own raycasting?

Edit: Oh oops, I kind of made redundant nodes in my image. Imagine there are other objects in the green leaves to justify the extra nodes

Unity implements its own spatial acceleration structures and the built in ray casting system will use them. So you shouldn't have to worry about it.

As far as how does a quad tree work with regards to ray casting. You are basically correct. The ray cast will walk the tree asking only the question: "Does this ray intersect this node in any way?" If so, it walks that nodes children (which is a quad tree itself) and asks the same question. It goes deeper and deeper into the tree like this until some cut off the programmer has defined. Then it jumps back to the parent, and walks the next child that intersects, and so on.

It builds a list of nodes where the ray cast intersects. From that list of nodes we can then get a list of objects that are contained in those nodes. This is all very fast because you are just doing a line intersection test against an axis aligned box.

Once there is a list of objects that "possibly" intersect, you then have to do a more accurate collision test against the ray. This would involve doing a ray test against each objects AABB and if needed / desired even per vertex collision hit detection on each object. So from this list you then get a new list which is all objects that definitely intersect with the ray. And you can return that.

If you were actually implementing this you'd probably want some ray casting options that include 'give me all objects that intersect', 'give me only the first object that intersects', ray cast distance, etc.

Rocko Bonaparte
Mar 12, 2002

Every day is Friday!
I am having a really rough time with shaders in Unity. It's just such a mishmash of code and special sauce. Is there a decent shader editor to instantly preview changes? That would be a step up.

I just wanted to make a shader that darkened the color of an object by 25% in my GUI overlay. Hence, it wasn't going to be listening to any lighting information. I figured I'd just write a fragment shader to sample the texture and multiple across it by .25. But noooo I guess I need to write a pass-through vertex shader too (?).

Visual Studio also can't indent it worth a drat. I am hoping I should just be using some other editor for that stuff.

Is there something that explains the steps in the shader in a certain amount of painful detail? I think I don't actually want the beginner's thing but rather something explaining why I need this or that statement in all its glory. My particular problem is I played around in Microsoft's shader syntax roughly 15 years ago and had a good handle on that whole process worked, but a lot of the various declarations I have to magically know is keeping me from getting the plumbing connected to operate a shader correctly these days.

xgalaxy
Jan 27, 2004
i write code
https://www.youtube.com/channel/UCEklP9iLcpExB8vp_fWQseg

Does a pretty good job of breaking down what and why. He didn't produce much content because he ended up getting a job somewhere. But what videos exist are excellent. His videos typically follow the format of 'here is a cool effect in some game lets reproduce it in unity'.

xgalaxy fucked around with this message at 19:50 on Jun 22, 2018

Triarii
Jun 14, 2003

Rocko Bonaparte posted:

I am having a really rough time with shaders in Unity. It's just such a mishmash of code and special sauce. Is there a decent shader editor to instantly preview changes? That would be a step up.

I just wanted to make a shader that darkened the color of an object by 25% in my GUI overlay. Hence, it wasn't going to be listening to any lighting information. I figured I'd just write a fragment shader to sample the texture and multiple across it by .25. But noooo I guess I need to write a pass-through vertex shader too (?).

Visual Studio also can't indent it worth a drat. I am hoping I should just be using some other editor for that stuff.

Is there something that explains the steps in the shader in a certain amount of painful detail? I think I don't actually want the beginner's thing but rather something explaining why I need this or that statement in all its glory. My particular problem is I played around in Microsoft's shader syntax roughly 15 years ago and had a good handle on that whole process worked, but a lot of the various declarations I have to magically know is keeping me from getting the plumbing connected to operate a shader correctly these days.

That's kind of a weird thing to write a shader for (you can just set the color of an image object to be darker) but what I found to be the biggest help in figuring out shaders was to pick the one built in to unity that was closest to what I was trying to do, make a copy of it, and start tinkering with it from there. You can download all of unity's shaders here https://unity3d.com/get-unity/download/archive (it's "Built in shaders" under the Downloads dropdown for whichever version you're using). Unity does actually instantly recompile shader changes without having to restart the game.

Rocko Bonaparte
Mar 12, 2002

Every day is Friday!
Well, I don't think it's going to end up being just gray, so I figured I'd start in on a shader. I'm tinkering, which I basically treat like hunting and pecking.

Like, at this point, it seems to me that I have to write a vertex shader that does what the defaults if I want to use a fragment shader at all. Is this about right?

Absurd Alhazred
Mar 27, 2010

by Athanatos

Rocko Bonaparte posted:

Well, I don't think it's going to end up being just gray, so I figured I'd start in on a shader. I'm tinkering, which I basically treat like hunting and pecking.

Like, at this point, it seems to me that I have to write a vertex shader that does what the defaults if I want to use a fragment shader at all. Is this about right?

Yeah, a pass-through vertex shader is the absolute minimum you need for a pipeline. If you were creating a depth map (like for shadow mapping or whatever), that's the only shader you'd need.

Rocko Bonaparte
Mar 12, 2002

Every day is Friday!

Absurd Alhazred posted:

Yeah, a pass-through vertex shader is the absolute minimum you need for a pipeline. If you were creating a depth map (like for shadow mapping or whatever), that's the only shader you'd need.
Meh it's been so long that I would have figured that would have been decoupled or something. Or at least the syntax of these higher-level shader languages would fill in a default vertex shader if you just define a fragment shader.

Is there a better tool to dabble in this stuff than, say, going back and forth with Visual Studio? It's not reporting many outright syntactical errors other than to make the result purple. This is making even just tinkering line-by-line slow. The way Visual Studio screws up indentation is also frustrating.

KillHour
Oct 28, 2007


If you're willing to switch to one of the new rendering pipelines, you can use the node based shader editor. It's really good.

Obsurveyor
Jan 10, 2003

Amplify Shader Editor is pretty fantastic too, I believe it's still further along than Shader Graph too.

Tiler Kiwi
Feb 26, 2011
this is pretty candy rear end poo poo but given that i was griping about this a lot, i feel like its worth showing off that i came up with a solution. at least, a short term solution.

used a table making asset i grabbed earlier plus a crude understanding of OnValidate to help make it at least a little gently caress-up proof (tho its still ugly and probably should store a backup in case you misclick and wanna undo). its the first thing i made specifically to solve an issue in the editor tho so I guess its progress??? (You could get similar results with a dictionary<tuple, value> and some lists / property drawers too I guess but TABLES)

it seems handy enough that I wonder if I can make it more generic, or at least do some wrapper nonsense on a generic because unity has a fit with generics because it hates everything cool.

Tiler Kiwi fucked around with this message at 09:24 on Jun 24, 2018

Minorkos
Feb 20, 2010

It has come time to make the 2D grid for the game logic of my turn-based strategy game. What would be the best way to handle a grid and store objects in grid coordinates?

My first instinct was to give each game object the values posX and posY that correspond their position on the map. The "grid" itself wouldn't actually exist, instead it would just be two int values that limit the size of the map or something like that. When the game needs to render the area, it loops through all the objects on the map and renders them at their correct positions. But the thing I don't like about this solution is that finding what exists in a grid position or a grid area (like for AoE effects) would require searching through all the game objects to see if they exist there. Not a big deal considering I'd only need to run through around 30 objects at most (assuming I don't run through terrain objects as well), but it still feels a little bad.

I also thought of building a 2-dimensional array of objects to signify grid points, with each object having a list of object references that reside on the grid point, and searching through each list on each coordinate location to find relevant objects. But then I'd also be doing a ton of redundant looping, just in a different flavor. That looping would probably be easier on the calculations though. I don't know, I haven't slept in a good 21 hours

Minorkos fucked around with this message at 06:12 on Jun 25, 2018

roomforthetuna
Mar 22, 2005

I don't need to know anything about virii! My CUSTOM PROGRAM keeps me protected! It's not like they'll try to come in through the Internet or something!

Minorkos posted:

It has come time to make the 2D grid for the game logic of my turn-based strategy game. What would be the best way to handle a grid and store objects in grid coordinates?
The bidirectional reference method you suggested is good for dense or small grids.
The "just scan over everything to find if something is at a specific x,y" method is good if you don't expect to have many things (where many is more than 100 moving things; it's only a scan of size (nMovingThings * nAllThings), and 10000 is not really that big these days.)
For a sparse, large grid you might want to hashtable it keyed on [x,y].

Minorkos
Feb 20, 2010

roomforthetuna posted:

The bidirectional reference method you suggested is good for dense or small grids.
The "just scan over everything to find if something is at a specific x,y" method is good if you don't expect to have many things (where many is more than 100 moving things; it's only a scan of size (nMovingThings * nAllThings), and 10000 is not really that big these days.)
For a sparse, large grid you might want to hashtable it keyed on [x,y].

The game isn't really neither dense or sparse in terms of enemy distribution. Maps are enclosed smallish spaces and units are distributed quite evenly throughout. In fact I can't imagine I want to have more than 1 unit in the same spot anyway. The game is basically like XCOM in terms of map and enemy count, so I think I'm just going to go for the simple "coordinates store on each object, run through all to find relevant ones". It seems like it would make debugging a lot easier too.

Thanks for the answer, at least I'm not loving up too much. It feels like the main benefit of posting is the fact that I'm forced to write my thoughts out, which helps me answer my own questions most of the time.

Edit: Actually I think I still might need a simple object grid for rendering fog of war and the type of floor in the area since those things are going to be checked on every single point of the map

Edit2: I could also store whether the terrain is passable in that object grid location. Like, when a unit moves into that location, it sets that grid location as impassable, and sets it back to passable again when moving out. Then I wouldn't need to run through all the objects for pathfinding and so on. In fact, it seems a bit necessary unless I want to run through all objects every time pathfinding tries to draw a path, which it will have to do around 500 times when it tries to figure out where an unit is able to move

Minorkos fucked around with this message at 08:37 on Jun 25, 2018

Boz0r
Sep 7, 2006
The Rocketship in action.
I'm trying to make a portals for my game. The way I'm doing it is having a camera mimic the player's position and rotation in the other portals local space.
My problem is, that whatever is behind the portal gets rendered on this camera, so if I move back from the portal, some other stuff will clip in.

How do I cull whatever is behind the portal plane from the camera?

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe
Put a plane equation into SV_ClipDistance[0] or gl_ClipDistance[0]. If it's greater than 0, it's clipped. I think you also have to enable something on the CPU somewhere. Of course, I don't know how to do this if you're using Unity or Unreal or one of those.

Fun fact: the original Portal team called it "banana juice" because when they first saw it, they were so confused by it and needed a term for the team to go "hey, there's some of that weird banana juice again".

chglcu
May 17, 2007

I'm so bored with the USA.
Never actually done portal rendering, but it seems like you could render the portal’s shape to the stencil buffer then have your camera test the stencil value. Might need some trickery if you can have portals visible through other portals.

Boz0r
Sep 7, 2006
The Rocketship in action.
Oh yeah, it's in Unity. That's probably relevant.

HappyHippo
Nov 19, 2003
Do you have an Air Miles Card?

Minorkos posted:

It has come time to make the 2D grid for the game logic of my turn-based strategy game. What would be the best way to handle a grid and store objects in grid coordinates?

My first instinct was to give each game object the values posX and posY that correspond their position on the map. The "grid" itself wouldn't actually exist, instead it would just be two int values that limit the size of the map or something like that. When the game needs to render the area, it loops through all the objects on the map and renders them at their correct positions. But the thing I don't like about this solution is that finding what exists in a grid position or a grid area (like for AoE effects) would require searching through all the game objects to see if they exist there. Not a big deal considering I'd only need to run through around 30 objects at most (assuming I don't run through terrain objects as well), but it still feels a little bad.

I also thought of building a 2-dimensional array of objects to signify grid points, with each object having a list of object references that reside on the grid point, and searching through each list on each coordinate location to find relevant objects. But then I'd also be doing a ton of redundant looping, just in a different flavor. That looping would probably be easier on the calculations though. I don't know, I haven't slept in a good 21 hours

This is kind of a "classic" problem. Some options are:
1) Objects store their location. To find something at a location you have to loop through all objects.
2) Grid points store pointers to objects. Now to find the location of something you'd have to loop through the grid. I don't think anyone actually does this, there are usually far more grid points than objects.
3) Grid points store pointers to objects, and objects store their location. Now you don't have to loop much at all really. But you have the potential for bugs, because it's possible for things to get out of sync (the object's location not matching what the grid thinks).

For a turn based game, I'd just go with number 1. I think you're overestimating the significance of looping over ~30 objects. That's basically nothing. Real time games at 60fps can do that, and this is turn based.

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe

Boz0r posted:

Oh yeah, it's in Unity. That's probably relevant.

Unity uses HLSL. You can just use a custom vertex shader that sets SV_ClipDistance.

baby puzzle
Jun 3, 2011

I'll Sequence your Storm.
I’m starting to feel like I need a generic “handle manager” thing where I can safely keep handles to transient objects. We had several such things at Disney, but they were all in-house of course.

I’m trying to avoid using shared_ptr/weak_ptr. Because I’m a game developer.

is there a general purpose library? I’m not using any engine but my own. Or is writing this kind of thing from scratch a rite of passage?

Xik
Mar 10, 2011

Dinosaur Gum
Can't you use a dependency injection library already available for your language of choice? Keeping track of objects with various lifetimes and throwing them where they need to be is basically describing DI.

Minorkos
Feb 20, 2010

HappyHippo posted:

For a turn based game, I'd just go with number 1. I think you're overestimating the significance of looping over ~30 objects. That's basically nothing. Real time games at 60fps can do that, and this is turn based.

Yeah, it just seems like unnecessary work for the program to do so it feels bad. Plus I'd have to loop over a lot more objects than 30 in some cases such as pathfinding. For example, I have an entity with a movement range of 8 and I need to draw his possible available paths. To do this, pathfinding needs to find paths in radius of 8 tiles. Let's say this is around 30 paths to draw, although it will typically be more. Now, assuming all those paths are 8 to 6 tiles long and there are no obstructions, then pathfinding will check 7 tiles on average. So to draw possible paths for an entity, I'll have to to check an object if it exists in that location for 30 * 7 * 30 (object count), so 6300 times. And the number will grow even higher once entities gain movement range and there are more obstructions in the way. Unless I made a mistake, it seems like quite a lot of work to do unless optimizations are made.

Edit: Although in this specific case, I could avoid using pathfinding entirely and instead just use some kind of algorithm that "spills" a movement variable to adjacent and diagonal tiles while reducing the total amount of movement left by the amount of movement it costs, and essentially figure out the maximum movement range that way.

Minorkos fucked around with this message at 09:12 on Jun 27, 2018

Dirty
Apr 8, 2003

Ceci n'est pas un fabricant de pates

Minorkos posted:

Yeah, it just seems like unnecessary work for the program to do so it feels bad. Plus I'd have to loop over a lot more objects than 30 in some cases such as pathfinding. For example, I have an entity with a movement range of 8 and I need to draw his possible available paths. To do this, pathfinding needs to find paths in radius of 8 tiles. Let's say this is around 30 paths to draw, although it will typically be more. Now, assuming all those paths are 8 to 6 tiles long and there are no obstructions, then pathfinding will check 7 tiles on average. So to draw possible paths for an entity, I'll have to to check an object if it exists in that location for 30 * 7 * 30 (object count), so 6300 times. And the number will grow even higher once entities gain movement range and there are more obstructions in the way. Unless I made a mistake, it seems like quite a lot of work to do unless optimizations are made.

Edit: Although in this specific case, I could avoid using pathfinding entirely and instead just use some kind of algorithm that "spills" a movement variable to adjacent and diagonal tiles while reducing the total amount of movement left by the amount of movement it costs, and essentially figure out the maximum movement range that way.

For situations like the above, you could do a pass first to cull objects that simply aren't in range, and then do your checks with the smaller number of in-range objects. If all 30 objects were in range, that would be slower, but if the presumably much more likely circumstance of only one or two objects being in range, you'd save quite a few loops.

You could also can get slightly fancy and split your processing over multiple frames, maybe one path per frame, so there's no noticeable lock-up while working out all the paths. And you can store the paths once you've created them so as your player selects different objects, you don't need to keep recalculating them.

Minorkos
Feb 20, 2010

Dirty posted:

For situations like the above, you could do a pass first to cull objects that simply aren't in range, and then do your checks with the smaller number of in-range objects. If all 30 objects were in range, that would be slower, but if the presumably much more likely circumstance of only one or two objects being in range, you'd save quite a few loops.

I managed to figure out the spilling algorith I just talked about so I might use that in tandem with that optimization. I could also run through the objects once and mark their positions on the temporary pathfinding grid, which would cut down required calculations by a ton as well.

ZombieApostate
Mar 13, 2011
Sorry, I didn't read your post.

I'm too busy replying to what I wish you said

:allears:
Does anybody know if there's a way with UE4 to render actors to a RenderTarget2D/RenderTargetComponent2D and not the main camera? Basically trying to make 3d portraits for characters like they have in DOTA2. I think I found the bits and bobs that will let them only render their own junk to their own RenderTarget, but they'll still show up in the actual game scene. I can always hide them under the floor if it comes to that, but surely there's a classier way to do it.

leper khan
Dec 28, 2010
Honest to god thinks Half Life 2 is a bad game. But at least he likes Monster Hunter.

baby puzzle posted:

I’m starting to feel like I need a generic “handle manager” thing where I can safely keep handles to transient objects. We had several such things at Disney, but they were all in-house of course.

I’m trying to avoid using shared_ptr/weak_ptr. Because I’m a game developer.

is there a general purpose library? I’m not using any engine but my own. Or is writing this kind of thing from scratch a rite of passage?

Have you considered shared_ptr and weak_ptr?

baby puzzle
Jun 3, 2011

I'll Sequence your Storm.

leper khan posted:

Have you considered shared_ptr and weak_ptr?

I was thinking that this person really knew what they were talking about : http://seanmiddleditch.com/dangers-of-stdshared_ptr/

He suggests using managed handles instead, which I agree with. I don't actually need objects to have shared ownership.. but you need to use shared_ptr if you want to use weak_ptr as a "handle" type.

baby puzzle fucked around with this message at 14:46 on Jun 27, 2018

Twobirds
Oct 17, 2000

The only talking mouse in all of Britannia.
I'm a novice programmer and am playing with Pyglet after spending some time with Python. I've noticed when I make a window, it's scaled according to Windows' display scaling option. Like, if I code a 640x480 pixel window the actual window appears as 800x600 if I have display scaling at 125%. Is this expected behavior? It seems really odd to me.

I thought this might be a better venue than the Python thread, since there's little discussion of game libraries there.

KillHour
Oct 28, 2007


That sounds like the kind of behavior I would want, yeah.

Twobirds
Oct 17, 2000

The only talking mouse in all of Britannia.
I guess I thought that if I tell a user what size the window will be, in pixels, that they don't get something else. Particularly something that's larger than their display.

xzzy
Mar 5, 2009

Sounds like the sort of thing that should probably be treated as a bug, but the app is technically following a specification and doing what it's supposed to.

I'd read up on it and see what "correct" is and make a value judgement.

Worst case, query the user's display scale and shrink your requested game window size by that percentage. :v:

HaB
Jan 5, 2001

What are the odds?

xzzy posted:

Sounds like the sort of thing that should probably be treated as a bug, but the app is technically following a specification and doing what it's supposed to.

I'd read up on it and see what "correct" is and make a value judgement.

Worst case, query the user's display scale and shrink your requested game window size by that percentage. :v:

Yeah if someone is scaling their display - you should provide a scaled window to them. That's what they have requested from the OS, so Pyglet is doing the "right" thing here.

If I have my display set to scale 125%, I mean everything, not "everything but this guy's game"

Twobirds
Oct 17, 2000

The only talking mouse in all of Britannia.
That makes sense, thanks all. I'm just used to selecting resolutions in games assuming that pixels are pixels.

xzzy
Mar 5, 2009

HaB posted:

Yeah if someone is scaling their display - you should provide a scaled window to them. That's what they have requested from the OS, so Pyglet is doing the "right" thing here.

If I have my display set to scale 125%, I mean everything, not "everything but this guy's game"

I just played around with it on a W10 machine and it's funny how not everything does the same thing. Like explorer windows don't change their dimensinos when adjusting display scaling, all the stuff inside them just gets bigger. Chrome increases its window size by the scaling value. Photoshop does literally nothing, you have to restart it completely.

I can see some cases where one might prefer one over the other, and I bet there's some hooks into the OS that lets one choose a behavior.

Polio Vax Scene
Apr 5, 2009



Game Maker does that too.
The trouble comes in when you have a game that expects a specific resolution and is able to render pixels crisply if that's the case, but then when your 800x600 window gets scaled now everything has this blurry/fuzzy feel to it.

Adbot
ADBOT LOVES YOU

KillHour
Oct 28, 2007


Then design the program with that in mind and don't require a specific resolution to look good. I'm sick of poo poo being too small on my 4K monitors. Gimp is impossible to use.

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply