Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   Future Improvements (https://forums.graalonline.com/forums/forumdisplay.php?f=10)
-   -   Multitasking (https://forums.graalonline.com/forums/showthread.php?t=15665)

Tyhm 10-29-2001 02:42 AM

Multitasking
 
This one's more so I can get a concensus than anything else; what do you guys think about me making a pathing NPCW? It wouldn't be TOO difficult, use the string parsing commands to figure out how many levels away your destination is, and use onwall to find a way from one side of the level to the other...the current world isn't TOO complicated, the only new command I'd need is for onwall() to work like tiles(), so you can feed in a negative value or a >64 value and it'll check the next level over, then a simple bidirectional search and a few static destinations, wouldn't be too difficult. Good practice too. Just take more time than I have, but eh.

The upshot of this is that your Graalian would do the walking for you, Starcraft style. You set your destination to Bomboria Square, and it walks while you talk to your friends, etc.
Maybe it'd work with the go-karts? Press A for Autopilot? ^_^

DoragonKoden_RC6 10-29-2001 03:31 AM

Re: Multitasking
 
Quote:

Originally posted by Tyhm
This one's more so I can get a concensus than anything else; what do you guys think about me making a pathing NPCW? It wouldn't be TOO difficult, use the string parsing commands to figure out how many levels away your destination is, and use onwall to find a way from one side of the level to the other...the current world isn't TOO complicated, the only new command I'd need is for onwall() to work like tiles(), so you can feed in a negative value or a >64 value and it'll check the next level over, then a simple bidirectional search and a few static destinations, wouldn't be too difficult. Good practice too. Just take more time than I have, but eh.

The upshot of this is that your Graalian would do the walking for you, Starcraft style. You set your destination to Bomboria Square, and it walks while you talk to your friends, etc.
Maybe it'd work with the go-karts? Press A for Autopilot? ^_^

That's a neat idea, maybe they could set up a new command
to "read" the map based on how it is, ie, maplevel(x, y) could
return the level at that position on the map. Then you could
easily come up with the distance from yourself to that level.

Tyhm 10-29-2001 07:54 AM

It'd be really simple, that part.
You enter the Go-Kart, say Bombaria, hit A, and it goes.
What it does is it compares "Bombaria" to its database of waypoints, translates it to "a-6" or whatever, then uses the ASCII of the current level letter (say you're in g-2), a-g=1-7=-6, *64=384, -(x-targetx) for the exact...same for the y, and you'll have the exact coordinates relative to your current level to search for a path to.

Admins 10-29-2001 09:12 AM

Re: Re: Multitasking
 
Quote:

Originally posted by DoragonKoden_RC6


That's a neat idea, maybe they could set up a new command
to "read" the map based on how it is, ie, maplevel(x, y) could
return the level at that position on the map. Then you could
easily come up with the distance from yourself to that level.

There is something like onmapx(level) and onmapy(level) or so

Tyhm 10-29-2001 09:31 AM

Thwarted again by my ignorance of the spiffy P2P commands! Darn!

I assume onmapx(level) and onmapy(level) returns the level's X and Y on the map? So onmapx(graalmap_a-1.nw) or whatever would return 1, and onmapy(graalmap_a-1.nw) would return 1, etc?

Of course, that part I can do anyway just with the level names, since G2K1 is so nicely arranged...it would only be the onwall(-384,-384) that I'd need to make this work really nicely! Otherwise I suppose I could just use an uninformed search strategy, have the player keep wandering in approximately the right direction.....

freddyfox 10-29-2001 01:10 PM

How about horses that go on a destinated path?

You can buy a ticket for, say, 3 gralats.

adam 11-25-2001 01:27 PM

You done yet?

I wanna see :)

Spark910 11-25-2001 10:02 PM

0.o.O
 
Slow down everything will be autopiolet else made not a horse but a Horse and cart 5g a graalian day that way its noo jsut a horse.

Tyhm 11-26-2001 10:36 AM

......rrriiiiiiiight

Haven't even started yet, really. Stupid finals.

adam 11-26-2001 04:59 PM

Quote:

Originally posted by Tyhm
......rrriiiiiiiight

Haven't even started yet, really. Stupid finals.

Understood

*looks at time*

I decided not to sleep today.... too much to do

*is totally serious I am not sleeping....*

look it's 5 am already and I goto work at 11 am.

adam 05-08-2002 11:23 AM

Im still waiting for this to get done Tyhm. You have some more finals?

:cool:

Frolic_RC2 05-08-2002 09:06 PM

Hmm...couldn't you use something like the A* pathfining technique?

Assign numbers from your current location to destination, all going fown one number. Destination is 8 tiles away, where you are would be 8, destination would be 0. From 8 you move to 7, things like that, and you could only move from a bigger number to smaller. And assign -1 to onwall...

I been meaning to try making something like that, never bothered though, mainly because I want a 2d array =P. I know it can be simulated, but it would be spiffy to have 2d arrays.

adam 05-08-2002 09:24 PM

Quote:

Originally posted by Frolic_RC2
Hmm...couldn't you use something like the A* pathfining technique?

Assign numbers from your current location to destination, all going fown one number. Destination is 8 tiles away, where you are would be 8, destination would be 0. From 8 you move to 7, things like that, and you could only move from a bigger number to smaller. And assign -1 to onwall...

I been meaning to try making something like that, never bothered though, mainly because I want a 2d array =P. I know it can be simulated, but it would be spiffy to have 2d arrays.


The pathfinder tyhm create will be able to track between many levels. not just within one level.

This one == hard to make if he has to go around a few levels to get to the one the player is in.

Falcor 05-08-2002 09:26 PM

Hmm this seems a little complex thym. You saying this will perfectly find a path? What if no path exsists. What if the path needs to go backwards before it goes forward. Its eems simple in concept but its almost crazy if you have too many walls.

Saga2001 05-08-2002 10:39 PM

Quote:

Originally posted by Falcor
Hmm this seems a little complex thym. You saying this will perfectly find a path? What if no path exsists. What if the path needs to go backwards before it goes forward. Its eems simple in concept but its almost crazy if you have too many walls.
What if there were no path! x_x or what if there was no logical links to het there...
It could be harder then you may think, plus people may set their destination and go afk...:-/

Spark910 05-09-2002 12:29 AM

Add a built in PK Sytem that kills anyone who touches your ass while your on Autopilot! Or if people come within 4graal people space of you lots of killer ants come out and eat the person who comes to you alive...

Kaimetsu 05-09-2002 04:42 AM

On NW I decided that a waypoint system would be the best way to do pathfinding. How else could you get the NPC to respect things like roads and whatever? So, in that case, you wouldn't even need onwall et al. And it'd be really easy to write an algorithm for it - I already wrote one for NW :)

Frolic_RC2 05-09-2002 06:02 AM

Quote:

Originally posted by Kaimetsu
On NW I decided that a waypoint system would be the best way to do pathfinding. How else could you get the NPC to respect things like roads and whatever? So, in that case, you wouldn't even need onwall et al. And it'd be really easy to write an algorithm for it - I already wrote one for NW :)
Thats the second thing I would have said, way points...

But even then you need something like the A* Algorithm...what if something blocks the way to the next waypoint? You need to find an different way to then get to the waypoint.

Kaimetsu 05-09-2002 06:16 AM

Quote:

Originally posted by Frolic_RC2


Thats the second thing I would have said, way points...

But even then you need something like the A* Algorithm...what if something blocks the way to the next waypoint? You need to find an different way to then get to the waypoint.

You'd use A* either way. For waypoints OR tiles.

Falcor 05-09-2002 07:19 AM

waypoints work. but it takes a lil time to put them on =\. If ther was a way to make it so you didnt have to have waypoints it would be cool.

Tyhm 05-11-2002 01:03 PM

I finished my Java pather. Does a horrible awful disgusting painfully bad job of reducing its world to waypoints, then connecting them as necessary. It's somewhere like http://www.iub.edu/~roboclub/ or something - a simple best-first search, removing expanded waypoints and building a list of possible paths, works really well. Might be tricky in a language without vectors - you'd have a finite number of possible paths and a finite path length - but doable.

Kaimetsu 05-11-2002 01:12 PM

Quote:

Originally posted by Tyhm
Might be tricky in a language without vectors - you'd have a finite number of possible paths and a finite path length - but doable.
I already made one. It's actually pretty easy, and we can make our own thing to do the same thing as Vectors if we want. It's not like it's a primitive class, they still just throw numbers around. The fact that we can redimension GScript arrays without losing the contained data makes it a cinch.

adam 05-17-2002 01:01 PM

Quote:

Originally posted by Kaimetsu


I already made one. It's actually pretty easy, and we can make our own thing to do the same thing as Vectors if we want. It's not like it's a primitive class, they still just throw numbers around. The fact that we can redimension GScript arrays without losing the contained data makes it a cinch.

Ok pathfinding script is/was great.

But could we make a pathfinder that isn't all-knowing?

He should be able to find his way and only know what he can see with his two eye's. Your pathfinding script finds a route. Then tells the baddy specifically where to go. He should have to do some searching to find the path. ... Intelligent searching hehe.


Baddy: "I know I saw that player go this way..."
Baddy: "Oh there are lot's of twists and turns here..."
Baddy: "Maybe he went this way. I'll go look"
Baddy: "Whoops dead end I better go back and go that other way."
Baddy: "Hmm... another dead end. I better go back again"
Baddy: "Whoops almost went down the path I already checked, I had better be more careful."
Baddy: "Aha.. there is an exit here. The player must be here!"


I know it's silly =)

Kaimetsu 05-17-2002 03:06 PM

Quote:

Originally posted by adam


Ok pathfinding script is/was great.

But could we make a pathfinder that isn't all-knowing?

He should be able to find his way and only know what he can see with his two eye's. Your pathfinding script finds a route. Then tells the baddy specifically where to go. He should have to do some searching to find the path. ... Intelligent searching hehe.

Sure, it's doable. In fact, I was actually talking about my second pathfinding script, which wasn't the one I showed you. This second one would allow learning pretty easily :)

adam 05-18-2002 12:25 PM

Quote:

Originally posted by Kaimetsu


Sure, it's doable. In fact, I was actually talking about my second pathfinding script, which wasn't the one I showed you. This second one would allow learning pretty easily :)


:D

:( I lost the other script u showed me when I built my new computer. The backup disk was bad.


All times are GMT +2. The time now is 12:31 PM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.