|
code:
|
# ? May 21, 2020 02:57 |
|
|
# ? May 23, 2024 16:15 |
|
TooMuchAbstraction posted:
That would allocate an array every time it was called. Burst would throw a fit. Edit: Since it's a flag enum (and already declared clockwise because I foresaw wanting to do something like this), you could do this: code:
KillHour fucked around with this message at 04:05 on May 21, 2020 |
# ? May 21, 2020 03:42 |
|
Code golf version, since it's already clamped to (-180, 180]: (D)pow(2,((int)x+135)/90); KillHour fucked around with this message at 04:23 on May 21, 2020 |
# ? May 21, 2020 04:20 |
|
Also the first version KillHour posted is drat nice and readable. I understood it in 5 seconds. I don't want to have to sit and stare at a single liner math equation from high school going "Hu so if it's under 135 x is equal to what?" Personally I'll always sacrifice small performance gains for minor readability gains. Obviously if the performance gain is major then screw you, I'll write a comment
|
# ? May 21, 2020 12:21 |
|
KillHour posted:After working pretty much exclusively with JS for the last year for work (with some Python thrown in), I forgot how many good features C# has in newer releases. Ditto. I used a lot of ?. in my Sports 2 Jam Now only if it could recognize the enum context code:
|
# ? May 21, 2020 13:49 |
|
kaffo posted:Also the first version KillHour posted is drat nice and readable. I understood it in 5 seconds. I don't want to have to sit and stare at a single liner math equation from high school going "Hu so if it's under 135 x is equal to what?" Switch statements are extremely performant, anyways. Edit: Not as fast as the code golf version I posted - especially since I used the burst versions of the operations, which get turned into SIMD instructions - but much faster than heap-allocating an array and then immediately sending it off for garbage collection. KillHour fucked around with this message at 14:03 on May 21, 2020 |
# ? May 21, 2020 13:54 |
|
kaffo posted:Also the first version KillHour posted is drat nice and readable. I understood it in 5 seconds. I don't want to have to sit and stare at a single liner math equation from high school going "Hu so if it's under 135 x is equal to what?" Yeah, I wasn't remotely suggesting that my version (or KillHour's responses to same) are superior. Just being silly.
|
# ? May 21, 2020 14:33 |
|
TooMuchAbstraction posted:Yeah, I wasn't remotely suggesting that my version (or KillHour's responses to same) are superior. Just being silly. code:
|
# ? May 21, 2020 15:32 |
|
Oh my God I just punched my screen why
|
# ? May 21, 2020 18:11 |
|
KillHour posted:Oh my God I just punched my screen why post ur angle code ppl code:
|
# ? May 21, 2020 20:10 |
|
nm i cant be arsed to fix it
taqueso fucked around with this message at 20:53 on May 21, 2020 |
# ? May 21, 2020 20:44 |
|
dupersaurus posted:Ditto. I used a lot of ?. in my Sports 2 Jam Yes. I'd love for them to allow the short form enums. Languages like Swift and Zig do this and it is so nice.
|
# ? May 21, 2020 22:59 |
|
kaffo posted:Writing this made me want to cry ngl
|
# ? May 22, 2020 04:35 |
|
dupersaurus posted:Ditto. I used a lot of ?. in my Sports 2 Jam It can. You just have to add it to the definitions. code:
|
# ? May 22, 2020 05:17 |
|
KillHour posted:It can. You just have to add it to the definitions. Thats not being context aware though and won't work well. You aren't going to statically namespace every enum you want to interact with and in the hypothetically scenario where two different enum types have the same names for their variants you won't be able to statically namespace one of them. I know it seems stupid to be complaining about something like this.. but a lot of people thought (and some still do) that var is stupid too. But it saves on typing, it saves and noise. And it is convenient. xgalaxy fucked around with this message at 05:49 on May 22, 2020 |
# ? May 22, 2020 05:43 |
|
That's fair. I've seen proposals to add implicit assignment types (e.g., "Dictionary<int, int> myDict = new ();"), so it might happen.
|
# ? May 22, 2020 07:19 |
|
I thought I knew a thing or two about C# yet here I am, trying to figure out how to get this manhole cover to fit back over the hole I'm crawling back into.
|
# ? May 22, 2020 07:47 |
|
Rocko Bonaparte posted:I thought I knew a thing or two about C# yet here I am, trying to figure out how to get this manhole cover to fit back over the hole I'm crawling back into. Don't worry, we're all furiously Googling poo poo as we go.
|
# ? May 22, 2020 08:09 |
|
I thought it was interesting and funny to discover that Minecraft Dungeons is made with Unreal Engine. I would have thought they would have just built on the existing Minecraft C++ engine.
|
# ? May 22, 2020 21:05 |
|
xgalaxy posted:I thought it was interesting and funny to discover that Minecraft Dungeons is made with Unreal Engine. Unless you really need to reuse a lot of poo poo from a custom inhouse engine written by an incel it probably makes sense to start over in something that you don't have to spend half your development time hacking it up to make it work for your game
|
# ? May 23, 2020 00:40 |
|
more falafel please posted:Unless you really need to reuse a lot of poo poo from a custom inhouse engine written by an incel it probably makes sense to start over in something that you don't have to spend half your development time hacking it up to make it work for your game I don't even play Minecraft, but I think that would be the Java version. Microsoft spent a bunch of money rewriting it in C++.
|
# ? May 23, 2020 02:02 |
|
This is an extreme long shot, but if anyone here has experience with Bezier curves/splines, I've got a very long question over on Stack Overflow I'd love to get thoughts on https://stackoverflow.com/questions/61966340/how-can-i-build-a-3d-bezier-spline-out-of-predefined-2d-xz-segments-with-a-con The tl;dr there is that I'm having a heck of a time turning a 2D "top-down" Bezier spline representing a big long track into a 3D spline with a constant rate of descent. I sent that to a friend and their first reaction was "oh just give up on a 3D spline and just turn that poo poo into a points of a 2D spline and then and linearly interpolate your descent over the list of points," which is both a totally reasonable thing to do and also totally feels like admitting defeat. I'm already using a quirky custom spline class wrapping my engine's built-in representation so that I can apply rotation to points along the splines, so maybe adding more behavior to that wouldn't be so bad, but it really feels like a 3D spline should work here. I'm mostly having fun with splines, at least. There is a lot of decently readable material out there for how Beziers and splines work, just not very much about how procedural generation of pieces of a spline can work. Though there are a lot of loving paid Unity plugins for the latter, I guess because everyone wants to build endless runners.
|
# ? May 23, 2020 02:47 |
|
Dunno about Bezier splines specifically, but in Unity the CinemachineSmoothPath component (part of Cinemachine of course, which is free) will fit a smooth curve through a set of waypoints and they can be 3D or 2D as you like. I'm pretty sure that if you use a continuous Y distance between waypoints then you'll get a fixed rate of descent, too.
|
# ? May 23, 2020 03:34 |
|
abraham linksys posted:This is an extreme long shot, but if anyone here has experience with Bezier curves/splines, I've got a very long question over on Stack Overflow I'd love to get thoughts on https://stackoverflow.com/questions/61966340/how-can-i-build-a-3d-bezier-spline-out-of-predefined-2d-xz-segments-with-a-con Are you sure you want bezier curves instead of spherical arcs?
|
# ? May 23, 2020 04:04 |
|
abraham linksys posted:This is an extreme long shot, but if anyone here has experience with Bezier curves/splines, I've got a very long question over on Stack Overflow I'd love to get thoughts on https://stackoverflow.com/questions/61966340/how-can-i-build-a-3d-bezier-spline-out-of-predefined-2d-xz-segments-with-a-con Your friend is correct that modifying the height of the output points directly is the way to go - it lets you change the descent rate dynamically and decouples it from the prefab pieces. It's just better design. But if you're really determined, here you go. There's even JS code for the curves. https://www.arc.id.au/HelixDrawing.html leper khan posted:Are you sure you want bezier curves instead of spherical arcs? This wouldn't have a constant descent like a helix. At the start of the arc, the descent would be whatever angle, but after 90 degrees, it would be 0. You could approximate a helix with a bunch of them, but it would be pretty jagged. KillHour fucked around with this message at 04:17 on May 23, 2020 |
# ? May 23, 2020 04:12 |
|
KillHour posted:Your friend is correct that modifying the height of the output points directly is the way to go - it lets you change the descent rate dynamically and decouples it from the prefab pieces. It's just better design. After taking the briefest of glances at your link and very quickly agreeing with you that the "proper" fix is overkill (mostly because I do not understand the math involved), I went with the output modification idea, and it looks great! Here's how it's lookin' now: https://disco.zone/splines/2/ Three JS is pretty fun for these sorts of things, very easy to build out procedural geometry and stuff. Tons of debug tools like the camera I'm using there, too. I kinda wish I knew a good JS game engine that wrapped it. Will probably port my new logic back over to Godot to get back to the game I was making, but GDScript is just idiosyncratic enough to irk me.
|
# ? May 23, 2020 04:41 |
|
Lookin good. Maybe have the banking code keep the angle if the next piece turns in the same direction.
|
# ? May 23, 2020 06:02 |
|
more falafel please posted:Unless you really need to reuse a lot of poo poo from a custom inhouse engine written by an incel it probably makes sense to start over in something that you don't have to spend half your development time hacking it up to make it work for your game
|
# ? May 23, 2020 07:11 |
|
OneEightHundred posted:There's other stuff you can reuse too (i.e. gameplay systems), but it's mostly a function of how similar the game you're making is to the one you already made, and Minecraft Dungeons and Minecraft have almost nothing to do with each other aside from the art style. Yeah, this is my point. A company I used to work for tried to make a God of War/Batman-style action adventure game in their extremely custom fighting game engine and it was basically the worst idea
|
# ? May 23, 2020 21:23 |
|
more falafel please posted:Yeah, this is my point. A company I used to work for tried to make a God of War/Batman-style action adventure game in their extremely custom fighting game engine and it was basically the worst idea If you want a similar example, Batman Forever was a fighting/platformer game made with the Mortal Kombat SNES engine. It is so terrible.
|
# ? May 23, 2020 21:32 |
|
TooMuchAbstraction posted:If you want a similar example, Batman Forever was a fighting/platformer game made with the Mortal Kombat SNES engine. It is so terrible. Fun trivia: The Genesis version is different in various ways, some good, some bad. The best is that there are no "HOLD ON" loading screens, and some of the moves are different (Batman's electro pellet is much better). The worst... since it uses fighting game inputs that normally assume "forward" and "back" are relative to a single opponent, things don't work well when there can be enemies on either side of you! You know how they say some inputs require holding the strafe button? There is no strafe button on Genesis because there aren't enough buttons, so any command that requires a "back" input only works if you're close enough to an enemy for it to lock your facing direction. Naturally, Robin's long-range projectile input is For+For+Back+C OneEightHundred fucked around with this message at 01:20 on May 24, 2020 |
# ? May 24, 2020 01:17 |
|
OneEightHundred posted:I actually enjoyed that game but I was like 13 at the time, so... AKA emergent flanking.
|
# ? May 24, 2020 01:18 |
|
TooMuchAbstraction posted:If you want a similar example, Batman Forever was a fighting/platformer game made with the Mortal Kombat SNES engine. It is so terrible. Back in 2000 there was an FPS called Project IGI that was built on a flight simulator engine. It was pretty neat at the time because the maps and draw distances were huge compared to most other FPS. https://m.youtube.com/watch?v=f_9LtmxDPiI
|
# ? May 24, 2020 01:27 |
|
The only cases I know of where an insane engine choice worked out somewhat is Anachronox and God of War.
|
# ? May 24, 2020 02:17 |
|
Tip posted:Back in 2000 there was an FPS called Project IGI that was built on a flight simulator engine. It was pretty neat at the time because the maps and draw distances were huge compared to most other FPS. That doesn't look half bad outside of the terrible animations and sound design. It seems technically competent, at least.
|
# ? May 24, 2020 03:04 |
|
Tip posted:Back in 2000 there was an FPS called Project IGI that was built on a flight simulator engine. It was pretty neat at the time because the maps and draw distances were huge compared to most other FPS. NBA Ballers (and Ballers 2: Phenom and Ballers 3:
|
# ? May 24, 2020 05:23 |
|
OneEightHundred posted:The only cases I know of where an insane engine choice worked out somewhat is Anachronox and God of War. For a moment there I thought you were trying to say that God of War ran on the Anachronox engine.
|
# ? May 24, 2020 07:49 |
|
another day, another long-winded question about splines: So, I've now got a nice spline renderer that is able to build a whole lotta triangles to render, all great. I'm now thinking about, uh, whatever game I'd like to make with this. The simplest kind of game to make would probably be something "Audiosurf-y," where movement is just following the spline as a path (with some offset). This was kinda my original plan, to make some sorta shooty or avoidance game with it. This would be relatively easy, and I already did some prototypes (sans fancier curve generation stuff) in Godot - the main missing piece here is that I haven't yet added a method for smooth traversal along my newly-height-adjusted spline, but I think that should be pretty easy to do with arc distance approximation between the generated points like any other curve. One thing I am kinda curious about, though, is building some sort of more traditional racing game that actually uses the spline as a surface (given an extruded "track width" and set normals for turns etc.), rather than just a path. This would be something more like Impossible Road or just a generic driving game, where you race up and down the curve as a solid road and have to actually turn to follow it. Now, I should note here my prototype is still just a Three JS thing, which is just a renderer; I don't yet have a physics engine or collision system at my disposal. That said, I'll almost certainly end up moving to Unity/Godot/something to do this, since god knows I don't want to reimplement physics and 3D collisions myself (there are a handful of JS options, but they're mostly like C++ libraries compiled to JS with questionable performance and API usability). So I'm not trying to find any specific concrete implementation of physics/collision yet, I'm just trying to think about it in the abstract. So, how would I move my car on the surface of the spline? My initial thought was "well, I'm turning this curve into a series of points and triangle segments connecting them for rendering, why not use that logic to create some kind of collider"? In my head, it could maybe like... raycast the "car" forward (relative to the normal, so it can handle banked corners) and get a collision vector from whatever triangle it's intersecting with? But trying to Google this idea has shown me very few results, which makes me think it might be, uh, a bad idea. I can't find a lot online about this, so I'm curious if anyone knows of general ways to do this (or topics I should be researching). The closest I've seen is that in Unity most people use a "MeshCollider" to generate a collider from their generated mesh. I think Godot has an equivalent of this, though the documentation for anything 3D in Godot is basically nonexistent, so I can't quite confirm this. I'm concerned one giant collider wouldn't be particularly performant, though, so I'm wondering if there's some sort of simpler decomposition that makes sense - I guess I could generate a "box collider" for every two triangles of my curve (with a slight bit of rounding as a result since the triangles are not actually parallel right triangles around corners? But I worry like smoothly passing over a bunch of potentially-overlapping colliders like that would be a tricky problem; reminds me of my difficulties getting tile-based 2D platformers to not stick characters on edges and stuff.
|
# ? May 25, 2020 00:06 |
|
Yeah, you'd use a mesh collider (or a bunch of mesh colliders, one per section of the course) for this. For the overlap concern, you can have overlapping colliders rounded off at the ends, like this: In other words, each collider goes one step past where it would normally end, but that step is recessed into the ground.
|
# ? May 25, 2020 01:16 |
|
|
# ? May 23, 2024 16:15 |
|
Make a procedural version of SSX, complete with a 90's soundtrack. Basically, this but snowboarding. https://squidsquadgames.itch.io/tanuki-sunset
|
# ? May 25, 2020 04:37 |