Qaia

Member
  • Content count

    5
  • Joined

  • Last visited

Community Reputation

104 Neutral

About Qaia

  • Rank
    Newbie
  1. Garbage Collector?

    [quote name='gekko' timestamp='1348639496' post='4983901'] What is the problem you are trying to solve with garbage collection? Are you trying to deal with cross-object references and lifetime management? Even if you go with garbage collection, you should still avoid run-time allocations and explicitly run the garbage collector at load-time or whenever you can hide the massive frame spike you will get. [/quote] My main interest in GC is related to RTS-type games. I'm experimenting with different ways to reach a good balance between game performance and resource management. The suggestion of smart pointers is definitely interesting and I'm probing that scenario. In the RTS genre, you constantly have dynamic objects being created and destroyed. The main thing I'm trying to work out is this: Would a single sweep to collect a large amount of destroyed units be more efficient than interrupting the gameflow in order to destroy each individual unit as it is no longer in the game? Think of multiplayer RTS battles like Supreme Commander or Total Annihilation where you can literally have 100+ units being destroyed within the span of "seconds" (vs "minutes"). Interrupt game logic to destroy each unit individually as it becomes unreferenced or sweep occasionally to destroy several unreferenced units?
  2. Is it adviseable to implement a custom garbage collector for a game engine written in C++, or just delete objects immediately as soon as they become unreferenced? If a GC should be implemented, what criteria / guidelines should be adhered to (in terms of when the GC should be called)?
  3. What's the preferred method to select units with the mouse, i.e., you have a unit on screen that you want to either control or see its stats and you hover your mouse over the unit and click to select it? I was thinking of reading the (x,y) screen coordinates (not the world coordinates) of the unit and comparing that with the (x,y) mouse coordinates. But I'm not sure if this approach is commonly used or efficient. I was also thinking if it would be possible to associate a hitbox with the mouse and project that into the world. Are there other approaches commonly used?
  4. Perfect! Skybox is exactly what I was looking for. Thanks! About the collision detection, I'm guessing I'll have to create a new content pipeline processor specifically for skyboxes, since my current implementation processes all 3D models with their corresponding hitboxes.
  5. What is the most efficient and preferred way to implement static backgrounds involving full 3D camera rotation? For example, space and aquatic sims environments. The background is exactly that, just a backdrop to create the overall encapsulating environment allowing the character to explore the 3D universe unhindered. I was thinking there are two general approaches: 1) Use a 3D model that encapsulates the universe (like a box) with the inside of the model textured; or 2) Use a 2D sprite sheet that maps coordinates on the sheet to the camera position. The downside to 1) is that because it is a 3D model (needless) collision calculations would constantly be performed. The downside to 2) is that the engine has to constantly perform the mapping calculations and reload the sprite sheet accordingly. Which of these two approaches is preferred? Are there any other approaches used?