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

Oni Sephiroth

  • Content count

  • Joined

  • Last visited

Community Reputation

100 Neutral

About Oni Sephiroth

  • Rank
  1. I'm trying to create an FIBITMAP from an unsigned char array. I have verified that the data is correct by writing it to a file on the harddrive and opening it with an image viewer. However, for some reason I can't get the bitmap to be created. The memory stream is created, but the bitmap comes out null every time. Here's what I'm working with... [source]unsigned char * CSpriteX::loadImageFile(CFileData *image, IMAGEFILE *imgFile, GLuint &texture) { FREE_IMAGE_FORMAT fif = FreeImage_GetFIFFromFilename(image->getName().c_str()); FIMEMORY * stream = 0; unsigned char tempRGB; GLuint tempTex = 0; GLenum errCode; bool error = false; stream = FreeImage_OpenMemory(image->getData()); if(FreeImage_FIFSupportsReading(fif)) imgFile->dib = FreeImage_LoadFromMemory(fif, stream); if(!imgFile->dib) return NULL;[/source] The rest of the function should be unneeded. The type of image->getData() is unsigned char * and returns a pointer to the first element of my image data. imgFile->dib is type FIBITMAP *. EDIT: Disregard this, I fixed it.
  2. Basically, in a nutshell, I have an archive of resources (not a standard archive, one I wrote myself). Let's say for example I pull a .png file out of that archive and into a char array. So, the ENTIRE image file is in that array, including the header. I need to get the image data into a dib. I looked around and found this function: [source]FreeImage_LoadFromHandle(FREE_IMAGE_FORMAT fif, FreeImageIO *io, fi_handle handle, int flags FI_DEFAULT(0));[/source] Could I use this to get what I need? For example... Assume that fif, io and image are declared and initialized. image is the char array of image data. [source] FIBITMAP* dib = FreeImage_LoadFromHandle(fif, &io, (fi_handle)image, 0); unsigned char * bits = FreeImage_GetBits(dib); [/source]
  3. It depends on your map format. Similarly to how you know how to read in model data, you need to know how to read in the format of your map. You need to know how the file is organized and where everything is located. For example, I use a custom format in my engine where the header contains the map's background music and tileset. If someone wants to write a reader for my map, they need to know what that header looks like.
  4. You have the concept right. You basically have two classes, your node class and your linkedList class. The node class contains your data as well as a pointer to a node object, which is the next node in the list. The linked list class has 3 node pointers, a firstNode, a lastNode and a currentNode. The firstNode is the first node in the list, or the head. lastNode is the last node in the list, or the tail. currentNode is used to iterate through the list by grabbing the memory addresses of each subsequent node. The reason you only need three nodes and not one for each piece of data is because each node exists within its previous node. So if you have 5 nodes, you have your head, which contains a pointer to the second node, which contains a pointer to the 3rd, which contains a pointer to the 4th, which contains a pointer to the 5th (the tail).
  5. Wouldn't the for loop cover all of those though? I've tried casting the _key variable to a char as well and that didn't do me any good either.
  6. I threw a breakpoint in where I'm actually checking the state of the key. It doesn't break when I press a letter key, but it does for others. I'll look into GetKeyboardState()
  7. I'm having some trouble getting GetKeyState() to work properly. I need it to detect letters and numbers, which it's not doing. It detects the enter key, caps lock, shift, tab, etc but nothing for letters and numbers. Here's what I'm doing.. void HVSTInput::CkeyboardTrigger::pollKeys() { for (int i = 0; i < 128; i++) { _keyboard[i]->setKeyState(); } } First there's this, which runs from 0 to 127, checking 128 different "keys." void HVSTInput::CKey::setKeyState() { _previousState = _currentState; _currentState = GetKeyState(_key); } Then this just sets the state of the key using GetKeyState, where _key == i from the loop in pollKeys() method. Now I've looked on MSDN which says to use the ascii value for letters and numbers, which is what I thought I was doing here. Yet, only the keys that I mentioned above are actually triggering.
  8. As far as keycodes go, is it a problem that I'm using ASCII values?
  9. I'm having a little trouble getting my event system to detect keyboard input. Basically, I have this which runs once per main loop iteration.. void HVSTInput::CkeyboardTrigger::update() { pollKeys(); //keydown events for(int i = 0; i < 46; i++) { if (_keyboard[i]->getKeyState() == 1) _events[0]->keyStrokesDown.add(_keyboard[i]->getKey()); } if (_events[0]->keyStrokesDown.count() > 0) { try { signalHandler(_events[0]); } catch (const char * error) { //do something.. } } } pollKeys looks like this.. void HVSTInput::CkeyboardTrigger::pollKeys() { for (int i = 0; i < 46; i++) { _keyboard[i]->setKeyState(); } } aand setKeyState.. void HVSTInput::CKey::setKeyState() { _previousState = _currentState; _currentState = GetKeyState(_key); } Pretty much it just isn't picking up any of my keystrokes. I'm assuming it's because I'm not fully understanding how GetKeyState works. Am I using this properly, and if not, what would be the best way to handle this? My last ditch resort is working in WM_KEYDOWN and KEYUP events, but I want to see if there's another way to do it first.
  10. I'm having some problems with this and the parameter, it's not allowing me to pass a function to it. #include "inputManager.h" CkeyboardTrigger * CkeyboardTrigger::_singleton; CkeyboardTrigger::CkeyboardTrigger() { CBaseEvent * keyDown = new CBaseEvent(); CBaseEvent * keyUp = new CBaseEvent(); CBaseEvent * mouseClick = new CBaseEvent(); CBaseEvent * mouseRelease = new CBaseEvent(); _addEvent(keyDown); _addEvent(keyUp); _addEvent(mouseClick); _addEvent(mouseRelease); glutKeyboardFunc(_keyboard); } void CkeyboardTrigger::_keyboard(unsigned char key, int x, int y) { } CkeyboardTrigger * CkeyboardTrigger::initialize() { if (!_singleton) _singleton = new CkeyboardTrigger(); return _singleton; } CkeyboardTrigger::~CkeyboardTrigger() { if (_singleton) delete _singleton; } the constructor and the _keyboard function is the part in question... The error I'm getting back is error C3867: 'CkeyboardTrigger::_keyboard': function call missing argument list; use '&CkeyboardTrigger::_keyboard' to create a pointer to member I tried what it said and put the &CkeyboardTrigger::_keyboard infront of it, but got no luck. Am I missing something here? I looked up the error code as well and found nothing that would compile.
  11. I'm having a little problem coming up with a decent algorithm for instantiating a class based on data read from a file. Basically, I have 2 files, I have entity data which defines some properties, and then there's another file that tells which of these classes should be instantiated. The former file is a custom script that looks like this... ent_0 player CBasePlayer { =Events: ev_kaboom =End_Events =Sprite: mapResources/sprites/player.png =Params: file Sound int Apples =End_Params } The most significant part is the first line, where ent_0 gives the entity ID, player gives the entity name and CBasePlayer is the class in the C++ code that this entity is associated with. When I for example, see an ID of 0 in the second file, I want to instantiate the CBasePlayer class. When I see another number, lets say 1, I want to instantiate whatever class is associated with the number 1. I've thought about using a dictionary to map the IDs to classes, but I'm not sure how to map the classes in there. I've thought about using void pointers or templates, but I'm not really sure of a good way to implement either.
  12. OpenGL

    I just had a similar problem, and it was a rounding error in my tile size. Trying replacing .025f with the actual division (i.e. (1.0f/40.0f)
  13. Sorry, just one more question for the people it was crashing for. When you hit enter, did you see any of the map at all, or did it just immediately crash? Trying to find where it's crashing..I'm assuming there's a bad pointer somewhere.
  14. That's what I'm thinking..I'm gonna play with the values a bit. Also, the width and height was put in from when I wasn't sure what tilesize I wanted, so I was able to change it as a I wanted. Old code really. EDIT: Alright, I removed the rounding. It's not perfect, but it's a HELL of a lot better. Thank you for the help, I'll see what else I can do to perfect it. Quote:I do notice that you have some z-ordering issues for example at the tree's so you walk above the bottom half of the tree but under the top half etc. Nope, that's supposed to be that way. The top half is on a higher layer, so you overlap the bottom half, but kind of walk "behind" the top half. [Edited by - Oni Sephiroth on January 19, 2010 10:55:51 PM]
  15. Quote:nigger.HMD as someone might come across it and get rather angry. heheh..whoops..forgot to remove my sick humor from some of the resources I see. Sorry about that. Vsync is on, I've tried it with it off as well. Quote:How are you doing the drawing? Here, I'll show you some code.. Basically, this draws the layers, where a -1 as a tile ID means no tile tileCoordX and Y are predetermined values that separate the tiles by 16 pixels in both x and y directions for (int i = 0; i < HMD.layerCount; i++) { for (int j = 0; j < 2500; j++) if (HMD.layers[i].getTileNum(j) != -1) { HVSTGFX::createTilePNG(HMD.layers[i].getTileNum(j), tileCoordX[j], tileCoordY[j], HMD.tileSet); } if (HMD.layers[i].playerCount > 0) HMD.layers[i].player[0]->Draw(); } And as for the createTilePNG Function, we have.. void HVSTGFX::createTilePNG(int tileID, float x, float y, HVSTGFX::CXTileSheet tileSht) { float widthAdd = (tileSht.width/2)*WIDTHSCALE; float heightAdd = (tileSht.height/2)*HEIGHTSCALE; glBindTexture(GL_TEXTURE_2D, tileSht.texture); glColor4f(1.0f,1.0f,1.0f, 1.0f ); glBegin(GL_QUADS); glTexCoord2f(tileSht.xCoords[tileID], tileSht.yCoords[tileID]); glVertex3f(x, y, 0.0f); glTexCoord2f(tileSht.xCoords[tileID] + tileSht.glWidth, tileSht.yCoords[tileID]); glVertex3f(x + widthAdd, y, 0.0f); glTexCoord2f(tileSht.xCoords[tileID] + tileSht.glWidth, tileSht.yCoords[tileID] + tileSht.glHeight); glVertex3f(x + widthAdd, y + heightAdd, 0.0f); glTexCoord2f(tileSht.xCoords[tileID], tileSht.yCoords[tileID] + tileSht.glHeight); glVertex3f(x, y + heightAdd, 0.0f); glEnd(); }