• Advertisement

Kercyn

Member
  • Content count

    35
  • Joined

  • Last visited

Community Reputation

453 Neutral

About Kercyn

  • Rank
    Member

Personal Information

  • Interests
    Art
    Audio
    Business
    Design
    DevOps
    Education
    Production
    Programming
    QA
  1. Improving 2D raycasting performance

    You can find the source code here. What I'm doing is applying a reverse-rotation to the ray, so that I can treat the problem as a ray vs AABB collision. Then I'm implementing the algorithm described here. It may not be the fastest or most efficient implementation, but for my current needs, it's "good enough".
  2. When you erase an element, check if your container is empty and notify appropriately.
  3. For such specific legal issues, I think the safest option is to consult a lawyer. I'm sure there are people in this forum than can answer your question, but I doubt "XYZ on gamedev told me so" would be an acceptable legal defence in case something goes wrong.
  4. Improving 2D raycasting performance

    I was struggling with this for a couple of days, but I finally decided to replace my algorithm with a much simpler one that runs way more efficiently. Thanks for the guidelines!
  5. Improving 2D raycasting performance

    Thanks for the reply. It's too late right now to check your suggestion so I'll do it tomorrow. For the const auto& issue, I replaced all autos in the first post with their actual type. I'm also including the headers used in the snippets above, just in case. PCollisionLayer Line EDIT: I tried what you suggested but unfortunately all I got was a fancier way of viewing what already existed in the call stack table. My main concern is that my entire approach is wrong, since the "hottest" line ends up being a range-based for.
  6. Hello everybody. I have implemented a 2D raycasting algorithm in my game engine but I must be doing something very wrong, since my game is pretty much unplayable if I cast around 10 rays each frame (it runs fine at around 5-6 casts per frame). I tried profiling but, as you can see from the two pictures, I ended up on STL territory, which tells me that the performance issues arise from my approach to the problem. I'm using the Sweep-and-Prune algorithm for my broadphase detection, which divides my entire map into sections, and colliders inside a section are only checked for collisions with other colliders from that section. This approach is used in my raycasting algorithm as well. Initially, I get a list of all colliders inside the raycast's radius and then I check the ray against every collider in that list. As far as I understand it the problem lies not in the Ray vs. Shape checks, but in the preparation work before that. Any tips or guidelines on how to correct my approach, or specifics of the algorithms, are most welcome. Thank you in advance. Raycast BroadCircleToOBB SOBB::GetSupportPoint
  7. There are tons of free assets that you and your son can use to make your game without spending anything. Sure, the art style of some assets will not completely match the style of other assets, but you can't have everything. You might want to take a look at OpenGameArt or here.
  8. You could try loading the entire file into a vector of strings, then using std::replace_if with an appropriate predicate to do the replacement for you. For your predicate, you could use a lambda that captures your alternative words list, and then checks the current string in the vector and replaces it if needed.
  9. Absolute beginner to C. Need help

    1) C# and C++ are not variations of C, they're completely different languages with completely different mindsets. Sure, there are similarities but they quickly disappear once you go past anything trivial. Both C++ and C# are used for game development, but if you're just beginning don't care about C++ at all and start with C# and Unity. 2) You can, of course, write everything in Notepad++ or any other text editor, but there are specialized programs for programming called IDEs (Integrated Development Environment). IDEs offer a lot of tools that make your job a lot easier. A very popular IDE for both C# and C++ is [url="https://www.visualstudio.com/"]Visual Studio[/url]. 3) The code you write in a file is not the actual code run by the computer. Computers understand only sequences of 0 and 1, so in order for a computer to run your program, it must transform the code you write into 0s and 1s.This process is called compilation and the program that performs it a compiler. There's more to it, obviously, but this is the general idea. I'd suggest reading up on version control, what it is and why it's useful. If, when you read good code or design practices etc, you find an article that tells you "X is bad, do Y instead" and you don't understand why or you intuitively find X to be better, don't blindly do Y without understanding why. It's better to do X and see for yourself why X is bad and why Y is better. Don't start big; start small, with reasonable aims. Big is going to come, eventually.   PS. You can also read the [url="https://www.gamedev.net/reference/faq.php/_/for-beginners-r1"]FAQ[/url].
  10. Creating levels with Tiles

    I'm using Tiled to design maps for my current project. You must be doing something wrong (exactly [i]what[/i] you're doing wrong we can only guess) if you encounter a performance problem with this. You can try the following approach: Load the TMX file contents into a buffer. Use an XML parser to parse it and populate various structures that describe everything you need to know about the map (tile positions, layer information, paths to tilesets etc). I use rapidxml for parsing. Locate, load and store any assets you're going to need for your current map (which generate the appropriate textures for your tilesets, but you may have other assets that you define in the map) All of the above is done once, when you load a new map. Now, in every frame, you can traverse the map structures and render the appropriate section of the map.
  11. MMORPG

    I'd swear I've seen this exact topic a month or so ago.
  12. Need game idea help

    A billiard game?
  13. Simple binding of functions to C++

    Check out [url="https://github.com/jeremyong/Selene"]Selene[/url], it's very easy to set up and use.
  14. TicTacToe game attempt review

      [url="http://stackoverflow.com/questions/10231349/are-the-days-of-passing-const-stdstring-as-a-parameter-over"]Relevant[/url] for std::string.
  • Advertisement