|
Thread: A*
-
Sep 20th, 2004, 05:18 AM
#1
Thread Starter
Addicted Member
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...)
-
Sep 22nd, 2004, 12:48 PM
#2
Fanatic Member
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.
-
Oct 28th, 2004, 12:38 AM
#3
Lively Member
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
-
Oct 28th, 2004, 02:39 AM
#4
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
-
Oct 28th, 2004, 05:08 PM
#5
Thread Starter
Addicted Member
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.)
-
Oct 28th, 2004, 11:15 PM
#6
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
-
Nov 3rd, 2004, 12:29 PM
#7
Fanatic Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|