jaxson

Members
  • Content count

    459
  • Joined

  • Last visited

Community Reputation

127 Neutral

About jaxson

  • Rank
    Member
  1. New to C++

    OR You can put a breakpoint on the 'return 0' and run the code with the debugger: Click on the line and press F9, which should put a little red dot beside it. Now start program execution with Debug->Start (hotkey F5, I think). Execution of your app will stop when it hits the breakpoint. To get it to continue use menu item Debug->Continue (or press F5 again). Using the debugger and breakpoints can be very handy when debugging code since the debugger can take you immediately to spots in the code where a runtime error/access violation has occurred.
  2. RPG Fight Engine

    I wouldn't recommend exactly copying how they did it, but this link is an interesting read about how the combat system in Final Fantasy Tactics works. http://db.gamefaqs.com/console/psx/file/final_fantasy_tactics_battle_mechanics.txt
  3. Is Turn Based Strategy Dead?

    Silent Storm is a good turn based PC game from a year or two ago. It's a little like X-Com in a World War 2 setting.
  4. Pathfinding Oppinions

    One option is to start an A* search from both ends at the same time. In other words, have the destination start searching for the beginning and the beginning start searching for the destination. If either one runs out of nodes, there is no path. If they ever reach the same node in the search, then you've found your path. I wish I could remember the computer science term for this type of A* search so you could google for an example. (All I can remember is "iterative deepening A*" but that has to do with only searching out one node away the first time, then trying two nodes, then three nodes, etc)
  5. Any Gun Experts? (Continued)

    Quote:Original post by grekster What do you mean by orange tip? They paint the end of the gun orange?[oh] Toy guns in the US are required to have an obvious orange cap on the barrel so that little kids don't get shot by police when they are playing with their ultra realistic looking 9mm handguns.
  6. An interesting puzzle

    Ok, maybe I'm just not very clever, but the code from the yellow chamber isn't working for me. I tried it forwards, backwards and other combinations. What am I missing? I keep getting "the numbers are not right." Edit: Nevermind, I refreshed the page and replayed it and the code worked fine, so there must be a bug or something. Or maybe the code changes every so often and I timed it just wrong. [Edited by - jaxson on March 4, 2005 7:14:39 PM]
  7. One of the professors at Oregon State taught a class about parallel computing while I was there and naturally he used his own book as the text for the class. As I recall, the book was fairly good, so maybe it will be what you want. His name is Michael Quinn and the book is titled something like "Parallel Computing: Theory and Practice". I don't know if you can buy it from Amazon, though.
  8. Strange Commands in C++ ???

    'register' tells the compiler to try to store that variable in a register instead of memory, since registers are faster. This is only a suggestion to the compiler and it won't necessarily be done. Also, a good compiler will usually optimize something like a loop counter into a register anyway, so in my opinion, it is just a waste of typing. :) An assert normally only gets executed in a debug build and causes an exception to occur. In the example you gave, an error would occur if nMax was zero. Some people fill their code with asserts to check for things like NULL pointers. Once again, you'd probably be better off doing an actual check, since asserts are normally compiled out in release builds.
  9. I once had a similar sounding problem and it was because I was using the D3DXFont class and I was forgetting to reset it as well. So, if you are using any of those D3DX helper classes, make sure you call their reset methods.
  10. Constructor Speed

    For the example you listed, I would guess that they are virtually identical since you are using floats. However, if you were initializing an object member, it is often faster to do it the first way, since in the first instance the object will be constructed with the correct value, but in the second it will be constructed with default values first (assuming it has a constructor) and then you will be resetting it to new information. For example, suppose you have a class like: class Foo { public: Foo() { a = 10; b = 20; } Foo(int aa, int bb) { a = aa; b = bb; } private: int a; int b; }; // then here is MyClass class MyClass { // some methods here private Foo foo; }; If you initialize it the first way, then the 'a' & 'b' members will be set to their correct values in one pass. If you initialize it the second way, first they will be set to 10 and 20, and then you will have to reset them to the values you want.
  11. force enum to 8-bit?

    #pragma pack might do it. That at least causes classes and structs to be compiled to the smalled possible size even though it will be less efficient in memory.
  12. MOO 3

    I agree with the people who said the game was a disappointment. I tried so hard to like the game and I just couldn't. I played MOO3 at some length at different times both before and after patches were released and each time I would end up playing back playing MOO2 and actually enjoying myself. In my opinion, MOO3 removed almost every aspect of the old games that was actually fun, and replaced it with frustration and tedium.
  13. hungarion notation

    By far, the most useful portion of Hungarian notation is the scope indicators. At the company I work for, there are a dozen or so Windows programmers. Trying to read someone else's code is much easier when they use 'm_' to indicate member variables and 'g_' to indicate globals. It saves a lot of scrolling back up in the file or waiting for the tooltip to pop up if you can just tell by the name where the variable resides. The other handy bit of notation is when indicating a pointer. This is even more useful when there is a distinction made between a normal pointer (pFoo) and a smart pointer (spFoo). It is nice to be visually reminded whether this particular COM object needs to be explicitly released.