Omid Ghavami

  • Content count

  • Joined

  • Last visited

Community Reputation

1007 Excellent

About Omid Ghavami

  • Rank

Personal Information

  1. Vindicator: Uprising playable demo released

    Looks great! The look & feel is really awesome and very polished. Nice use of the single-screen view as well.   EDIT: Oh, and nice work on the soundtrack too!
  2. Pong game - Computer AI and criticism

    Well, there are many ways of doing the AI. Here is one suggestion:   In your current solution the AI paddle will constantly track the movement of the ball, and your difficulty setting essentially adjust the movement speed of the paddle. As an alternative, consider having the AI predict the final position of the ball instead, and then have the paddle move to that predicted location. You can change the difficulty by adjusting the accuracy of the prediction, the frequency of re-evaluation, and the response time to new predictions.
  3. What's your dream job?

    Professor and director of CSAIL at MIT [grin]
  4. I'm so drunk

    Drunk as a Boiled Owl.
  5. Quote: Is an engine a collection of APIs with simplified terms to produce similar results to the raw APIs, but at a more user-friendly level? The engine uses the "raw" API to produce its results, so the results are not similar to the "raw" API, they are identical. What the engine does is provide higher-level functionality; it is a framework that utilizes other API, such as DirectX, to provide functionality necessary for a game within some (or several) genre(s). An engine usually has some low-level subsets, for example: some sort of task manager which controls the flow of the application; some sort of visual tree which controls the rendering process; some resources/asset manager to load, unload and provide resources. These are just a few examples of subsets in the low-level parts of your high-level engine, there are many many more. These are the bare necessities of an engine, the framework. Then you will have higher-level subsets on top of this. Such as: loading, rendering, animating and interacting with world geometry (levels, map etc), and other objects; rendering and interacting with vast outdoor environments etc. And depending on how high-level your engine is there may be even higher-level subsets on top of these, such as certain game mechanisms. An engine for RTS games will probably have built-in support for basic RTS game mechanisms; an engine for RPG games probably has a system for in-game dialogs etc. Hope this helps! P.S. Quote: Is an engine (in general), a collection of APIs (e.g. DirectX for graphics, Havok for Physics, etc.) with simplified terms (so instead of "Console.WriteLine("...");" which writes a line to the console in C#, perhaps "cprint("...");") to produce similar results to the raw APIs, but at a more user-friendly level? Although I'm sure you were just providing an example, the notion that an engine would be some kind of one-to-one mapping of methods is very wrong! To render something with a graphics API you usually call some draw method; in an engine with a visual tree you never call a draw method, you just add objects to the visual tree and they will "automatically" be drawn by the engine. The engine provides a completely different way of rendering objects than the API does.
  6. Quote:Original post by gretty Thanks for the replies guys, I checked out that lower_bound() again but it is not returning the closest match. Are you comparing the returned value with its neighbour? lower_bound will return the first position where you would insert your value if you want to preserve the ordering. For example: if your list is {10,20,30,40,50,60}, then lower_bound for 24 will be index 2 (30), since that's the index at which you would insert the number 24. Now you need to compare the number 24 with its two neighbours, 20 and 30, to see which one is the closest one. So once you've got an index from lower_bound you need to get the value at index - 1 as well, unless the index is begin, and then compare the two with your value to see which one is the closest one.
  7. Ok, let's see, you should be able to do something like this (I can't test this at the moment, so it may not work): The tree path in of the XML we are interested in is: <html> <body> <ul> <li> <a> @href TiXmlDocument doc; doc.Parse(myString.c_str()); /* Traverse down the tree html->body->ul and then get the last <li> element under <ul>. */ TiXmlNode* pLastNode = doc.FirstChild().FirstChild("body").FirstChild("ul").LastChild("li"); /* Now that we have the last one, we can get the previous sibling which gives us the second to last one */ TiXmlNode* pSecondToLastNode = pLastNode ->PreviousSibling(); /* Now that we have the <li> elements we get the first child of each, which is the <a> element, and then we get the attribute "href" on that element */ const char* lastUrl = pLastNode->FirstChid()->ToElement()->Attribute("href"); const char* secondToLastUrl = pSecondToLastNode->FirstChid()->ToElement()->Attribute("href"); Something along those lines should work. I hope you manage to solve it!
  8. I'm not entirely sure which part you're having problems with, is it parsing the XML string? The TiXmlDocument class has a method called Parse so you should be able to do something like: TiXmlDocument doc; doc.Parse(myString.c_str()); Note: You may need to remove <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> from the XML string before attempting to parse it, I'm not sure if it can handle that part. Once you've parsed the string you can use the available methods (FirstChild, IterateChildren, etc) to traverse the XML-tree just as usual.
  9. Perhaps this is way off, but is it really necessary to clear the arrays? Would it not suffice just to overwrite them?
  10. Minimum Needed To Evoke Sense of Exploration

    Quote:Original post by Kylotan Quote:Original post by Wavinator Can you evoke a sense of exploration with a single screen? Small Worlds (It's actually 5 screens, if I remember correctly. But you should quickly realise why I linked it here.) What a beautiful game, a piece of art :)
  11. odd C++ bug(?)

    Quote:Original post by NukeCorr Okay, I have no idea what's happening here. *** Source Snippet Removed *** Those are the only places "killsMsgWep" variable is used, nowhere else. So how can the initializion crash the program with such simple variable? Am I missing something here or what's this about :S That works completely fine when run in isolation, what compiler are you using? I'm guessing there must be something else in your code causing this, perhaps memory has been corrupted somewhere else in your code.
  12. How to get equation given many (x,y) points?

    Quote:Original post by helloworld123 Quote:Original post by Atrix256 You say these numbers are random... where are they coming from? if they are coming from rand(), keep in mind that rand() itself is a mathematical function, so it is giving you what you want already! (kind of... it can be made to work for you, depending on what you need exactly) Can you give some more info about what you are trying to do and why you need to come up with an equation to match the numbers? I bet there's a better way to get what you want. well, i was just curious at how to have f(x)=y, where you have an equation that could be solved manually. i mean given the original problem, if i have 1000 points, i'd get an equation of degree 999. if this were the 1800s, no calculators and computers (maybe abacus, yes), and you have an equation with very very very high degree polynomial, would you solve it manually? or is there someone who's found a solution to make a very high degree equation into something bearable with pen and paper? I would guess that usually you'd have collected data from observing some real-world phenomenon, and you'd be hoping to find some mathematical expression. If the data is not completely random you will be able to find a reasonable expression; position of free falling object for example. If the data is completely random you won't find a mathematical expression worth using, not in the 1800s and not today. You can't magically decrease the degree of a polynomial without information loss. You either need to add additional information about the shape of the curve, which you have somehow acquired (observation etc). Or you'll have to settle for a less accurate formula by approximating. As for evaluating a high degree polynomial, there are several tricks which can be used to find the solution for extreme values -- if your input value is small (<1) for example, you approximate large powers terms to be roughly zero; if your input is very large you can assume that large power terms will dominate the result, and thus smaller power terms can be neglected. But actually solving accurately for any point requires performing all calculations.
  13. How to get equation given many (x,y) points?

    What you are looking for is probably Curve Fitting. Hope this helps.
  14. The Meaning of War

    Quote:Original post by visitor Also it is not particularly helpful to point out that US has sponsored lots of dictators in various countries (Iraq, Haiti, Chile and probably others). They were actors in the Cold War. Saddam in particular fought Islamic fundamentalism of Iran. Not helpful for who? Depends entirely on what your agenda is, right? Furthermore, Iraq invaded Iran and bombed civilians, calling it "fighting Islamic fundamentalism" is quite inaccurate, don't you think?