• Advertisement

CrazyCdn

Member
  • Content count

    1423
  • Joined

  • Last visited

Community Reputation

1303 Excellent

3 Followers

About CrazyCdn

  • Rank
    Contributor

Personal Information

  • Industry Role
    Programmer
  • Interests
    Programming

Social

  • Twitter
    @CrazyMadCoder
  • Github
    https://github.com/CrazyCdn
  1. Again, you've not once explained why you're using the most in-efficient in-secure method known to man in the C language. Are you limited to C99 only? You tagged this as C++, use C++ it has much easier, and much more secure methods to solve this problem. And they've already been posted in this thread. I'm not sure why you're still battling this fight which you're ultimately never going to win (it will always be very insecure and a possible source of serious bugs).
  2. It's honestly not that bad. Until a profiler tells you to, just use the STL containers. It's not that difficult to replace later if you implement the same standard interfaces either. There are also quite a few useful additions to C++ (and others you don't have to use either), lambda's being one nice thing along with std::function (when not used excessively) and constexpr. You can still quite easily develop for iOS/Android using C++, it's actually slightly easier now too with Visual Studio's supporting both platforms, along with GCC or clang compilers. We used to have 3Dfx, OpenGL and DirectX. Now we have Metal, OpenGL (being phased out eventually), Vulkan and D3D. One more contender, not horrible. And as you mentioned, Vulkan is now wrapped on MacOS/iOS over Metal so you don't even have to learn that. Based on this NDA free PS4 guide it looks like the PS4 supports GNM but Sony has said it is committed to offering Vulkan support (maybe for their next console). As you mentioned XBox One uses D3D. So honestly it's kinda down to Vulkan, OpenGL ES for Android (but they're moving to Vulkan too) and D3D. Also, why are you changing "clean C code" into "C++ monster" code? If it works, it works. As to answer the OP'er @Fleshbits, the D3D SDK kinda still exists, just comes with Windows. I would personally go Vulkan, that way you can work on most platforms. That or D3D11. There are plenty of resources for both though. I'm with you on Unity/UE4
  3. What you typically want to do is work out the scaling factor in both x and y directions and as you load any textures/models scale them at that time. In the very rare case someone changes resolution mid-game, I would just destroy then reload all your assets. You can then save this information into a file for the next game load also. No need to keep any object specific variables around just a global scale factor for loading purposes. The only other thing that needs to be recalculated might be the hit boxes or AABB's. Why would your physics change? Would physics change if you were to zoomed in? Does gravity for instance change based on resolution? Things should move at the same speed regardless of resolution. Unless you're modeling the universe and expecting centimeter resolution there should be no accuracy issues across hardware. Crashlands transitions from PC to mobile very well without issues and it was released in 2016. And if you're only worried about accuracy for the very small fraction of floating point values that are visible on the screen you would be fine with 1980s hardware. I assume they're talking about when working with sprite sheets, which I think is a little to advanced for you at this point in time imo. But for Mipmap generation you'll want to use trilinear filtering as mentioned by @Scouting Ninja.
  4. Since you're using C++, use C++: std::string str("This is a string"); char *cstr = new char[str.length()+1]; std::strcpy(cstr, str.c_str()); Also note you forgot the +1 on your allocation. You are aware you can send information over the sockets like, the next data sent will be text, or binary and then send text or binary so you do not have to butcher the text data like you are, right? It's very little extra code too.
  5. This has nothing to do with OpenGL and everything to do with how you're doing it. You need to keep a copy of the last frame rendered and display that during those 9 frames you do not want to re-render. But again, this will likely not solve your issue. You'll just display 6 frames a second if it's running at 60 fps. You will want to not clear your framebuffer unless you're on that specific render frame. Also, @astromop's code will not slow execution, if you use it correctly it will bypass the expensive rendering pass thereby speeding up your code. Are you using a profiler? If so, lets see the code and profiler information so we can compare your previous version to the one using code similar to his.
  6. How to optimize code

    First off, why are you using D3D9? D3D10 is like 12 years old now, I would recommend D3D11 if your OS supports it. There is really not much knowledge that will transfer over to newer, modern, APIs so it's really kinda pointless to learn at this point in time. Secondly there is no way to really optimize that code, it should be run once (outside of certain situations).
  7. Since no one else addressed this question, no! No it is not okay to disable it, it exists for a reason, you have a bug in your code. Now the release mode version might be compiling it away, but that does not mean it is gone or no longer exists. You might not have hit it yet. I can honestly say, in over 20 years of programming not recall an instance where a bug found in a debug build was not a legitimate bug that could have in the right scenario been a bug in release too and much harder to track down. Find it in debug mode, it's much faster and easier then in release later down the line. Now if you want actual help, you're going to have to help us. Post some code, as multiple people have requested, one cannot make any conclusions other then those provided from your dearth of code.
  8. Problem serializing small ammount of data

    Also, why are you saving out terrain information, unless it's being changed by the player, but then just save the delta's not the whole terrain. Also, unless you're writing out a character name, this should all be done in binary as everyone else has said/suggested. Also as mellinoe asked, all your model data is held in memory not as strings but as bytes, correct? Then just write them out as bytes, don't do this bytes->(save)string->(load)string->bytes conversion that is horrifically slow.
  9. In general no one is going to steal your game idea, ideas are a dime a dozen honestly. You can put copyright notices in a corner of your assets you post online (images) which should cover you and see what other companies do for their logos, I never worried about it with my previous company as the company name was the logo... But I'm also not a lawyer and I would recommend consulting one.
  10. Marketing idea

    Welcome to 2016, this is being done in a quite a few AAA games. Typically called microtransactions, you can either grind or pay.
  11. Some cameras are always kept at 0, 0, 0 and the world moves around them. Set a break point after the GetTransform function and see what the values are before the inverse and see if they make sense. I'm not a D3D guy so YMMV.
  12. Has anyone read the Game Coding book?

    The forth edition of this book sits on my desk from time to time. I like how they layout their visual studio projects but don't make new ones often enough to have all the variables used memorized. I also have Real-Time Rendering and Game Engine Architecture in the same stack. But as for a beginner book, I would not recommend it no. I also own the 3rd edition on my kindle of Game Coding Complete, and I didn't notice a ton of differences between them myself. But I've not read the 4th edition front to back like I did the 3rd.
  13. Not just post the solution, but fix the topic so it is once again searchable...
  14. IRC Recommendations

    @TheComet You forgot to mention no quotes around any of the commands, ran across people having issues with this in the past so thought I would mention it. @Brian That is awesome, I started around 1997 on Undernet, ended up running #Partyhouse for about 5 years.
  15. Batch rendering of all similar tiles might be a major win too, even when zoomed in. But most definitely profile the code to see where the bottle necks are, guessing is rarely a viable or useful solution
  • Advertisement