Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 28 Feb 2011
Offline Last Active Today, 02:08 PM

Posts I've Made

In Topic: Fast Approximation to memcpy()

14 October 2016 - 06:24 AM


This one actually works... within a given assumption :wink:

void memcpy(void *dest, void *src, size_t size)
  assert(dest == src);


Technically the memory pointed to by the src and dest pointers can't overlap, so a compiler could technically optimize "dest == src" to "size == 0" making your function very fast by virtue of accepting only zero-length inputs :lol:

In Topic: GDNet+ ads

29 September 2016 - 01:56 AM


Why not just have a page with all the GDNet+ ads?

I think that would be a cool thing.

It would allow people that are interested in seeing what  GDNet+ Developers are working on.



Which is sort of what the old IOTD was.

In Topic: Buying a pc for game development courses in college.

17 September 2016 - 12:51 AM

It's honestly very hard to mess up while assembling a computer these days. Parts that aren't meant to go together won't fit, and you would have to try very hard (as in furiously rubbing your feet against carpet during assembly) to damage them with static electricity. Just be careful to not press on the motherboard like a madman; sometimes it takes a little work to plug components into it and lock them, and in some cases you will need to push fairly hard to insert them, but do not apply excessive force, take it slow and check what the issue is. The most intimidating part for a newbie is probably putting the CPU in its socket, just work slowly, read the instructions, think twice before doing and don't break anything and you'll be fine.


Just make sure to buy components that are actually compatible, e.g. don't buy a motherboard with an AMD socket and an Intel CPU, because that simply will not work.


It really isn't that hard :)

In Topic: Faster Sin and Cos

07 September 2016 - 11:46 PM

I feel like this is the kind of optimization problem that just screams out "genetic algorithm! genetic algorithm!" as the search space seems very smooth and well-behaved.

In Topic: Weitght vs speed when considering damage output

04 September 2016 - 12:28 AM

Yes, a punch from a really thin, pointy piece of light metal would be extremely destructive.


Actually the metric you are looking for is not force, but force over surface area (also known as pressure). An extremely strong punch distributed over a large surface area is going to do far less damage than a weak punch concentrated into a tiny surface area. Also see beanbags vs bullets. Similarly, a fast-moving object has a lot of energy, because kinetic energy scales with the square of velocity; so all things equal, the faster object will probably do more damage than the heavier one.


The actual damage imparted to the target depends on the consistency of the weapon and the consistency of the impacted area, as you correctly identified a plastic punch won't do much to an iron target, because the plastic will crumple on the iron and absorb the force of its own impact. If you can't penetrate the iron armor, you can still try and hit it really hard, which will set up a shockwave through the iron (because it's not completely rigid) which can damage whatever is behind (this is the basis for https://en.wikipedia.org/wiki/High-explosive_squash_head weapons). Sufficiently loud sounds can be very damaging because of the amplitude of the sound waves generated; that's why for instance water was being poured onto the launch pad for space shuttle launches to dissipate acoustic energy, so that the sound waves wouldn't shake the shuttle to pieces; if you were standing next to that your internal organs would be instantly turned to mush.


How accurate do you want to be?