Jump to content
  • Advertisement

TravisWells

Member
  • Content Count

    373
  • Joined

  • Last visited

Community Reputation

276 Neutral

About TravisWells

  • Rank
    Member
  1. TravisWells

    Gesture systems and runic magic on PCs

    The game Amulets & Armor had a keyboard based gesture-spellcasting system that was pretty nifty. You had a bunch of runes that were mapped to the numpad, and spells were made up of 3-6 runes. So instead of drawing or clicking a gesture, you'd type the number on the numpad. It worked well, because very quickly you didn't have to think about which numbers you were hitting, you just remembered the motions.
  2. TravisWells

    void* casting

    Whoops, missed that.
  3. TravisWells

    void* casting

    Quote:Original post by newera So my question is, is there a way I can cut out imageData from this picture, and just use surf-pixels? Yes, but not in the way you think. You can tell OpenGL that your surface is in BGR. I believe you just use GL_BGR instead of GL_RGB as the format in your call to glTexImage2D. Now, there's a slight problem with doing this on windows: GL_BGR isn't defined by the OpenGL headers, but GL_BGR_EXT is, which is the same. So you can just do this #ifndef GL_BGR #define GL_BGR GL_BGR_EXT #endif And still run on non-windows platforms. EDIT: Quoted the wrong person! [Edited by - TravisWells on July 14, 2006 12:01:56 AM]
  4. TravisWells

    Weird values file/IO

    The numbers you're seeing are the ASCII values of the char you loaded from the file. In this case, 0,1,2,3. 0=48 1=49 2=50 3=51 An easy way to fix it would be to do: tiles >> temp; temp-=48;
  5. TravisWells

    python cgi errors and setup

    Another thing to try: Make sure your file has unix (\n only) line endings. If saving on windows you'll get \r\n and that'll prevent your script from running (Python doesn't care about this, but the #! line is interpreted before python even starts) Also, make sure the #! line is at the very beginning of your script (No lines before it, even comments or blank lines) Have you checked your host's site? They may have a FAQ showing the location of the python binary.
  6. TravisWells

    How do I work with files in Python?

    writelines doesn't add newlines to the lines it prints (kinda confusing, that) Try this pair: #writing invintory.writelines('\n'.join(uList)) #reading uList = [x.rstrip('\n\r') for x in invintory.readlines()] Or, simpler: #writing invintory = file(sDir, 'wb') # b for binary cPickle.dump(uList, invintory) # Pass the file object, not the name! #reading invintory = file(sDir,'rb') uList = cPickle.load(invintory) EDIT: Fixed minor logic error with str.rstrip EDIT 2: And windows compatibility error :) EDIT 3: And the final read/write pair: #writing invintory.write('*'.join(uList)) # Pick a separator not used in uList #reading uList = invintory.read().split('*') # Make sure you use the same one :) Of all of these, the cPickle one is: 1. Fastest (String handling is done in C, not python) 2. Most flexible (You can put just about anything into uList, not just strings) 3. Least likely to cause problems (The contents of the strings in uList can't mess it up, like they could with 1 or 3) BTW, It's spelled "inventory"
  7. TravisWells

    Can't create hardware video mode in SDL

    The last I heard, SDL can only get hardware surfaces on linux in fullscreen (And then only with certain X extensions installed, on certain hardware with certain drivers) The only realistic way to get hardware surfaces is to use OpenGL (directly or through glSDL) (BTW, you are using SDL_DisplayFormat right? It's a very common mistake to omit it, leading to horrible performance)
  8. TravisWells

    SimCity graphics. where to start?

    Yeah, seconding that. (I just saw Isometric form + SimCity and dived into the explanation) If you want to concentrate on the game logic, do 2D. It's vastly simpler: int rx,ry; for(int y=0;y<MAP_HEIGHT;y++){ for(int x=0;x<MAP_WIDTH;x++){ rx=x*TILE_WIDTH; ry=y*TILE_HEIGHT; DrawTile(rx,ry,map[x][y]); } } Digitalemu: I wouldn't worry about the large number of tiles to be drawn. Computers are fast. Doing 3D rendered tiles would be much more complex to do. I say start with the dead-simple rendering system, and if it turns out that it's too slow later on, you can replace it with a 3D rendered system. If it's not too slow, you saved all the development time to make the 3d tiles.
  9. TravisWells

    SimCity graphics. where to start?

    When I make an isometric engine, I start like this: Set the map size small. Like around 5x5. Make one "blank" title (like a space in SimCity with nothing built on it yet), and get that drawing correctly. Then you make a drawing loop, which'll be something like this: (In C/C++, but it'd be very similar in Java) int rx,ry; // Screen position for(int y=0;y<MAP_H;y++){ for(int x=0;x<MAP_W;x++){ rx=(x+y)*TILE_WIDTH; ty=(x-y)*TILE_HEIGHT; DrawTile(rx,ry,map[x][y]); } } The rx/ry is the position on screen where you draw the tile. DrawTile should be replaced with the bit-blit call from whatever API you are using. (It should look up the tile position in your tilesheet based on the map[x][y] info, which should just be an int identifier. I could give an example if that's confusing) The next step is to draw a tile which must be drawn in order. In other words, it's not just a diamond shape, it's got something sticking up. To draw that correctly, you need to adjust the order in which you draw the tiles, so that closer-to-the-camera tiles get drawn later than farther from the camera.
  10. TravisWells

    sdl & text width

    Look up TTF_SizeText in the docs: int x,y; TTF_SizeText(font_name,"text blah",&x,&y);
  11. TravisWells

    Tools for creating vegetation

    There's PlantStudio. It's quite good, and exports in many simple 3D formats. Lots of options, and a neat cross-breed feature for generating new plants. EDIT: Forgot to mention, it IS freeware. They changed it from shareware, and didn't update the binary. You just install it, then you can register it for free (No email/name required, just enter a registration code) on their "order" page
  12. TravisWells

    AA, AF, Gamma

    ARB_Imaging isn't in the extension registry because it's not an extension anymore. It was moved into the core in 1.3, I think.
  13. TravisWells

    Weird Bug

    I know that you fixed it, but this: str=new char[1023]; free(str);} was probably your problem. If you use new[], you need to use delete []. free goes with malloc(), not new/new[]
  14. I think there are problems with telling left/right alt/shift/control apart on some OSes. Try this: if ((mainApp.GetKey(SDLK_LALT) || mainApp.GetKey(SDLK_RALT)) && mainApp.GetKey(SDLK_F4)) return false;
  15. I'm pretty sure Red Alert used the same engine, and RA ran at 640x400 (or optionally 640x480 in windows)
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!