Jump to content

  • Log In with Google      Sign In   
  • Create Account

Josh Petrie

Member Since 11 Jun 2003
Offline Last Active Today, 01:15 AM

#5244501 Including headers from Windows 10 SDK

Posted by Josh Petrie on 04 August 2015 - 09:13 AM

Please clarify what "doesn't get included" means. Do you get an error? If so, what is the exact error message? 

#5244326 Clone functions

Posted by Josh Petrie on 03 August 2015 - 11:21 AM

All clone functions should fully clone ?



That depends entirely on what you need or want out of it. Both options are valid; choosing between one or the other is fine, as is offering both in your API if so desired.


The second option should to have 2 functions Clone and CloneCompletely




This is traditionally referred to as a shallow versus a deep clone.

#5244319 Negative revenue on iOS, anyone experience it?

Posted by Josh Petrie on 03 August 2015 - 10:56 AM

$99/year for the developer membership, but $99 isn't $200 (unless you have multiple accounts) and that cost isn't factored in the graphs in question anyway, as far as I know. A chargeback or similar as mentioned by Rattenhirn is the likely explanation I'd think.

#5244314 Constructor Initializer List and Heap Allocation

Posted by Josh Petrie on 03 August 2015 - 10:33 AM

It's reasonable to allocate within the initializer list. It's "slightly faster" in theory, because there is only initialization of the pointer instead of initialization and reassignment (however this difference is likely nonexistent in practical applications). The performance of the constructors of the thing you're heap-allocating is irrelevant since they're executed in both cases. Obviously if you need to execute any logic prior to being able to heap-allocate something, you'll need to put that logic in the body and thus you'll need to allocate in the body (after hopefully initializing to null in the initializer list), unless you can encode that logic in the initialization of some member known to initialize before the pointer (that's a bit dangerous though).


Note however, that if you allocate in the initializer list and you want to handle exceptions that may be thrown as a result of the allocation you'll have to use a function-level try block. Since most people don't seem to know what a function-level try block is (or that it exists), usually you see people allocate in the constructor body if they intend to handle exceptions.


Note that it's legal and safe to delete a null pointer, so your "if (model) delete model" test in the destructor is not neccessary; you can just "delete model."

#5244095 Is using a GUID (Globally Unique Identifier), a good idea for storing rpg ite...

Posted by Josh Petrie on 01 August 2015 - 09:24 PM

I'm not convinced at all you need GUIDs for this; I know that Guild Wars 2 certainly doesn't. 


I feel like the real problem here is with "the buffer part in nodejs memory," which I feel like you don't properly understand. The reason for this is because NodeJS would be basically impossible to use if there was no way to look a thing back up once you have stored it in memory. So unless I'm missing some aspect of this "buffer part" you're talking about, you don't need GUIDs for this. Alternatively, if you're basically referring to not being able to tell which item (on the ground) a user clicks on to loot, that is also not a problem that requires the unique identification of every item using a GUID, as you already have a unique identification of every item (the item itself).


I think you should explain your scenario in more detail as it sounds like you're about to go off and make some very poor implementation decisions.

#5244092 Is using a GUID (Globally Unique Identifier), a good idea for storing rpg ite...

Posted by Josh Petrie on 01 August 2015 - 09:11 PM

It might be overkill; if each item really needs to be distinct (because it can be individually modified in some fashion, for example), than a GUID is a simple way to do it. It takes up more space -- almost certainly more than you'll need -- but it does have the nice property of being locally-generatable, without requiring any sort of authoritative source for IDs that other, smaller ID forms may require if they need to be unique.


However if items are not distinct -- if you can't modify them, so that once instance of the Shovel of Demonslaying + 2 is always exactly the same as another, then you don't need a GUID. You only need to store the item template that this particular item is derived from. Seven instances of the Shovel are just seven handles referring to the one Shovel template in memory elsewhere.

#5244004 Is it considered unprofessional for a game designer to be a fanboy?

Posted by Josh Petrie on 01 August 2015 - 10:11 AM

It's somewhat inappropriate to negatively "rant" publicly if you are also identifying yourself publicly as a professional in the industry. This is especially true of games or products that your own could be seen as in competition with. Well-reasoned arguments and discussion are fine, and the occasional burst of frustration on Twitter when some bug renders your game un-completable are probably forgivable, but frequently descending into histrionics and bad-mouthing is likely to be viewed unfavorably.



If you're ranting in the sense of "overjoyed adoration of same particular game," then maybe some people will raise a few eyebrows at your fervor but otherwise it shouldn't be an issue.

#5243854 Making games as a portfolio to join the industry

Posted by Josh Petrie on 31 July 2015 - 12:07 PM

Jack-of-all-trades is not a job title (at least, not an entry-level one). This is not to say that having a broad range of skills outside one particular discipline is bad (it's good), but you still are going to need to decide which actual career path to focus on. From what you've described of your current career, "programmer" is probably the option you want.

#5243809 Making games as a portfolio to join the industry

Posted by Josh Petrie on 31 July 2015 - 09:13 AM

Moving to the Breaking In forum.

#5243272 Defining a struct in a header so that I can use my varaible anywhere

Posted by Josh Petrie on 28 July 2015 - 04:22 PM

Note that inline initialization of myMemberVariable requires C++11 or better. That is, if you don't have C++11 support for some reason, do this instead:

struct MyStruct
  int myMemberVariable;

#5243183 DigiPen: The Game School I Went To

Posted by Josh Petrie on 28 July 2015 - 09:26 AM

Why would you say so many fail to graduate, aside from getting job offers early?



When I was there, a large portion of the kids who didn't make it to year two simply had no idea what they were getting in to. They loved to play games and figured that meant they'd love to (and be good at) making them; they were basically extremely unqualified.

#5243182 What skills is more important for a Junior programmer to master

Posted by Josh Petrie on 28 July 2015 - 09:24 AM

Good programmers tend to have both breadth and depth: they tend to know a lot of things on a basic-to-intermediate level and at the same time know quite a lot about a few more-specific things.


How "about to get your first job" are you, exactly? You're not likely to do something in the next two weeks, for example, that really demonstrates either of those. 


You also shouldn't be learning things with the idea of simply learning them to "do well" on an interview. Learn what you want to learn; if Unity interests you more than Unreal, focus on that. If you don't like FPS games, don't spend a whole lot of time and energy making them. You tend to do better at, and internalize more of, the things you are interested in.

#5242275 Build 3D objects in-game?

Posted by Josh Petrie on 23 July 2015 - 04:22 PM

What have you tried?



Can you perform the first thing shown in that video, looking at a spot and dynamically spawning some object where you're looking with a keypress? If not, consider focusing only on that problem first.

#5242272 Build 3D objects in-game?

Posted by Josh Petrie on 23 July 2015 - 03:55 PM

There's a couple concepts at work, most of which are independent and not all of which have one name.


The overall idea is called "placing objects at runtime." The concept of having objects aligned to nearby objects by default when placing them is called "snapping" or "automatic alignment" or some variation thereof. The technique for determining where in the 3D world the 2D cursor or focal point is looking at is called "picking."


Implementing these algorithms is a broad topic; there's no one way to do so. It largely depends on the information and tools you have available in the codebase or engine you're using, and the shape of your data.

#5242104 My First Game Project

Posted by Josh Petrie on 22 July 2015 - 10:24 PM

That does not make willful copyright violation acceptable.


The laws governing the protection of intellectual property exist, in part, to protect the rights of the creators of that property. They are very important to game developers, and brazenly disregarding them as you're doing is extremely insulting to many developers whose livelihood is buoyed up by the protections you're spurning.


I don't expect you will find significant help here if you're going to disrespect the community that much.