Jump to content

  • Log In with Google      Sign In   
  • Create Account

Mihai Moldovan

Member Since 06 Oct 2011
Offline Last Active Apr 01 2013 05:33 PM

#4936257 Use DXGI_FORMAT_R8G8B8A8_UINT texture format in pixel shader

Posted by Mihai Moldovan on 30 April 2012 - 06:40 PM

If anyone ever finds the need to do this in OpenGL, you would simply use a [g]usampler2D with texture2DLod(coord, 0).a

#4936254 Neural Networks and Genetic Algorithms

Posted by Mihai Moldovan on 30 April 2012 - 06:30 PM

It doesn't help that most people's way of thinking of neural networks is they're just magical artificial brains.

In fact Neural Networks are mostly bullshit, created to solve problems that you don't want to or are not intelligent enough to code up a proper solution to. In these cases you just accept approximate solutions and state that you want any inputs to be mapped to outputs that are known to arise from similar inputs.

TL;DR: NNs are way over-hyped.

#4936251 android java code problem

Posted by Mihai Moldovan on 30 April 2012 - 06:24 PM

It's my experience that Java code on Android will tend to crash about 1000 times more often than the same amount of native code.

This can probably be attributed to the many noob developers looking to develop their own app without ever properly learning the language as well as the paltform inherently being unstable due to crappy decisions by Google engineers working under time pressure.

#4936248 Lockstep games - waiting and synching worlds

Posted by Mihai Moldovan on 30 April 2012 - 06:18 PM

I would say that nowadays the way to go is async. C++11 and boost::asio make it so easy to write a multithreaded game server with the minimum amount of locking and without compromising readability.

For your simulation, look into the reactor pattern and using a priority_queue to manage your upcoming events.

#4936246 beginner direct x 9

Posted by Mihai Moldovan on 30 April 2012 - 06:09 PM

Student project? PLEASE just don't try to make a game. You'll miss every deadline.

#4936236 Does starcraft2 use navmesh A* or grid A* for pathfinding?

Posted by Mihai Moldovan on 30 April 2012 - 05:57 PM

Your question doesn't make sense.

A* is an algorithm while a Navmesh is the data structure (graph) representing your terrain. Thus SC2 uses both, A* and a Navmesh, and steering behaviour on top of that.

Anyway, I wouldn't try to learn from what Blizzard is doing with their games. They're really just not that good except for their marketing and cinematics team.

#4936234 Language Comparison

Posted by Mihai Moldovan on 30 April 2012 - 05:53 PM

It's really a shame that Universities nowadays do not even teach any systems programming languages anymore. Not even C++.

I've seen people graduate from their 5-year CS program without ever having programmed a single line in any language, but the norm is that people who graduate are at least capable of writing maybe a Hello-World Java program. That's the most you can expect though.

Our OS class focused entirely on writing user-level 20-line Java programs, because the students just didn't know any C.

#4936229 Ideas for how to improve code

Posted by Mihai Moldovan on 30 April 2012 - 05:47 PM

There's no shame in doing something incorrectly.

There's no good reason to use malloc in C++ anyway, especially if you're about to use it incorrectly.

If you really want "performance" (PLEASE PROFILE FIRST), then you can use the OS-specific HeapRealloc or POSIX realloc APIs and hide them behind an overloaded new operator.

#4936219 Windows development setup

Posted by Mihai Moldovan on 30 April 2012 - 05:30 PM

How about CMake and TDM-GCC? No reason to buy into the platform-lock.

#4936216 Ideas for how to improve code

Posted by Mihai Moldovan on 30 April 2012 - 05:27 PM

 * Like new, we want to guarantee that we NEVER
 * return NULL.  Loop until there is free memory.
static char* malloc_never_null (size_t const b)
  char *p;

  do {
    p = static_cast<char*>(malloc(b));
  } while ( p == NULL );

  return p;

This is just wrong, you should feel ashamed.. the reason new never returns a null pointer is because it throws an exception if it can't allocate the requested amount of memory.

Unless you disable exceptions in your specific compiler, then new can of course return null pointers (depending on implementation specifics).