Comments (22)
See my reply on this issue. I think we should let the user decide wether to use MapAndreas and path finding. I don't think it's a good idea to integrate a pathfinding method, without letting the user decide if the method should be used. If the user wants to sacrifice RAM or performance, then let him toggle on MapAndreas and/or pathfinding. If the user doesn't want to do that (because not all NPC use cases require the use of MapAndreas and/or pathfinding), then let him toggle off MapAndreas and/or pathfinding.
from fcnpc.
@WoutProvost, I agree with it, thank you. Issue updated.
from fcnpc.
@ziggi When and how do you plan on integrating ColAndreas? Mainly how.
from fcnpc.
@Crayder I will try to merge all the source code. When I will be have good mood for this.
from fcnpc.
Well, the main two functions you'll want to use are CA_RayCastLine
and CA_RayCastLineAngle
.
Would the way you're planning to do this work alongside the ColAndreas plugin being loaded? And would both plugins be accessing the same data that is loaded? If we would need to change the CA plugin up a bit to do so feel free to count me in.
from fcnpc.
Since ColAndreas uses quite some resources, I really think it's best to load the plugin just once (if it is even possible of course). Maybe you can add something like CA_GetAddress();
@Crayder? I've mentioned this already in this post.
from fcnpc.
Obviously we only want to load the models and map once.
And ColAndreas isn't like MapAndreas, an address isn't simple as it sounds. Both plugins would need the bullet physics library (which just means adding it to FCNPC, it's already the root of CA) and a way to share the data between them. How it will be shared is still a cloud to me.
from fcnpc.
Please consider path finding with nodes.
from fcnpc.
@karimcambridge, I doesn't want to work with nodes, because they are awful. You can use GPS plugin for this.
from fcnpc.
Damn @ziggi.. the GPS plugin is crashy as fuck.
It would be a good learning experience though.
from fcnpc.
Well i hate nodes, specially the ones from SA and i dont see why they are in these plugin at all (not after that FCNPC_AddPointToPath function implementation). Also if GPS plugin is crashing it doesnt mean FCNPC has to be stuffed with alternative. There is a way to communicate between them and its more than enough from my perspective...
from fcnpc.
I actually use a pathfinder plugin on top of this already and it works good, I hope I can keep it if I choose to in the next version.
from fcnpc.
I recently had an idea of how to do pathfinding on the 3d map by creating and connecting nodes at runtime. You only need the CA_RayCastMultiLine function of the colandreas that is already inserted in the plugin. For more details see the post I created in the samp forum:
https://forum.sa-mp.com/showthread.php?t=662209
from fcnpc.
I know about A*, but it's should be implemented with threads. And I have no time for now.
from fcnpc.
Is it really necessary to calculate about 2k - 3k of nodes? Because even in pawn the execution time is irrelevant, in c ++ it should be much faster, or am I mistaken?
from fcnpc.
Just try to calculate path from LS to LV with your script. SA-MP server works in one thread, so, any execution in main thread blocks processing of other plugins or scripts.
from fcnpc.
I am just now making pathfinder plugin used colandreas and a*. I think it is better to implement another algorithm for CA raycastline.
I use multithreading.
PathFinder on CA:
https://github.com/Fleynaro/PathFinderCA
from fcnpc.
As you can see, I define two path finding algorithms:
#define FCNPC_MOVE_PATHFINDING_Z (1)
#define FCNPC_MOVE_PATHFINDING_RAYCAST (2)
FCNPC_MOVE_PATHFINDING_Z
- it's default A* algorithm with can be used with MapAndreas or ColAndreas.
FCNPC_MOVE_PATHFINDING_RAYCAST
- it's raycast path finding, where I'm planning implement something like human vision into NPC.
from fcnpc.
Gathered some documentation:
- Pamdex's PathFinder plugin: thread and repo, uses a separate thread for path calculation
- Ryder's Dijkstra include: thread
- ForT's Pathfinder include: thread and repo
- Fleynaro's PathFinder include: pastebin
- Fleynaro's PathFinder plugin: repo
- Crayder's Pathfinding theory: thread
- Cessil's Pathfinding theory: thread
Important NavMesh settings for the NavMeshAgent/NPC:
- agent radius: about 0.7
- agent height: about 1.8
- max slope: 63.5 degrees
- step height: ????
- drop height: ????
- jump distance: ????
from fcnpc.
I was looking into generating a navigational mesh for the map at one point. The most simplified way I found but never actually did was importing the map into Unity, using it's navigational mesh generator, then extracting the data needed to produce that mesh. From there we would need a plugin that could interpret this data and navigate it.
It would be best if we could efficiently generate this mesh during runtime though, like each time an object is placed test which planes could be walked on and generate part of the mesh for each slope that is walkable. You'd also want this to be able to connect the meshes for different objects so you can go under bridges and such.
It's a complicated mess.
Here's a lib:
- Recast Navigation: repo
And this repo if your interested in the Unity generated method, it already imports the map and all:
- SanAndreasUnity: repo
from fcnpc.
The navmesh is definitely the most complicated part of this feature.
For the other part, the multithreading, I've been doing some research and experiments.
from fcnpc.
This amazing repo imports the map in Unity. Unity is able to bake a navmesh.
Unity code available here.
from fcnpc.
Related Issues (20)
- Signal 11 (Segmentation fault), address is 94 from 8096232 HOT 1
- Linux server Error HOT 1
- Help Compiling HOT 1
- Can you help fix crash fcnpc 0.3dl , Please help me HOT 5
- how to fix it? HOT 1
- Linux Server Crash HOT 7
- Issues when running on Linux HOT 3
- Open Mp HOT 4
- Crash on Linux Server HOT 14
- FCNPC_OnCreate and FCNPC_OnSpawn Callback Problem HOT 4
- Callback Problems HOT 1
- Need Some Information About Some Natives HOT 3
- Correct Delta Calculations
- Signal 11 (Segmentation fault), address is 351 from f79570e3 HOT 2
- Signal 11 (Segmentation fault) HOT 2
- FCNPCs can't drive trailers
- The position of the train cars is not returned if FCNPC drive train.
- FCNPC_EnterVehicle. NPC should not check map.
- FCNPC_LoadPlayingPlayback conflicts with temporary recordings loaded by FCNPC_StartPlayingPlayback
- FCNPC Not created HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fcnpc.