Jump to content
  • Advertisement

livengood

Member
  • Content Count

    81
  • Joined

  • Last visited

Community Reputation

144 Neutral

About livengood

  • Rank
    Member
  1. livengood

    CS vs ECE

    Thanks guys. What are some careers for a Computer Engineering major? I suppose things like hardware related, embedded systems, integrated circuits stuff like that? I suppose CS would be a better supplement to game development then CE.
  2. livengood

    CS vs ECE

    Hello, I was wondering some of the differences between these two degrees and some of the different careers that would be typical of each. Thanks!
  3. Is there a way to reduce the number of Effect framework set calls? In my code I was attempting to render something like 500 objects with a simple effect(transform and texture) and for each object I set the data and transfer to the GPU (wvp, tex). I understand that the amount of time it takes to do a transfer like this is significant, but how can it be reduced? I ran the program through a profiler and it shows these calls being significantly slower then other calls in the program. Is there anyway to work around this? I know that I could do instancing of the geometry stream, but, doesn't that still require repeat transfer of the non-geometry data? It seems that sending the wvp 500 times each frame is the problem as this function showed up slower then the texture function. Is there a method of batching this data? Am I simple wrong in thinking that I need to make a set for each object? Thanks in advance.
  4. livengood

    Finding and using data

    Hmm. My ResourceManager technically already owns the Texture that each sprite uses. I suppose I could make a class that holds the sprites and gives out handles to the UserInterface. The Renderer could then just be fed the Sprites from the intermediate class.
  5. livengood

    Finding and using data

    Well yeah, that is about how I plan to do it, aside from changing the name of 'menu' to be more general and adding a SuperClass above all that for the whole jazz. I'm not sure how I can gather up the different sprites for rendering though, as they are all spread out amongst different classes. I mentioned that I could possible queue them up as an operation and then feed that into the rendering. How else would I go about getting all these sprites to render (I don't really want to have render specific code in each sprite)
  6. livengood

    Finding and using data

    Quote:Original post by beebs1 Quote:Original post by livengood The 'Menu' would hold a container of 'UIElement' and each 'UIElement' would hold a sprite representation? That sounds like a good plan. You could even subclass UIElement and write LabelElement, ButtonElement, etc classes, with different behaviours. Yeah, this makes sense. Looks like I'm adding a GUI to the game. What do you think of the other questions I asked(sorry, edited them in without realizing how quickly you'd respond)
  7. livengood

    Finding and using data

    Quote:Original post by Captain P The problem here is that you're going too generic. That sprite is more than just a sprite - it's a button. Generalizing that away is not a smart idea. Why not write a Button class for it, that offers button-specific functionality, and that contains a Sprite internally for it's representation? Suddenly, it's much easier: a Button updates it's own Sprite whenever it changes state, and you just have to go and check a few buttons whenever you click somewhere, rather than running through every sprite. This makes sense. What construct would then hold the buttons? My main menu in this case has say 6 buttons and each subsequent menu after that has 5 more buttons. I suppose this would be a reasonable place to employ an std::map. I understand what you mean by too generic. This is a 3d game so the large majority of sprites are in fact buttons, I suppose that's why I didn't make the distinction myself. So to extend on this, in the situation I mentioned in my previous post, the sprites had a relationship as follows: Each Sprite was stored in a SpriteBatch, these batches consisted of sprites that should generally be grouped together, a common case would be the main menu sprite batch (which I could load in from xml), the SpriteBatch(s) were further stored in a SpritePool which is essentially a central update area for all Sprites in the game. In the case you describe this model would be represented more specifically. The 'Menu' would hold a container of 'UIElement' and each 'UIElement' would hold a sprite representation? How would I go about grouping and updating these menus? Would I gather all the menus into a vector for updating? Would I do it one at a time? Maybe make a small UI interface in the engine that can have menus added to it? Hmm, that brings up another question, how do I get this to the renderer. Before I could supply the renderer with a spritepool and it would go through rendering each sprite, in this case each sprite is individual. Do you then add a RenderQueue where each sprite is inserted everyframe? or make the sprite render itself then adding render specific code to each sprite... Your post was excellent and I appreciate it. It's one of those things that you don't think about until someone else mentions it. I think it has become a syndrome of mine, generalizing like this, thanks. [Edited by - livengood on May 1, 2009 6:32:23 PM]
  8. livengood

    Finding and using data

    Let me go in a bit more depth. All the sprites in this case are stored in a std::list, they have no notion of one another. I want to access my sprite "Play Button" and then call NextFrame() on this "Play Button" sprite. I can't simple call NextFrame() on any sprite. I need to call it on only the "Play Button" sprite. This sprite however has no notion that it's a play button, it remains generic, holding only it's texture ref and orientation data. I was just asking in general, not specifically about sprite animation. This just happened to be the case at hand. Hope this helps
  9. livengood

    Finding and using data

    Hello, I have a recurring question that always seems to crop up when I'm working on a project. How do you go about accessing specific data that you need. Suppose I have a std::list<Sprite*> and I'm on the main menu and want to call NextFrame() on the play button when the mouse is over it. Now I could build up some sort of Id class that is used to access into this list, maybe even a handler class with a pointer to a specific sprite that is created from a string argument. What would be another way to do this? How do I take something generic and make it specific? Shouldn't I generally avoid doing it? And in cases like this, how? What is your solution?
  10. Are you including the .lib? I'm not sure if tinyXML uses a .lib file or the source directly, but, often times a linker error like that one occurs because the program has the header file, and thus the signature of the function, but it cannot find the definition of the function. If it can't find the signature you will often get 'invalid type' errors, where as when it has found the signature and not the definition you will often get linking errors. I would say that you either need to include the source files or include the .lib file if tinyXML includes one.
  11. livengood

    Stack Allocation.

    Thanks for the response guys. GaryNas, I never considered testing it in that way. I had actually read that GotW thread a couple days back... can't believe I forgot about the second portion of it. Thanks again.
  12. livengood

    Stack Allocation.

    Why does this work? #include <iostream> int& SomeFunc() { int g = 5; return g; } int main() { int& temp = SomeFunc(); std::cout << temp << std::endl; std::cin.get() } I was under the impression that the data went out of scope no matter if it was referenced. Is it simply that the data hasn't been touched again at that memory location? ie: The system has taken it back, but I still hold a reference, and the reference could potentially be changed against my will, or does it ref count the data that is allocated (I was almost certain it didn't do this)? Thanks.
  13. Element: Character: Anti AI Cardio Anima Ork - A giant ork like creature with a massive paddle that is capable of sucking this amalgam into the end of his paddle and then hurling her into the depths of space. It is a plot twist immediately after he/she appears she is sucked into said paddle and launched into space. Never to be seen again (Maybe later she will reappear, only to be sucked back into said paddle :(... like a vacuum). Btw, this orks sole purpose is the sucking of of amalgam's and the throwing of them into deep space, he is all seeing.
  14. livengood

    learning by the book

    I am personally a big fan of C++ Primer 4th Ed.(Lippman). He does a good job of explaining C++ from the ground up and expands in depth on many topics. If at first you don't need this expanse of information in the future you will. He also makes a point to add tips every few pages that explain a concept and its uses (common things like initializer lists, virtual destructors, passing references to const). Each of these tips goes in depth on an idea and tries to explain when to use it and when not to use it. The not is always more important. I would not recommend his book as your very first C++ book as it doesn't build with repetition nearly as much as other books do, but, as a second book it is excellent. Also, for tips and tricks, there are several Scott Meyer books out there that have to the point explanations of specific concepts in C++.
  15. livengood

    MSVS C++ 2008 Express compile problem

    on the line where you call: int X = askNumber(); you must pass 2 int parameters to the askNumber function. This data is then copied over for use inside the function. You would do something similar to this: int X = askNumber(1,5); thus passing the integer constants 1 and 5 into your askNumber function. Hope this helps. Edit: Furthermore, default parameters are not-required for function definitions. It is perfectly acceptable, if not standard, to define a function as you did the code above. The only situation where a default parameter is used is the case that you intend /not/ to pass a parameter to the function, but, to instead have it value initialized to the default. Also note that default parameters must be based on the right hand side of your parameter list. As func(,,4) is not legal in c++.
  • 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!