Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1411315 Posts in 69330 Topics- by 58383 Members - Latest Member: Unicorling

April 03, 2024, 04:17:36 AM

Need hosting? Check out Digital Ocean
(more details in this thread)
  Show Posts
Pages: [1] 2 3 4
1  Developer / Technical / Re: The grumpy old programmer room on: December 06, 2014, 07:36:36 PM
This is an actual line of code I just wrote.

Code:
r.attributify(attributes.attributes);

Please forgive me.
2  Developer / Technical / Re: OpenGL particle System: gl_points? on: August 07, 2013, 11:05:12 AM
I feed particles (with position, velocity, etc.) as points to a geometry shader that generates a triangle strip which is stretched according to the velocity at the midpoint so as to avoid distorting the ends. This obviously only works if you're targeting OpenGL 3.2+ hardware.
3  Developer / Technical / Re: circle to circle collision on: July 13, 2013, 10:14:02 AM
Code:
offset = c1.r + c2.r
overlap = offset*offset > dx*dx + dy*dy
Pretty darn cheaper.

1 vector subtraction (not shown in the example but needed, possibly free if you're already doing it for some other reason), 1 scalar addition, 1 scalar multiplication, 1 dot product.

You'd be hard pressed to beat that.
4  Developer / Technical / Re: Beautiful fails. on: July 13, 2013, 10:09:25 AM


Bitmap font offsets and interlacing fail.  I kinda like it though.

The font is inspired by the old IBM PS2 / VGA BIOS, so scan lines would actually be quite fitting... hmm.

This is wonderful. I don't think you could go wrong putting that to use for something.
5  Developer / Technical / Re: What are you programming RIGHT NOW? on: July 03, 2013, 10:18:29 AM
Code:
movaps xmm3, xmm2
shufps xmm3, xmm0, 0x33
shufps xmm2, xmm3, 0xC9
shufps xmm3, xmm1, 0x36
shufps xmm0, xmm3, 0xC9
shufps xmm1, xmm3, 0x69
6  Developer / Technical / Re: The happy programmer room on: July 02, 2013, 03:10:55 PM
Sorry compiler, but you've been outplayed.

Code:
mulps xmm0, xmm3
mulps xmm1, xmm4
mulps xmm2, xmm5

movaps xmm6, xmm1
shufps xmm6, xmm2, 0x9E

movaps xmm7, xmm0
shufps xmm7, xmm1, 0x49

shufps xmm0, xmm6, 0x8C
shufps xmm1, xmm6, 0xD8
shufps xmm7, xmm2, 0xCD

addps xmm0, xmm1
addps xmm0, xmm7
7  Developer / Technical / Re: The happy programmer room on: June 24, 2013, 12:13:25 PM
Code:
float cos_theta = dot(n, v);
vec3 r = cos_theta * n + sqrt(1.0f - cos_theta * cos_theta) * cross(n, cross(n, v));

What does that do, angle between two vectors?

After thinking about it some more, the same thing as this:

Code:
vec3 r = -v + dot(v, n) * 2 * n;

It's ray ref(lec|rac)tion without quaternions.
8  Developer / Technical / Re: The happy programmer room on: June 23, 2013, 12:00:34 PM
Code:
float cos_theta = dot(n, v);
vec3 r = cos_theta * n + sqrt(1.0f - cos_theta * cos_theta) * cross(n, cross(n, v));
9  Developer / Technical / Re: The grumpy old programmer room on: June 17, 2013, 03:11:33 PM
Code:
    mov ax, 0x0E07
    xor bx, bx
    int 0x10

Surely your assembler doesn't treat unprefixed hex values as memory locations rather than immediates?
10  Developer / Technical / Re: Post if you just laughed at your code. on: June 17, 2013, 02:59:04 PM
Ahem:

Code:
// fopen is kinda janky
#pragma warning(disable: 4996)
11  Developer / Technical / Re: The grumpy old programmer room on: June 14, 2013, 11:40:26 AM
I lost two days on this one:

Code:
d.x = r.origin.x - l.origin.x;
d.y = r.origin.y - l.origin.z;
d.z = r.origin.z - l.origin.y;
12  Community / Townhall / Re: Save the Date. It's a game about having dinner. on: June 08, 2013, 06:50:36 AM
For what it's worth, the "goodbye" ending was the last one I chose and it was the best ending I can imagine for a game so narratively ambitious. You've played through all these doomed scenarios with the mindset of trying to solve a puzzle. You've had the rug pulled out from under you by way of an insightful conversation with the author about game narrative. You've all but given up on the "puzzle" and resorted to digging around in the game files looking for more, leading you to the ending you thought you wanted, only to find it totally unsatisfying. At this point you have the choice to either accept this hollow ending or return one last time to end the game in a way that's at least cathartic, if still doomed. I really enjoyed how game, narrative, and player agency all came together to create a sense of closure in the "goodbye" ending.
13  Developer / Technical / Re: Post if you just laughed at your code. on: February 06, 2013, 06:06:40 PM
Code:
// maybe we can use the handle itself to disambiguate?
// nope
14  Player / General / Re: "What kind of games do you make?" on: January 23, 2013, 05:16:26 PM
"I make games that deserve to exist"
15  Developer / Design / Re: "It's not a game" on: January 18, 2013, 09:39:26 AM
if you sincerely tried to make a short film and the result was a novel then I can't object to you calling it that

wasn't the point i was trying to make.

Perhaps not, but it does illustrate a problem with the aim of this thread. If I asked you whether a nuclear power plant is a toothbrush it would be perfectly reasonable for you to answer no. If I asked you to quantify to what extent a nuclear power plant is a toothbrush an argument could be made that a nonzero (though very small) answer would still be reasonable.
16  Developer / Design / Re: "It's not a game" on: January 18, 2013, 08:46:18 AM
Something is a game if the creator decides what they're making is a game, likewise with art.

well no, that can't be true. definitions are independent of intent; i can't go around writing a novel and call it a short film, can i?

Sure you can. It's a really unusual and intrinsically failed short film, but if you sincerely tried to make a short film and the result was a novel then I can't object to you calling it that.
17  Developer / Design / Re: "It's not a game" on: January 18, 2013, 08:35:47 AM
Something is a game if the creator decides what they're making is a game, likewise with art.
18  Player / General / Re: IGF Thread 2013 on: January 14, 2013, 02:13:38 PM
I have to admit I didn't finish Little Inferno. Having now watched the ending I can appreciate what it was trying to do, though maybe the fact that some people stop playing means it waits a bit too long to reveal itself. Or maybe it means I just didn't "need" it.
19  Developer / Technical / Re: How to make a downloader / patcher / updater / launcher / thing on: January 09, 2013, 08:42:39 AM
If someone performs a man-in-the-middle attack or hacks your update server they can distribute malware to every user of your software, and you might be liable.

Calculate & supply a checksum with your update so when someone does hack your server, they need to reverse engineer your updater / executable as well in order to build a valid update package.

A Terms of Use & Statement of Liability is not a bad idea either Wink

As I kind of insinuated the whole thing is a futile exercise given that there are much easier ways for attackers to get their code on your users' machines (if they can MITM your users they can simply replace your updater with their malware as it's being downloaded). That having been said, a checksum is not enough here. Even a real cryptographic hash isn't enough here. Really you need digital signatures.
20  Developer / Technical / Re: How to make a downloader / patcher / updater / launcher / thing on: January 08, 2013, 06:51:25 PM
There's a potential security breach when you transfer the build to the offline machine for signing.  More importantly, it's all for naught if your server's hacked and the source of the public key used to verify the signature is changed.  Tongue

Anyway, the bottom line is it's a very complicated problem to do this securely and it's usually better not to do it yourself if you aren't a cryptography expert.  I know enough to be aware of this, but not nearly enough to qualify as such an "expert".

I do believe you may have missed the point of my silly little post.
Pages: [1] 2 3 4
Theme orange-lt created by panic