|
ApproachingInfinity posted:This is pretty much what Unity's built-in text system does (or well, they probably use FreeType or similar but same deal). Doing this is fast enough that you can, if you want to, render to that texture on-demand and just display the letters at the size/style you want without much issue. Even better, if you need the same glyph again, you just pull the one you already rendered out of the texture. You can also pre-render all the glyphs you think you'll need beforehand for even more speed. The problem with this method is that you're pre-rendering text at fixed sizes; glyphs rendered at 16 pt just aren't going to look good at 80 pt size. Thanks for the detailed answer e: it's a new page might as well quote the whole thing
|
# ? Jan 11, 2018 10:49 |
|
|
# ? Apr 26, 2024 02:19 |
|
leper khan posted:.... you just put the attributes on things. I don’t understand what the issue is.
|
# ? Jan 11, 2018 22:22 |
|
OneEightHundred posted:If the text is being rendered at a single size with no rotation, scaling, or other subpixel motion (like in typical web scenarios), the best thing to do is render it at the size it's being displayed to take advantage of font hinting features that improve the legibility of the text. When that's done, there's not really much point in keeping polys around because the rasterized result is always the same. I wasn't convinced by the n^3 algorithm argument (or others about the triangle-ing being a pain), because n is pretty small and it's a "run once at startup" thing so meh to time/complexity, and while yes conceptually triangling around holes sucks, I'm pretty sure it reduces to a "use a library" problem these days (and even if it didn't, it's an interesting problem). So outcome-based reasons are much more compelling than difficulty-based reasons. On a related note, is there a decent library or method for inexpensively rendering text in WebGL? (Here, the most concerning expense is effort, with hardly any poo poo given about rendering time and only a small poo poo about bandwidth.)
|
# ? Jan 12, 2018 01:10 |
|
roomforthetuna posted:I wasn't convinced by the n^3 algorithm argument (or others about the triangle-ing being a pain), because n is pretty small and it's a "run once at startup" thing so meh to time/complexity, and while yes conceptually triangling around holes sucks, I'm pretty sure it reduces to a "use a library" problem these days (and even if it didn't, it's an interesting problem). So outcome-based reasons are much more compelling than difficulty-based reasons. Yeah, it's "run once per font size, and possibly for all three subpixel positions if you want to do subpixel layout". Grid fitting, stem darkening, hinting are all complex algorithms that are very sensitive to the final pixel size of the font, and greatly distort the shape of the font. It's a very interesting problem. Pathfinder 2 is attempting to use Lorenzetto triangulation on the CPU. Slug uses efficient bezier math on the GPU but that still kills your early-Z and has to do the bezier roots per fragment which is inefficient. For WebGL, just render text to a separate 2D canvas using drawText, or just build a PNG/SVG text sprite sheet and supply that as your font atlas during texImage2D.
|
# ? Jan 12, 2018 01:41 |
|
Suspicious Dish posted:For WebGL, just render text to a separate 2D canvas using drawText, or just build a PNG/SVG text sprite sheet and supply that as your font atlas during texImage2D.
|
# ? Jan 12, 2018 06:54 |
|
leper khan I have DOTWeen questions. Actually this is just Rotation Hell; I don't think anybody's going to be left out. I think I figured this out but it makes me feel gross. I am trying to convert this tire fire that is my ring menu rotation management code into a tween, but I'm trading one problem for another. I have to rotate clockwise or counter-clockwise by the theta angle representing the angle between my ring menu elements whenever the player presses the appropriate key. I haven't even gotten into what happens if they hit one of the keys while an existing tween is running. The rotation is just fussy. Setting it up superficially is not that hard: code:
I tried the LocalAxisAdd and WorldAxisAdd, and these seem to try to do the right thing, but there's a compounding error factor that causes the elements to veer out of alignment at their stationary positions. Now I just grab the rotation by the balls when it finishes and force it into the right spot at the end: code:
Does this look at all right? The next part of the problem is being able to handle changing this tween as it runs. I haven't looked into what I can do for that, but it has to be easier than this crap I have for the rotation logic right now: code:
|
# ? Jan 12, 2018 08:01 |
|
I feel like I should market Godot again. I went to add sound effects the other day, having done absolutely nothing with sound before, and it took me only 45 minutes to record, edit, learn how to do sound in Godot, load my five sounds into the editor, add them to my scripts, and then realize that I could even *not* put it in the scripts and instead attach the playing of sound into animations, and do that instead. Which is to say, the sound stuff is super intuitive and easy, and the animation stuff is amazingly flexible.
|
# ? Jan 12, 2018 17:39 |
|
I was waiting for 3.0 release before I tear into it, but you think it's okay to dive in a little early?
|
# ? Jan 12, 2018 19:18 |
|
leper khan posted:More cool, in my opinion, are all of the attributes. You can tag fields as supposed to be filled with a scene object or prefab and then it tells you if the contract is broken. There are a lot of new attributes, and many are neat/useful. Others I just haven’t bothered to get to yet Oh my. I may to need to get that. I've thought about how nice that would be but was never certain how you'd do that given the tools. I also just love that kinda stuff. I'm, basically, the only one that touches stuff, but every field accessible in the editor gets a tooltip and is either bound by a Range attribute or has some sort of validation check. I've been thinking about adding something to have fixed sized arrays shown in the Inspector, but I'm currently just hacking it that way with a Validate method that forces the array to be of the proper size. Does... does this make me a tools engineer?
|
# ? Jan 12, 2018 22:52 |
|
BirdOfPlay posted:Does... does this make me a tools engineer? Kind of like the people that would say you're a test engineer if you wrote a unit test.
|
# ? Jan 12, 2018 23:43 |
|
Been doing some work on the tiles for my crpg. Here's a demo screenshot:
|
# ? Jan 15, 2018 06:36 |
|
Worked on some new art for my game. Here is a screenshot of new assets:
|
# ? Jan 17, 2018 06:32 |
Is there a good way to use the Unity 2D animator to change a sprite if a character goes further than a given distance? Just something like "for every ten pixels of Y movement, switch to the next frame on the spritesheet." It is probably just me, but I am having difficulty finding tutorials for how to do it with the animator, rather than pure C#. Thanks in advance!
|
|
# ? Jan 19, 2018 03:57 |
|
Farchanter posted:Is there a good way to use the Unity 2D animator to change a sprite if a character goes further than a given distance? Just something like "for every ten pixels of Y movement, switch to the next frame on the spritesheet." It is probably just me, but I am having difficulty finding tutorials for how to do it with the animator, rather than pure C#. AnimationPlayer.set_speed(0); AnimationPlayer.seek(x*DISTANCE_TO_ANIM_TIME_RATIO);
|
# ? Jan 19, 2018 06:09 |
|
I downloaded Tiled and was able to pop up a map rather quickly: The output is a JSON file, so my next step is to read that into the game and parse the contents.
|
# ? Jan 22, 2018 07:17 |
|
Farchanter posted:Is there a good way to use the Unity 2D animator to change a sprite if a character goes further than a given distance? Just something like "for every ten pixels of Y movement, switch to the next frame on the spritesheet." It is probably just me, but I am having difficulty finding tutorials for how to do it with the animator, rather than pure C#.
|
# ? Jan 22, 2018 07:33 |
|
Speaking of 2D animation, after reading about what Unity’s animator actually does every frame I’m looking into alternatives for general canvas-based UI animation. Some light research suggests DOTween is a good pick, but I’m wondering if anyone in the thread has opinions on the matter. Also, if there is a more performant alternative to layout groups out there I would love to hear about it.
|
# ? Jan 23, 2018 07:03 |
|
TerraGoetia posted:I downloaded Tiled and was able to pop up a map rather quickly: I wrote something for this. It's a little basic but I'll throw it somewhere and you can modify it.
|
# ? Jan 23, 2018 07:20 |
|
Doctor Soup posted:Speaking of 2D animation, after reading about what Unity’s animator actually does every frame I’m looking into alternatives for general canvas-based UI animation. Some light research suggests DOTween is a good pick, but I’m wondering if anyone in the thread has opinions on the matter. Tweens are ok for simple things, but more complex animations probably want something with a timeline. What performance issues are you running into with layout groups?
|
# ? Jan 23, 2018 09:52 |
|
New assets and me wondering if the final boss should be an evil computer:
|
# ? Jan 23, 2018 10:47 |
|
leper khan posted:Tweens are ok for simple things, but more complex animations probably want something with a timeline. Basically, we did everything wrong with our last game's UI. We created deep object hierarchies with multiple layout groups, lots of animations, and only a handful of canvases. As you can imagine, basically everything ended up getting dirtied/rebuilt/recalculated each frame, which was not great for performance. As for layout groups specifically, most of our problems would go away if we didn't use animations so it's not as big of a priority as finding an alternative animation system. That said, now that I think about it I do wish layout elements had a flag we could throw that would prevent them from traversing the object hierarchy looking for layout groups to dirty.
|
# ? Jan 23, 2018 20:25 |
|
I've just run into what seems to be a weird omission in the Godot engine - I'm using KinematicBody2D for all my moving parts because I hate physics engines. The move[_to] functions work pretty well for the sort of behavior I want, I can do partial physics and resolve collisions mid-frame in whatever way I feel is appropriate. For example of something I can do that regular physics wouldn't, I can transition from horizontal motion on a horizontal surface to 45 degree descending on a slope without momentarily lifting off at the corner because momentum. Anyway, the next thing I'm trying to do is add a long aimable weapon to the player-character. My intent was to make the weapon another KinematicBody2D separate from the player character but moving so as to always stay positioned on the player character, with special cases to resolve whatever kinds of collisions might occur. The aiming requires rotation. Which is the weird thing - there doesn't seem to be any sort of rotation functions for KinematicBody2D. I'm pretty sure if I rotate the thing by just updating its rotation value it will get all out of sync with the physics and be terrible, like it will end up overlapping with objects it shouldn't be able to. Anyone here got an idea for how to resolve this? Failing a proper solution, the best workaround I can think of is to represent the weapon as a small KinematicBody circle at the tip of the weapon, move that with the linear move functions so as to position it where the rotating tip is trying to be, resolving collisions along the way, and then position and angle a sprite between the player and that point. But I'd really rather not - that way the weapon could potentially get its midpoint passing through a thin protrusion, for example, and it'd also be a significant pain in the rear end to implement in the first place. Or no body at all and just use free-floating collision detecting functions, but that way other things could move into the weapon.
|
# ? Jan 25, 2018 06:55 |
|
Why is the weapon part of a kinematic body at all?
|
# ? Jan 25, 2018 07:15 |
|
I can't tell if I'm making a video game or a ring menu.
|
# ? Jan 25, 2018 08:00 |
|
Rocko Bonaparte posted:I can't tell if I'm making a video game or a ring menu. Make the ring menu standalone and customizable and sell it on the asset store.
|
# ? Jan 25, 2018 08:14 |
|
Rocko Bonaparte posted:I can't tell if I'm making a video game or a ring menu. KillHour posted:Make the ring menu standalone and customizable and sell it on the asset store. Secret of Menu: Ring
|
# ? Jan 25, 2018 19:48 |
|
TerraGoetia posted:I downloaded Tiled and was able to pop up a map rather quickly: What language are you using? If it's C# you can use the TiledSharp library to easily read and parse Tiled maps from their native .tmx format EDIT: Also I think I made something like what you're working on for the game jam contest earlier this month, so let me know if you need any advice or code samples Thermal Anomaly fucked around with this message at 21:52 on Jan 25, 2018 |
# ? Jan 25, 2018 21:43 |
|
OneEightHundred posted:Why is the weapon part of a kinematic body at all? It's not part of a kinematic body, it is a kinematic body. Though it's linked to the wielder, so inverse kinematics might happen as part of collision resolution. An example of a collision resolution I want that might explain better; if your weapon is a lance, and you charge it point first into a stone wall, you get knocked off your mount or break the lance. If you ride through a doorway with the lance pointing up, on the other hand, it should just rotate out of the way because leverage. It's not just a "hit monster" thing, it interacts with any objects.
|
# ? Jan 26, 2018 08:06 |
|
roomforthetuna posted:An example of a collision resolution I want that might explain better; if your weapon is a lance, and you charge it point first into a stone wall, you get knocked off your mount or break the lance. If you ride through a doorway with the lance pointing up, on the other hand, it should just rotate out of the way because leverage. It's not just a "hit monster" thing, it interacts with any objects. Your best bet is probably going to have to do be doing something like doing rotations separately and using is_colliding to figure out if the rotation caused an overlap, then figure out the nature of the overlap and resolve it iteratively.
|
# ? Jan 27, 2018 04:13 |
|
OneEightHundred posted:I don't think it supports doing that. Kinematic bodies use a different, specialized physics simulation that AFAIK only support movement and not rotation and its kick-out behavior is already pretty limited. quote:Your best bet is probably going to have to do be doing something like doing rotations separately and using is_colliding to figure out if the rotation caused an overlap, then figure out the nature of the overlap and resolve it iteratively. I know modifying kinematic bodies other than with the move functions sometimes has just horrifying side-effects, from trying to teleport a character by updating its coordinates (it ends up colliding with stuff where it used to be, in the next frame). Maybe that's just problematic if you mix coordinate changes with move functions though. I'd be okay with the weapon being moved only by direct updates, I could probably even make it a trigger-only kinematic body. Thanks, that will probably work, though I'm nervous because of that prior side-effects experience.
|
# ? Jan 27, 2018 06:23 |
|
Thermal Anomaly posted:What language are you using? If it's C# you can use the TiledSharp library to easily read and parse Tiled maps from their native .tmx format I'm working in Java, using LWJGL. When I have some time to work on my map importer I'll take a look at that. Thanks!
|
# ? Jan 27, 2018 06:54 |
|
I'm starting to do some strange things in Unity and need to think out loud and compare. I am dabbling in making my player controls events that fire off. Different parts of the system attach and detach as they are active or inactive. First, this is looking like it will be kind of inefficient with directional control. Should I not be too disturbed by that? The alternative is a polling loop checking for directional controls instead of an event firing that off each frame. The second issue is this attachment process is touchy when starting up. If the subsystem checking controls and firing events isn't set up yet, then I'll get null pointers trying to attach to it. I started to dabble in giving the subsystem a callback queue to check on each Update(). I send the attachment requests to that so I know I'm in a good spot when it finally does the attachment. The alternative is to use coroutines. It wouldn't really be an issue if I needed to give the subsystem to the callback to do some processing, but I'm not taking any arguments, and I'm not returning any values. So I believe a coroutine could do it fine. It's hard to tell though if the coroutine happens at the beginning of the Updates() or at the end; I could theoretically be losing a frame before I even get a chance to run the code. In that case, I guess I should start doing this callback queue thing. It's not too alien an idea to me to do this. I'm used to having to schedule tasks to run on other threads in other projects, for example.
|
# ? Jan 29, 2018 08:30 |
|
Rocko Bonaparte posted:I'm starting to do some strange things in Unity and need to think out loud and compare. I am dabbling in making my player controls events that fire off. Different parts of the system attach and detach as they are active or inactive. First, this is looking like it will be kind of inefficient with directional control. Should I not be too disturbed by that? The alternative is a polling loop checking for directional controls instead of an event firing that off each frame. You can use a ScriptableObject to do what you want. Have your input manager call an InputChanged function or w/e and have things what care about input subscribe to it. No NRE issues, because the ScriptableObject /will/ exist, and that’s what everything is told about inputs from. Then you can do the Mario hat thing by swapping which input manager (player vs ai) they’re listening to. see also this Unite talk
|
# ? Jan 29, 2018 15:03 |
|
Okay okay time to get into ScriptableObjects. Edit: Pardon my frustration, but it's frustrating to me that the Unity developers decided, "Hey let's make this really important thing that we think can solve a lot of problems for you, then make a little lovely dilly in the docs about it and put everything else about it into videos. Our users are visual learners that don't read or write code so it's perfect!" I know I'm pissing in the wind about it, but it's particularly stark here with ScriptableObjects. Rocko Bonaparte fucked around with this message at 18:49 on Jan 29, 2018 |
# ? Jan 29, 2018 18:08 |
|
Rocko Bonaparte posted:Okay okay time to get into ScriptableObjects. You need to appreciate the purpose of the unity docs. They’re actually really good for some things, but you need to keep a bit of cynicism. Unity was originally a game engine for hobbyist game developers only usable on OSX. The documentation and “best practices” found therein reflect this, and essentially act as mitigations for customer support tickets. This is the same reason they recommend serializing fields by making them public and explicitly state that you may never end up using [SerializeField]. Every organization I’ve worked in this is almost the opposite. There is a mechanism to serialize to the editor that does not mess with member visibility; it gets used frequently.
|
# ? Jan 29, 2018 19:53 |
|
Okay I'll try to go through what I did to start using a ScriptableObject, but it's extremely contextual. I'm also not done, which I'll try to highlight. I put the events and InControl ControlActions into a ScriptableObject. The OnEnable sets up all the events; each button is wrapped up in a object that is has the actual event and the logic to do the per-frame poll to fire them. The idea is this is the one place I poll on them. Maybe that logic should come out of there and go into the control subsystem now. At the moment, this ScriptableObject is created and owned by the control subsystem, which is hanging off my global state singleton with all the other subsystems. It's OnEnable() creates the ScriptableObjects. At this point, everything trying to subscribe for events do that in Start() so I don't have to worry about an NPE. However, I'm conceptually not done. I think the next step is to attach the ScriptableObject directly to something. It will probably be the global state GameObject itself. Everything will just retrieve the record from there instead. I got the impression that they were trying to use ScriptableObject to somewhat avoid having these global states. I don't really see how that works. I could create the thing the first time I need it and then otherwise just have Unity scan for the item, but to me that seems pretty much the same as having some global GameObject anyways.
|
# ? Jan 30, 2018 19:35 |
|
Godot 3.0 is out.
|
# ? Jan 30, 2018 19:39 |
|
It took me way too long to figure out they renamed Globals to ProjectSettings
|
# ? Jan 31, 2018 01:21 |
|
Is it going to ruin everything if I try to transition my existing project?
|
# ? Jan 31, 2018 05:03 |
|
|
# ? Apr 26, 2024 02:19 |
|
It seems like Godot wants to be a serious contender for both 2D and 3D game development. With C# (7!) support does anyone know how it compares to Unity? Right now I see it as something that's growing and to keep an eye out for. Would love to hear anyone else's thoughts.
|
# ? Jan 31, 2018 06:07 |