Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
My own try at A*
#21
No, that should work fine. Are you absolutely sure you're compiling the same program as you were with FBIde? All that FBIde does is run fbc.exe on the file you provide...
Reply
#22
Well, I copied it directly from the "Freebasic Projects" Folder to the "FreeBasic" folder. So I don't see why it wouldn't be the same file. Do me a favor, could you try to compile it once to see if it works? Or would that be too much trouble?
quote="Deleter"]judging gameplay, you can adaquately compare quake 4 with pong[/quote]
Reply
#23
I'll try it when I get home; I'm at work and don't have all my usual programming goodies set up at the moment, plus the mingw gdb download seems to be borked... Smile

EDIT: also notice that you are trying to PRINT "Press any key to continue" once per square in the draw routine...
Reply
#24
I compiled it and it worked fine except for the drawing part. I used gdb and got the following message:

Quote:Starting program: C:\Program Files\Freebasic\Proggies/board.exe
bff40000:C:/WINDOWS/SYSTEM/USER32.DLL
78000000:C:/WINDOWS/SYSTEM/MSVCRT.DLL
bfe60000:C:/WINDOWS/SYSTEM/ADVAPI32.DLL
bff60000:C:/WINDOWS/SYSTEM/KERNEL32.DLL
bff10000:C:/WINDOWS/SYSTEM/GDI32.DLL
Finding Path

Program received signal SIGSEGV, Segmentation fault.
0x4012b6 in t0084 () at proggies/board.bas:99
99 IF NOT Map((c.x + x),(c.y+y)).mType = Wall THEN
'If it is not a Wall square

I went to that line and couldn't see anything wrong with it, so I removed the "NOT" (useless probably, or was it???). I compiled it and then I ran it and got an error. I used gdb again and this is what it said:

Quote:Starting program: C:\Program Files\Freebasic\Proggies/board.exe
bff40000:C:/WINDOWS/SYSTEM/USER32.DLL(no debugging symbols found)...
78000000:C:/WINDOWS/SYSTEM/MSVCRT.DLL(no debugging symbols found)...
bfe60000:C:/WINDOWS/SYSTEM/ADVAPI32.DLL
(no debugging symbols found)...
bff60000:C:/WINDOWS/SYSTEM/KERNEL32.DLL(no debugging symbols found)...
bff10000:C:/WINDOWS/SYSTEM/GDI32.DLL
(no debugging symbols found)...
Finding Path

Program received signal SIGSEGV, Segmentation fault.
0x4012a6 in ?? ()

I hope someone understands this because I don't! Tongue
974277320612072617420666C61696C21 (Hexadecimal for those who don't know)
Reply
#25
TY for that Drv.

Rpgfan, that NOT is important. That statement checks to make sure that the square is not a Wall square. By removing the not, you're saying that you should only check it if it IS a wall square.

As for the errors, I have no clue what that means Tongue .
quote="Deleter"]judging gameplay, you can adaquately compare quake 4 with pong[/quote]
Reply
#26
I meant the fact that me removing it from the program shouldn't have changed the program from error-free (other than the drawing) to causing an error. Even after adding it back in, it still gave me an error. I would manually debug it (e.g. using PRINT and SLEEP) to trace your Map array and all of its values {this means "Map(x, y)", "Map(x, y).x" and "Map(x, y).y"}. *sigh* Too bad GDB isn't a GUI like QB's debugger. Otherwise, it'd be much easier. Smile
974277320612072617420666C61696C21 (Hexadecimal for those who don't know)
Reply
#27
Well, you're gonna laugh at this. I was using the wrong numbers on my board. So now, it turns out that it actually works. It displays the board and everything. But *sniff* it won't move. It's frozen.

Make a file called "board.brd" and put it in the same directory, then run it once. In the file put this:

Code:
20,15
0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0
0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0
0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0
0,0,0,5,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0
0,0,0,0,2,2,2,2,2,2,1,1,2,2,2,0,0,0,0,0
0,0,0,2,2,2,2,2,2,2,2,2,2,2,2,2,0,0,0,0
0,0,0,2,2,2,2,2,2,2,2,2,2,2,2,2,2,0,0,0
0,0,0,0,2,2,2,2,2,1,1,2,2,2,0,0,0,0,0,0
0,0,0,0,0,0,2,2,2,2,1,1,0,0,0,0,0,0,0,0
0,0,0,0,0,0,0,2,2,0,1,1,0,0,0,0,0,0,0,0
0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,6,0,0
0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0
0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0

Then let me know how it works for you.
quote="Deleter"]judging gameplay, you can adaquately compare quake 4 with pong[/quote]
Reply
#28
Another problem (boy, don't you just love me). Ok, I forgot to put a const ______ = 2 in there. So there was no such thing as 2 on that board. It also thought that that was a Chain of hill in the center, but it was supposed to be water. So now that I fix that, it can't find the path anymore :evil: . Grr...
quote="Deleter"]judging gameplay, you can adaquately compare quake 4 with pong[/quote]
Reply
#29
Ok ok. Sorry for all the posts. But I made it so it told me the coord. in the Path array after it had found the path, and guess what! It found the path correctly! I must not be going through the path right. Take a look at the main loop and tell me if you see anything wrong ok?
quote="Deleter"]judging gameplay, you can adaquately compare quake 4 with pong[/quote]
Reply
#30
Somebody post so I don't have to feel bad about posting so many in a row :wink: .

Anyway, I tried it on a new board, and it can't find a path. Hmm...

Code:
10,8
0,0,0,0,0,0,0,0,0,0
0,0,0,0,0,0,0,0,0,0
0,0,0,0,4,4,0,0,0,6
0,0,0,0,4,4,0,0,0,0
0,5,0,0,4,4,0,0,0,0
0,0,0,0,4,4,0,0,0,0
0,0,0,0,0,0,0,0,0,0
0,0,0,0,0,0,0,0,0,0
[/code]
quote="Deleter"]judging gameplay, you can adaquately compare quake 4 with pong[/quote]
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)