Results 1 to 7 of 7

Thread: A*

  1. #1

    Thread Starter
    Addicted Member CodeRonin's Avatar
    Join Date
    Jul 2002
    Location
    Vienna, Austria
    Posts
    233

    A*

    Hi there...

    did anyone of you guys ever attempt to code the A* algorithm or any similar pathfinding algo in assembler? (I know this is hardcore, just thought I'd ask...)
    Code Ronin

  2. #2
    Fanatic Member
    Join Date
    Jan 2003
    Posts
    1,004
    Well, it is possible, but that would require me to create a lot of the game in assembler.

    Why do you ask?
    "Can't" and "shouldn't" are two totally separate things.

    All questions should be answered. All answers should be true. That is why I post.

  3. #3
    Lively Member Brandito's Avatar
    Join Date
    Nov 2000
    Location
    Here, There, Every Where!
    Posts
    106
    I was going to code minimax() in asm but I realized it is not worth it... you can get a compiler to optimize your code in ways that you would never think of. Knowing that my code would most likely run faster being compiled from a high level language has totally changed my view on using asm for speed. I assume that is what you are hoping for.

    Just curious, what are you applying a* too?
    Master of Cyber Fu - A Temple of Digital Chi

  4. #4
    G&G Moderator chemicalNova's Avatar
    Join Date
    Jun 2002
    Location
    Victoria, Australia
    Posts
    4,246
    You wouldn't have to exactly write most of the game in assembler. You would just have to pass the hDC's of each object to a function inside an ASM dll and then manipulate them then. The pathfinding wouldn't be as hard as you think, since its just the same for any other language. All thats required is a little bit more code.

    But then again, it kinda depends on what compiler you use..

    Phreak

    Visual Studio 6, Visual Studio.NET 2005, MASM

  5. #5

    Thread Starter
    Addicted Member CodeRonin's Avatar
    Join Date
    Jul 2002
    Location
    Vienna, Austria
    Posts
    233

    Ok...

    First, you don't have to pass HDC's at all - because second: I'm using A* as a pathfinding algo. Third, I never thought I could write fater code than the BorlandBuilder oder VisualC++ do - I was just curious if anyone attempted something like this before.

    (@ First: My entire map is saved independently from the graphics - that is, not exactly, I'm using DirectX9 Sprite elements inside my class, but you don't exactly need to pass a HDC because the terrain graphics are completely unimportant when it comes to pathfinding - it's the data behind them that counts.)
    Code Ronin

  6. #6
    G&G Moderator chemicalNova's Avatar
    Join Date
    Jun 2002
    Location
    Victoria, Australia
    Posts
    4,246
    When I said pass the hDC's, I was referring to writing the game in mostly assembler. I meant that you could write the pathfinding in something like C++ and then just have the graphics part of it in ASM, or something similar.

    Phreak

    Visual Studio 6, Visual Studio.NET 2005, MASM

  7. #7
    Fanatic Member
    Join Date
    Jan 2003
    Posts
    1,004
    If you are using C++ and you are just going to use the same API calls in assembler as you would in C++ and you are going to code a good portion of your algoritm in C++, then why are you considering an assembler over a compiler. You could always use the asm statement in C++.
    "Can't" and "shouldn't" are two totally separate things.

    All questions should be answered. All answers should be true. That is why I post.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width