• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.


  • Content count

  • Joined

  • Last visited

Community Reputation

6070 Excellent

About Oberon_Command

  • Rank
  1. C++

    According to cppreference, the exact type of std::ios_base::openmode is implementation defined. http://en.cppreference.com/w/cpp/io/ios_base/openmode Again, though, just because one particular implementation of the standard library does it, doesn't mean it's actually a good idea.
  2. C++

    It seems to me that people are talking at cross-purposes here. One camp is insisting that the standard allows for you to use enums for bit flags (and furthermore, that this is conventional) while the other camp is arguing that you shouldn't do that (regardless of whether or not it's conventional) and that the behaviour is only in the standard to support legacy code. "Can" vs "should." I don't see anyone denying that enums have been used for bit flags, only that we should use them for bit flags. I certainly don't see any bullying here. Bullying would involve personal attacks, and I haven't seen any so far. Pointing out that someone is doing something practicible, but dangerous or confusing or just non-preferable, is not bullying. In support of the "you shouldn't do that" camp: Very few compilers adhere precisely to the standard. It's not unheard of for compilers to make non-standard optimizations and subtly different behaviour between compilers is not unheard of even when the compilers aren't optimizing. See Hodgman's examples. Using enumerations for bit flags dilutes their meaning; you're taking something meant for one thing and re-purposing it to do something else. A similar argument has been made against the use of exceptions for control flow (at least in C++). It has been claimed that the use of enums for bit fields is "going out of fashion", meaning later generations of programmers reading your code won't think much of code that does this and may be actively confused by it. In C++, alternatives exist (like std::bitset and constants in a namespace). It may be true that the standard allows us to use unscoped enums as bit flags, but being allowed to do something isn't an argument for doing it.
  3. Sorry, I should have been more clear - try using SetWindowLongPtr to attach the pointer to the D3DApp to the window. Attaching the method will not help you because you would still need the D3DApp instance to call it properly. In your wndproc you can retrieve the pointer, cast it to a D3DApp, and call the virtual function on it, just as you are with the global.
  4. C++

    1. std::bitset is specialized on the number of bits it can support. At the very least, the type system will prevent you from assigning incompatible bitsets. If you wanted more type safety on top of that, you could have a wrapper structure (or typedef) that takes both the bitflag enum type and the number of bits as template arguments, making the enum part of the type, but getting the convenient interface of bitset. 2. That seems suboptimal and I would be curious as to the reasoning. You can construct the bitset with an initial value, either by passing the initial value as an integer type or as a string (which it will parse). Surprisingly and somewhat annoyingly, it doesn't appear there's a way to pass in an initializer list of the flags, but you could easily write a function that builds a raw bitset from a list of flags. See the cppreference link I posted above for std::bitset for more info.
  5. C++

    Why use enums for flag values when you can use a regular enum with std::bitset, and have code that is much clearer? Then you don't have to think about any of this. enum FlagBit { Bit0 = 0, Bit1, Count }; std::bitset<FlagBit::Count> bits; bits.set(FlagBit::Bit0); printf("%d", bits.count());
  6. A few things: 1) Yes, gd3dApp is a global. Hence the 'g' prefix. 2) The global isn't actually necessary - Windows allows you to attach a pointer of an arbitrary type to a window, either at construction time or at any point later", albeit at the cost of type-safety. Look up "SetWindowLongPtr". Mind you, the point about not assigning a member function to the window still holds, though, because of how pointers to member functions work in C++. 3) The anonymous namespace is used to prevent the global from being accessible outside the source file in which it is defined. In C we would do this using the "static" keyword, but anonymous namespaces are how modern C++ accomplishes this. 4) Classes are constructed in order of inheritance hierarchy - and destructed in the opposite order. So the base class (D3DApp) would be constructed first, assigning the "this" pointer of the class to the global. 5) If you were to have two classes deriving from D3DApp, and you would instantiate both of them, the global would be set to the address of whichever one was most recently constructed without fanfare. You can probably see why this could be dangerous...
  7. C++

    If you want to use enumeration values to refer to bits, is there any particular reason you aren't using std::bitset, which is specifically designed for this sort of thing? Also, it is only "scoped" enums (enum classes, in other words) which have an underlying type of int unless otherwise specified. The unnamed, unscoped enums in this thread are not scoped, therefore this does not apply to them. Instead, section 10.2.5 specifies that the underlying type is the type of the first assigned expression to the enum, or an unspecified integral type wide enough to contain the largest value (if such a type exists, otherwise the program is malformed). Also, that "if the underlying type is fixed" part is important. The underlying type is only fixed if a) the underlying type is explicitly specified or b) the enum is scoped (in which case it defaults to int). Paragraph 10.2.7 says: "For an enumeration whose underlying type is not fixed, the underlying type is an integral type that can represent all the enumerator values defined in the enumeration. If no integral type can represent all the enumerator values, the enumeration is ill-formed. It is implementation-defined which integral type is used as the underlying type except that the underlying type shall not be larger than int unless the value of an enumerator cannot fit in an int or unsigned int. If the enumerator-list is empty, the underlying type is as if the enumeration had a single enumerator with value 0." I'll grant you that 10.2.8 does say that unfixed type enumerations can hold values that are not defined by any of the enumerators, but... std::bitset, anyone?
  8. Check out FreeBASIC: https://www.freebasic.net/
  9. Being at work and spending all your time compiling your code is a joke...
  10. Because clearly, attractive women cannot possibly just be actual pedophiles...
  11. The hell? No, that's not what that means. None of us are responsible for the actions of our predecessors, but we are responsible for how we respond to the society they created - whether we perpetuate the systems they left us with or change them to be more inclusive. One should not ignore history when making decisions of how to treat people. It would be nice if that were possible, and we should work towards a future where it is, but the wounds are still too fresh.   It isn't merely a shadow, there are still echoes of the bad shit in today's society. THAT is what all this talk about institutionalized racism is about. So, what do you suggest as a "centrist solution" to address the problem of intergenerational trauma? An example of that on the Canadian side of the border would be the residential schools and the fallout therefrom.
  12. Just because they're "popular", doesn't mean they always report things properly. Some nuance is often lost. There's incentive to report on the most sensational thing in a sensational way. For example, the Lara Witt article is just pointing out that somebody said something that sounds sensational; it doesn't even try to explain why she might have said any of the things she said, it purely focuses on the optics of what she said and then editorializes thereon. I'd hardly call that "journalism" at all. In fact, on the note of popularity, who the hell is "PJMedia"? The "end of white america" refers to the end of America being defined by "whiteness," not the end of white people existing in America. The article actually says this in its subtitle. Much of the "white people are evil/whiteness is evil" stuff isn't talking about actual people, but "whiteness" as an identity. If someone's talking about identity politics, don't be surprised when the things they say don't make sense outside the context of identity politics. Many of these headlines come from academics using words in ways that aren't extreme at all in context, but seem so when taken out of context. The high school teacher who said that "white people are all racist" was clearly talking about institutional/cultural racism, not individual bigotry - an idea the article actually refers to. The only reason this is news is some offended students who didn't understand what he was actually talking about. Now that I actually get to it, I'm not confident that you actually read your own links and thought critically about them, and I suspect you just picked them based on their headlines (and only looked at the headlines).
  13. I think Hodg's reaction (which is also my own) is that Wav has drastically oversimplified things to the point that what Wav said isn't actually a meaningful representation of any position. No, the Left is NOT telling us that "how one gender and one demographic is the fount of all that is wrong with society." The actual position is more along the lines of, "for historical reasons, one particular demographic currently has more advantages and power in the aggregate than the others. This is a bad thing (for a bunch of reasons), so we should make that not a thing anymore and if you happen to be in that demographic, be mindful of how you use your privilege and how your actions come across to those with less privilege than you, and if you don't do that, you're perpetuating the fallout of the bad shit that happened back in the day and making life harder for everyone else." Of course, it IS true that most of the objectionable shit the "Left" (in North America at least) is talking about ultimately happened because of European colonialism and there's a lot of resentment there, but one just can't simplify that to "WHITE MEN BAD," and the people who are doing that are either letting their resentment and anger get the better of them or seeking to caricature the real position.
  14. Holy fuck, no. That will NOT end ISIS overnight. It would be like bombing the Vatican in response to the Irish Republican Army. It would only aggravate the 1.6 billion Muslims worldwide, turn them against us, and lead to even more conflict. The extraordinary measures of addressing the fact that some people feel alienated and purposeless in a changing, hostile world? Actually, that would be kind of extraordinary.
  15. Are you serious? What about all the abortion clinic attacks that have happened over the years? What about the Charleston attack? All the school shootings? And that's just in the US. In Canada we had this guy: http://www.bbc.com/news/world-us-canada-38805163   I'm not saying it's sufficient. Only that authoritarian measures are not going to help and that ostracizing some segments of society will only drive them closer to radicalism. You swing to authoritarianism because of ISIS, and you are dancing to the tune they're playing and not your own. And as for the status quo, how many people die a year in terrorist acts vs. how many people a year in car crashes? I mean, last time I looked, more people die in car accidents per year than in airplane crashes, so I'm pretty sure which way that comparison would go...   The WWII analogy is crap IMO. The Japanese were an empire. They had an official navy, air force, and army. Their combatants were uniformed. They had a country to defend and the strength to invade other nations and subjugate them. Last time I checked, ISIS and friends are not defending a country. They are not an empire. They're a bunch of dirty deluded dudes who shoot people and hide like cowards among innocent civilians, daring us to kill them all and sacrifice our principle that innocent people shouldn't suffer. Do people really think most of the people who live in ISIS territory actually support the militants? ISIS is really bad for the people who are living under their sway, of course, but here in the West, what power do they have? Even the latest attack was just some guys rolling a truck around and stabbing people. Basically a glorified, sensationalized car accident. That's... kind of unimpressive by WWII standards. My respects to your veteran friend, but what applied in 1945 to Imperial Japan does not necessarily apply in 2017 to ISIS and friends. We don't need to repeat mid-20th century atrocities.