Commit graph

165 commits

Author SHA1 Message Date
in0finite
d7b0329291 detect visible peds by AI peds 2022-01-02 20:31:57 +01:00
in0finite
08c46da0bd apply initial velocity to destroyed vehicle parts 2021-12-27 01:29:44 +01:00
in0finite
8d240d7dc6 fix warning 2021-11-21 22:11:23 +01:00
in0finite
864dd6239c remove unused variables 2021-11-21 21:52:11 +01:00
in0finite
6c13d5a7a2 fix some warnings 2021-11-21 21:39:55 +01:00
in0finite
6f98b639c9 detect when colors are changed on clients 2021-11-17 19:25:31 +01:00
in0finite
6adfbcd69c add onColorsChanged event to Vehicle 2021-11-17 19:05:34 +01:00
in0finite
a5d3c657fc add synced bag to VehicleController 2021-11-17 18:54:11 +01:00
in0finite
6d1b0f0a78 change vehicle's color system to use Color32 instead of indices 2021-11-14 23:53:23 +01:00
in0finite
41aaf1bf44 react when someone damages our vehicle 2021-09-13 02:27:15 +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
fb2f17792e unsupported vehicles will not cause spamming error messages - they are destroyed 2021-02-22 22:19:15 +01:00
in0finite
104f627bd3 extract into static function 2021-02-13 22:52:43 +01:00
in0finite
0d3d8e3dce remove old code 2021-02-13 22:44:22 +01:00
in0finite
7b4d256008 cache shader property ids 2021-02-13 22:38:35 +01:00
in0finite
ec660c368c set vehicle lights' intensity to 0 by default 2021-02-13 22:22:03 +01:00
in0finite
2232f4327f fix FPS drop on Android 2021-02-13 22:18:27 +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
3e73a557f2 set vehicle's rigid body CollisionDetectionMode to continuous dynamic 2021-02-06 02:39:56 +01:00
in0finite
964a76685e set collision detection mode to ContinuousDynamic - seems that leftover parts no longer can go through ground 2021-02-05 23:40:30 +01:00
in0finite
7df6fcd135 more limitations on client ... 2021-02-05 01:08:07 +01:00
in0finite
93a1c7aaf0 use RigidBody's position for syncing, not transform's 2021-02-05 01:06:11 +01:00
in0finite
c4699859e1 add option to destroy wheel colliders on client 2021-02-05 01:04:37 +01:00
in0finite
c6bd9fef9a sync rpm and properly rotate wheel 2021-02-04 23:18:01 +01:00
in0finite
b0ec6417c7 extract function 2021-02-04 23:17:12 +01:00
in0finite
f6fe21cbdb sync y position of wheel 2021-02-04 22:21:16 +01:00
in0finite
91bc7547a5 don't use gravity and don't detect collisions on client 2021-02-04 22:19:34 +01:00
in0finite
9caf2df790 set interpolation on vehicle rigid body 2021-02-04 22:17:26 +01:00
in0finite
f17824e237 reset velocity on clients if it is not synced 2021-02-04 22:14:10 +01:00
in0finite
75d9ca5f35 when vehicle explodes, all peds inside are killed - this also fixes Unity crash 2021-01-05 05:56:39 +01:00
in0finite
85ed0480e6 add setting for radio volume 2021-01-02 23:22:52 +01:00
in0finite
350f70ac9b don't create hinge joints for vehicle doors 2020-12-29 20:58:51 +01:00
in0finite
edceca030f extract function 2020-12-29 20:43:33 +01:00
in0finite
74bc44561f remove commented code 2020-12-29 20:36:35 +01:00
in0finite
615491aab6 use InvariantCulture when (de)serializing colors 2020-07-05 22:35:21 +02:00
in0finite
5816570fd2 sync color of detached parts 2020-07-05 22:33:34 +02:00
in0finite
f926bb7c24 send color of detached part 2020-07-05 21:39:59 +02:00
in0finite
d5a51d595e newly connected clients can see already existing detached parts 2020-07-05 18:37:56 +02:00
in0finite
e959d1c483 don't log error if frame is not child of vehicle, because some vehicles have multiple frames with the same name, and this causes error only on client, but not on server 2020-07-05 13:42:50 +02:00
in0finite
942453a2a4 check if frame is already detached before detaching it - this also fixes a bug on client when he was trying to detach already detached frame 2020-07-04 20:12:01 +02:00
in0finite
9c63b25d38 log error if frame is not child of vehicle 2020-07-04 19:11:39 +02:00
in0finite
96b0ac1f33 disable cooking options on MeshCollider 2020-07-04 19:11:09 +02:00
in0finite
e47d8d0adf explosion is synced 2020-07-04 18:52:23 +02:00
in0finite
798dfd55ed ... 2020-07-01 23:36:49 +02:00
in0finite
41e5223fc7 detached vehicle parts should be synced 2020-07-01 23:36:01 +02:00
in0finite
6725e3ce57 do some logic only on server 2020-07-01 19:36:39 +02:00
in0finite
96829ef506 sync vehicle's health 2020-07-01 19:31:06 +02:00
in0finite
2e0108d662 cleanup code 2020-07-01 19:25:59 +02:00
in0finite
395bcdcf4b add some commented code related to petrolcap 2020-07-01 18:53:15 +02:00
in0finite
d6c79434a4 cache petrolcap transform 2020-06-29 21:57:44 +02:00