![]() |
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? ^_^ |
Re: Multitasking
Quote:
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. |
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. |
Re: Re: Multitasking
Quote:
|
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..... |
How about horses that go on a destinated path?
You can buy a ticket for, say, 3 gralats. |
You done yet?
I wanna see :) |
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.
|
......rrriiiiiiiight
Haven't even started yet, really. Stupid finals. |
Quote:
*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. |
Im still waiting for this to get done Tyhm. You have some more finals?
:cool: |
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. |
Quote:
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. |
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.
|
Quote:
It could be harder then you may think, plus people may set their destination and go afk...:-/ |
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...
|
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 :)
|
Quote:
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. |
Quote:
|
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.
|
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.
|
Quote:
|
Quote:
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 =) |
Quote:
|
Quote:
: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.