Jump to content
  • Advertisement
  • 06/09/16 01:14 AM
    Sign in to follow this  

    Math for Game Developers: Graphs and Pathfinding

    Math and Physics

    BSVino
    • Posted By BSVino
    Math for Game Developers is exactly what it sounds like - a weekly instructional YouTube series wherein I show you how to use math to make your games. Every Thursday we'll learn how to implement one game design, starting from the underlying mathematical concept and ending with its C++ implementation. The videos will teach you everything you need to know, all you need is a basic understanding of algebra and trigonometry. If you want to follow along with the code sections, it will help to know a bit of programming already, but it's not necessary. You can download the source code that I'm using from GitHub, from the description of each video. If you have questions about the topics covered or requests for future topics, I would love to hear them! Leave a comment, or ask me on my Twitter, @VinoBS
    The video below contains the playlist for all the videos in this series, which can be accessed via the playlist icon at the top of the embedded video frame. The first video in the series is loaded automatically

    Graphs and Pathfinding

    [playlist=PLW3Zl3wyJwWO7p6xpTzs-QR58DRg2Ln0V]


      Report Article
    Sign in to follow this  


    User Feedback


    You had me with the math discussion and the "Kahn Academy" style tutorial.  I think this is a great way to teach this stuff.  But when you started typing in the C++ code and explaining pointers, not using vectors with pointers, using indices for data, and then showing the code in memory, then I felt like you were trying to teach a beginner how to use the language using a Node/Edge data structure as a learning tool.

    Share this comment


    Link to comment
    Share on other sites
    I'm actually a big fan of your videos and I've recommended them to a lot of people in the past to help with understanding complex concepts like quaternions, etc. I think this is the first time I've seen you break to code though (maybe I've only watched ones where you don't), and although you did cover the basics of graphs, it really felt like you could have spent the 'code' time explaining a little bit more about graph basics, or even showing a simple BFS to get from A to B. (This is just referring to the first video in the series here. I'm sure you cover the bases by the end.)

    In any case, Budapest made me lol. I was expecting Byzantium.

    Please keep making videos.

    Share this comment


    Link to comment
    Share on other sites


    Create an account or sign in to comment

    You need to be a member in order to leave a comment

    Create an account

    Sign up for a new account in our community. It's easy!

    Register a new account

    Sign in

    Already have an account? Sign in here.

    Sign In Now

  • Advertisement
  • Advertisement
  • intellogo.png

    Are you ready to promote your game?

    Submit your game for Intel® certification by December 21, 2018 and you could win big! 

    Click here to learn more.

  • Latest Featured Articles

  • Featured Blogs

  • Advertisement
  • Popular Now

  • Similar Content

    • By JeZ-l-Lee
      Hi,
      We are working on a sequel to my all time favorite application:
      "Garry Kitchen's GameMaker" for the Commodore 64.
      (it's a very simple game creation IDE)
      Application builds and runs on Windows(R) and Linux.
      (the only dependency is SDL2 and there is a makefile included to build on any Linux)
      NOTE: This is a just started work-in-progress...don't expect too much
      We will be updating this thread posting as production progresses.
      Please post complaints and suggestions to this forum thread.
      This is our most ambitious project to date so don't expect a beta for at least 6-12 months...
      Thanks!
      JeZxLee
      www.FallenAngelSoftware.com
      If you are unfamiliar with this superb game creation IDE then please check out the wiki below:
      en.wikipedia.org Garry Kitchen's GameMaker
      Garry Kitchen's GameMaker is an IDE for the Commodore 64, Apple II, and IBM PCs, created by Garry Kitchen and released by Activision in 1985. The software is notable as one of the earliest all-in-one game design products aimed at the general consumer, preceded by Broderbund’s The Arcade Machine in 1982. Two add-on disks are available for the Commodore 64 version: Sports, and Science Fiction. These include sprites, music, and background elements for loading into GameMaker. To demonstrate the vers...
        You can download the current entire project below on GitHub:
      GitHub FallenAngelSoftware/SDL2-C64GKGM2
      100% FREE Cross-Platform Open-Source SDL2 Video Game Engine! - FallenAngelSoftware/SDL2-C64GKGM2
        Here is a screenshot:

    • By Enerjak
      I decided to write a small program that writes a vector to a binary file. However, I'm having some issues with the code. Here is what I have so far:
      #include <iostream> #include <map> #include <string> #include <vector> #include <cmath> #include <math.h> #include <fstream> using namespace std; class Book { protected: string m_pBookTitle; string m_pAuthor; string m_pGenre; int m_pNumberOfPages; public: Book() : m_pBookTitle(""), m_pAuthor(""), m_pGenre(""), m_pNumberOfPages(0){} Book(string title, string author, string genre, int numPages) : m_pBookTitle(title), m_pAuthor(author), m_pGenre(genre), m_pNumberOfPages(numPages) { } ~Book(){} string getBookTitle() const { return m_pBookTitle; } string getBookAuthor() const { return m_pAuthor; } string getBookGenre() const { return m_pGenre; } int getNumPages() const { return m_pNumberOfPages; } }; int main(int argc, char** argv) { vector<Book*> Books; Book* book1 = new Book("The man with a dog", "Robert White", "scifi", 300); Books.push_back(book1); Book* book2 = new Book("Just got here", "James Hancock", "Fantasy", 100); Books.push_back(book2); Book* book3 = new Book("The Girl with the Dragon Tattoo", "Eddinton Carlos","Fiction", 500); Books.push_back(book3); cout << "Number of books: " << Books.size() << endl; ofstream bookFile; bookFile.open("Books.book", ios::binary); if (bookFile.is_open()) { for (vector<Book*>::iterator i = Books.begin()+1; i != Books.end(); i++) { bookFile.write((char*)&(*i), sizeof((*i))); } } bookFile.close(); ifstream bookFileIn; bookFileIn.open("Books.book", ios::binary); vector<Book*> LoadedBooks; if (bookFileIn.is_open()) { Book* book = nullptr; while (!bookFileIn.eof()) { bookFileIn.read((char*)&book, sizeof(book)); LoadedBooks.push_back(book); } } bookFileIn.close(); for (vector<Book*>::iterator i = LoadedBooks.begin(); i != LoadedBooks.end(); i++) { Book* b = (*i); cout << "Book title: " << b->getBookTitle() << endl; cout << "Book Author: " << b->getBookAuthor() << endl; cout << "Genre: " << b->getBookGenre() << endl; cout << "Number of pages: " << b->getNumPages() << endl; } cout << "Number of books: " << LoadedBooks.size() << endl; system("PAUSE"); return EXIT_SUCCESS; } This is what happens with the +1:
      http://puu.sh/ChluR/3c42a42137.png
      And removing the +1:
      http://puu.sh/Chlwz/ed52d85cdb.png
      The problem is that one of the books gets added twice. Someone in the Discord server I'm in said that I can't do bookFile.write((char*)&(*i),sizeof((*i)) because the book has non trivial types such as strings. What should I do?
    • By IGotProblems
      I am curious, if anyone would be interested in an RPG Adventure in a visual novel art style?
      I loved Doki Doki and if I could create something in an RPG element, that would be THE BEST.
      I am a complete noob however, that is the thing. Like I just started adventuring into coding two weeks ago. I love it so far.
      I think I may be addicted. oof. Which is why I want to create something I have that itch. lol.
      Basically if anyone who wants to pitch in for free, or not I'd be glad to include them in the credits section.
      Also, I'd love to get the community involved in this, to create more fun RPG-esk things if that makes sense.
      Where would I go for that?
    • By komires
      We are pleased to announce the release of Matali Physics 4.4. The latest version introduces comprehensive support for Android 9.0 Pie, iOS 12.x and macOS Mojave (version 10.14.x). Latest version also introduces Matali Render 3.4 add-on with normal mapping and parallax mapping based on the distance from the observer as well as other improvements and fixes.
      What is Matali Physics?
      Matali Physics is an advanced, multi-platform, high-performance 3d physics engine intended for games, virtual reality and physics-based simulations. Matali Physics and add-ons form physics environment which provides complex physical simulation and physics-based modeling of objects both real and imagined.
      Main benefits of using Matali Physics:
       Stable, high-performance solution supplied together with the rich set of add-ons for all major mobile and desktop platforms (both 32 and 64 bit)  Advanced samples ready to use in your own games  New features on request  Dedicated technical support  Regular updates and fixes
      You can find out more information on www.mataliphysics.com

      View full story
    • By irreversible
      I'm what you might consider a "casual prosumer" when it comes to commenting. I comment important stuff, but only if the code isn't written in a self-explanatory way. Which is why I've also adapted a really simple and descriptive naming scheme and done away with any and all notation systems. 
      That being said, there are occasions where I want to either document a whole system of code or provide a summarized walk-through on a per-function basis. This is where I find myself in a frustrating spot since none of the solutions on the market seem to be quite for what I want. So I figured I'd list things I want to achieve and what I want to avoid in hopes that I'm either not familiar with something or perhaps am simply not configuring stuff properly.
      I'm willing to pay for a good solution. 
      The dream wish list of things I want and need:
      full documentation generation, a la Doxygen a non-verbose (lightweight) and non-monolithic style non-XML style markup (eg the way Natural Docs does it, not Doxygen) no block comments in documentation (I use block comments extensively to manage code flow during development) partial documentation (I really don't want to provide an explanation for each and every argument and return type) a concise format with a clear layout, so no \param and \return shenanigans automatically filled in for me no duplication of obvious information (eg the function name) in the comments inline documentation no explicit flow direction (in/out/inout) in documentation, but rather taken directly from code - I already provide this information! proper macro expansion I've tried Atomineer and it doesn't work for me at all. So far the Doxygen style in general is pure bloat in my eyes since it becomes bothersome to maintain as soon as you make something as simple as a name change. Allow me to demonstrate by example:
      Here's what a typical function in my code might look like:
      _BASEMETHOD ECBool OnInitialize( IN MODIFY ResourceType& object, IN const char* type, OPTIONAL IN ISignalable* signalable = nullptr, OPTIONAL IN uint32 flags = 0) const { ... } _BASEMETHOD expands to 'virtual'. Atomineer doesn't handle this too well since it is adamant about placing the documentation below that line unless I take care to actually generate it on the word _BASEMETHOD itself.
      Here's the default "trite" Atomineer generates:
      /// Executes the initialize action /// /// \author yomama /// \date 12-Dec-18 /// /// \tparam ResourceType Type of the resource type. /// \param [in,out] {IN MODIFY ResourceType&} object The object. /// \param {IN const char*} type The type. /// \param [in,out] {OPTIONAL IN ISignalable*} signalable (Optional) If non-null, the signalable. /// \param {OPTIONAL IN uint32} custHandlerFlags The customer handler flags. /// /// \return {ECBool} An ECBool. This is close to being the least useful way to say what the function actually does. None of the auto-generated stuff makes sense, because it's already obvious from the names. In addition, data flow direction is assumed, not extrapolated from markup that already exists in the code (notice the in/out of signalable while certain conditions might force me to accept a non-const pointer, which is nevertheless never written to). The return type is obvious. Even the general description is obvious to the point of being insulting to the reader. 
      Of course this is all meant to be manually edited. However, the problem is that:
      1) on the one hand, writing this stuff from scratch using this style of markup is time consuming and annoyingly verbose.
      2) auto-generating the template and editing is also time consuming, because again, it's way too verbose.
      Here's what an ideal way of commenting the above function looks to me:
      /// Fill \p object with data and notify \p signalable once the procedure is complete. Runs asynchronously. _BASEMETHOD ECBool OnInitialize( IN MODIFY ResourceType& object, IN const char* type, OPTIONAL IN ISignalable* signalable = nullptr, /// Type-specific flags. See documentation of related resource type for possible values. OPTIONAL IN uint32 flags = 0) const { ... } That's it. This should be enough to generate feature-complete documentation when the docs are finally built. AND it's easy to read inline while writing code.
      A major hurdle is that while I actually kinda like the Natural Docs style, to the best of my knowledge it's only able to generate documentation for things that have actually been manually documented. Facepalm. So no automatic full documentation of classes, inheritance diagrams, etc. This seemingly forces me into using Doxygen, which is much more feature complete, but suffers from the abovementioned stylistic bloat and for some reason cannot handle relatively simple macro expansions in imo-not-so-complicated cases. I simplified the following from a real world example, but this includes auto-generated class implementations, eg:
      BEGIN_DEFAULT_HANDLER(foo) _BASEMETHOD const char* bar() const _OVERRIDE { return "yomama"; } END_DEFAULT_HANDLER(foo) which might expand into something like ---------> class foo : public crpt_base<foo> { base_interface* GetInterfaceClass() const _OVERRIDE { _STATIC foo_interface if; return &if; } _BASEMETHOD const char* bar() const _OVERRIDE { return "yomama"; } }; extern "C" _DLLEXPORT base_class* _fooFactory() { return static_cast<base_class*>(new foo); } Doxygen doesn't even recognize foo as a class.
      The bottom line is it seems to me I shouldn't be asking for too much here. I'd really like the clear coding style I've adopted to pay off in more than just the code.
      What's your approach? Any suggestions? Ideas or alternative options to explore?
×

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!