• 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.

Splinter of Chaos

  • Content count

  • Joined

  • Last visited

Community Reputation

239 Neutral

About Splinter of Chaos

  • Rank
    Advanced Member

Personal Information

  1. [quote name='RobMaddison' timestamp='1354390240' post='5006073'] The reason I ask is because if you are calculating times for animation tracks, you can just get the current time and use that as a reference point for local animations. I've done this and it seems to work pretty much spot on for animation timings, no matter how long your frame time is. [/quote] What happens if your game freezes for an entire second? Whether or not the animation is correct, the world will have advanced a whole second and the user will be confused about what happened in that time. For simple problems, maybe one doesn't need a fixed time step, but there should at least be a maximum allowable amount of time to pass in one frame.
  2. I haven't done much in this domain, but when I was researching this before, I though [url="http://www.zeromq.org/"]zmq[/url] was the best option. BTW: Sockets are old; maybe try googling for C, not C++.
  3. SDL on mac requires an objective c file to define SDL_main, or something. The one provided by SDL's mac devel package also sets up a rudimentary menu. I want that menu to be extended to modify some configurations that were previously only modifiable through a text file, parsed with c++ code. Maybe i'm just not understanding, but when i google it, i get more results about including objective c in your c++ code than the other way around. Pretty new to obj-c so that might just be the problem. So, for some example code, say i got this: C++:AssociativeContainer c; c["some string"] = "value"; The objective c code needs to call operator[] and set it to a string.
  4. Or more simply: [code]int round( float f ) { return f + 0.5f; }[/code]
  5. It was the Cocoa framework! And the .m file. Thanks! Got it to compile, but not run: [code]dyld: lazy symbol binding failed: Symbol not found: __ZNKSt5ctypeIcE13_M_widen_initEv Referenced from: /Users/hakusa/programming/c++/workspace/orbital-chaos/./run Expected in: /usr/lib/libstdc++.6.dylib dyld: Symbol not found: __ZNKSt5ctypeIcE13_M_widen_initEv Referenced from: /Users/hakusa/programming/c++/workspace/orbital-chaos/./run Expected in: /usr/lib/libstdc++.6.dylib [1] 96821 trace trap ./run/code] Then i modified my code to compile with llvm-g++, but it segfaults when i try and run it. I ran it through gdb and got this: [quote](gdb) run Starting program: /Users/hakusa/programming/c++/workspace/orbital-chaos/run Reading symbols for shared libraries ++++++++++++................................................................................................................................... done dyld: lazy symbol binding failed: Symbol not found: __ZNKSt5ctypeIcE13_M_widen_initEv Referenced from: /Users/.../run Expected in: /usr/lib/libstdc++.6.dylib dyld: Symbol not found: __ZNKSt5ctypeIcE13_M_widen_initEv Referenced from: /Users/.../orbital-chaos/run Expected in: /usr/lib/libstdc++.6.dylib Program received signal SIGTRAP, Trace/breakpoint trap. 0x00007fff5fc0106d in __dyld_dyld_fatal_error ()[/quote] I'm really not sure what to make of that. It looks like the problem is it's looking for a standard function that just isn't there... do i not have something installed properly?
  6. The command line is actually my method, especially considering how much i invested in my [url="https://github.com/splinterofchaos/Gravity-Battle/blob/master/makefile"]makefile[/url]. It seems like i need a .h and .m file to get SDLmain to work, but i don't know how to do that. Thanks for the link, but it's not for Xcode 4 and it seems they've changed a lot of things because all the tutorials i've seen (for more than just SDL) are out of date. Feels like i just chose a bad time to invest in a Mac.
  7. There's no one way to do it so you'll just have to find what works for you. What i'll do is write everything in main.cpp and when i see that several functions operate on a specific type of data, or do a specific subset of things, i'll move those functions to their own headers and sources. I do the same for classes. For me, it's just easier to write and refactor than write it right the first time.
  8. I think the commercial industry is no where near crashing. Companies come and go, but we still get huge AAA titles that do nothing for gaming or gamers, but still rake in boat-loads of cash. They stopped taking risks, like Hollywood, and stared making money, like Hollywood. This suggests to me that in a capitalistic art industry, this is what's stable. Even books have done a similar thing. I don't think things will get worse, but if books, movies, and music can tell us where the industry is headed, it won't be getting better either. [quote name='Antheus' timestamp='1315845933' post='4860742'] In some ways, maybe the whole model is wrong. Maybe studios shouldn't expect to survive more than a single title and instead adopt Hollywood model. Not because it's better, but over long term no real-world alternatives evolved. And there are considerable parallels. [/quote] I think you're absolutely right. Think about it. You're a studio, spending two-five years making a game, 100 million dollars (Rockstar's estimate for Max Pain 3) going into it, and you sell it for 60 bucks so i can take your product home and use it for a few tens of hours. The business model of the game industry is insane and it's mind boggling that it's even possible! Plus, while i believe the comercial aspect of gaming has a tendency to make studios take only safe projects, what enables indies to take risks is the lower investment. Give Notch (Minecraft) 100 million to make a game and i bet you he'd pretty much HAVE to make a generic FPS. Gamers demand this because many only want to play games with distinct AAA qualities--meaning there is no lack of demand. I certainly don't think we need the Hollywood model, but i do think that we need to focus on smaller investments in games that take less money to produce, offer a shorter but more detailed experience. If the indies can do it while living off ramen noodles, you'd think the big cats could do it and be even more efficient at it!
  9. So, i got this game on Windows and Linux and it requires gcc 4.4 or later for the c++0x features. I got xcode to use a gcc i compiled myself (gcc-fsf-4.6), but xcode immediately responds with an error: "Invalid value 'gcc-fsf-4.6' for GCC_VERSION". Not sure what i can do about that except maybe recompile and manually set its version (somehow). I would really like not to use xcode at all, but i couldn't find ANY help online about how to do that.
  10. In OpenGL, you don't need to use 4.0 to be up-to-date, and you probably won't be using the newest features if you're new to graphics programming. Check how few graphics cards even support it according to wiki: [url="http://en.wikipedia.org/wiki/OpenGL#OpenGL_4.0"]http://en.wikipedia....enGL#OpenGL_4.0[/url] To write modern OpenGL code, just avoid immediate mode functions. Google VBO or vertex array. Even if you did start with 2.0, the lessons will carry over to 3 and 4.0. Since 2.0 is a lot simpler, it makes sense tutorials use it. You can easily adapt 2.0 code to 3.0 once you know the difference. I suspect DX is a similar story.
  11. Wow, i'm really surprised this got read at all! I only wrote it to link to whenever i'm in a discussion with someone not using them and it's unfinished and doesn't have a "further reading" section or anything. Thanks for the comments! [quote name='JTippetts' timestamp='1314156068'] The problem I have with vector classes is that everyone has one. I've got projects on my drive that link to three or more libraries that all include their own vector classes. Whose vector class do I use? [/quote] I know what you mean. This bugged me when i used DX and again when i tried Irrlitch. I try to use my own whenever possible because it's more generic than any ive seen before it. Though Japro's looks similar.
  12. Geese, all i was trying to do was give some background on why the IRC people were upset! But i didn't do it in the right way, so i made my bed and it's time to lie down. I just hope to quench this fire quick so we can stay on-topic and get off this DRM-wannabe discussion. I knew there'd be a little whiplash, but i didn't expect every subsequent post to have something about it. Plus, i haven't had anything to add since my second post, so i'm trying to get out of the discussion, myself. [font="arial, verdana, tahoma, sans-serif"][size="2"][quote name='Hodgman' timestamp='1314089615' post='4852705'] so I've no idea why archive formats are a political topic here. [/quote] Data hiding is the political topic. Whether or not one agrees with my opinion. Most people think it isn't because it's the norm. People with GNU influences, especially ones ties to open-source and free software ideologies will feel one way about the issue. [/size][/font] [font="arial, verdana, tahoma, sans-serif"] [/font][font="arial, verdana, tahoma, sans-serif"][size="2"][quote name='Postie' timestamp='1314091900' post='4852715'] Splinter of Chaos, the reason I didn't respond in a PM is that it wouldn't add anything to the discussion if it was behind closed doors. My post wasn't intended as a personal attack, I was merely stating my opinion on the matter and attempting to bring an alternate viewpoint to the table.[/quote] I see. I respect adding to the conversation. What made me feel that way was that you started your post by saying my name and didn't write anything on-topic until the end. That and the fact i felt victim to a straw man attack. [/size][/font] [font="arial, verdana, tahoma, sans-serif"][size="2"][quote name='Computercodemonkey' timestamp='1314092176' post='4852716'] and Splinter of Chaos I was offended especially when my indie game is going to cost me upwards of $50k in artist fees (seriously thinking of different artists) as well as royalties but me raging back at you will provide what? make other people reading the thread think im a childish idiot that thinks capslocking you to death will prove something? thats why i more or less ignored you and just corrected your supposition that i was slinging the word Nazi around instead of it having been used on me ive got APIs to investigate and code to comment and debug i dont have time to participate in a forum flame war [/quote] [/size][/font][font="arial, verdana, tahoma, sans-serif"][size="2"]I'm really sorry to hear that! You should have at least said i offended you, but perhaps it seemed deliberate. You don't have to "rag" on someone to let them know they hurt you. I understood originally that it was the IRC people who said nazi; i was trying to make a comment on them in sympathy. The real crux of my argument was really just the last part, which seemed to have been ignored:[/size][/font][color="#1C2837"][size="2"]"And don't think that by hiding those files, you don't have to worry about copyright. You have do it either way, you're protected either way, why bother? "[/size][/color] All i was really trying to say is that you need to worry about copyright no matter what. Someone could stream the audio out of your game using a legal and free program and then use it in their game. Or a hacker could decrypt your file. You can make it harder on the hacker, but if it's worth to do, they will. Even EA cannot thwart hackers. I'm gonna stop watching this discussion and won't dare start any more fires here. Re-reading my second post, the language really was pretty harsh and it really didn't help me state my opinion peacefully. Sorry for upsetting you, Computercodemonkey, and for derailing the discussion, and for not having had much useful to say on it.
  13. [quote name='Postie' timestamp='1314081177' post='4852669'] Splinter of Chaos, I'd hardly equate the OP's attempt to safeguard the non-licensed use of his game assets to EA or other big software company's DRM. [/quote] [img]http://public.gamedev.net/public/style_emoticons/default/mellow.gif[/img] That's not what i said at all. I said it that the OP was using the same form of reasoning: I don't want people doing X, so i'll doing something that inadvertently prevents Y and Z. I was merely explaining why i thought it was reasonable that people on the IRC, and possibly others, would be disturbed by the OP's choice. I was not equating the OP and EA, but was relating them. If i came out harsh on the OP, that wasn't my intent and i apologize, but s/he didn't seem offended. [quote]I disagree strongly with the statement you made that anything installed on a user's computer becomes their property and they can do whatever they want with it.[/quote] You don't have to agree. Besides, i was speaking little of the fact it's installed and more of how the art assets and stuff are actually on the harddrive, and the user should have access, like how hackers certainly will. It being installed is irrelevant. But there's no reason for you to agree, It's just an opinion. [quote]When it comes down to it, the law isn't on your side when it comes to taking other people's work without just compensation.[/quote] I never said anything to the contrary! I said that there are perfectly legal and legitimate uses of the assets that don't imply stealing someone else's works (in much different words). For example, what if i wanted to make a picture in the game my desktop background? Does that infringe on the developer's ability to make money? *sigh* I knew i'd have to make a post like this if i said that shit... That post was so directed at me that i wonder why you didn't just PM your list of complaints.
  14. I can't count the number of times i've gone on to a forum and seen code like this: (Using a modified example from gafferongames.com) posX = posX + velX * dt; posY = posY + velY * dt; velX = velX + (forceX/mass) * dt; velY = velY + (forceY/mass) * dt; I'm going to use this space to explain why such code is bad, especially in more complicated examples, and how simple it is to make it better. First, i think it would be clearest if i simply showed how this looks if posX and posY are represented by a vector, pos, and do they same for vel and force. pos = pos + vel * dt; vel = vel + (force/mass) * dt; Obviously, this is simpler, cleaner, and more readable. [subheading]Why this code is bad.[/subheading] You have to write twice as many lines of code than necessary, for 2D, and three times for 3D. Even using vectors, a complex physics equation, for example, might take 5 lines, which means 15 lines using 3D math without vectors. You have to make redundantly names variables (posX, posY; redundancy highlighted). It's harder for people to read your code, and for you to maintain it since the lines have to do the exact same thing. Vectors basically take multidimensional equations and lets you evaluate them on one dimension. [subheading]What is a vector?[/subheading] A vector is simply a piece of data representing both a direction and magnitude (or length). The most obvious way to represent that is through a polar vector. While out of the scope of this log, a polar vector is one around a pole, simple enough, with a distance from the center and an angle from an arbitrary axis. A vector used more often in games is simply represented by an (using a 2D example) x and y like so: . We can find the magnitude with sqrt( x*x + y*y ) (Pythagorean Theorem) and the direction from the x-axis by using atan2( y, x ). Even though it contains neither a magnitude or direction, directly, we can derive those values from x and y and thus they make a vector. For an example of a vector: say you had a screen object at (1,1). That's the position vector, s, . If next from you want it to move one unit left, that means its velocity vector, v, is , 1 for one unit left and 0 for no movement in the y direction. s + v = the position next frame. s + v = + = = . If a = and b = , a + b = , [subheading]Vectors are incredibly easy to write! (Without a lot of knowledge about math.)[/subheading] The simplest vector implementation, in c++, is this: struct Vector { float x, y; }; With this, posX and posY become pos, but would not make the above example any prettier. What it does do is simplifies writing a class. One with a position and velocity should have two members (pos, vel), not four (posX, posY, velX, velY). To really see any gains, we need to start adding functions that do common calculations on vectors. For example, adding to vectors: Vector add( Vector a, Vector b ) { return { a.x + b.x, a.y + b.y }; } // ... Vector velDt = { vel.x * dt, vel.y * dt }; pos = add( pos, velDt ); Although the intent of this code is not quite as clear as a simple "pos = pos + vel*dt", it still looks better than seeing two lines of "x = x + velX*dt". Many languages do not allow what's called operator overloading, but c++ does and we can simplify the code further by adding two functions: Vector operator + ( Vector a, Vector b ) { return { a.x + b.x, a.y + b.y }; } Vector operator * ( Vector a, float b ) { return { a.x * b, a.y * b }; } // ... pos = pos + vel * dt; [subheading]Useful Functions[/subheading] Aside the already mentioned ones, you should be equipped with at least a dot and cross product, a function to find a vector's length. When you begin to look up vector equations, these functions will come up a lot. To learn their meanings and uses is outside the scope of this, but: A dot product is the sum of two vectors with their like components multiplied and returns a scaler (non-vector) value: * = a*x + b*y. A cross product is used to find a vector tangent to both a and b. //Using a 3D Vector class: int operator * ( Vector a, Vector b ) { return a.x*b.x + a.y*b.y + a.z*b.z; } // Crosses only make sense with 3D vectors. Vector cross( Vector a, Vector b ) { Vector c; c.x = a.y*b.z - a.z*b.y; c.y = a.z*b.x - a.x*b.z; c.z = a.x*b.y - a.y*b.x; return c; } // The square of a vector, v*v, is the dot product of itself. Vector square( Vector v ) { return v * v; } // This can also be named "length" or "size". Vector magnitude( Vector v ) { // Pythorous' theorem states the answer is sqrt( v.x*v.x + v.y*v.y + v.z*v.z ). // Notice that v*v = v.x*v.x + v.y*v.y ... so the above is equal to sqrt( v*v ). return std::sqrt( v*v ); } // Another name for sqrt(v*v). Often written ||v||. // Note that |-5| = sqrt((-5)*(-5)) = sqrt(25) = 5. Vector abs( Vector v ) { return magnitude( v ); } [subheading]Going Further[/subheading] A vector class can be built to hold ints or floats, but sometimes one is more convenient than another for different situations. That means either you can write a vector for each type or make it templated. You might want a 2D vector for a 2D game, or a 3D vector for a 3D game. Again, you can make a different class for both, but doing that and one for int and float means four classes! Of course, for most situations, you only need a 3D class and just set z to zero if you're making a 2D game, but what if you wanted to make a 4D vector, the fourth dimension perhaps being time? So, if you really need a robust vector class it needs to be templated by size, and type is convenient. template< int Size, typedef T > struct Vector { // Provide typedefs to be able to reference the types this class uses, externally. typedef T value_type; // Do the same for the size. // static_size is barrowed from std::array. enum { static_size = Size } // Since the number of dimensions are variable, we must hold an array instead of individual members. value_type dims[ static_size ]; // Overload [] so that dims can be accessed more conveniently. T& operator [] ( int i ) { return *(data + i); } const T& operator [] ( int i ) const { return *(data + i); } }; Now, defining the operators on this class can be a little difficult. At times, i've written the operators as normal, templated, free function, but depending on the calling code, thanks to standard C++ function lookup rules, you'll get a weird error. Take this example, using the above class. template< class T, int X > Vector operator * ( Vector v, T a ) { Vector vec = v; for( int i=0; i < X; i++ ) vec *= a; } int main() { Vector v; v[0] = 1; v[1] = 1; Vector x = v * 5.4; } The error received on g++, version 4.2, is "error: no match for 'operator*' in 'v * 5.4000...0625e+0'". It doesn't know to convert 5.4 to an int to match the function signature. When a conversion is required, neither the left nor right operator takes precedence. We can see that the float should be converted to a float, but the compiler doesn't know it shouldn't convert the vector to a Vector! We could rewrite it to let the second argument be a different type, but we don't want that. In the + operation, a conversion has to take place whether vec needs conversion to a float, then to be converted back to an int for storage, or a has to convert to an int. It just makes sense that the conversion should happen when the function calls. I wish i could give a link that explains this problem better, or that explains why the solution i'm about to give works, but i don't. What needs to happen is the operator needs to be defined outside the class, but as a friend of it, defined inline. Again, this has to do with lookup rules. The class must be defined like this: template< class T, int X > struct Vector { T data[X]; T* begin() { return data; } T* end() { return data+X; } T& operator [] ( int i ) { return *(data + i); } const T& operator [] ( int i ) const { return *(data + i); } template< class T, int X > friend Vector operator * ( Vector v, T a ) { Vector vec = v; for( int i=0; i < X; i++ ) vec *= a; } // More operators... }; This is how i wrote my own class for my game. The code can be found at https://github.com/splinterofchaos/Orthello/blob/master/Vector.h
  15. You don't need a System Development Kit to open a zip file. [url="http://www.google.com/search?hl=en&safe=off&rlz=1C1CHFX_enUS391US391&q=zip+sdl&oq=zip+sdl&aq=f&aqi=g10&aql=&gs_sm=e&gs_upl=6051905l6058211l0l6058366l7l5l0l0l0l0l250l493l2-2l2l0"]http://www.google.co...250l493l2-2l2l0[/url] That's not the library, but the first link is an example using SDL and zlib. Not being my specialty or interest, i don't know about encryption or opening a password protected zip. On the other hand, the program [url="http://www.7-zip.org/"]7-zip[/url] is open source and you could try and figure out how they do it. [font="arial, verdana, tahoma, sans-serif"][size="2"][quote name='Computercodemonkey' timestamp='1314049946' post='4852531'] but my point is im making a commercial game and since im having to pay people for art nd sound i should have the right to lock it up so it doesn't get ripped for people to put in crappy flash games [/quote] [/size][/font][size="2"]You might not realize it, but that's a political statement. Users have rights too (my political statement). Whatever you payed your artist, Lady Ga Ga's label payed a lot more, but that wouldn't stop me from using an mp3 of hers (for comedic affect, i assure you!) in a free non-profit project that only a few people would see. [/size] [size="2"]The logic you're using is the same that DRM-big cats use all the time: that one use of our product that we don't want is bad so all legitimate uses should be disabled as well. With EA, it's making backup copies, which is perfectly legal, but they fear you might distribute them. You're so concerned that someone might use what you payed for in other games for free that you're entirely ignoring millions of other [/size]legitimate and legal[size="2"] uses that users have a right to! [/size]The law enforces EA's right to prevent people from making copies of their games by letting them use invasive and destructive software. The law does not enforce the rights of users. Users get very upset when their rights are violated. I'm only giving you this long winded rant so you understand why people are (very rightly so) disturbed. Not to change your opinion. As for protecting the files from being used in other works: It's called copyright, or preferably [url="http://creativecommons.org/"]creative commons[/url], a more flexible copyright. There's nothing wrong with letting people use those files for personal use. You have to make it legally clear that they can't be used any other way. Even AAA titles like Oblivion and Fallout don't go through any measures to thwart users from copying the art files, but i bet you'd get in trouble if you used their resources in your commercial game. And don't think that by hiding those files, you don't have to worry about copyright. You have do it either way, you're protected either way, why bother? (Note: i'm not a good person to take legal advice from. This is more a topic for the business section of the forums.)