Jump to content
  • Advertisement

a light breeze

  • Content Count

  • Joined

  • Last visited

  • Days Won


a light breeze last won the day on October 13

a light breeze had the most liked content!

Community Reputation

126 Neutral

1 Follower

About a light breeze

  • Rank

Personal Information

  • Website
  • Role
    Creative Director
    Game Designer
  • Interests


  • Github
  • Steam

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Yes, that's exactly what I was looking for. Thanks for the links!
  2. That would work if I were actually just rendering to the bottom half of a 1000×1000 window, although it wouldn't necessarily be the most efficient solution. But in my case, the upper half of the window doesn't exist - I only have a 1000×500 window.
  3. Is there a way to set up the projection matrix (in OpenGL) so that the vanishing point is not at the center of the screen? Let me explain what I mean in more detail. Imagine that I am rendering a 3D scene with a standard perspective projection matrix to a 1000x1000 window. There is no camera matrix, so planes of constant z are parallel to the screen, and objects move toward the center of the window as their z coordinate approaches infinity. Now, I want to only render the bottom half of this window. Planes of constant z are still parallel to the screen, but now objects move to a point at the top of the window as their z approaches infinity.
  4. I would actually recommend going the other direction and making just a single .cpp files and putting everything else in headers. The time required to fully compile a program is roughly proportional to (number of compilation modules)×(number of lines of code per compilation module), where a "compilation module" is a .cpp file plus all of the headers it includes. There are two possible strategies for reducing compile times: reducing the number of compilation modules and reducing the size of the compilation modules. There's a lot you can do to reduce the number of lines of code per compilation module, but it's ultimately a losing battle. Just including a few headers from the standard library is going to add hundreds of thousands of lines to each compilation module. Any template you use is going to be replicated across every compilation module that uses it. On the other hand, reducing the number of compilation modules is easy, straightforward, and effective. If there's just one compilation module, then every header file that your project uses is only going to be included once, and every template is going to be instantiated just once. Just don't try to mix and match these two approaches. When trying to minimize an A×B problem, it is most effective to get either A or B as low as it can possibly go, and more or less ignore the other one. If you have just two compilation modules instead of just one, you're going have compile times about twice as long as if you went all the way.
  5. gcc and clang support the -E option to preprocess a source file without compiling. By checking the output, I can easily see that (for example) #include <iostream> by itself yields 28138 lines of code on my computer!
  6. 320 lines of code in the main C++ files, and however many thousands lines of code are directly and indirectly included. The code in the actual C++ file is rarely the main culprit when it comes to slow compile speeds.
  7. It's uglier and harder to read, and doesn't translate at all to languages that have no upper/lower case distinction, and translates only imperfectly to many languages that do? Not trying to start an argument here, just pointing out that for any mostly subjective question like this, no matter how strongly you feel about it, there will always be people who are just as passionate on the other side. In the end, it's far more important that you have a consistent style and stick to it than what the style actually is. Well, as long as the style doesn't include camelCase anyway.
  8. a light breeze

    Compile time tricks

    The main advantage is that it's fool-proof, i.e. it fails at compile-time if you pass it a non-array type such as a pointer, whereas the sizeof trick silently produces incorrect results. // This function looks like it takes a fixed-size array as argument, but it really takes a pointer. void f(int a[10]) { std::cout << sizeof(a) / sizeof(a[0]) << "\n" << std::flush; // Silently produces incorrect result. std::cout << array_size(a) << "\n" << std::flush; // Fails at compile-time. }
  9. a light breeze

    Defining function using a Macro?

    template<class T, std::size_t N> constexpr std::size_t array_size(T(&)[N]) noexcept { return N; } Without the constexpr and noexcept, this has worked for as long as C++ has had templates.
  10. a light breeze

    Defining function using a Macro?

    I'm less bothered by the use of macros here as by the bad practices in the generated code. Macros are a useful tool of last resort for eliminating redundancies in code, but the sizeof(ARRAY)/sizeof(ARRAY[0]) trick for finding the length of an array has no place in C++.
  11. a light breeze

    Simultaneous turns? (turn-based strategy)

    Age of Wonders 3 has simultaneous turns with immediate feedback. (Well, not always immediate feedback, but close enough. I think actions go into a queue when commands are given while another action is being executed, so sometimes you have a wait a few seconds for your action to complete.) When I first saw this, it offended by sense of purity, but when I actually played it, I realized that I care a lot more about having near-immediate feedback without waiting for my opponents to move than I care about purity. It does introduce a realtime element where the first player to move sometimes has an advantage, but this doesn't really bother me.
  12. a light breeze

    Turn-Based Strategy Unit Type Roles

    Obvious tools to differentiate units that you haven't used: Different damage types, with different enemies having different resistances and vulnerabilities and possibly even immunities. Different terrain traversal abilities, e.g. flying, swimming. Stealth. Movement speed. In general, any combat role can be combined with any movement characteristic. Have a slow-moving tank group that's expected to survive heavy fire? You want the utility units in the group (healers, buffs, debuffs) to also have high survivability. Have a fast-moving group of jet fighters that avoids heavy fire by flying away? You also need the utility units in the group to match the rest of the group in speed and flying ability. You could even take the modular theme all the way by not having predefined units at all. Instead, you have a set of abilities in three categories, and for each bot the player uses to construct a unit, the player gets to choose one ability in the matching category. For example: Attack abilities: High damage. Long range. Area of attack. Secondary melee push attack. Defence abilities: Armour. Shield. High hp. Regeneration. Stealth. Utility abilities: Buff allies. Debuff enemies. Healing. High speed. Flying.
  13. a light breeze

    Simultaneous turns? (turn-based strategy)

    I don't like games where I give orders and then have to wait for them to be carried out. It's "realistic" - in real life, the all units are going to move at the same time instead of sitting around waiting for other units to move - but it just doesn't feel very satisfying. You know how in action games, the controls feel sluggish when there is a noticeable delay between pressing the attack button and the attack actually happening? Strategy games where you give orders that aren't carried out immediately are like that, only on a much larger scale.
  14. a light breeze

    Particle (star) rendering not working.

    Another possible causes: you change the value of some OpenGL state variables in order to render the Earth, and don't change them back in order to render the stars. You haven't posted nearly enough information to diagnose your problem, so this is just a wild guess.
  15. a light breeze

    Game Art topology

    The one with the fewest triangles. Your modelling software should be able to tell you which one that is. Or you can count by hand; just remember that each quad consists of two triangles.
  • 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!