Jump to content
  • Advertisement

Tang of the Mountain

Member
  • Content Count

    246
  • Joined

  • Last visited

Community Reputation

100 Neutral

About Tang of the Mountain

  • Rank
    Member
  1. I have a custom exception handler filter set up for the unmanaged side of my application using SetUnhandledExceptionFilter. This works fine and allows me to dump out any information I require about the crash and state of the system. (courtesy of Random gamedev ramblings) My question: Is this possible for the managed side of my application. I read somewhere that the exceptions will get marshalled before I can even have a chance to catch them. I'm not looking for an implementation so much as a confirmation that it is/is not possible and maybe a link to an article explaining how one might override the the top level filter to do what I want. Or where to start looking for hooks. Cheers.
  2. Tang of the Mountain

    Interview programming test

    It varies based on the company and what they are looking for. I head up the process for my company and these are the kinds of questions I might ask: 1. Write a string reversal algorithm 2. Write a function to determine if a number is a power of 2 3. Calculate the nth Fibonacci number 4. Write a function to reverse a doubly linked list 5. Determine if a linked list is circular. Sometimes they can get much more complicated. Finding the correct answer is not always the only thing they want. They want you to understand the problem or understand how to work it out/break it up. They want to see how you approach solving the problem. It's also not unheard of to sit someone down for 3 hours while they develop a mock system(A car where you must define individual components(motor, seats) using inheritance etc.) to see how they design and approach larger scale problems. Sometimes they will give you an incredibly hard problem you may not be able to finish. In this case, try your best, explain how you would try to solve it, in the end its good to understand your limitations. If you can not do it, just tell them. "This is an interesting problem, however I am not familiar enough with X to solve it. Would you mind explaining what this does?" Have fun with it most of all. It's always a learning experience.
  3. Tang of the Mountain

    most fun 2D 1v1 multiplayer game?

    I second scorched earth and played Warheads for a while
  4. (It's late, I thought I clicked in general programming, my apologies) Ok, I have this cluster of inherited objects. Base A derives from base B,C,D derive from A Classes B, C, D's ctors have the same params. A is the outcast with one extra param. I am developing a templated object manager which will create any of the given types. The problem is the specialization needed for A. If I do the following inside the manager: ... template <typename T> T* Create(const st::string & name)...} template <> A* Create<A>(const std::string name, int id){...} //fails but ideally what im trying to accomplish template <> A* Create<A>(const std::string name) {...} //would work but useless for my purpose ... Well, I can't. Because its not really a specialization of a template. Its a new function. But I want the functionality of this function to work solely for A. I don't want to have to overload Create and always return NULL then create a specialization of the overloaded Create for type A to work normally. However, that's what I'm thinking. Any ideas? I could change the ctor of A but I'm trying to avoid that for now.
  5. Tang of the Mountain

    Can I make a game in 3 Hours?

    its very possible. Create your assets beforehand. When I was in college, we had finals where they handed us assets and gave us an hour to write a game. Granted it was frogger, but still ;) The hard part is having assets, so with that out of the way you should be good to go. Puzzle game might be easiest. You could always do something crazy like Number Munchers (http://en.wikipedia.org/wiki/Number_Munchers) meets Bejeweled or lol. That probably sounds like more fun in my head than on paper.
  6. Tang of the Mountain

    Systems of failure

    Since the Patriot Act, there have been an amazing number of American Failures on behalf of the government. I came across this article: http://www.boston.com/news/nation/articles/2009/01/25/bad_behavior_on_flights_prosecutable_under_patriot_act/ I had read about it when it happened. Mother disciplines her children on plain, swears when confronted about it, throws some juice on the floor in anger and gets arrested for acts of terrorism. I thought it was asinine at the time. Sure she could have handled it better, but what parent hasn't had one of these moments because of unruly kids. This is one of many acts of idiocy that have spawned from the Patriot Act, in which 200 "terrorists" were convicted. Most of the cases being drunken behavior or use of obscene language. We seemingly apply no judgment of our own when applying these laws. We simply convict anything and everything without thought to what we are doing. "Oh I'm sorry your 6 month old's name was on the terrorist watch list, please step this way so we may check his diaper for explosives and/or Bin Laden". The results of which are shown in the article. The mother of the children has now lost her kids and is unable to fight for custody because she is under probation on Oklahoma, and her kids were placed in a foster home in Hawaii. People who enforce the laws don't think about the reality of their actions. Is there seriously not more attention being given to this problem? Welcome to America, if you don't sit down and shut your mouth on our planes, we will ruin your life. After all, we wrote(modified to suit our needs) the laws, and we will enforce them without a thought as to how ignorant we are or what the cost will be to you. I guess people will start to care more when they are personally affected by the plague of stupidity which has apparently run amok in this country. (More so than usual)
  7. Tang of the Mountain

    vectors + class problem

    for one, I would not assign your id to the passed in id, i would strcpy. However, personally, i would change it to a short or an int. Other than thatd, i agree more code would be helpful, at least the struct itself and where you are caling this function or some example data coming into the function.
  8. Tang of the Mountain

    Apparent call stack corruption

    Having found nothing to fix the problem, i started peeling through ogre functions related to the vertex declaration object. I happened to notice there was another function, getElements(), that would return a reference to mElementList, which the findElementsBySource(int source) was copying from and returning a copy to the new list given a source index. I plugged in the new function and it worked. The downside being that the data which may contain a separate source would have to be parsed through on my end, which is no big deal. Being as I have the reference to the list any extra allocation can be handled by me and not ogre. Now, all i have to do is revert to the ogre I was using previously with boost enabled and ensure the problem does not persist. If it does, well then Ill have to post on the appropriate forums. If not, i suppose there is either a bug in the function i was using, or the function i recently swapped to is masking the leak which could once again poke its ugly head out at any time. I would still like to get an idea as to why this is crashing when passed a copy of the list, but as ive spent far too much time on it now, it'll have to wait.
  9. Tang of the Mountain

    Apparent call stack corruption

    The assert found nothing as I posted it throughout my code. I changed my ogre version to be built without boost and in fact to a version pre 1.6. The crash is similar, it happens upon cleaning of the local list but now it crashes inside of xlock.cpp. __thiscall _Lockit::~_Lockit() { // unlock the mutex _Mtxunlock(&mtx[_Locktype]); } This call is immediately following the previously stated "operator delete(_Ptr)" call on the call stack. I'm pretty much out of ideas on what to do here. I have no knowledge on threading and am curious as to what could cause a crash here. I'm going to find out as much as I can about this, if someone could provide some insight that would be great. Cheers.
  10. Tang of the Mountain

    Apparent call stack corruption

    Thanks for the reply, i tried enabling the CRT debug a while ago but it never gave me anything. I told it to print results to a file but nada. Its possible i was doing it wrong. I will add assert(_CrtCheckMemory()); and see where it happens. As it stands now, I think I have narrowed it down. However unlikely it may be. There is a memory manager enabled for ogre. The changes since its broken have started to call OGRE_NEW in place of new on the object that holds the given list. What i am thinking here is that Ogre provided memory to STL, and STL is trying to delete it on clean up in that function. It seems unlikely because, I use that data in other places which i would think wouldve crashed. Ill continue to further investigate. Thanks again for the advice. Cheers
  11. So i have this problem. It would seem i have some form of memory corruption, i can only assume is the call stack due to a crash on return true. Here is a brief explanation of the problem, I'm hoping someone can give me insight to what could generally cause the problem. bool ExpSubMesh::AddSubmeshToVertexbuffer(Ogre::SubMesh* pOgreSubmesh, Ogre::VertexDeclaration* pVertDecl, Ogre::HardwareVertexBufferSharedPtr vertBuf, int vertOffset) { //all code besides this call is commented out here //VertexElementList is std::list<VertexElement> Ogre::VertexDeclaration::VertexElementList ElemsList = pVertDecl->findElementsBySource(0); return true; } The rest of the code has been commented out, this is the line that is causing the crash on return true. If commented out, there is no crash. the function called does the following and is part of Ogre: VertexDeclaration::VertexElementList VertexDeclaration::findElementsBySource(unsigned short source) { VertexElementList retList; VertexElementList::const_iterator ei, eiend; eiend = mElementList.end(); for (ei = mElementList.begin(); ei != eiend; ++ei) { if (ei->getSource() == source) { retList.push_back(*ei); } } return retList; } So its returning to me a copy of the list, when it crashes, its in xmemory trying to clean up the list apparently. Which contains 2 structs containing 2 shorts 3 ints no dynamic memory. void deallocate(pointer _Ptr, size_type) { // deallocate object at _Ptr, ignore size ::operator delete(_Ptr); } I have so far looked into all of the following: Check all [] for buffer overwrites Check all new and delete/delete [] calls Manually clear the list local list before the return. Modify what is put into the main list returned by ogre. Moving the code outside of the function and placing it where the function call was. There is a large number of things i have already tried related to the above code, which is returning what data belongs in a vertex so i can fill a vertex buffer later in the function. Ive run through the code with a fine tooth comb looking for improper memory usage and overruns, stl allocation, deprecated functions, every form of memory allocator and deallocator, all API calls, etc. The kicker is, the code runs fine on XP and not on Vista. Ive tried 3 different vista machines(one same hardware one laptop) with the same test case and it fails, XP runs fine. Any help at all would be vastly appreciated. If i havent given enough info, let me know and I can post what is needed. Cheers
  12. Tang of the Mountain

    [Solved]Advanced C++ Programming

    @ shwasasin and alvaro I have to say i am not in full agreement with you. There are special cases and I'm not saying a singleton is a good idea for all variations of an Entity Manager, for my case of one manager managing everything, it works. Not all people want to run parallel instances of the game(I've never found a need and am not entirely sure it would be an issue or could not be worked around.) I don't consider not serving the needs of very special circumstances to be a lack of imagination. However, not to steal away this topic from the OP, i will gladly continue this discussion on another thread or via pms. Jedimace, what I commonly do, is keep a list of things I do not know and want to, and every time I find some free time, i start attacking the list(google, blogs, msdn, gamedev, etc). I like to spend 20hrs a week exploring new things, I've heard its good practice to spend at least a few hours a week doing so. You never know when something you learn will prove useful.
  13. Tang of the Mountain

    [Solved]Advanced C++ Programming

    I would like to give my opinion on the singleton pattern as the population of programmers is broken into people who like it and those who do not. Not to discount DevFred or nobodynews. Singletons are useful in a variety of situations, some of which you'll find commonly in game engines and systems in general. One such use would be for entity/memory managers(entity representing any game object perhaps). You don't want to have more than one EntityManager managing entities. If your class is a singleton you force the user to only have on instance of the manager at a given time. Perhaps if you have an audio engine, you do not want to create separate instances and initialize multiple objects interacting with your sound files as you may not be sure who has the audio file buffered that you wish to access. It can be very useful in some situations. Besides that, its always good to put another tool in your toolbox. Simply knowing how a singleton works and how you can effectively use it will benefit you down the road, even if you don't implement it in your engine. That being said, I would recommend taking a look at: http://www.gamedev.net/columns/books/bookdetails.asp?productid=18&CategoryID=17 This book will cover a lot of the more commonly used design patterns(and some more uncommonly used), including singletons. If you gain nothing else, you will know why there are different design patterns and how they work which may give you insight into a problem you may face in the future. Regarding advanced features, build a list of what you would like to know and gamedev will probably have some insight as to how it works or where to find the information you require. You could probably check out the current c++ standard and start picking from there. (Keep in mind a new standard is being worked on and things may change.) In my opinion, you can never learn too much and nothing learned is wasted(within reason). Cheers.
  14. Tang of the Mountain

    Sound/Music Manager for games

    I did some extensive research and implementation on the different sound libraries. If youre looking for something full featured and simple to use, FMOD is the best hands down in my opinion. If you want something a little less robust but a little more complex to set up, you might want to look at irrklang. However, you need to write your own streaming file access routines. Personally, I suggest FMOD, expecially if you ever want to get into using its 3d sound occlusion etc. Creating a manager is as simple as creating a wrapper around the audio library, and storing audio files somewhere. You can most likely find decent articles on gamedev, that book also has some decent information. Cheers.
  15. Tang of the Mountain

    Visual Studio 2008 issue

    I had no issues, have you tried uninstall -> full reinstall?
  • 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!