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

Rene Z

Members
  • Content count

    99
  • Joined

  • Last visited

Community Reputation

605 Good

About Rene Z

  • Rank
    Member
  1. The dot product between two perpendicular vectors is zero, check if you divide some value by the dot product between the surface normal and the light direction. Can you show your shaders? I can't be more specific without them.
  2. For some reason the edit button doesn't work. Read 'Then multiply the size of the camera view' in the post above as 'Then multiply the width and height of the camera view'.
  3. If you're using an orthographic projection, the area the camera can see has a width height, and depth. Transform the mouse position data to normalized coordinates (a range from zero to one) if you're currently using pixels or something else. Then multiply the size of the camera view with delta mouse position, negate, and use the result to translate the camera. If you're using a perspective projection this won't work, so let me know if that's the case.
  4. [quote name='DuckerDuck' timestamp='1340712300' post='4952986'] for (int i = 0; i <= NumberOfPlatforms;i++){ [/quote] What is the value of NumberOfPlatforms? Why don't you use the same constant to specify the size of the array? Doing so will avoid bugs when resizing the array later on. If you're using C++ it's even better to use a container like std::vector. I can't be sure what the problem is without knowing the value of NumberOfPlatforms, but it's most likely an out of bounds array access. Try to figure out why. Also, have you ever used a debugger? It allows you to step through your code while the program is running, so you can see when and why it's crashing.
  5. Probably not. I always use smart pointers, unless there's a good reason not to. A good reason can be performance in tight loops or something like that, but those cases are rare and should never leak out of your interfaces. Note that using smart pointers doesn't mean 'don't think about ownership', which often results in overusing shared pointers. Quite the opposite in fact: different types of smart pointers are a great way to explicitly state ownership of an object.
  6. [quote name='CyberRascal' timestamp='1332241957' post='4923580'] How do you solve this [/quote] Solve what exactly?
  7. The linker gives you a hint: some symbols have been defined multiple times. Those float globals in Camera.h can be declared there, but you shoud define them somewhere else, best place is in Camera.cpp. The header should contain float camX, camY, camZ. The cpp should contain float camX = 0.0f; Now some (constructive!) criticism towards your code: Why does your FPSCamera class use those global variables? Only use globals when you absolutely have to, or they will come back to bite you in the behind. In this case, camX ect. should be members of the FPSCamera class. Remove the globals in main.cpp too. Pi is indeed a good candidate for a const global, but doesn't belong in Camera.h. Ask yourself this: you need Pi for some calculations, does it make sense if you have to include Camera.h? Camera.h includes main.h. Why? Has the camera a dependency on main? Include as little as possible in the header. In this case, you don't have to include anything. Include what you need for the implementation on your cpp file. Use smart pointers instead of raw pointers. I may be missing something, but you don't appear to be using shutdown(). Remove this function, move the call to glfwTerminate to the end of main(). Terminate the application by changing 'while(1)' in the main loop to 'while(running)' where running is a bool. When the user presses escape, set running to false. Try to avoid using exit(), it makes it harder to reason about code. Add parameter names to your function declarations. They're a form of documentation. When peeking at the header, I have no idea what I should pass to moveCamera(float, float). Never put 'using namespace x' in a header, this kills the benefits of namespaces in every file that includes it, directly or indirectly. Don't handle keypresses in your camera class. Add functions to the class which allow you to move the camera, call these from another place where you handle all user input. There is more I can find, but this should be enough for now. Please let me know if you have any more questions.
  8. OpenGL

    In glsl, the pow(x, y) function return value is undefined if x < 0 or if x = 0 && y = 0. I once had a situation where the specular multiplier and specular exponent of a specular map were both zero at some texels, which caused pow to return NaN. You can also check for that.
  9. Scanner.nextLine removes line separators.
  10. OpenGL

    You need to put a ; after the declarations of vVertex, vFragColor and vVaryingColor.
  11. [quote name='altich88' timestamp='1328706524' post='4910879'] Thanks for your reply. Why is it better to use a pointer here? [/quote] The SomeType* means a pointer to SomeType, but that's a raw pointer. Raw pointers can easily cause problems in large codebases like dangling pointers, memory leaks, heap corruption just to name a few. A smart pointer is a small class or struct that manages the data it's pointing to. Basically, this means the pointed-to data will automatically be deleted as soon as there's no longer a pointer pointing to it, and no sooner than that. Most high quality code bases will almost exclusively use smart pointers. As NightCreature said, if you want to use polymorphism you must use pointers or references. If you want to understand why, look up the 'slicing problem'. The following answer on StackOverflow explains nicely: [url="http://stackoverflow.com/questions/274626/what-is-the-slicing-problem-in-c#274636"]http://stackoverflow...lem-in-c#274636[/url]
  12. [quote name='altich88' timestamp='1328701718' post='4910867'] I want to write the Grid class so that the 2D vector can store GridTile tiles or any type that inherits from GridTile. [/quote] [code] vector< vector< GridTile* > > grid; [/code] Better to use a smart pointer though.
  13. [code] glGenBuffers(sizeOfBuffer, &nameOfBuffer); // Generate the buffer [/code] The first parameter of GenBuffers is the number of buffers, not the size of the buffer. Pass 1 instead of sizeOfBuffers. The size of the buffer is determined when you call BufferData, which is when the buffer is allocated
  14. You can call glGenTextures as many times as you want. When adding a texture, call glGenTextures(1, &handle); where handle is a single GLuint.
  15. Transform Feedback would work, but it's probably faster and easier to do this completely on the CPU.