Jump to content
  • Advertisement


  • Content count

  • Joined

  • Last visited

Community Reputation

1905 Excellent

1 Follower

About rnlf_in_space

  • Rank

Personal Information

  • Role
  • Interests


  • Twitter
  • Github

Recent Profile Visitors

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

  1. rnlf_in_space

    loop only every 10th or so

    Of course you get flickering when you draw something only every 10th frame. What you probably want to do is store the last computed FPS into a variable and only do the computation every 10th frame, but still draw on every frame.
  2. rnlf_in_space

    How was lighting handled in early 3D games?

    Don't forget that Duke Nukem 3D was released 3 years after DOOM. Half a year before id released Quake. Of course Build engine games looked better at that time.
  3. rnlf_in_space

    Always align memory in array class ?

    Alignment is important for many things. Most CPUs cannot access unaligned memory. If you want to save on the padding, try rearranging stuff inside of your elements or consider going from Array of Structures to a Structure of Arrays, i.e. instead of having struct MyStruct { uint32_t foo; uint16_t bar; }; MyStruct array[100]; // 200 bytes wasted To something like struct MyData { uint32_t foo[100]; uint16_t bar[100]; }; MyData data; // Nothing wasted.
  4. rnlf_in_space

    STB Image

    I am using STBI and I never had a problem. Not sure what kind of trouble you had, but for it's been a smooth ride so far.
  5. rnlf_in_space

    Problem with sleep

    @Luhan M., it will probably take weeks before you notice any difference. A single night is not going to change anything. Continuity is the key to good sleep.
  6. rnlf_in_space

    Problem with sleep

    I had problems sleeping, too. In hindsight, they may have started when I got my first smart phone. I started watching YouTube and whatnot late in the evening while already in bed but recently I am forcing myself to not look at my phone at least an hour before I plan to sleep. Instead I'm reading books (those things made from paper) for an hour. I've only been doing that for three weeks, but I believe it already improved the situation. I tend to fall asleep faster and then wake up a few minutes before my alarm, just like it used to be in highschool.
  7. rnlf_in_space

    Too Many Roads With No Map

    When you're just starting to learn programming and want to do so while making games, why not give LÖVE a try. It's a very powerful but relatively basic and easy to learn 2D game engine. It just takes a few minutes to understand the basics and get an image on screen and a few more to make the image move. It used Lua as its user programming language, which is a very small language that will allow you to focus on the basic principles of programming. But don't think it's a beginner language, it is tremendously powerful when used skillfully.
  8. rnlf_in_space

    Leaving a company at a critical moment

    During the interview for the job I have now, I told the interviewer that I felt it was my obligation to help my previous (then current) company finish an important project and asked them to let me start 2 months later. I expected that to be a problem for them, but quite the contrary: After the interview, they told me they had talked about that and found it meant I was a loyal person and that they felt assured that if I ever left the new company, I'd give them enough time to find a replacement, too. Have you tried talking to the new company about the issue? Maybe they are more open to it than you think.
  9. rnlf_in_space

    Convert functions to linux (gcc)

    I think you may want to use CLOCK_MONOTONIC_RAW instead of CLOCK_MONOTONIC. It doesn't make a huge difference, and mostlikely never causes any notiveable problems, but CLOCK_MONOTONIC may run slower or faster than "real" time, when the clock gets adjusted. Basically, a correctly implemented tool to set system time on a UNIX system will not just set the new time, but rather slow down or speed up the system clock to gradually go to the new time. This is so that there are no jumps in the system time, which will throw off a bunch of things on a UNIX system. CLOCK_MONOTONIC is subject to these adjustments, so you might experience a time where your game does not actually measure one second of realtime as one second, but rather as 1.1s or something like that. CLOCK_MONOTONIC_RAW is never sped up or slowed down.
  10. rnlf_in_space

    Convert functions to linux (gcc)

    There's clock_gettime in Linux. It gives you the time with nano-second resolution (but lower precision, usually), but clock_getres can be used to find the actual precision. You may want to use the clock named CLOCK_MONOTONIC_RAW to get the actual real time that has passed.
  11. rnlf_in_space

    Bit manipulation returning wrong data

    I'm not sure why you even want to go through all the trouble of packing your data like this. Just return a struct { int mouse_x; int mouse_y; } and you're done.
  12. rnlf_in_space

    Video codecs: compressing delta values

    I don't know much about the topic, but you don't actually need one extra bit for the difference if you wrap the difference around at the 1-byte border: The difference from 255 to 0 is -255, but can be expressed as +1: (255 + 1) % 256 = 0. The difference from 0 to 255 is +255 and can be expressed as that: (0+255) % 256 = 255. PNG does that for some row filter methods if i'm not mistaken.
  13. rnlf_in_space


    Yeah, this can all lead to an explosion of overloads very quickly. I think passing an std::string by value and then moving from that string to initialize your members has the best performance/effort ratio. This talk by Nicolai Josuttis illustrates the problem very nicely, even if for slightly more complex cases: In your case I'd probably just go with Str(std::string str) : m_str(std::move(str)) {}, that way you create one copy of your string at the call site and then just use the (comparatively) cheap move constructor to initialize your member. std::string only has an explicit constructor that takes a string_view though, so if you'll either have to create the string object at the call site, too, or overload with something like Std(std::string_view v) : Str(std::string(v)) {}. I'd prefer the first option (making the copy explicit at the call site) because it doesn't hide the extra allocations and memcpy.
  14. rnlf_in_space


    string_views never own. The ambiguity comes form the fact that you are creating a temporary object out of your string-literal. The compiler cannot figure out which of the two possibilities you want, either a string_view which will then be used to construct a new std::string in your constructor, or create a temporary string object and then move-construct your member from that. I don't see a good reason to use string_view here, you'll have to make a copy sooner or later anyway, why not create it at the call site and forgot about all the difficulties you are facing now?
  15. Unreal engine works fine on Linux. Epic even provides the build scripts and everything (IIRC, might have gotten them from a third party? But I don't think so).
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!