|
Mooey Cow posted:You can use Euler angles to define orientations, but they are no good for rotations in general. They represent a composition of three rotations; around the x-axis, the y-axis and the z-axis, but the order of composition is not defined. So a Euler vector of (90,0,90) in one library could be a completely different rotation in a another one. I figured it was something like that. How do I figure out the correct values of the appropriate Quaternion?
|
# ? Feb 4, 2019 13:35 |
|
|
# ? May 25, 2024 14:38 |
|
horriblePencilist posted:I figured it was something like that. How do I figure out the correct values of the appropriate Quaternion? Unity has a function for that: Quaternion.AngleAxis. I'm not sure what axes your Euler vectors would translate to though, but maybe your source for the algorithm knows what they should be. (The formula for that function is also simple: If a is the angle, then the scalar part of the quaternion is cos(a/2), and the vector part is sin(a/2) times your axis vector. From which it is clear that any rotation of 0 degrees is always the identity quaternion (0,0,0,1) ). If it turns out you do need to rotate your rotations along with the coordinate system, you should send the quaternions as arguments to your recursive function.
|
# ? Feb 4, 2019 14:00 |
|
Mooey Cow posted:Unity has a function for that: Quaternion.AngleAxis. I'm not sure what axes your Euler vectors would translate to though, but maybe your source for the algorithm knows what they should be. I don't think the definition of the rotations using Euler is the problem - if I create a rotation by multiplying two Quaternions defined by AngleAxis it's the same as if I just used Euler. I tried passing the rotated Quaternions like you suggested, but it's not quite right either. The first corner is rotated correctly, but after that all subsequent corners have the same orientation. And as before, rotating the gameobject causes the rotations to get mixed up as well. Again, here's the code, I must be getting something wrong.
|
# ? Feb 4, 2019 14:42 |
|
OneEightHundred posted:Well, found an efficient way to compress ETC1/ETC2 textures, should have it finished off in a week. It's already like 4x as fast as etc2comp, just need to finish off the SSE2 port and then it'll be probably 20x as fast. Sweet! How are you licensing it?
|
# ? Feb 4, 2019 16:11 |
|
Absurd Alhazred posted:Sweet! How are you licensing it? Main caveat is it won't support alpha or 11-bit in the initial version. e: Also it's not good for image types that use weird error metrics that etc2comp supports (like normal maps) and can't support weight-by-alpha. OneEightHundred fucked around with this message at 06:02 on Feb 5, 2019 |
# ? Feb 4, 2019 19:15 |
|
I finally managed to pinpoint my error: The possible rotations were defined using the default coordinate system, when they needed to be defined with the currently used one. Instead of defining the array at the start of the script, I just had to initialize it within the recursive function. Now to figure out how to make it work for a dodecahedral structure and come up with a nearest neighbor algorithm
|
# ? Feb 4, 2019 23:34 |
|
You probably need to depth test those.
|
# ? Feb 5, 2019 01:21 |
|
OneEightHundred posted:MIT license.
|
# ? Feb 5, 2019 04:06 |
|
KillHour posted:You probably need to depth test those. Oh, this is just the Debug.DrawLine function, it doesn't occlude itself. I just needed a way to visualize the progression.
|
# ? Feb 5, 2019 08:34 |
|
Well, turns out the speed test had a problem with it, and the SIMD port didn't yield as much as expected. It's about 2x as fast as etc2comp with default parameters, but quality on par with -effort 100 a.k.a. max quality. Early version if you want to take it for a spin. Channel weights don't work yet (so it's only comparable to using -errormetric rgbx). https://github.com/elasota/cvtt/tree/cvtt/ConvectionKernels
|
# ? Feb 6, 2019 11:31 |
|
OneEightHundred posted:Well, turns out the speed test had a problem with it, and the SIMD port didn't yield as much as expected. Sweet! Can't make any promises, but I'll PM you if I get anywhere with it.
|
# ? Feb 7, 2019 03:13 |
|
Is there a high performance way to check collision on a sprite animation that's accurate to transparency? I can create a box that contains just the non-transparent pixels of a sprite frame but obviously it'll still contain a lot of transparent space. Checking the actual pixels on every collision is pretty bad. I can create a mesh tight on the non-transparent shape but doing that every time the sprite changes in an animation isn't great. How did old games do it? I know Doom has fairly loose collision but was that common? I'm not terribly concerned about extra hits except something like hit particles would look kinda awkward spurting from the empty space under an arm or something. Setting up hit boxes is kind of a pisser with multi-directional animations as you gotta do that per frame + per direction. I could voxelize them at X accuracy and store that info (then on collision check if the voxel is filled or not) though that's not a trivial amount of data to store for every frame of every animation in every direction.
|
# ? Feb 8, 2019 02:54 |
|
Most old games just make a slightly small bounding box and don't fuss much about minor inaccuracies. In general, if you err towards being generous to your players, they won't complain.
|
# ? Feb 8, 2019 03:33 |
|
TooMuchAbstraction posted:Most old games just make a slightly small bounding box and don't fuss much about minor inaccuracies. In general, if you err towards being generous to your players, they won't complain.
|
# ? Feb 8, 2019 03:54 |
|
Touching my hair might get you killed 💅
|
# ? Feb 8, 2019 04:09 |
|
Also if it really is necessary you could always just pre-compute the collision polygons, or use something like Physics Editor.
|
# ? Feb 8, 2019 04:23 |
|
There are definitely a bunch of old games (especially on Mac) that had pixel-precision sprite collision checks and used them to sometimes interesting effect where you could dodge things by razor-thin margins. Sprite-sprite overlap checks are cheap, just make a collision bitfield, use bit shifts to line them up, and bitwise-AND the bitfields to see if there's any overlap. Ray-sprite checks can be cheapened somewhat too depending on how aligned the ray is with an axis: You can create series of bits in a register with 3 instructions, bitwise-AND them with the collision bitfield, and even find the collision depth in 1 instruction with CLZ/FFS or equivalent. Colliding sprite transforms with rotations, determining collision depth of sprite-sprite collisions, and any kind of restitution are much harder though.
|
# ? Feb 8, 2019 06:16 |
|
love when platforming depends on where i am in the walk cycle animation
|
# ? Feb 8, 2019 06:16 |
|
Suspicious Dish posted:love when platforming depends on where i am in the walk cycle animation
|
# ? Feb 8, 2019 07:09 |
|
To be clearer this is a first person game and not a platformer. *snip* edit: you know with some testing I'm designing here for the extreme edge case of a monster throwing his arms out everywhere. A tight box does almost everything I want. Also, the animation where the hitbox looked worst was a death animation. Oi that's some overthinking it. FuzzySlippers fucked around with this message at 10:53 on Feb 8, 2019 |
# ? Feb 8, 2019 07:12 |
|
Maybe determine where on the textured quad you’re hitting, and use the UV coords of the hit to do a check against precomputed 2D collision shapes like you would in a 2D game? Since they’re precomputed, keeping a different set for each animation frame shouldn’t be that big of a deal, and since you aren’t hit testing them in 3D it should be fast (just testing if the hit point UV coord is inside any of the current frame’s 2D collision shapes).
|
# ? Feb 8, 2019 08:02 |
|
FuzzySlippers posted:To be clearer this is a first person game and not a platformer. Anyway, here's what the 'hurtboxes' look like in Quake 3: In Quake 1 they were even bigger and more imprecise. You could draw blood from the empty space in front of an enemy standing around the corner from you. Nobody noticed or cared. I actually like the reduced emphasis on precision in old shooters and kind of miss not having to worry so much about meticulously placing every shot.
|
# ? Feb 8, 2019 08:13 |
|
If you're just tracing rays, and don't need full sprite->sprite collisions, then it should be a simple matter of intersecting your ray with the sprite's plane, then transform the hit point to the sprite's local 2D space. Then you can check if the point is even within the sprite's quad, and also get the texture coordinates of that point. You can use those to easily calculate the pixel coordinates and simply check the texture data at that point if it's transparent or not. It will most likely be a lot faster than checking a bunch of polygons. You'll want to keep the texture data in main memory though; if you have to download it from graphics memory it will not necessarily be very fast.
|
# ? Feb 8, 2019 11:03 |
|
Mooey Cow posted:You'll want to keep the texture data in main memory though; if you have to download it from graphics memory it will not necessarily be very fast. Yeah, and if you want to reduce your memory utilization, you can keep a downsampled texture on the CPU end, at the cost of lower precision.
|
# ? Feb 8, 2019 14:53 |
|
I've added leaderboards to my game, but how am I supposed to handle usernames like 絕望類型? The font I'm using obviously doesn't have those characters. Is there a font I can use that just has all the characters? How does this work?
|
# ? Feb 8, 2019 16:32 |
|
Mooey Cow posted:You'll want to keep the texture data in main memory though; if you have to download it from graphics memory it will not necessarily be very fast. A copy of it, yes. Also, a check to see if a 2D point is inside a handful of 2D collision shapes is incredibly fast, and gives you the option of being selective about what non-transparent pixels count as a hit, so you can exclude hair or a cape or a glow effect or whatever.
|
# ? Feb 8, 2019 19:45 |
|
baby puzzle posted:I've added leaderboards to my game, but how am I supposed to handle usernames like 絕望類型? The font I'm using obviously doesn't have those characters. The font called Arial Unicode MS works a treat, but that isn't free as far as I can tell.
|
# ? Feb 8, 2019 22:46 |
|
Noto is SIL Open Font Licensed.
|
# ? Feb 8, 2019 23:56 |
|
I was looking into that but its like a gig of dozens of files... If there was like a "best hits of Noto" on one file, that would be great. It is starting to seem like this isn't something I can support, and that some users are just going to see squares instead of their names.
|
# ? Feb 9, 2019 00:04 |
|
baby puzzle posted:I was looking into that but its like a gig of dozens of files... If there was like a "best hits of Noto" on one file, that would be great. 1. check that all characters in a string exist in the font you're using, and if not, search fonts on the current system for one that does support the string and then use that. I found this for a way to do that, it's super gross. 2. check that all characters in a string exist in the font you're using, and if not, make the user enter a different string for their name so you can still use your font. 3. always make the user enter a string for their name, and don't accept any characters that aren't in your font (a lot of games limit to just the ASCII characters). 4. Just let them see squares. These are in order of best to worst, and also coincidentally in order of hardest to easiest!
|
# ? Feb 9, 2019 00:41 |
|
Your number 1 is what I was thinking I'd have to do... probably the correct way. These are steam usernames so I have no way to control their contents.
|
# ? Feb 9, 2019 00:51 |
|
Noto Sans Regular is like ~30 MB, less if you filter out the non-UI variants for the languages that have UI variants (which I didn't bother to do).
|
# ? Feb 9, 2019 01:22 |
|
pseudorandom name posted:Noto Sans Regular is like ~30 MB, less if you filter out the non-UI variants for the languages that have UI variants (which I didn't bother to do). Where do you get that from? NotoSans-Regular.ttf from the google font site is only 406kb and doesn't support these characters. e: Oh are you talking about using a bunch of different ttf files and not just one?
|
# ? Feb 9, 2019 01:58 |
|
Yeah, the Unicode coverage is spread out across a bunch of different font files.
|
# ? Feb 9, 2019 05:33 |
|
pseudorandom name posted:Yeah, the Unicode coverage is spread out across a bunch of different font files. Might as well call it Multicode at this point.
|
# ? Feb 9, 2019 05:51 |
|
One code to rule us all...
|
# ? Feb 9, 2019 05:57 |
|
Absurd Alhazred posted:Sweet! Can't make any promises, but I'll PM you if I get anywhere with it. https://github.com/elasota/ConvectionKernels Also false alarm on the underwhelming speed: There was a bug making the error calculations (which is the vast majority of the processing time) take 3 times as long.
|
# ? Feb 10, 2019 03:12 |
|
baby puzzle posted:Your number 1 is what I was thinking I'd have to do... probably the correct way. These are steam usernames so I have no way to control their contents. The "real" system here is something known as a "font shaping engine", where you feed it a string of code points and it comes back with a bunch of font/glyph pairs (along with their location). Harfbuzz is the open-source one and it's decently simple to use. Pair it with a font renderer like stb_truetype.h for something quick and easy.
|
# ? Feb 10, 2019 03:29 |
|
Its not free but Slug is pretty awesome: http://sluglibrary.com I recently learned that Path of Exile now uses it.
|
# ? Feb 10, 2019 18:24 |
|
|
# ? May 25, 2024 14:38 |
|
Bad news: https://twitter.com/eevee/status/1095149563562811392 I hope this is just an unfounded rumor.
|
# ? Feb 12, 2019 03:42 |