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

bradbobak

Members
  • Content count

    112
  • Joined

  • Last visited

Community Reputation

1825 Excellent

About bradbobak

  • Rank
    Member
  1.  Maybe stat is failing? (You may need to append the filename to the directory to pass to stat).
  2.  I generally put small comments next to the code, and bigger ones above it.  I've voted for below as well (but not sure if it would be interpreted as such) for a case such as     char buf[500];  // read a header  read(stream, buf, 500);    // some arbritary code  x = buf[3];   // file is now parsed.
  3. This is what I use. You might be able to extract extra checks from this. Note the disclaimer.   http://files.sandmines.org/sml_endian.hpp  
  4.   fyi, i think this is wrong.. everything will be set to backlog[0]. I think you need to do the loop in reverse.
  5. afaik, PM_NOREMOVE causes the PeekMessage() to leave the message on the queue. GetMessage() then removes the message from the queue.   edit: although this example would probably be fine with just the PeekMessage() without the PM_NOREMOVE.
  6.  As far as i know, a text file is treated similar to binary file except that some os's do some linefeed, carriage return translations. Text files are sometimes parsed by reading line-by-line, which, in c++, is straightforward to do (std::getline()). You have the filesize, you know when you've reached the end of file, and you can read line-by-line if you want. Thinking from a text file point of view, i don't even think '\0' is valid in it (does getline() stop at the '\0'). I guess what i'm trying to say, a text file is basically a binary file except it generally contains printable text rather than some sort of binary data and a '\0' would be considered binary data.    (did i get that right, lol)    EDIT: ninja'd
  7.  You need to add a '\0' c-string terminator. make the char buffer 1 bigger, then when you read it, assign the last char in the array a value of 0.    int filesize = whatever; char *buf = new char[filesize + 1]; read_the_data(); buf[filesize] = 0;    This is needed as a c-string holds a null terminator to signify the end of the string.
  8. It may just be me, but that looks like a buffer overflow.   Don't think so. read reads bytes and the array size is specified correctly.
  9.  read, write, and close are posix functions. 'man 2 read' in unix should bring up the man pages.    From your compiler output it seems like the header files are not being included. Try including <unistd.h>, that may fix your problem.
  10.  I read somewhere that the 8 core fx series has 4 'modules' each with 2 integer cores and a shared floating point core per module. so, maybe that has something to do with this.
  11.  Can I guarantee that once inserted, the value part will not be copied? // i.e. can i do this:   std::map< int, int > my_map;   int *int_ptr = &my_map::find(5)->second; // assuming 5 exists.   // will int_ptr always be at the same place if I add / remove map entries (not including the int_ptr entry).    And if this is true, is it valid to say an unordered_map will do this as well?  
  12. I thought the quads were 20 pixels, 0..19 is 20 units no?
  13.  Hi, when I render quads to my ortho view (set up as (0, window_x_size), (0, window_y_size), (-1, 1)) opengl leaves a blank line between neighbouring quads.   heres my ortho matrix setup: matrix4x4 &matrix4x4::make_ortho(float left_, float right_,  float top_, float bottom_, float near_, float far_) {   zero();     mat[0] = 2.0f / (right_ - left_);   mat[5] = 2.0f / (top_ - bottom_);   mat[10] = -2.0f / (far_ - near_);   mat[12] = -((right_ + left_) / (right_ - left_));   mat[13] = -((top_ + bottom_) / (top_ - bottom_));   mat[14] = -((far_ + near_) / (far_ - near_));   mat[15] = 1.0f;     return *this; } I call the above with make_ortho(0, 600, 0, 400, -1, 1) where the window size is 600 x 400.   This is the contents of my vertex array right before I enable the vertex attrib array and glVertexAttribPointer it.   (2 quads, one under the other)   verts : (0, 300, 0) verts : (19, 300, 0) verts : (19, 319, 0) verts : (0, 319, 0) verts : (0, 320, 0) verts : (19, 320, 0) verts : (19, 339, 0) verts : (0, 339, 0)   Unfortunately, this is leaving a blank line between the top quad and the bottom one and I can't see why.   My vertex shader: (trans is set to my ortho matrix) #version 330   uniform mat4 trans;   in vec3 pos; in vec3 color;   out vec3 frag_color;   void main() {   gl_Position = trans * vec4(pos, 1.0);     frag_color = color; }     Fragment shader: #version 330   in vec3 frag_color;   out vec4 out_color;   void main() {   out_color = vec4(frag_color, 1.0); }      Everything works fine (quad placement is correct, color is correct), except there is a blank (black) horizontal line between the 2 quads.    Any help would be appreciated.    
  14.  I just started this shader stuff, but I think your vertex shader needs to output a color to the fragment shader.