Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / 3D puzzle game - A* programming needed

Author
Message
Red general
23
Years of Service
User Offline
Joined: 19th Nov 2002
Location: United Kingdom
Posted: 13th Jul 2003 00:37
I am making a 3D puzzle game - like discworld noir, or the broken sword but in 3D.

The room and its items are made out of several objects (.x), as I lack a free editor that accepts .X

I would like to make a object move around the room to where I click. When I click on an object he can interact with, the object should then move near it.


Is there a way of doing this?
My computer melts regulary - perhaps it likes being fondue
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 13th Jul 2003 00:50
If you are using a grid-based system, you can use my A* code in code-snippets. Otherwise, you can try Mr Flibbles way-point based system.
flibX0r
23
Years of Service
User Offline
Joined: 14th Feb 2003
Location: Western Australia
Posted: 13th Jul 2003 09:39
Thnx for the metion Ian. You can find both of our methods in the Code Snippets section. Some time soon i'm gonna convert my algorithm to work as a grid based system, which won't be hard.

"Time not important only life important...
I have no life so time is irrelevent..."
Twin P4 Xeon 2.0 Ghz, GeForce Quadro4 XGL 128MB, 1Gb DDR RAM, Twin 19" Flat Screens
Red general
23
Years of Service
User Offline
Joined: 19th Nov 2002
Location: United Kingdom
Posted: 13th Jul 2003 23:48
Mr Fibble, when i tried to use your system, it seriously went wrong. I have no idea why, must have been something I did.

I will try IanM's system next

RED GENERAL

My computer melts regulary - perhaps it likes being fondue
Red general
23
Years of Service
User Offline
Joined: 19th Nov 2002
Location: United Kingdom
Posted: 16th Jul 2003 21:30
Seems to work very well ianM, but how do you move a waypoint later on after it has been defined (eg. in the DO LOOP, you click somewhere and the waypoint moves there and the bot carries on to the new waypoint position) - I don't seem to be able to do this.
Any ideas?

My computer melts regulary - perhaps it likes being fondue
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 16th Jul 2003 21:43 Edited at: 16th Jul 2003 21:50
Basically, every time you reach the waypoint, you decide where you want to go next (or wait to be instructed).

When you know where you want to go, just do another search, then follow that path to it's end.


Found = SearchMapAStar8(0,SourceX,SourceY,TargetX,TargetY)

Where SourceX/Y is where you are and TargetX/Y is where you want to be.

Maybe I'll update that waypoint code I included in the post...

[EDIT]Doesn't need it ... all the benefits of planning your interface before coding anything [/EDIT]
Red general
23
Years of Service
User Offline
Joined: 19th Nov 2002
Location: United Kingdom
Posted: 17th Jul 2003 20:30
Can you give me a sample code as I'm still having problems with it.

My computer melts regulary - perhaps it likes being fondue
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 17th Jul 2003 20:46
Um, well the code is in the post. Here it is all in one source file.

I've reduced it to one bot to make it easier to see it travelling.
Red general
23
Years of Service
User Offline
Joined: 19th Nov 2002
Location: United Kingdom
Posted: 18th Jul 2003 13:34
Thanks
RED GENERAL

My computer melts regulary - perhaps it likes being fondue

Login to post a reply

Server time is: 2026-07-21 12:49:43
Your offset time is: 2026-07-21 12:49:43