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

ultramailman

Members
  • Content count

    317
  • Joined

  • Last visited

Community Reputation

1720 Excellent

About ultramailman

  • Rank
    Member
  1. Hey SteveHatcher,   I have no idea what multiple managers can achieve, and I wasn't suggesting you to have multiple managers. I was just remarking that *if* for some reason you need multiple managers, passing the manager as a parameter would be the way to go as passing parameter provides the most flexibility out of all the other options. This goes for other similar situations as well.   Like BitMaster said, a static variable in a class is just like a global variable outside a class. It may be what you need if you are very sure you will only need one manager.   I don't have much to say about your quadtree, since I don't know much about using quadtrees and ECS together. I remember L.Spiro has an article on efficient quad trees though. Here it is: http://lspiroengine.com/?p=530
  2. If you really don't want to keep a member reference variable to the entity manager, you could pass it as a function parameter to the functions that actually need it.   Another way is to make the entity manager a global variable.   Personally I think the member reference variable approach is fine, it's pretty simple. Passing the manager as a function parameter is more flexible, but you probably don't need it unless you are considering the possibility of using the same tree node on different entity managers . On the other side, you have the global entity manager approach. That's a fine approach if you will only ever use one manager.
  3. Ooo can somebody explain deftware's code? I didn't know .java files can look like that (looks like some kind of assembly?). How does it call checkCubicRoot? Also Mr L, are you accepting trick answers or are you really looking for a specific mathy solution?
  4. If you are having troubles with ordering of indices, you can make yourself a function that accepts indices in whatever order you want.   item = array.atXY(x, y)
  5. Maybe I can try using analogy to explain it.   automatic allocation: Imagine there is a restaurant with many tables and seats. You and your family go in the restaurant. The mute receptionist sees that you have 5 people, and leads you to a table G, with 5 seats. Now table G is occupied by your family. When you are done eating, you leave the restaurant. The receptionist sees that and table G is unoccupied. The next family of 5 that comes are able to use table G. This whole time, you did not speak to the receptionist at all, because he is mute.   dynamic allocation: Now Imagine there is another restaurant with many tables and seats. You and your family go in the restaurant. The blind receptionist asks "how many people"? and you tell him 5. The blind receptionist finds an unoccupied table E with enough seats for 5 people. He's blind so he doesn't want to talk and trip, so he tells you where the table is. Now table E is occupied by your family. When you are done eating, you leave the restaurant. However, you forgot to tell the blind receptionist that you left. He still thinks table E is occupied by you, so table E will not be given to any customers.   tables and seats = memory, since they are space. customers = data, since they are the contents that occupy space. the act of entering/leaving restaurant = entering and leaving a scope. the act of being led to a table by the mute receptionist = automatic allocation. the act of telling the blind receptionist how many seats you need at the minimum, and getting the location of the seats/tables = dynamic allocation.   This analogy omits some details, but I hope that helps.
  6. There's also a way to use 1d array as a logical 2d array while keeping the [][] indexing syntax. Basically you have your Wrapper class that has an operator[]. This operator[] returns a light weight "view" object that defines the operator[] as well. The [] operator of this view object then returns the item you want. Grid g(10, 5); View v = g[2]; Item i = v[3];   // or simply Grid g(10, 5); Item i = Grid[2][3]; Basically indexing the grid by x gives you a closure, and calling the closure with y effectively gives you the item at grid[x][y].   edit: http://www.gamedev.net/topic/665945-easiest-way-to-pass-a-2d-array/#entry5211935 looks like someone else already gave an example of this, in a different thread on a similar topic
  7. What ^ said. If you want pretty code for the indexing logic, it's pretty easy to wrap around in a function.   You can also make a wrapper class that only contains the 1d vector and some methods or operator overloads. That'll allow you to write it like 2dArray.at(x, y) or even 2dArray(x, y).
  8.   Yes sorry if I didn't clarify before, but I'm pretty sure I'm not doing a copy in my own code, because I don't have any code. I'm simply trying to build sfml from source.
  9.   good catch! In the source code, m_mutex is a noncopyable, and is contained by the Lock class. I suspect clang saw that m_mutex is noncopyable, and is trying to tell me that a copyable class can't have noncopyable members. However, the containing class is also a noncopyable. Clang didn't know Lock was noncopyable at that time. This looks like a something to do with the order of semantic analysis.   If this is what happend, then this could be a clang bug, a clang bug but only on windows, or g++ is incorrect.   So I tried changing private constructors to deleted ones, and I get a pretty similar result.   In file included from E:\Programming\SFML-2.2\src\SFML\System\Lock.cpp:28: E:/Programming/SFML-2.2/include\SFML/System/Lock.hpp:43:23: error: attempt to       use a deleted function class SFML_SYSTEM_API Lock : NonCopyable                       ^ E:/Programming/SFML-2.2/include\SFML/System/NonCopyable.hpp:79:18: note:       'operator=' has been explicitly marked deleted here     NonCopyable& operator =(const NonCopyable&) = delete;                  ^ E:/Programming/SFML-2.2/include\SFML/System/Lock.hpp:43:23: note: implicit copy       assignment operator for 'sf::Lock' first required here class SFML_SYSTEM_API Lock : NonCopyable                       ^ In file included from E:\Programming\SFML-2.2\src\SFML\System\Lock.cpp:29: E:/Programming/SFML-2.2/include\SFML/System/Mutex.hpp:47:23: error: attempt to       use a deleted function class SFML_SYSTEM_API Mutex : NonCopyable                       ^ E:/Programming/SFML-2.2/include\SFML/System/NonCopyable.hpp:79:18: note:       'operator=' has been explicitly marked deleted here     NonCopyable& operator =(const NonCopyable&) = delete;                  ^ E:/Programming/SFML-2.2/include\SFML/System/Mutex.hpp:47:23: note: implicit copy         assignment operator for 'sf::Mutex' first required here class SFML_SYSTEM_API Mutex : NonCopyable                       ^
  10. Hello Gamedev.   I was trying to build SFML with clang on Windows, but it gave compiler errors about NonCopyable having private copy constructors (isn't that the whole point of NonCopyable?). However, if I try to build SFML with mingw g++, it compiles without any problems. Does anyone know if this is a clang bug, a non-standard idiom supported by only gcc and not clang, or something else?   I can still get it to build under clang if I delete the code that inherits from NonCopyable and add private constructors to those classes by hand.   example:   In file included from E:\Programming\SFML-2.2\src\SFML\System\Lock.cpp:28: E:/Programming/SFML-2.2/include\SFML/System/Lock.hpp:43:23: error: base class       'sf::NonCopyable' has private copy constructor class SFML_SYSTEM_API Lock : NonCopyable                       ^ E:/Programming/SFML-2.2/include\SFML/System/NonCopyable.hpp:67:5: note:       declared private here     NonCopyable(const NonCopyable&);     ^ E:/Programming/SFML-2.2/include\SFML/System/Lock.hpp:43:23: note: implicit copy       constructor for 'sf::Lock' first required here class SFML_SYSTEM_API Lock : NonCopyable                       ^ E:/Programming/SFML-2.2/include\SFML/System/Lock.hpp:43:23: error: 'operator='       is a private member of 'sf::NonCopyable' class SFML_SYSTEM_API Lock : NonCopyable                       ^ E:/Programming/SFML-2.2/include\SFML/System/NonCopyable.hpp:79:18: note:       declared private here     NonCopyable& operator =(const NonCopyable&);                  ^ In file included from E:\Programming\SFML-2.2\src\SFML\System\Lock.cpp:28: E:/Programming/SFML-2.2/include\SFML/System/Lock.hpp:43:23: error: cannot define         the implicit copy assignment operator for 'sf::Lock', because non-static       reference member 'm_mutex' can't use copy assignment operator class SFML_SYSTEM_API Lock : NonCopyable                       ^
  11. If you are using SDL2, just use a bigger rectangle for dstrect. The texture will stretch to fit the dstrect.   https://wiki.libsdl.org/SDL_RenderCopy
  12. Ok, I figured out from the right panel that the grid is created by xoring the bit string with itself, at different offsets. But I still don't get how the grid is used in the algorithm, on the left panel. Can you explain more in words?   Also, why use the first half to predict the second half? Say my bitstring has 32 bits, so the algo would use the first half (bits 0-15) to predict the second half (bits 16-31). There are 2^16 different bitstrings that can be the second half. That mean the prediction only has the probability of 1/2^16 of being correct. Not good.
  13.   Your question kind of answers your question. Make separate states for "initiating the jump" and "jumping" (I like to call it "falling"). if(spacePressed && (state != ActionState.JUMPING)) { state = ActionState.JUMP; } else if(state == ActionState.JUMP) // .... and then in the next frame { state = ActionState.JUMPING; }
  14. That sounds like a job for an array-like data structure. So I think a vector is suitable for this. When you remove the item, you mark that item's slot as unused.
  15. Whatever you do, you are probably reinventing the wheel. I don't think there's anything wrong with it though. If you have a problem and you come up with a system to solve it, good for you, and you learned something, wheel or not.