Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Community Reputation

307 Neutral

About ascorbic

  • Rank
  1. We had to do somehing like that for an AI assignment last term. We used the information from this website below. It gives 80-90% accuracy and is actually quite easy to implement. Link Hope this helps. At least it's an interesting read...
  2. I can't remember which one of the two... I don't have XNA up where I am. 230 is just about 90% opaque... Try either of these in its place: 1) new Color((byte)255, (byte)255, (byte)255, (byte)230) 2) new Color((byte)230, (byte)230, (byte)230)
  3. ascorbic

    XNA - Alpha channels and SpriteBlendMode

    Thanks everyone for the replies. I figure my only two options would be: 1) Use two separate sprite files: one transparant, one not. Use the needed one in each given situation. 2) Write a shader. Not too familiar with shaders, but that doesn't sound too mind-shattering to do. I guess I started this thread on a somewhat false assumption. Thanks for straightening me out a bit.
  4. ascorbic

    XNA - Alpha channels and SpriteBlendMode

    Thanks for the reply. I've thought about what you've said but that is not what I'm looking for. I'm only trying to draw one sprite, not two or more. I just want to draw every pixel non-transparent but with opacity. By using SpriteBlendMode.None, it draws every pixel non-transparent but it appears I lose the ability to set the opacity. I'm looking for a way to override this. The opacity information I assume is inherent in the .DDS file. I shouldn't have to modify the file every frame to accomplish what I'm looking to do.
  5. Hopefully an easy solution to a XNA beginner's question... I'm looking to take a .DDS file and draw it with a given opacity AND be non-transparent. I'm looking to do #4 in the linked graphic below. Link By playing with the SpriteBlendMode and alpha values I've been able to accomplish 1-3 but not 4. What method do I use to accomplish this?
  6. ascorbic

    Tutorials for vector based platform gaming

    Thanks for the help. The link is exactly what I was looking for.
  7. Hi all, I have recently worked on a little demo that bounces some objects around the screen, off of a user-created series of lines. Link to program to explain it a little better. This is all fine and good for either a 2D top-down game or a 3D game where the game field is completely flat or close to it (No elevation). What I'm looking for are good resources on how to start treating this like a 2D Super Mario side-scroller. In other words, I'd like to start putting in gravity and allow jumping, climbing and falling down slanted walls and whatever else I've missed. I'm looking for any relevant resources to begin working on this. My apolgoies if the search for such resources is trivial; I just don't know the exact name of the information I'm searching for. Any help you guys could give me is as always much appreciated!
  8. ascorbic

    Job Interview

    I just want to know where I can find these "easy" game programming interviews. Eight hours of pure hell and six hours a few layers above that are all I've sniffed of the industry so far. In my experience, the amount of math you need to know, or at least the formulas you need to have memorized, depends on the specific job you're applying for. The one interview I had was for 3D engine type coding, so I was asked linear algebra and other stuff covered in 3D math books. Among other things... The other interview was for a programmer for a specific game. The 3D questions weren't as rigorous, but the other C++ style questions made up for that. I would give a more specific response, but I'm really not sure if I can discuss any actual information from the interviews. Just study up on what you think is important. Good luck!
  9. Thanks so far for all your responses. There really is no real world problem that I need to address. This was a tricky interview question I had that I couldn't figure out the answer to. It's very possible I just don't remember the exact question very well. Sneftel mentioned that there are ways to make the public usage of bar(double) impossible. This is probably all the interviewers were looking for. How would you go about doing this? Also, is there a specific small project that one can do to learn templates in better detail than just writing a stack or queue class?
  10. I have a simple question about templates that I hope has a similarly simple answer. Suppose I have a class defined as below: template<class T> class foo { public: T bar(T); // works fine private: // MY ATTEMPTS AT SOLVING MY PROBLEM double bar(double); // C2535 : member function already defined template<> double bar(double); // compiles, but obviously not right }; foo<int> i; foo<double> d; int a = 2; double b = 3.0; i.bar(a); // should work - int should be public d.bar(b); // should not work - double should be private How do I do the specialization so that, for example, if T is a double, then the function is private? Only a double should not be defined as public. I've tried a couple of ways to approach the problem, but no. Is this even possible? If I need to explain the question better, please let me know. As always, thanks for your help in advance!
  11. Thanks so much MaulingMonkey! I figured there were a couple branches in the logic. You're saying that a function as follows is needed: template <class T> bool isTheSameNumber(T a, T b, T tol) { if(a >= 0) { if(b >= 0) { return (max(a,b) - min(a,b)) < tol; } else { return (a < tol + b); } } else { if(b >= 0) { return (b < tol + a); } else { return (max(a,b) - min(a,b)) < tol; } } } Probably why I didn't get the job! Thanks for the help! EDIT: Not exactly right... per your edit above... but good enough to shed light on my problems... thanks for everything!
  12. I recently had this question asked of me in an interview and didn't really know how to answer it. The question had to do with a templated function that determined if two numbers were within a certain tolerance and thus could be considered the same number or not. a and b are basically numbers, tol is the allowable difference between the numbers. I simplified the function just to magnify the question. Most of the time this function works properly. template <class T> bool isDifferent(T a, T b, T tol) { return (a-b)>tol; // plus "or" something I don't remember... unimportant to question... } If a=4, b=3, tol=5, then 4-3>5 is 1>5 is false... which is expected. However, if we use unsigned chars for T, then the following could be true. If a=0, b=2, tol=5, then 0-2>5 is 254>5, which is true, which is NOT expected. The question was then asked of how to fix the function to account for this. I really had no idea. I figured to account for this, you could do a check like: if((a-b) > a) { return (b-a)>tol; // b is bigger than a - underflow with (a-b) } else { return (a-b)>tol; // a is bigger than b - no problem } This doesn't seem right... but maybe it is. This fixes the problem with unsigned numbers. But now what about signed numbers? Sorry for the long winded and confused question. So bottom line, how do you correctly account for overflow/underflow to make this function robust for all data types? Thanks!
  13. Has it really been this long since I posted my first and only journal entry? A lot has happened since then. I'll have to post a "little" more often now! Finally finished my 2D RPG. It's complete, polished and ready to show as a portfolio demo. It's finally time to move away from 2D once and for all. Almost done with my seventh class at DePaul. Six to go! Woo hoo! Attendence policy still the only mark against my GPA. Finishing up teaching a game development class at a community college. Game Maker is really a great tool for quick idea prototyping! You guys can pooh-pooh it all you want, but it really is a good learning tool. Just got my internship rejection email from Midway. Mixed feelings. I've applied for exactly one job in the past four years and got an interview. Really, how bad could that be? You better bet your ass I'll be much better prepared this time next year! I just hope all the flubbing I did won't ruin my chances in the future. Currently working on figuring out how XNA calculates its camera matrices and projection matrices. Figured out Matrix.CreateLookAt(...) but having trouble with Matrix.CreatePerspectiveFieldOfView(...). The formulas I've found for it are close but not exact. Probably caused by the colum vs row order being different. I just can't get the results to match for element (3,3). (near + far) / (near - far) is not it. Anyway, now with the taste of blood, I want into the industry more than ever. Now I know exactly what I need to master. And I'll have the summer to get up to that point.
  • Advertisement

Important Information

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

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!