Jump to content

  • Log In with Google      Sign In   
  • Create Account


Pink Horror

Member Since 02 Jul 2013
Offline Last Active Yesterday, 07:08 AM

#5171295 potatoe

Posted by Pink Horror on 03 August 2014 - 01:49 PM


Actually, in Lua all numbers are FP32. And it's a pain in the ass, because all of a sudden you loose the ability to store a 32-bit hash or a 32-bit Unicode codepoint as a regular number. Indices for an array can not only be negative, but can also be fractions or NANs.

 

I don't know the history or what version of Lua you're talking about, but in the version of Lua that I downloaded source for around a year ago, the base lua_Number is a double, and it is configurable.




#5167289 Vertex shader value is not interpolated in pixel shader

Posted by Pink Horror on 16 July 2014 - 08:19 PM

How do you compute your tangents? My guess is that your triangles all have unique vertices, even when they are adjacent, and the flat shading is an accurate reflection of the situation. I would dump the buffers out to a file and inspect manually.


#5166898 Storing position of member variable

Posted by Pink Horror on 14 July 2014 - 09:22 PM

const ComponentDeclaration::AttributeVector vAttributes =
{
{ AttributeType::FLOAT, "x" },
{ AttributeType::FLOAT, "y" },
{ AttributeType::FLOAT, "z" },
}


I came on here to mention offsetof, though I see that you've found that. Instead of trying to get fancier, I would start out by implementing your original idea. Maybe it'll be a little annoying to type class names over and over, but it'll get something working that you can refactor:

const ComponentDeclaration::AttributeVector vAttributes =
{
{ AttributeType::FLOAT, "x", offsetof(Component, vPosition) + offsetof(Vector2f, x) },
{ AttributeType::FLOAT, "y", offsetof(Component, vPosition) + offsetof(Vector2f, y) },
{ AttributeType::FLOAT, "z", offsetof(Component, vPosition) + offsetof(Vector2f, z) },
}



#5164828 I've got problems with interviews

Posted by Pink Horror on 04 July 2014 - 07:33 PM

In my opinion core algorithm development on computer (not on paper) should be the best way to test the competence and intelligence of a developer


I have to be brutally honest here: I know a few people who think they are great programmers and scoff at basic interview-style questions and knowing the definitions of things, and who cannot code on paper. The code they produce at their computers is all average or worse. I can understand there might be exceptions, but I haven't met any yet. I can also understand how an interviewer would be skeptical about whether you're an exception.

This doesn't just sound like you don't know specific things like the linked list loop problem. It sounds like you don't place much value in understanding more than whatever it takes to get your code to run. That doesn't make you a person who I would want to work with.


#5164824 So... I'm a Molecular Biologist....

Posted by Pink Horror on 04 July 2014 - 07:11 PM

I figure I would try to get the game coded in C++ and for mobile devices, but I want it to be as cross platform compatible as possible and the code to be as open source as possible. I'm not sure what my options are in that regard.


Why is it "C++ and mobile devices"? Does that mean you do not expect the mobile devices to use C++? Why do you care if the game is in C++, if you're not programming it?

What do you think it means to be "as open source as possible"? Do you mean you want to make your source code public? Do you want to let volunteers contribute to your source code?

Honestly, as a programmer, one thing that somewhat bothers me is when someone who does not know what he or she is doing with software still wants to make all the high level technical decisions, and then force the actual programmers doing the work to use the programming languages, libraries and tools of their choice, based on some light Internet research, instead of letting the people who may have actually written games in several different languages and environments decide which ones to use. But that's just me.


#5161988 DirectX

Posted by Pink Horror on 21 June 2014 - 06:30 PM

My question is, in which particular version of visual studio did the work? I am reading Frank D. Luna's book about directx programming and in the book they are using the xnamath library which I can't do in microsoft visual studio 2013/2012. I tried to install VS2010 but it is not compatible with windows 8.
 
It is a pain in the as* that microsoft keeps removing/add stuff and changing old things so they don't work anymore, which makes the learning proccess much harder than it should be.
 
 
What should I do now? Any suggestions?


I wouldn't go back to Visual Studio 2010 just because of this problem. I would use directxmath instead of xnamath. Here's a guide I found by searching for "directxmath vs xnamath":

http://msdn.microsoft.com/en-us/library/windows/desktop/ee418730(v=vs.85).aspx

Ok, the learning process isn't easy, but this is the learning process you need: I'll assume that in your year of learning C++, you actually learned something about how to write some code. Someday you have to learn how to solve problems with compilers, build configurations, breaking changes in APIs, and finding information for yourself. You don't simply lack DirectX experience.

You clearly lack experience doing all of these non-coding tasks. It probably wouldn't have mattered which API you picked first. It's ok - you're just getting started. But you have to make a decision: do you want to be the kind of person who switches tools every time you run into a problem and/or complains about the tools you have, or do you want to be someone who can adapt to whatever circumstance you face? I've been unfortunate enough to work for the first type of engineers a couple of times - teams that have jumped between server platforms and databases and operating systems when they have run into problems, quitting instead of figuring out what happened.

All of the information for what you want to do is available to you is out on the web, just like the information you've found about html and programming languages. It's probably also available to install to your computer, from wherever you got Visual Studio 2013. It might be over your head, but that doesn't mean that it doesn't exist.


#5161191 A Dream at Work! Starting up a Studio.

Posted by Pink Horror on 17 June 2014 - 07:03 PM

-I am aware that the cost can go up to 10’s of millions, so I risk in being candid that my projected proposal is between 3 to 5 million US dollars.  Have you heard of Studios that have done so with such a limited budget?


Wow. I wish I knew someone who was willing to hand three to five million dollars to somebody who needs to go online to forums to ask what the budget should be for a "AAA Open World" game.

I'm sure this is one of those things where if you gave us the information we really need to find a comparable game to determine the budget, you'd be giving away your big idea, but your big idea is probably all you have. It's probably something like, GTA, but with X!, or in Y! Of course the latest sequels to GTA, Assassin's Creed, The Elder Scrolls, Infamous - those are all games that have all the tools and engines and assets from the previous iterations, but I doubt they could pull off what you're asking to do with the budget you have.

Maybe my definition is not the consensus, but to me "AAA" is not a quality measure. It means, to me, a game that actually has a huge budget, so in a way I'd consider your proposal impossible on a technicality. Also, IMO, a "AAA Open World" game is the sort of game that has tons of little side quests and mini-games to round out the experience, the kinds of things that can be easily farmed out to many separate teams and studios, but with only one small studio, and considering the hit-and-miss quality of that sort of thing, it doesn't make much sense to me to even try to make a game like that on a smaller budget.

Of course, I'm not going to deny that it's possible to do what you want. However, for some new studio to come out and do what Ubisoft or Rockstar does, only much more efficiently, I cannot imagine how that would happen unless the company was founded not by someone with an idea for a game, but someone with an actual conceptual process for how to make that type of game faster and cheaper than the competition. If your only idea for how to do that is to license an existing game engine, the best you can expect to do is what other game studios have managed to do, on average, with the same budget and engine. If you have a better idea than that, well... I really, really doubt you'd have to ask any questions.


#5160674 Why does this code snippet not work when i take it out of function scope

Posted by Pink Horror on 15 June 2014 - 12:31 PM

1. If you need an array of a small number of chars, I would default to putting them on the stack, i.e. "unsigned char buf[4]", instead of using new. Your sizeof would work if you did that.

2. If you want to test your function's ability to pack and unpack an int into a char array, you might want to choose an int that actually takes more than one byte to store.


#5160176 Checking if a bit is set in a byte

Posted by Pink Horror on 12 June 2014 - 06:09 PM

The whole BIT enum idea is practically pointless once you get binary literals:


You're still going to want to give them names, right? I don't want to have put in a comment explaining what bit "0b001000" is when I could have used something with a name instead. And writing "0b001000" doesn't look any better than writing (1 << 3) to me.


#5158805 Access violating reading 0x00000C44?

Posted by Pink Horror on 06 June 2014 - 04:53 PM

Nothing is ever solved by just adding an output to the log.


I once worked on a bug that came down to denormalized floating-point values getting zeroed out when they were loaded into vector registers, while keeping the original values when used as bytes or loading into normal registers. Adding some sort of side-effect, such as a log, in one particular constructor or assignment operator we had (I cannot remember which) was preventing the compiler from using the vector load and stopping the bug.

I learned this when I thought I had fixed the bug when I made two changes at the same time: one to try to prevent some other behavior which I thought was the cause, and one to log out when the copied values didn't match the originals, so I could verify the fix. When I was ready to submit my code and removed the log, I decided to test one last time, and the problem came back.


#5158093 Checking if a bit is set in a byte

Posted by Pink Horror on 04 June 2014 - 08:11 AM

if( (10110 & 10000) == 10000 )
if( (value & mask) == mask )


I wonder, why do some people write "== mask" instead of "!= 0"? I suppose it doesn't matter much when the variable is "mask" and/or you use a function, but I've seen this pattern with huge blocks of hard-coded if checks with duplicated giant enum names everywhere.


#5156192 Upon compiling with Nvidia SDK 3.3.1 - I get This Operator is not allowed as...

Posted by Pink Horror on 26 May 2014 - 10:30 PM

I'm about a month late to the discussion, but I think I have the answer:

PX_OFFSET_OF uses the offsetof macro.

The C++ version of the offsetof macro in Visual Studio's stddef.h has a reinterpret_cast in it.

Visual Studio 2013 Intellisense does not appear to accept reinterpret_cast in a constant expression, while Visual Studio 2012 was able to handle it just fine.

I tested this with a plain struct, and when I wrote up a similar expression with a C-style pointer cast instead of the C++ style reference cast, it had no problem with it.

It also looks like it would work if the file with that header is compiled as C instead of C++, because there is a C-style version of the macro in the header file that gets used in that case.

Anyway, I believe offsetof should be usable for this sort of thing, and the problem appears to only occur with Intellisense, not the compiler, so I would complain to Microsoft, not NVIDIA.


#5156149 tab[10][10] in c

Posted by Pink Horror on 26 May 2014 - 05:32 PM

1)
 
if i got 
 
int tab[10][10];
 
what type has tab[1] ? is this an 10-int array of
 
{ tab[1][0], tab[1][1], ... tab[1][9] } ?
 
2) what is the way or recast one dimensional array into two dimensional, say i got
 
int tab1[100];
 
and want to 'recast' it  into 
 
int tab2[10][10];


1. tab[1] is the same type as tab[0] - they are both arrays of 10 ints. As arrays of ints, they are also usable as pointers to ints without casting.

2.
int tab1[100];
int (*tab2)[10] = (int (*)[10])tab1;
Note that you have to know the 10 at compile time, which means you'll probably still find yourself using (10*y + x) whenever you need something with a dynamic size (I need dynamic sizing more often than not). I've used this cast when working on arrays full of vectors or triangles or other objects which were just some number of floats each, stored as some type I didn't want to deal with.


#5155545 tab[10][10] in c

Posted by Pink Horror on 23 May 2014 - 05:41 PM

You can access the first item in the array as tab[0][0], or as tab[0], or as *tab. The compiler treats all of these the same.


I don't consider those are all the same. tab[0][0] is an int, and tab[0] and *tab are arrays. The things they refer to all have the same memory address, but the compiler does not treat them all the same. Well, the last two are the same because *x and x[0] are generally the same (I think operator overloading is about the only thing that can make them work differently).

int tab[10][10];

int* p1 = tab[0];
int* p2 = (int*)tab;
int* p3 = &tab[0][0];
int (*p4)[10] = tab;

assert(p1 == p2 && p1 == p3 && p1 == *p4);



#5154092 How to legally access information sent by Hearthstone server?

Posted by Pink Horror on 16 May 2014 - 01:16 PM


Yeah I know it would be cheating if it would be made public. I just want to do this to practice programming and to make it a little faster for me to draft.

 

How does it make a difference whether you make it public or not? If you're using loaded dice, you don't have to tell anybody for it to be cheating. It's still cheating whether or not you get caught. I don't play Hearthstone, but "to make it a little faster for me to draft" sounds like a form of cheating to me.






PARTNERS