The above video goes away if you are a member and logged in, so log in now!

 Would you like to get all the newest Gaming News fromQJ.NET in your email each day? Want to learn more about the team who brings you the QJ news?

## Pathfiding...

This is a discussion on Pathfiding... within the PSP Development Forum forums, part of the PSP Development, Hacks, and Homebrew category; I really have much questions today :ROFL: All is in the title.I'm updating an RTS project, and i'l really need ...

 Tweet
1. ## Pathfiding...

I really have much questions today :ROFL:

All is in the title.I'm updating an RTS project, and i'l really need pieces of advises concerning on how to set a pahfinding..
I'm explaining for all.

In any RTS games on PC, you can click on a point and then, the selected unit will move up to this point.If he collides with an house, or a three, he automatically changes his direction to reach the waypoint you've selected.

How can this be done in LUA..? :Argh:

Actually, i've used a collision engine function..but i'm not satisfied..What i've been able to do is, when a waypoint is selected with the cursor, the unit move there.If he collides with a map element, he stops and ask for what to do..

So help..

2. A* pathfinding Algorithm

Pronounsed A-Star

3. Do you Know a link to A* Algorithm in lua?

Edit: Found it.
http://www.evilmana.com/tutorials/co..._algorithm.php

4. Originally Posted by dan369
Do you Know a link to A* Algorithm in lua?

Edit: Found it.
http://www.evilmana.com/tutorials/co..._algorithm.php
wow that alot of code for just to do that

5. its quite a complicated thing A* algorithm in my opinion though that code could be simpliflied

6. A* isn't that complicated

7. 1. A* is not complicated, it just is sometimes a pita to make work because it is possible to forget or overlook tiny things.
2. I know your programming level/experience and I guarantee you cannot possibly understand A* or how it works, so here's a very very very very very simple easy to understand explanation of A* (it falsely says closed sets are required but for an RTS they are since some places are unreachable)
3. I doubt you'll understand it after reading that tutorial, you're not at that level of programming yet.
4. I have a complete easytouse lua implementation of A*, loosely based off that one you found on evilmana. No, I won't feed it to you, I'm simply telling you it's possible to do.

8. 1. if your going to make an rts, and it's the normal type(i.e. build units, can build as many as you want), in lua your going to want to switch to c/++, lua is simple not powerful enough(trust me i've tried view my celestial cunning games if i remember correctly my first release was in lua)

2. A* isn't 100% necessary, creating a grid like A* requires(not requires but usually is easiest to make an A* path), their is an advantage to making a grid, your fog of war well be so much easier to create, however on the other-hand larger maps with large grids well require alot more cpu power

i wish you luck, i just highly recommend that you convert to c/++ if this is for the psp, but even then you have control issue's and what-not, an rts on the psp is just not viable from a control stand-point, but i wish you luck

at the same time, even highly optimized coding well still experiance slow-down's on the psp, it's not really the language, it's more the psp is simple not powerful enough for an rts

9. 1. if your going to make an rts, and it's the normal type(i.e. build units, can build as many as you want), in lua your going to want to switch to c/++, lua is simple not powerful enough(trust me i've tried view my celestial cunning games if i remember correctly my first release was in lua)
With good code I see no reason why an RTS isn't possible in Lua. You only have to render the tiles that are on the screen, and while there's a lot of calculations involved, the PSP is fast enough to make them easily. It would probably be a good idea to set up the game variables so you don't need huge armies, though (like Warcraft 3).

Grid-based A* is probably the best way for an RTS, because people can build buildings and any other way would be too hard to adapt when buildings are built.

The control problem is still there, though.

10. i disagree coolguy, keeping track of your units, ai units, and enviroment variables, can be very tedious for the psp, it may seem powerful enough but it can get large...quickly and become laggy....fast, on top of that having each unit combined with A*, even a simple one and lots of units being moved from point to point can get even more tedious, things add up fast in any rts, and the control scheme is rly horrible on the psp for an rts

however seanpaul...i'd love to be proved wrong

11. To Slicer4ever you're not the first guy to say such things.And in fact, i agrees the opinion that an RTS game would be best coded in C/C++.I'll follow the advise,( You're a Sage, afterall :ROFL:) sure, but i think that something great could be done in LUA.Why not try..?

4. I have a complete easytouse lua implementation of A*, loosely based off that one you found on evilmana. No, I won't feed it to you, I'm simply telling you it's possible to do.
To TurtlesPwn okay, i know I haven't reach a high level in programming, so why not gimme an help with your script..?
But i'll give a look to the link you've proposed.Thanks all.

The debate is still opened and if anybody's have an idea...

12. 1. Slicer, trust me, it is completely doable. I have thought out the concepts and how to get around speed limitations several times before. AI would be only thought out when a condition which would affect the condition changes. Tiles would be rendered to a single image and thus would not need to be rendered continuously. A* paths would be saved and only calculated when conditions change. It is all very possible as long as you are extremely careful in how it is done. And how is he going to get the units to find their way through the trees and buildings without some sort of pathfinding algorithm, A* being the most surefire one to use?

2. Seanpaul, I want you to learn and get better until you can do it on your own. If you continue to be fed everything you need you wont learn much.

13. gonna make researches so...

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•

All times are GMT -8. The time now is 11:41 PM.

Use of this Web site constitutes acceptance of the TERMS & CONDITIONS and PRIVACY POLICY