[Plugin] PathFinder by Pamdex
#81

I guess that would be possible.
Reply
#82

Cheers.

Just WOW !!...
It's so useful and amazing, i tried to use a similar plugin but this had a lot troubles. Nice .
Reply
#83

Source and Download are moved to bitbucket.org
Reply
#84

Nice work bro + rare rep
Reply
#85

I created the new version of PathFinder, which uses for path calculating more than one separated thread.
It has new functions:
  • PathFinder_MapAndreasLock()
  • PathFinder_MapAndreasUnlock()
This version was not fully tested so I will release it later with more info.

You can see the code there:
https://bitbucket.org/Pamdex/pathfin...t=more-threads
Reply
#86

Think you can update this to use ColAndreas ?
Reply
#87

Quote:
Originally Posted by Pottus
Посмотреть сообщение
Think you can update this to use ColAndreas ?
...wich would just be totaly awesome!
Reply
#88

Quote:
Originally Posted by Pottus
Посмотреть сообщение
Think you can update this to use ColAndreas ?
I'll be thinking about it after releasing more-thread version of PathFinder.
Reply
#89

Would be fantastic with colAndreas, as ****** said on first pages, collision detection is everything that this pathfinder needs to be perfect.
Reply
#90

Quote:
Originally Posted by pamdex
Посмотреть сообщение
I created the new version of PathFinder, which uses for path calculating more than one separated thread.
It has new functions:
  • PathFinder_MapAndreasLock()
  • PathFinder_MapAndreasUnlock()
This version was not fully tested so I will release it later with more info.

You can see the code there:
https://bitbucket.org/Pamdex/pathfin...t=more-threads
Good, its frustrating to try to get something work that doesn't really work.
Reply
#91

PathFinder 1.0 MT released!
This version adds multi-thread support. More paths can be calculated at the same time.

Download -> first post. If you using old version of PathFinder, please read first post!
Reply
#92

Hey !

I've got a problem using PathFinder, or more preciesely, its link with MapAndreas 1.2.1!

So...
[CODE="OnGameModeInit"]
//---PATH FINDER & MAPANDREAS---//
MapAndreas_Init(MAP_ANDREAS_MODE_FULL, "scriptfiles/SAfull.hmap");
printf("MapAndreasAddress: %d", MapAndreas_GetAddress());
PathFinder_Init(MapAndreas_GetAddress(), ;
[/CODE]

always shows

Код:
MapAndreasAddress: 0
...You'll tell me that it's because MapAndreas is not initialized... But... Right under this, I've got this...

Код:
for(new i = ; i < MAX_BAMBIS; i ++) CreateBambi(i, random(2));
Код:
CreateBambi(bambi, zone)
{
	//CODE...
    	MapAndreas_FindZ_For2DCoord(x, y, z);
	dBambi[bambi][oBambi] = CreateDynamicObject(19315, x, y, z + 0.6, 0.0, 0.0, 0.0, -1, -1, -1, 500.0, 500.0);
	//CODE...
}
And it all works, and whenever I use MapAndreas later, it also works!

But I do use the 1.2.1 version, I've tried to run the server either on my PC and on my dedicated server (W7 & Debian)!

I've also tried to initialize MapAndreas, then to init PathFinder later in OnGameModeInit, even by a couple of seconds timer... And I don't know what else I could do!
Reply
#93

@UP Please show your server log.

BTW If you use MapAndreas functions (like FindZ...) and PathFinder you must remember to use PathFinder Lock & Unlock functions (thread safety).
Reply
#94

Well,

First, that's what happens when I use PathFinder_MapAndreasLock():
Код:
[18:59:30] [debug] Server crashed while executing SurviveAll.amx
[18:59:30] [debug] AMX backtrace:
[18:59:30] [debug] #0 native PathFinder_MapAndreasLock () from PathFinder.DLL
[18:59:30] [debug] #1 00048c94 in ?? (0, 1) from SurviveAll.amx
[18:59:30] [debug] #2 000599dc in ?? () from SurviveAll.amx
[18:59:30] [debug] #3 0000602c in public ScriptInit_OnGameModeInit () from SurviveAll.amx
[18:59:30] [debug] #4 00000ed4 in public OnGameModeInit () from SurviveAll.amx
[18:59:31] [debug] Native backtrace:
[18:59:31] [debug] #0 6cf81f27 in ?? () from plugins\PathFinder.DLL
[18:59:31] [debug] #1 6ab262ca in ?? () from plugins\crashdetect.DLL
[18:59:31] [debug] #2 6ab28b28 in ?? () from plugins\crashdetect.DLL
[18:59:31] [debug] #3 6ab209c7 in ?? () from plugins\crashdetect.DLL
[18:59:31] [debug] #4 6ab2631a in ?? () from plugins\crashdetect.DLL
[18:59:31] [debug] #5 6aab51b9 in ?? () from plugins\streamer.DLL
[18:59:31] [debug] #6 0046f504 in ?? () from samp-server.exe
[18:59:31] [debug] #7 65646f6d in ?? () from samp-server.exe
[18:59:31] [debug] #8 75532f73 in ?? ()
[18:59:31] [debug] #9 76697672 in ?? () from C:\Windows\syswow64\SHELL32.dll
[18:59:31] [debug] #10 6c6c4165 in ?? () from samp-server.exe
[18:59:31] [debug] #11 786d612e in ?? () from samp-server.exe
Then, when I use PathFinder_FindWay:

Код:
[19:00:52] [debug] Run time error 3: "Stack/heap collision (insufficient stack size)"
[19:00:52] [debug]  Stack pointer (STK) is 0x1091758, heap pointer (HEA) is 0x1091904
[19:00:52] [debug] AMX backtrace:
[19:00:52] [debug] #0 0009f8b0 in ?? (17024952) from SurviveAll.amx
[19:00:52] [debug] #1 000431a0 in ?? (57, 1153419434, -1018283485, 1095992502, 1) from SurviveAll.amx
[19:00:52] [debug] #2 00043b98 in ?? () from SurviveAll.amx
[19:00:52] [debug] #3 0009de1c in public SecondUpdate () from SurviveAll.amx
But nothing shows up when I simply use initializing functions
Reply
#95

What version of MapAndreas and PathFinder you use?

Try to use this mapandreas init code:
MapAndreas_Init(MAP_ANDREAS_MODE_FULL);
Reply
#96

I'm using the PathFinder plugin that's available on the first page of the thread, and this version of M.-A.: http://forum.sa-mp.com/showpost.php?...&postcount=153

And that's the way I init (Sometimes I add the hmap file path, but I always test it with or without, desperatly)
Reply
#97

Don't forget about me please
Reply
#98

Quote:
Originally Posted by Stump
Посмотреть сообщение
Don't forget about me please
Show your server_log.txt with MapAndreas and PathFinder init lines.
Reply
#99

Код:
----------
Loaded log file: "server_log.txt".
----------

SA-MP Dedicated Server
----------------------
v0.3.7, ©2005-2015 SA-MP Team

[13:36:42] 
[13:36:42] Server Plugins
[13:36:42] --------------
[13:36:42]  Loading plugin: crashdetect
[13:36:42]   CrashDetect v4.15.1 is OK.
[13:36:42]   Loaded.
[13:36:42]  Loading plugin: RNPC
[13:36:42] RNPC V0.4.1 by Mauzen (03.12.2014)
[13:36:42]   Loaded.
[13:36:42]  Loading plugin: streamer
[13:36:42] 

*** Streamer Plugin v2.7.6 by Incognito loaded ***

[13:36:42]   Loaded.
[13:36:42]  Loading plugin: PathFinder
[13:36:42] =========================================
[13:36:42] PathFinder Plugin 1.0 MT
[13:36:42]          by Pamdex
[13:36:42] 
[13:36:42] Using MapAndreas Plugin 1.2.1
[13:36:42] Waiting for Init...
[13:36:42] =========================================
[13:36:42]   Loaded.
[13:36:42]  Loading plugin: MapAndreas
[13:36:42]   Loaded.
[13:36:42]  Loaded 5 plugins.
Edit: It gave me the idea of switching some plugin loading pos, I put RNPC after MapAndreas, and it works !

But now that I found by myself, I've got a bigger problem... Whenever I call PathFinder_FindWay, I get...

Either on Win7:

Код:
[14:58:19] [debug] Server crashed due to an unknown error
[14:58:19] [debug] Native backtrace:
[14:58:19] [debug] #0 65c527d9 in ?? () from plugins\PathFinder.DLL
[14:58:19] [debug] #1 65c52f4a in ?? () from plugins\PathFinder.DLL
[14:58:19] [debug] #2 65c5459f in ?? () from plugins\PathFinder.DLL
[14:58:19] [debug] #3 65c5445c in ?? () from plugins\PathFinder.DLL
[14:58:19] [debug] #4 55a1c934 in ?? () from C:\Windows\system32\MSVCR120.dll
[14:58:19] [debug] #5 55a1c9fd in ?? () from C:\Windows\system32\MSVCR120.dll
[14:58:19] [debug] #6 770d338a in ?? () from C:\Windows\syswow64\kernel32.dll
[14:58:19] [debug] #7 77609902 in ?? () from C:\Windows\SysWOW64\ntdll.dll
[14:58:19] [debug] #8 776098d5 in ?? () from C:\Windows\SysWOW64\ntdll.dll
or on Debian:

Код:
[14:46:57] [debug] Server crashed due to an unknown error
[14:46:57] [debug] Native backtrace:
[14:46:57] [debug] #0 eb29ee8b in _ZN10StackTraceC1EPv () from plugins/crashdetect.so
[14:46:57] [debug] #1 eb297bcf in _ZN11CrashDetect20PrintNativeBacktraceERSoPv () from plugins/crashdetect.so
[14:46:57] [debug] #2 eb298dbc in _ZN11CrashDetect20PrintNativeBacktraceEPv () from plugins/crashdetect.so
[14:46:57] [debug] #3 eb299226 in _ZN11CrashDetect11OnExceptionEPv () from plugins/crashdetect.so
[14:46:57] [debug] #4 eb29eadc in ?? () from plugins/crashdetect.so
[14:46:57] [debug] #5 eb580410 in ?? ()
[14:46:57] [debug] #6 eb26b922 in _ZN11CMapAndreas16FindZ_For2DCoordEffi () from plugins/PathFinder.so
[14:46:57] [debug] #7 eb272f68 in _ZN4Path14getZDifferenceEif () from plugins/PathFinder.so
[14:46:57] [debug] #8 eb273372 in _ZN4Path7findWayEfffffiii () from plugins/PathFinder.so
[14:46:57] [debug] #9 eb276ef4 in _ZN6Thread14PathCalculatorEPv () from plugins/PathFinder.so
[14:46:57] [debug] #10 eb276ddf in _ZN6Thread17RunPathCalculatorEPv () from plugins/PathFinder.so
[14:46:57] [debug] #11 eb55ec39 in ?? () from /lib32/libpthread.so.0
[14:46:57] [debug] #12 eb39ecfe in clone () from /lib32/libc.so.6
Код:
PathFinder_FindWay(bambi, bx, by, x, y, 2.0, 5, -1, 5);
I know I look stupid asking for a problem right after another that I just solve, but I don't even know what I could try considering that I don't really understand it
Reply

Okay, you are using RNPC, which contains built-in MapAndreas functions - it makes conflict with normal MapAndreas plugin.

You can try using my fixed version of RNPC (0.4.1) include:
http://pastebin.com/3A5CgKfJ

I created simple test code:
http://pastebin.com/ev4jiMnn

And my test code logs:
http://pastebin.com/AFbA2y2v

You have to load MapAndreas before RNPC.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)