Commit graph

426 commits

Author SHA1 Message Date
in0finite
45c9ca085d ... 2021-09-13 00:59:28 +02:00
in0finite
71fc261100 change distance of enemy ped 2021-09-13 00:12:41 +02:00
in0finite
217bf12473 add command "enemy" 2021-09-13 00:08:06 +02:00
in0finite
ed023bdcf7 spawn AI peds, not "regular" peds, from UI 2021-09-12 23:28:35 +02:00
in0finite
ad527ccb3d now able to un-recruit all peds 2021-09-12 23:09:38 +02:00
in0finite
d2fe1b1cfb fix group logic 2021-09-12 23:03:53 +02:00
in0finite
e0f89e1e47 ... 2021-09-12 22:40:24 +02:00
in0finite
c788732a65 switch to chasing from walking, if there are enemies 2021-09-12 22:40:11 +02:00
in0finite
4d29d11084 subscribe event for every ped ; add follower group logic 2021-09-12 22:26:05 +02:00
in0finite
867ac634af add StartIdling() 2021-09-12 21:14:48 +02:00
in0finite
c88314e4d5 chase peds properly 2021-09-12 21:07:00 +02:00
in0finite
1ed58b7f09 when chasing is finished, start walking from closest node 2021-09-12 20:05:07 +02:00
in0finite
82363bff84 immediately switch to walking state from idle state 2021-09-12 20:01:39 +02:00
in0finite
2b58398dfb find closest node if we don't have any 2021-09-12 19:53:27 +02:00
in0finite
ca4447b37a don't move ped if path nodes are not assigned 2021-09-12 18:32:18 +02:00
in0finite
c40f19348a exit vehicle when walking around 2021-09-12 18:22:04 +02:00
in0finite
cf28bd5c63 make attacking work in vehicles 2021-09-12 18:17:50 +02:00
in0finite
fc50d7cf32 ... 2021-09-12 04:11:43 +02:00
in0finite
4167d76bfb ... 2021-09-12 04:11:07 +02:00
in0finite
c71b7f41bc when entering/exiting car, don't call API which moves ped in/out of vehicle, but instead send input to ped 2021-09-12 04:08:19 +02:00
in0finite
f7327d9409 calculate distance to target based on XZ axis 2021-09-12 03:13:52 +02:00
in0finite
47a6f02fe7 rename 2021-09-12 01:38:35 +02:00
in0finite
805af9028b adjust target node position offset based on path width 2021-09-12 01:37:39 +02:00
in0finite
6db5f9a9a7 use deltaTime instead of fixedDeltaTime 2021-09-11 19:17:05 +02:00
in0finite
020be0dade fix spawning 2021-09-11 19:15:50 +02:00
in0finite
348c93ea5a normalize movement input 2021-09-11 19:14:31 +02:00
in0finite
d249412ab9 cleanup code 2021-09-11 18:35:59 +02:00
in0finite
7cdf2def5c remove PedStalker script 2021-09-11 18:04:50 +02:00
in0finite
ec991ee991 rename 2021-09-11 17:19:01 +02:00
in0finite
83edcd6f5f add gizmos 2021-09-11 17:08:29 +02:00
in0finite
6b66065ba5 extract method 2021-09-11 04:09:19 +02:00
in0finite
167e313456 aim toward head 2021-09-11 02:48:11 +02:00
in0finite
fa825315d9 adjust heading of ped when shooting 2021-09-11 02:44:41 +02:00
in0finite
b2989f530a fix next node for escaping 2021-09-11 02:34:37 +02:00
in0finite
69cb205ade fix finding next node 2021-09-11 02:33:58 +02:00
in0finite
49397154ca split paths into ped and vehicle paths 2021-09-11 01:12:39 +02:00
in0finite
1c389b2d91 some API changes 2021-09-11 00:51:23 +02:00
in0finite
88042fbeec refactor: add FocusPointManager 2021-09-08 16:26:11 +02:00
in0finite
4d42edade6 move function to other class 2021-09-07 02:16:02 +02:00
in0finite
eb2fe7ef66 rename class 2021-09-07 02:13:54 +02:00
in0finite
d7f0ec9d54 properly detect gang member 2021-09-07 01:33:19 +02:00
in0finite
6f866fa750 change namespace 2021-09-07 00:45:25 +02:00
in0finite
f3039575a2 ... 2021-09-07 00:28:37 +02:00
in0finite
a4ffe2e4fd fix memory leak with event 2021-09-07 00:27:22 +02:00
in0finite
1db899ebba rename class 2021-09-07 00:05:06 +02:00
in0finite
fdd15b81b5 rename file 2021-09-07 00:04:00 +02:00
in0finite
f4a2e25d21 cache list of ped AIs 2021-09-06 23:41:56 +02:00
in0finite
c48d59d7a1 some cleanup 2021-09-06 23:33:12 +02:00
Damien
5862efba4f
[#79] AI peds pathfinding (#111)
* Added Ped AI with debug info

* Improved ped AI + auto spawn for each players

* Disabling Ped Spawner script for clients

* Added flee script for peds and reworked peds AI

* Optimized Ped spawning script

* Removed unused ped command

* Convert class to struct in NodeFile.cs

* Revert style on Ped_Spawning

* Fixed respawning ped issue on multiplayer

* Improved ped's AI and spawns

* Added FindYCoordWithXZ method

* Fixed peds spawn point on bridges + added Ped tag

* Removed Ped tag to improve performances

* Fixed ped trying to spawn when player is in interior
2021-08-08 01:05:13 +02:00
in0finite
32c0be1af2
new world loading system (#110)
* wip

* much faster world creation

* add StaticGeometryInspector

* disable child/parent logic and fading

* rename

* (de)activate objects based on parent

* set draw distance based on layers

* ...

* wip

* wip

* wip

* remove unused param

* prevent concurrent modification

* ...

* catch exceptions when notifying

* ...

* notify about area, not objects

* limit public access to Area

* ...

* ...

* allow public access

* add public api

* adapt code

* pass callback to ctor

* adapt focus points

* fix

* fix intersection check

* support rectangles

* adjust parameters in prefab

* this should fix IsInsideOf()

* ...

* ...

* fix getting area by index

* create area if not exists

* ...

* ...

* ...

* wip for distance levels

* remove constraint on generic parameter

* add some validation

* fix

* fix draw distance per level

* change time of day in which lights are visible

* add todos

* don't use id for UnRegisterFocusPoint()

* use hash set for storing focus points

* add 1 more level

* mark area for update only if visibility changes

* profile WorldSystem calls

* add some profiling sections

* limit time per frame for LoadingThread

* switch custom concurrent queue

* copy jobs to buffer

* rename

* change max draw distance setting

* wait one more frame

* try to remove 801 distance level to remove holes

* attempt to hide interiors, but failed

* delete no longer needed script

* optimization

* some error checking

* add camera as focus point

* dont add camera as focus point in headless mode

* working on load priority

* fix bug - load priority finished

* ...

* small optimizations

* ...

* ...

* remove unneeded variable

* add fading

* dont do fading in headless mode

* fadeRate available in inspector

* change fade rate

* take into account if geometry is loaded when checking if object should be visible, and if fading should be done

* small optimization

* cache IsInHeadlessMode

* display Instance info in inspector

* move interiors up in the sky

* rename

* adapt code to different y pos of interiors

* refactor

* fix finding matched enex for enexes that lead to the same interior level

* display new world stats

* rename

* rename class

* ...

* ...

* extract function

* extract parameters into a struct

* add focus point to dead body

* add focus point to vehicle

* add focus point to vehicle detached parts

* remove OutOfRangeDestroyer from vehicle, and destroy vehicle if it falls below the map

* dont use focus points on vehicle and vehicle detached parts, when not on server

* add focus point for npc peds

* add possibility to set timeout during which focus point keeps revealing after it's destroyed

* adapt UnRegisterFocusPoint() to timeout

* rename

* adapt code

* cleanup MapObject class

* ...

* converting to `lock()`

* optimize method: use 1 lock instead of 3

* call OnObjectFinishedLoading() instead of AddToLoadedObjects()

* ...

* make sure it's main thread

* AsyncLoader is no longer thread safe

* convert static members to non-static in LoadingThread

* fix

* ...

* store indexes for each area

* impl GetAreaCenter()

* calculate load priority based on distance to area, not objects ; limit time per frame ; sort area in Cell, not in concurrent SortedSet ;

* add support for changing draw distance at runtime

* delay setting the new value by 0.2 s

* have a separate default max draw distance for mobile platforms

* adjust y axis world params so that number of visible areas is reduced

* remove "camera far clip plane" setting

* rename

* document flags

* rename

* disable shadow casting and receiving for some objects

* allow casting shadows for LODs with large draw distance

* remove "WorldSystem" layer

* revert layer
2021-07-18 06:03:43 +02:00
in0finite
378a92794d ... 2021-05-02 23:02:04 +02:00
in0finite
ab4f1e00d9 change SEO 2021-03-05 21:32:49 +01:00
in0finite
0589ccb039 exit aim & fire states if ped is not holding a weapon 2021-02-23 00:10:11 +01:00
in0finite
c52fd29de8 don't display inflicted damage for the same player 2021-02-22 23:56:58 +01:00
in0finite
9e7378d1ca exit drive-by state if ped doesn't have gun weapon 2021-02-22 23:20:01 +01:00
in0finite
985054b648 add Ped.onAwake event 2021-02-21 01:39:39 +01:00
in0finite
6e23e3a97c add Ped.onStart event 2021-02-21 01:20:20 +01:00
in0finite
7e97945021 add Ped.onDamaged event 2021-02-19 02:55:09 +01:00
in0finite
f9faff6c67 don't detach ragdoll when ped is killed in a vehicle, except if vehicle exploded 2021-02-06 21:12:41 +01:00
in0finite
3267daa543 state classes handle killing of ped 2021-02-06 21:11:14 +01:00
in0finite
ac56764618 add "Dead body traffic per player" stat 2021-02-06 20:07:53 +01:00
in0finite
6f21cc8bf0 destroy all rigid bodies on clients except for the root bone - they work for themselves, and bones look deformed and stretched 2021-02-06 19:20:21 +01:00
in0finite
d525a99575 sync velocity only for root bone 2021-02-06 19:18:36 +01:00
in0finite
ae834f63c7 add flags to sync data 2021-02-06 17:19:35 +01:00
in0finite
dac7f81574 add setting for ragdoll interpolation mode 2021-02-06 03:16:36 +01:00
in0finite
af54f74847 optimize network traffic for ragdolls - sync only rigid bodies - traffic should be 4 KB/s for 1 ragdoll 2021-02-06 01:29:55 +01:00
in0finite
b7ab28fedf add "num rigid bodies in dead bodies" to misc stats 2021-01-08 03:00:03 +01:00
in0finite
ebaa36fb1a add "num bones in dead bodies" to misc stats 2021-01-08 02:57:39 +01:00
in0finite
be97e40457 cleanup 2021-01-08 02:52:10 +01:00
in0finite
2451514db1 use custom serialization 2021-01-08 02:40:45 +01:00
in0finite
4b20f5de34 ... 2021-01-08 00:18:46 +01:00
in0finite
38e205efc4 found almost perfect solution 2021-01-07 23:21:28 +01:00
in0finite
c8b44837af fix comments 2021-01-07 22:16:51 +01:00
in0finite
dcc65fa8c5 tried to use MovePosition()/MoveRotation(), but it doesn't work 2021-01-07 21:43:03 +01:00
in0finite
34b9613782 don't set rigid body to kinematic - it behaves a little better with high velocity 2021-01-07 21:35:14 +01:00
in0finite
9267660a97 configure interpolation in Inspector 2021-01-07 21:02:12 +01:00
in0finite
2051451095 fix commented code 2021-01-07 20:59:36 +01:00
in0finite
7990d25ed5 extract SetPosition() and SetRotation() 2021-01-07 18:48:02 +01:00
in0finite
38d3035044 use struct for storing info about bones 2021-01-07 18:32:59 +01:00
in0finite
31d7d3c5dd apply initial velocities 2021-01-07 17:50:58 +01:00
in0finite
6b3e656ed7 extract SetVelocity() method 2021-01-07 17:47:45 +01:00
in0finite
2d5d67fc55 cleanup 2021-01-07 17:44:47 +01:00
in0finite
a9e70bf7cc cleanup 2021-01-07 16:51:30 +01:00
in0finite
506bca3faf cleanup 2021-01-07 15:43:56 +01:00
in0finite
34175971ae syncing is finally decent enough 2021-01-07 15:26:11 +01:00
in0finite
68413a5c37 sync velocity 2021-01-05 22:58:47 +01:00
in0finite
20100a34aa add "dead body sync rate" setting 2021-01-05 21:32:20 +01:00
in0finite
8d400bfceb syncing works 2021-01-05 21:09:25 +01:00
in0finite
f9e320ce23 move creation of dead body to it's own class 2021-01-05 19:30:14 +01:00
in0finite
8469f18862 use prefab to spawn dead body 2021-01-05 18:21:57 +01:00
in0finite
17f6aaeeda peds are killed with a separate function ; ragdoll is detached only when peds are killed, not destroyed 2021-01-05 05:18:47 +01:00
in0finite
3a5e237e06 add button to remove all dead bodies 2021-01-05 03:09:45 +01:00
in0finite
d6d5d660cf wip on ragdoll 2021-01-04 01:28:58 +01:00
in0finite
64680f7280 initial ragdoll stuff 2021-01-03 14:23:18 +01:00
in0finite
99c1cf8ecc ped can not be damaged by explosion while he is in vehicle 2020-06-29 17:50:33 +02:00
in0finite
e5c6144706 ped damage handling is done by State classes 2020-06-29 17:12:48 +02:00
in0finite
ba1ebf4213 don't try to damage ped if his health is <= 0 2020-06-27 22:12:22 +02:00
in0finite
16bd731403 ped can be damaged by explosion 2020-06-27 22:00:10 +02:00
in0finite
394348745e converting on-screen messages to uGUI 2020-06-06 18:09:26 +02:00
in0finite
29ab0556c6 specify ignored layer mask for finding ground in Inspector 2020-06-06 15:54:04 +02:00