Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 14 Feb 2007
Offline Last Active Today, 08:10 AM

#5128373 Why would devs be opposed to the PS4`s x86 architecture?

Posted by Hodgman on 03 February 2014 - 03:19 AM

Short answer (elaborated upon above) is that you can get more FLOPS per transistor with a custom architecture than with a complex, slowly-evolved arch like x86.

The SPUs were absolutely phenomenal for performance, especially in 2006!
If they'd followed the same path, they could've made a CPU with far more FLOPS, while keeping the same size/transistor-count/heat/voltage/production-cost.

The upside of x86 is that it's easier to develop for, because it's what we use on our workstations.

I'm guessing that the awesome PS3 CPU model (traditional CPU core paired with SPUs) was abandoned because we now have compute-shaders, which are almost the same thing.
The extra compute cores in the PS4 (over the Xbone) have about the same FLOPS output as the PS3s SPUs, which is interesting.

#5128289 Frameworks vs native API's?

Posted by Hodgman on 02 February 2014 - 07:08 PM

From my professional work experience -- it's 100% of the time.


However, sometimes instead of using public frameworks, they're developed internally. In those cases, there will be a small team of people who develop the framework (wrapping up the native APIs), and then the actual game team will make the game using these frameworks.

#5128114 Texture Streaming synchronization

Posted by Hodgman on 02 February 2014 - 03:06 AM

If you want to know when the GPU has finished a draw operation, you can use events, yes.

However, this isn't required for updating resources. The update call will complete immediately, copying the supplied data into an internal temporary buffer if required. The actual update will occur asynchronously in the background. Any draw-calls submitted before the update call will use the old data, any draw-calls submitted after the update will use the new data (stalling automatically, if necessary to avoid a race condition). Everything should just work™ without the need for any events.

#5128059 How long would you support Shader Model 2?

Posted by Hodgman on 01 February 2014 - 06:20 PM

Dx11 has feature levels.
9 is SM2.
10 is SM4.
11 is SM5.
There is no feature level for SM3....

Dx9 has Caps, and some other APIs for checking supported formats. You can use the caps to see how many textures or MRTs you can use at once, etc.

For VTF, I forget the function name, but you need to query whether a particular vertex format is usable from vertex shaders.
From memory, there might be a cap bit saying whether VTF is supported, but most SM3 cards still require you to use one specific texture format (likely RGBA_16f). Some cards may say they support VTF in the caps, but then return false for every format when asking if that format is VTF capable...

Some SM3 cards also support a bit of SM4-level functionality -- e.g. If you try an create a texture with the format of fourcc INTZ (I.e. DWORD fmt = 'I'<<24|'N'<<16....), some cards will give you a D24S8 texture that's readable from pixel shaders like in Dx10/11...

#5127865 Need Help Implementing Entity Component Systems

Posted by Hodgman on 31 January 2014 - 06:35 PM

There's a million different ideas about what ECS is, and what the goals of an ECS library should be. Different ECS libraries are solving different problems. Given this, it's hard to answer how to write an ECS library, unless the goals are stated first.

Also, a big hierarchy of classes (valuing inheritance over composition) is not traditional OOP; it's a complete abuse of OOP!
OO teaches that you should prefer composition over inheritance. I'd suggest simply practicing writing OO code using composition first, to get used to how composition based code is structured, before trying to create your own library that's designed to make composition easier somehow.

#5127715 How long would you support Shader Model 2?

Posted by Hodgman on 31 January 2014 - 07:01 AM

Are those actual customers who pay for the game, too?

I'm not sure. There's only a small/restricted free demo of the game out so far, which is actually usable at low framerates... however when the actual game is released, I don't think it will be really playable via these emulators, so all these non-SM3 customers will be lost either way.
Then yes, you've got to make the assumption that if they can't afford to upgrade from an old SM2 PC, then they probably can't afford very much software either...
However, I'm in Australia, which is over 50x smaller than India. So, even if piracy rates there are 50x times greater, then overall revenues would remain the same for each market.
Even if you assume that there will be 10x more piracy, and you also drop the price by 10x, there's still 50x more customers, so it's still a huge amount of extra revenue on top of our domestic market.
That said, I've not yet approached this company and asked them if they'd like me to port their game from SM3 to SM2... Maybe I should do that cool.png

there's very few stuff done only in SM4, rewriting a simple frag/vert shader both for SM2/SM3 is question of minutes (most time) and don't require any changes to the C++ part.

That's true only if you assume that you don't require any changes to the C++ part.
If the SM4 version uses stream-out, then porting to SM3 will require completely changing the algorithms used in the C++ part.
If the SM3 version uses VTF or MRT, then porting to SM2 will require completely changing the algorithms too.
As mentioned by others, the main difference between SM2/3/4/5 GPUs is in the feature sets that are supported.
SM2 is actually pretty nice because you know that all the fancy features aren't supported, so you can only write simple shaders biggrin.png
SM4 is nice too, because the D3D10 specification for SM4 cards is very strict about all standard features being supported.
SM3 is really annoying, because most of it's features are completely optional. You can even access some SM4-level features via driver hacks, but only on some cards.

#5127711 Engine with C++ scripting?

Posted by Hodgman on 31 January 2014 - 06:45 AM

You could try SourceSDK. I largely learned C++ using it's predecessor (GoldSource).

#5127656 Why doesn't screen tearing happen at 5 fps?

Posted by Hodgman on 30 January 2014 - 11:51 PM

Speaking of vsync, i wonder if this stuff will caugh on. I think it's about time we universalize this kind of stuffs, crt are a thing of the past, in most of the cases.

The funny thing about G-Sync, is that there's apparently already a VESA standard for variable refresh rates (in the display port specification).

Some LCD panels already support this spec, so if your GPU also does, then you can get variable VBLANK timings without buying a fancy new "G-Sync capable" monitor.

It seems that what we actually want is DisplayPort capable monitors cool.png


With that revealed, it seems that buying/using G-Sync chips are just a way that panel manufacturers can choose to implement the full DisplayPort specification -- with the caveat that the chip contains a DRM system that will disable these extra features if it's connected to a non-nVidia GPU...

Variable VBLANK capability makes me happy, DRM-ing the capability makes me sad wacko.png

#5127620 Is it practical to have two instance of a Game class object

Posted by Hodgman on 30 January 2014 - 07:03 PM

Even if you can't think of a scenario where you might want more than one Game instance, keep the possibility open.

This!  Don't prevent yourself from making additional instances because you can't currently think of reasons you might need them.  By not imposing an unnecessary restriction on your code now you allow yourself greater flexibility if you find the need for an additional instance in the future.

This! biggrin.png


Another example -- to diagnose problems with networking, I have seen a games company simply instance two copies of the entire game-client within the one application, and hook them up via the networking system. They even plugged both instances of the game into the one scene renderer (tinting the objects from one of the clients a different colour). This let them visualize the state of a two-player network game using only a single PC, and whenever a desync bug occurred, it was immediately obvious (as a player/game-object would 'split' into two different locations on the screen).


The game wasn't initially designed to be used this way, but because it was written using clean and sensible software engineering practices, it was very easy for them to implement this "multiplayer testing" feature later on.

#5127597 How long would you support Shader Model 2?

Posted by Hodgman on 30 January 2014 - 04:52 PM

Many new games (like BF3) have been requiring SM4+ for a while.

SM2 support is nice if you want to sell your game in India, China, etc, where there actually is a huge market of old PCs.

I've been working on a game for the Indian market that requires SM3+, and there's a huge number of fans who are using SM3-CPU-emulators in order to run the game!!

#5127434 human intelligence

Posted by Hodgman on 30 January 2014 - 05:37 AM

The debate is extremely flawed if you fail to accept that biology is just nanotechnology, and that humans are therefore machinery...


Humans are machines.

Humans are intelligent and self aware.

Therefore machines can be intelligent and self aware.

The only way for this to not be true, is to artificially restrict your definition of machinery, or to choose to believe that humans are made of magic or whatever...


@OP though -- An i7 and GB's of RAM -- no. That is a ridiculously simple (and inefficient, and fragile) machine when compared to a human.


On the topic though, google just spent half a billion dollars acquiring a company who's developed a self-learning AI that can learn to play (and win) at different Atari games just from the RGB pixel inputs -- that's fully automated feature recognition, classification, planning, etc... That's a pretty good achievement thus far!

#5127385 Building games for "x" brand controller

Posted by Hodgman on 29 January 2014 - 11:49 PM

There should be no legal issues in using someone's hardware.


However, when advertising your game, you have to be aware that things like Nintendo™, Wii™, Nunchuck™ are trademarks (property) of Nintendo -- this includes the written names, logos, and images. You're not allowed to use someone else's trademarks to promote your own products.

I am not a laywer, but if you mention that your game requires a Wiimote, you'd probably require some fine print stating that Wii is a trademark of Nintendo and that you claim no affiliation with them.

#5127192 Empty Array In Structures

Posted by Hodgman on 29 January 2014 - 07:01 AM

The second is that I'm not a fan of the C++ stream model.

I've been using C++ professionally for over a decade and have never seen the standard stream library in use. I've only ever used it as part of "hello world" learning exercises biggrin.png

I still kinda find it funny that you have to go through including the library vector, using vector, Resizing the vector, store the address of the vector into a pointer buffer to be used as an array by static_casting, load the data into that buffer and possibly put it back into the vector array.

C/C++ are systems programming languages, that only make the computer do exactly what you tell it to do. C was originally designed to be a "portable assembly language" -- i.e. a language that translates almost directly down to native machine instructions.
If you want to use simpler abstractions (rather than being extremely verbose and precise in your code), then yes, a higher level language like VB is a far better choice for you. C/C++ are for solving a different class of problems than VB, and are designed accordingly.

#5127122 normalize() producing different results

Posted by Hodgman on 28 January 2014 - 10:03 PM

Is it ever meaningful to normalize a float4 anyway? Apart from the perspective division I can't think of a situation where you'd want to do that rather than normalize the underlying float3.

For normalizing a vector (or turning a position into a vector), you'd use a float3, for normalizing a quaternion you'd use a float4.


Often in graphics you want to normalize a bunch of weights -- if you've got 4 and your weighting system is based on Euclidean distance, you might find normalizing a float4 handy too biggrin.png

Though usually normalizing weights looks more like weights /= dot(weights, (float4)1)...

#5127047 Empty Array In Structures

Posted by Hodgman on 28 January 2014 - 03:36 PM

Thanks for the solutions. I tried using vector but theres a problem. If you use a variable declared from vector, you wont be able to use that variable to extract data from a file because you cant convert a vector(unsigned char) to (char *). I am using ifstream file and file.read to get the data.

char* buffer = (char*)&Vec[0]