mirror of
https://github.com/GTA-ASM/SanAndreasUnity
synced 2024-11-24 21:13:01 +00:00
📝 update docs
This commit is contained in:
parent
041b6d015b
commit
c49ff01e90
4 changed files with 40 additions and 90 deletions
|
@ -2,15 +2,11 @@
|
|||
|
||||
All geometry and some other assets should be loaded async-ly.
|
||||
|
||||
We need a background thread which loads assets from disk. It will have a queue, where any script can register it's file for loading.
|
||||
|
||||
We need a way to wait until specific asset is loaded.
|
||||
We already have a background thread in which some assets are loaded from disk. But, assets should also be converted to usable data in this thread.
|
||||
|
||||
|
||||
***
|
||||
|
||||
First identify what is taking time using Profiler. Maybe not all time goes on loading from disk. Some of it may be spent on converting the mesh.
|
||||
|
||||
Identified what is taking time:
|
||||
|
||||
- loading from disk (mostly takes around 20 ms, and goes up to 70 ms, but for some txds it goes to 100 ms)
|
||||
|
@ -34,12 +30,8 @@ Identified what is taking time:
|
|||
|
||||
- update divisions in separate thread ? or optimize division system ?
|
||||
|
||||
- unload map objects which are not visible to any focus point for given amount of time - this means destroying meshes, materials, textures, and removing references to loaded data in RAM
|
||||
|
||||
|
||||
## TIPS
|
||||
|
||||
- attaching collision model takes a lot of memory - why ? - because it reads archive file
|
||||
|
||||
- dedicated server doesn't need textures - we can detect if we are running as dedicated server, and skip loading textures
|
||||
|
||||
|
|
|
@ -1,6 +1,9 @@
|
|||
|
||||
|
||||
# TODO
|
||||
# Multiplayer TODO
|
||||
|
||||
|
||||
### General
|
||||
|
||||
- scene changing: When network (server/client) is stopped, offline scene should be loaded. But, when switching back to online scene, Loader should not load everything again. Instead, only Cell loading should be done, if the new scene is main scene. But, are old meshes/textures destroyed ? Do we leave memory behind, every time when network is stopped ? Or... just exit the game when network is stopped (display message box first ?).
|
||||
|
||||
|
@ -8,13 +11,17 @@
|
|||
|
||||
- remove spamming logs:
|
||||
|
||||
- test situation when player connects, and there are peds sitting in vehicles
|
||||
- error when spawning RCCAM
|
||||
|
||||
***
|
||||
- all button events' Cmds on server should be enclosed with F.RunExceptionSafe()
|
||||
|
||||
|
||||
### Weapons
|
||||
|
||||
- is weapon sound 3d ?
|
||||
|
||||
***
|
||||
|
||||
### Vehicles
|
||||
|
||||
- **vehicle is bumping on clients** - disable (or destroy) wheel colliders, and sync them - this should not be done on local player, see below
|
||||
|
||||
|
@ -28,12 +35,3 @@
|
|||
|
||||
|
||||
|
||||
|
||||
# Notes
|
||||
|
||||
- server will have multiple Cell focus points - the game can lag too much, so server has to run on a dedicated machine
|
||||
|
||||
- dedicated server doesn't need to load textures
|
||||
|
||||
|
||||
|
||||
|
|
29
Docs/TODO.md
29
Docs/TODO.md
|
@ -2,32 +2,41 @@
|
|||
## TODO
|
||||
|
||||
|
||||
- Weapons - see [weapons.md](weapons.md)
|
||||
|
||||
- **Rigid body character**
|
||||
|
||||
- Load map in editor ?
|
||||
|
||||
- **Async geometry loading** - currently, geometry is loaded synchronously, which seems like the main performance bottleneck
|
||||
|
||||
- Multiplayer - see [Multiplayer.md](Multiplayer.md)
|
||||
|
||||
- Map - better info area ; input mouse position is not always correct ; see [Map.md](Map.md) ;
|
||||
- **Async geometry loading** - currently, geometry is loaded synchronously, which seems like the main performance bottleneck ; see [AsyncAssetLoading.md](AsyncAssetLoading.md) ;
|
||||
|
||||
- Weapons and damage system - see [weapons.md](weapons.md)
|
||||
|
||||
- Unloading assets - need to keep track of references to loaded assets (meshes, textures) ; need ability to release references ; when a certain asset is no longer referenced, it can be unloaded ;
|
||||
|
||||
- Unload distant parts of the world - first need a better Cell system, which will tell which divisions are close and which are not ; unloading includes releasing reference to meshes, textures, materials, collision models ;
|
||||
|
||||
- Rigid body character
|
||||
|
||||
- Minimap - better info area ; input mouse position is not always correct ; see [Map.md](Map.md) ;
|
||||
|
||||
- Teleport : when ground is too far away (like on mountains), geometry around it will not be loaded, and raycast will not succeed ; when position is too low, player gets constantly respawned ; adapt all other teleport code ;
|
||||
|
||||
|
||||
- Gravity setting failed to load on windows - instead of 9.81, it's loaded as 981 - maybe it happens when float.ToString() gives e
|
||||
|
||||
- Does 'O' button changes quality level ?
|
||||
|
||||
- Reduce physics time step to 30 - make it configurable in options
|
||||
|
||||
- Chat
|
||||
|
||||
- Android: touch input is required ; set default fps to 25 ;
|
||||
|
||||
- Play sounds: horn ; empty weapon slot ; ped damage ; footsteps in run and sprint states ;
|
||||
|
||||
- Script execution order: HUD before pause menu and windows ; fps counter after all ;
|
||||
|
||||
- Optimize Console.Update() - don't do trim excess for every log message
|
||||
|
||||
- Implement drive-by
|
||||
|
||||
- don't fade high LOD meshes
|
||||
|
||||
- Validate path to GTA ?
|
||||
|
@ -50,6 +59,8 @@
|
|||
|
||||
- Minimap size should depend on screen resolution
|
||||
|
||||
- Vehicle hijacking - throwing out other ped and entering vehicle at his seat
|
||||
|
||||
|
||||
- Import Vice City
|
||||
|
||||
|
|
|
@ -1,83 +1,32 @@
|
|||
|
||||
## About weapons implementation
|
||||
## Weapons/damage TODO
|
||||
<br>
|
||||
|
||||
|
||||
Loading weapons is easy, just load weapons.dat, and their models, and that's pretty much it.
|
||||
<br>
|
||||
|
||||
|
||||
***
|
||||
<br>
|
||||
|
||||
|
||||
What is difficult, is to integrate weapons with animations.
|
||||
|
||||
We need the following functionality:
|
||||
|
||||
- When player aims, he needs to switch to another anim, and he needs to **lean his head** (how to do this, is there a separate anim for this ?). - Found the anims that were needed.
|
||||
|
||||
- When player aims, his head and hands should rotate in that direction (including up and down), so we would need to somehow **rotate spine** or something
|
||||
|
||||
- When player has a weapon in his hand, the **weapon should be attached to fingers** (maybe with a little adjustment for fingers) - this way player can do all anims (jump, run, etc), and weapon will remain on the proper place. This should only be done for specific anims.
|
||||
|
||||
- There are cases when we need to **play 2 anims at the same time**. Examples: reloading a weapon, aim and move at the same time. How to do this ? Tried with anim blending, but it looked ugly. Try avatar mask ?
|
||||
|
||||
|
||||
***
|
||||
|
||||
Each weapon has it's own anim group. So, anims will be played based on what weapon is held.
|
||||
|
||||
But **how to determine position of weapon ?** Each weapon has firing offset, and aiming offset (maybe this is actually the position of weapon). - This can be done by testing.
|
||||
|
||||
**Where to place hands ?** There is nothing in weapons.dat saying about this. Is it hardcoded ? Or shall we just play weaponaim anim, and somehow adjust hands/fingers based on type of the weapon (or his aim offset) ? - Looks like that this is handled by anim.
|
||||
|
||||
***
|
||||
|
||||
These are the useful parameters in weapons.dat :
|
||||
|
||||
- fire offset (this could be just the location of bullet when it's fired ?)
|
||||
- aim offset (this could be position of weapon when it's held, or position of where the other hand should be ?)
|
||||
- anim group
|
||||
|
||||
***
|
||||
|
||||
### TODO
|
||||
### Weapons
|
||||
|
||||
- play separate anim for tec9 ?
|
||||
|
||||
- let aim anim to control head (or spine ?), in order to better simulate bullet firing ?
|
||||
- implement reloading
|
||||
|
||||
- improve aiming with AIMWITHARM weapons - upper arm should follow right vector of aiming, when aiming to side
|
||||
- when lerping upper arm transform toward ped forward vector, arm is going on the opposite side - it seems that it depends on world rotation of ped
|
||||
|
||||
- reloading
|
||||
|
||||
- when lerping upper arm transform toward player forward vector, arm is going on the opposite side - it seems that it depends on world rotation of player
|
||||
|
||||
- spine should be rotated locally, not globally ? - some models have different rotation of spine in the idle anim, which means that their spine will not look at the same place - possible solution would be to play the same idle anim on all models
|
||||
|
||||
- right after the model is loaded, reset model state - it's already done ?
|
||||
|
||||
- rotate the pelvis instead of spine (because thighs look ugly)
|
||||
|
||||
- rotate neck instead of spine, when following direction of aiming
|
||||
|
||||
- play separate anim for: minigun and flame thrower,
|
||||
- anim for minigun and flame thrower can't be loaded
|
||||
|
||||
|
||||
#### Damage system
|
||||
### Damage system
|
||||
|
||||
- particles on place of hit
|
||||
|
||||
- display inflicted damage as on-screen message
|
||||
|
||||
- die animation ; ped needs to have IsDead bool variable - code has to be adapted ;
|
||||
- die animation - detach ped model before destroying ped ; send rpc to players to ~~do the same~~ create ped model only (not ped), and play anim ;
|
||||
|
||||
- we need to raycast against ped mesh, not capsule collider ; also need to detect which part of body was hit
|
||||
|
||||
- adapt vehicles to damage system
|
||||
- adapt vehicles to damage system - need explosion and smoke effects first
|
||||
|
||||
- decals
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue