• 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

100 Neutral

About desudesu

  • Rank
  1. That's because that fstream seeking function takes a signed 32 bit integer. What you should do is to use two seeks - for example, if you want to seek 3gb you should use a 2gb seek first and then make a 1gb ios::cur seek. PS: Your compiler should warn you about integer overflow. Mine (GCC) did.
  2. Quote:Original post by Splinter of Chaos Quote:Original post by Trapper Zoid I'm still fond of C. It has its place; Linux is still very C oriented, and it's a good language for low-level libraries. I believe that's because Linus Torvalds hates C++. Yes, he hates C++. While I disagree to some of his statements, he has an excellent point. "It's made more horrible by the fact that a lot of substandard programmers use it, to a point where it's much much easier to generate total and utter crap with it.". C++ is great. Is a lot better than C, but only if a competent programmer uses it. Unfortunately, most programmers produce C++ code that is buggy, ugly and badly designed. It's not because C++ has more substandard programmers, but because it is a lot easier to do it in C++ than in C. So, by following that, I think that C++ should not be learned as a first language. Just as Promit said - it's a worst choice of a language for a first-timer. Either learn low-level C or high level Python/Ruby/C#.
  3. Quote:Original post by Thoover I am running FreeSpire2 with wine-0.9.41 You have a very very very ancient Wine. Try to upgrade and see if the problem persists.
  4. Quote:Original post by Evil Steve As far as I know (Although I may be wrong), there's no open source or free MP3 decoders available, since MP3 has licensing restrictions on it. Personally, I've always found DirectShow a pain in the ass to deal with, and Ogg Vorbis (And FMod) extremely simple. You are wrong. There is an excellent free software MP3 decoder out there.
  5. Evil_Steve: Thanks. That should work. Fortunately I have MSVC 2008 stashed here somewhere, since I assume it cannot be done on MinGW. (; Well, as for how it's done on GNU/Linux - it's not done. (: Well, seriously, not many people use it, but it can be done as I've illustrated in my first post. You just tell the linker to ignore all unresolved symbols - when the program is run these symbols will be null until you load a library trough dlopen with RTLD_GLOBAL flag. (It means that it would bind symbols loaded from the library to the global namespace, instead of keeping them local to the library.) It's a little different from Delay Loading that is done on Windows. The good thing is that on GNU/Linux you only need a header file to do it and you can load an entirely different shared object, provided it will contain the symbols you use. (So you, for example, don't really need GLEE to load OpenGL extensions you desire, provided you'll have a header file with them in.) The downside is that, AFAIK, there is no way to catch unresolved symbol errors at runtime, so the safest way is to actually check if a given symbol exists in the library you loaded with dlsym at initialization.
  6. Quote:Original post by Ximmer In your example you can pretty much replace dlopen with LoadLibrary and dlsym with GetProcAddress, the concepts are quite similar. I'm not sure why you have to ignore unresolved symbols when your example doesn't seem to have any unresolved symbols. When dynamically loading a dll in windows you never link to the actual dll because you are manually loading the dll and retrieving pointers to the functions. Can't say I know how it works in linux/unix My example has unresolved symbols (specifically, zlibVersion) since I'm not linking to the library at compile time. My whole point is to load the library at runtime, without retrieving pointers. On UNIX-like systems I can make the OS to do this automatically, behind the scenes. I'm asking if something like that can be done on Windows and if yes, then how.
  7. Hello. With my engine I like to load every external shared library at runtime, as to provide the different codepaths based on what libraries the user has installed. Consider the following example that illustrates what I'm doing: #include <stdio.h> #include <dlfcn.h> #include <zlib.h> int main( ) { void * library = dlopen( "libz.so", RTLD_LAZY | RTLD_GLOBAL ); if( library == 0 ) printf( "zlib is not present on the system\n" ); else printf( "%s\n", zlibVersion( ) ); return 0; } Now, this wouldn't be anything special except I'm not linking zlib to my program at all. Here's how I do it: gcc -fpic -pie example.c -ldl -Wl,--unresolved-symbols=ignore-allIt's all done at runtime. The linker automatically binds the symbols from dynamically loaded library to global symbols used by the program. This saves me the trouble of manually creating abominations like this: typedef const char * ( *zlibVersion_TYPE )( ); zlibVersion_TYPE zlibVersion_BINDING; bool load_zlib( ) { (...) zlibVersion_BINDING = dlsym( library, "zlibVersion" ); (...) } const char * zlibVersion( ) { return zlibVersion_BINDING( ); } So, my question is, while it's a piece of cake to do on a GNU/Linux system (or any other UNIX-like system for that matter), I have absolutely no idea how can this be achived on Windows. I tried doing this on MigGW, but without success. Any help?
  8. Probably your best bet would be to write your own string class that converts between UTF-8 and (preferably) UTF-32 behind the scenes, eg.: (based on string class from my engine) qr_string string( "Hello World!" ); // The string is UTF-8 internally. for( int i = 0; i < string.size( ); ++i ) { q32 character = string[ i ]; // Conversion behind the scenes to UTF-32. if( character > 255 ) something( ); else something_else( ); } puts( string.c_str( ) ); // Reconversion to UTF-8. wprintf( "%s\n", string.c_wstr( ) ); // Reconversion to native wchar_t. (UTF-16 on Windows, UTF-32 on the rest.) My internal converters are based on this code, thought it is very very ugly, so it requires a fair deal of refactoring.
  9. Quote:Original post by ToohrVyk Quote:Original post by desudesu Quote:Original post by Antheus Since when do plain C-style arrays support addition, removal and insertion? They always did, that is, if you do it manually. They never did. The number of elements in an array is fixed when the array is created, as per the language specification, to be the number between the [] in the array definition (which is a compile-time constant in C89 but can be a run-time value for stack arrays in C99). Perhaps you meant something else? I meant dynamically allocated arrays.
  10. Quote:Original post by Antheus Quote:Original post by desudesu And, where did I say that std :: vector is slow? Here: "Actually, they are not." I did not. Read the fragment I quoted. I was mainly referring to the statement that ,,It's very intentionally designed to be damn hard to beat for the tasks they're designed to solve.''. Quote:Original post by Antheus Quote:I'm just saying that it is not as fast as using a plain C-style array. And again - apples to airplanes. Since when do plain C-style arrays support addition, removal and insertion? They always did, that is, if you do it manually.
  11. Quote:Original post by Gage64 @desudesu: Any chance that your custom container removes elements by swapping them with the last element and decrementing the size by 1? If so, you can do that with std::vector as well. There's no member function for it (as far as I know), but it's only a few lines of code. Nope.
  12. Quote:Original post by ToohrVyk With a few corrections.... Quote:Deletion (of the first element) is about 800 thousand % faster, since I managed to get away without memory reallocation copy every delete. I'm wondering if you haven't just reinvented std::deque [smile] Quote:My std :: vector container probably doesn't exhibit *exactly* the same behaviour as STL one, but, I don't care. That wasn't my design goal. I wanted a vector that, speed-wise, can be used in a place of massive raw array manipulations without (or with very negligible) performance loss. It's been a long-known fact that some containers will outperform a vector on some operations. For instance, std::deque and std::list generally outperform a vector when removing or inserting elements at the front. This is less a case of "the SC++L is slow" than a case of "using the wrong container is stupid". Not really. I did the research. Insertion in std :: deque is still 49% slower than my implementation. Deletion of the first element is still unbearably slow. (Several thousand %) Quote:Original post by Antheus Then do not claim std::vector is slow, when it's your algorithmic requirements that are the problem. std::vector is storage class, with well-defined characteristics. Using it for a task that it isn't suitable for will make it "slow". State that you required O(1) deletion of first n elements in combination with contiguous storage, something that std::vector isn't designed to do. Probably. But it is designed for fast insertions, for which my implementation is still faster. You can treat my constant time first element removal as a 'bonus'. And, where did I say that std :: vector is slow? I'm just saying that it is not as fast as using a plain C-style array.
  13. Quote:Original post by Omid Ghavami I'm very skeptic to your numbers without source and compiler settings for your benchmark. And 70% faster at doing what? Access? Insertion? Deletion? You are being extremely vague. Sorry for being vague. Insertion. Access is obviously irrelevant here (constant time). Deletion (of the first element) is about 800 thousand % faster, since I managed to get away without memory reallocation every delete. My std :: vector probably doesn't exhibit *exactly* the same behaviour as STL one, but, I don't care. That wasn't my design goal. I wanted a vector that, speed-wise, can be used in a place of massive raw array manipulations without (or with very negligible) performance loss. Quote:Original post by Antheus It's the very big projects which may, if possible, justify creating your own containers. But what is the purpose of writing 5000-line implementation of your own standard library for a 2000 line project? I'd be very wary of someone implementing STL equivalents in under 40 man-hours that even approaches the quality of current STL implementations. And that is a lot of money for mere constant factor improvement. Some do that because they really need to, or because they don't have a choice. That's what I was saying in my previous post, unless you really need the speed (or have too much time on your hands), there is no point in doing the reimplementation. On other hand, when you need it you don't have to reimplement the whole STL - one can always rewrite a given container, or even rewrite it only partially, excluding the features that will not be used.
  14. Quote:Original post by MaulingMonkey "The SC++L is fast" is 1 reason why, but it admittedly doesn't go into the details. Aside from strict algorithmic performance requirements set forth by the standard, modern implementations use a huge bag of tricks to perform at their best -- empty base optimization, return value optimization, tag based dispatch to optimized versions, and general tailoring to the compiler they're targeted for. It's very intentionally designed to be damn hard to beat for the tasks they're designed to solve. Actually, they are not. At least on my GCC 4.3, that's it. My own std :: vector implementation is a whooping 70% faster than the STL one. But remember, unless you use a given STL container very heavily in your code there is absolutely no reason to reimplement it, since, as MaulingMonkey said, the STL containers are already debuged and basically bug-free. It's silly to introduce new bugs in your code when there will be no benefit performance-wise.
  15. Zer0wolf, isn't that Sayuri Ootomo? <; Here's more of her.