-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Godot 4.2.1 Optimizations, rewrites, features from upstream, etc. #3
Open
c08oprkiua
wants to merge
58
commits into
jreo03:godot-4.0.3-conversion
Choose a base branch
from
c08oprkiua:godot-4.0.3-conversion
base: godot-4.0.3-conversion
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Godot 4.2.1 Optimizations, rewrites, features from upstream, etc. #3
c08oprkiua
wants to merge
58
commits into
jreo03:godot-4.0.3-conversion
from
c08oprkiua:godot-4.0.3-conversion
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
A lot more typecasting: Most things in the engine are now typecasted (~85 variables/functions left out of 300+) Beginning to split some variable groups into resource classes
Slimmed up some functions using object-oriented swap-out strategies and built in Godot functions
Fixed wheels not turning Begun to implement analog controls (from a controller) Optimizing a bit around the tyre smoke.
Tune in next time, when I implement controller support (hopefully)
Mouse steering is broken, and touch (gyro) is untested, sorry in advance
Based on some tests done on a sufficiently low end device, I have optimized: ViVeWheel._physics_process() ViVeCar.new_controls()
Reorganized Scene tree calling; the base "world" Node3D now acts as a singleton, where nodes can fetch the active car and scene. Reorganized the popup menus into a single TabContainer in a Window.
Begun adding native in-engine documentation. Fixed steering assistance (as well as other control configs) not applying. Fixed the graph not drawing properly, and changed where/how it is loaded in-script. Did a little more work on the in-engine VItaVehicle GUI. Disabled VSync in order to display total FPS being reached (for performance measuring).
Documentation added: Most of ViVeCar Some of ViVeWheel ViVeTyreSettings ViVeCarTorque Said documentation has been removed from the VitaVehicle UI docs.
Added more descriptions of public variables to ViVeCar. A lot of the non-public variables from ViVeCar have now been hidden from the in-engine docs Fixed the instant dead RPM bug, and some *probable* bugs in VitaVehicleSimulation.multivariate() where it was accessing values that didn't exist/do anything.
*Roughly* ported the Synic EKI from Godot 3 for fun. It works but it is buggy (shaders especially are borked). Also as roughly ported (NitroVista) Aqua Highway, mainly for purposes of framerate tests (and also I just like the map :P)
Finished documentation for ViVeCar, ViVeGearAssist, ViVeESP, ViVeCVT, ViVeBTCS, ViVeABS, ViVeTorque, ViVeTTCS, and ViVeCarControls. Also fixed a bug where the config menu wasn't working for gear changing or input source changing.
Torque Graph has been ported into a native engine dock unit, meaning it can be pulled up as a subscreen while editing nodes. It can also theoretically redraw in real time as per changes the user makes to a car, though I couldn't test this due to exported values not showing up in my editor for some reason.
Bugs fixed: * Physics behave a bit more like VitaVehicle Godot 3 (screeching to a halt happened too quickly before) * Graphs now immediately draw when you start up the game (before, they would only draw after swapping a car) Features added: * VSync now available from the graphics config menu * Old graphics options from Godot 3 have been re-added to the graphics config menus. At the moment, only FXAA should do anything (though, I have not seen any actual differences with it enabled?), the rest are not set up. * The Godot editor plugin is currently being overhauled. Instead of having the dedicated main panel, the Torque Graph and (in the future) Collision editor will be accessible from the bottom panel (where the debug, shader editor, etc. are). Of these, the Torque Graph has been reimplemented. It does not entirely work yet. * I opened the "VitaVehicle" logo in GIMP and cut out the special V so that we could have a cool icon to use. Optimizations: * Tire marks should compute a little faster * Audio should process faster (audio is still broken tho, sorry) * A little less unneeded processing is happening in relation to the graphics config menus * multivariate() has been moved into ViVeCar, which should yield better performance because it is operating locally. * A lot of absolute value checks now return typed, which is something I had missed earlier. * A lot of child calls should process faster, due to the use of onready referencing variables.
Also fixed a minor bug where tyre smoke was enabled by default when it was supposed to not be
Now it matches how it appeared in Godot 3, except VSync (which wasn't in Godot 3) is at the top
It has now replaced the Previously instantiated WorldEnvironment. This allows more direct manipulation of lighting in a scene.
So, basically, because I changed how some of the car settings are stored, it didn't actually import properly. I'll have to add an importer tool to the plugin to automate this in the future.
Imagine ruining your hearing because you used a maxf instead of a minf, couldn't be me *cough* anyways, also in this commit: Properly abstracting AutoSettings into a Resource class Deleting some extra unused scripts that I ended up not using.
RIght now, the "UseAccelerometer" setting does nothing. Instead, to use accelerometer steering, enable "UseMouseSteering"
Now, when you press the menu button again while you are in the same tab that the button goes to, it will hide the menu.
Also, as a sidenote: Personally, I would say that I have done enough to warrant a bump in minor versioning, eg. "G-RCP2.1" / "RCP4.1". Though ultimately, whether that applies is for you to decide. |
Credit to CardboardPow on Discord for helping me with the Vulkan backend error fix, implemented on lines 117 and 118
Previously, when switching cars, the control settings would reset, causing issues both in keeping those options between switches and causing issues in the control config GUI, which would not update. Now, they get saved before releasing the car, and get applied to the new car when it is loaded, thus fixing the issue and improving UX.
The current fix may cause one or two redundant function runs in the process of swapping a car, but meh, it's not the most major deal, and could be looked at later
* Fixed the VGS not turning red * Fixed ground variables in all the scenes, so they work now * General mathematical/logical optimizations
* Slight math optimizations, especially for the wheel, so should run fractionally better now * Fixed all the shaders from the Godot 3 imports, so at least those shouldn't be broken anymore (the Materials are another story tho) * Actually using dedicated audio buses that I set aside a long time ago for engine and tyre sounds,
Long overdue
* Renamed tyres.gd to tyre_sounds.gd * Added more docs to ViVeWheel * Remove some redundant or easily redundant variables
* Staticly typed a couple of for loops * Added threaded loading of the cars, which significantly decreases load times * Set aside some magic numbers as consts for further investiation * Added export groups to ViVeWheel * Added a couple more descriptors for variables * Removed some goofy/unoptimized/redundant math * Renamed some function local variables for usage clarity * Moved `misc_smoke` out of VitaVehicleSimulation and into misc_graphics_settings * Unhid some variables * Made the camera more reliable * Added an outright toggle for steering assist, which exposed that it was not properly disabling before
* transmission() is now split up into what were different elifs on what transmission to emulate based on type, so now those processes are actual different functions for maintainability and readability * Added some documentation, renamed some variables
* Also partially added infrastructure to hopefully, in the future, adapt accordingly to the physics tick being changed, so that the physics behave consistently no matter what the tick is set to. It is NOT implemented properly; this is just a start. * As the commit name suggests, finally fixed the bug causing the game to flip out when you go backwards. This is actually something I caught a while ago, but was unsure about how to change until recently
* Changed some node based systems to cache the node in a variable instead of `get_node`ing, which has improved runtime performance. * Changed some debug menu stuff to only set when a car is swapped, improving performance * Attempting to import a new car, the Vigero ZX, which is not done because I don't have stuff set up to import fbx * Created an empty scene to test performance of the engine with the simulation effectively "not running" as a reference * Exprimenting with Aspect_Ratio in tyre_settings.gd being a float, since it logically speaking would be. * Cleaned up some code in the car swapper * Silently ported some resources from Godot 3 for the Miranda Proto (I have Plans:tm:)
Also * Did some shader stuff to the main scene to attempt fixing the jittering of the grid (not fixed yet, sadly) * renamed su and sd to shiftUp and shiftDown, as suggested by hooded_ice in the Discord
Axle related variables should be a lot clearer compared to their previously obscure names
* Renamed a couple more variables, to be more understandable, notably the variables related to axle geometry (except Geometry4, which I couldn't figure out) * Abstracted axle related values into a custom resource, for easy re-application between wheels. * Moved wheel-specific custom Resources into a folder under MAIN * Moved TyrePressure to TyreSettings and renamed it AirPressure
* Also subtly fixed that it wasn't using the differed calculations like it should've
* Implemented the two FPS monitors simultaneously: The more precise FPS is active with debug mode enabled, else you get the smooth engine-based FPS * Changed the back tyres in the base car and Synic EKI Rally to not be steering tyres, because them being steering tyres was pointless * Fixed an issue with steered tyres "flickering" under certain situations * Renamed a couple more variables to be more understandable * Added more documentation
* Fixed suspension, finally. * Renamed yet more variables and functions for easier readability. * Yet more documentation
* Controls properly preserve between car swaps * const-ified a couple more magic numbers * Approaching the new control implementation (still not done) * Organized some variables in car.gd for consistency
* Implement set functions with extra features, for certain QoL improvements * Mostly implemented the new Control Config GUI (presets are not implemented yet)
* Began implementing focus jumping for the control config UI. Doesn't work for anything except "Top" right now * Did a little more around implementing control setting loading * Fixed a bug where sliders weren't setting to their variable's value in the Control Config GUI * Partially fixed some loading glitches caused by the set function overrides from last commit
* Ported the Miranda Proto from the itch.io demo * Fixed some "glitches" (values that erased themselves from me changing export variables) in the Synic EKI Rally that were causing it to not behave properly * Set default controls to keyboard, no mouse * More renaming variables * Fixed the gforce drifting glitch (I think) * Added threaded loading for the scenes, though it seems to actually take longer to load...
* Added more documentation * Changed the names of yet more variables for the sake of readability * Hopefully sidestepped around an upstream glitch in Godot causing PackedArrays to not load properly and thus self-erase (for whatever odd reason) by switching the affected variables to generic typed arrays
* Finally finished the new control implementation. Seems to be working as well as the "old new" one. Still need to compare against the "old old" one. * More variable renaming
* Patched steering flickering. I am still not sure why it happens in the first place, which is frustrating, but the functionally important bit is that the patch does correct fully correct the issue from my testing. * More variable renaming. These new names may be inaccurate, but hopefully are a bit more understandable regardless (with my comments left) * Implemented Gear Assist in the control config GUI (forgot that, oops) * Localized the remainder of functions in the VitaVehicle singleton and completely removed it * Fixed steering assistance in the new control implementation * Slightly changed steering values to use less redundant variables * More documentation
* The editor plugin has been fixed, and now works somewhat like an official Godot tool: When you select a car, the torque graph will appear, otherwise it will auto-hide. * Constant refresh for the editor plugin has been fixed * Performance trackers, integrated into the engine, have been added both for the car and its wheels * Car name added to the Meta field, used in the above performance trackers * Fixed the tyre gripping issue * Moved shifting assistance from the GearAssistant to the ViVeCarControls * Added some weakrefs to fix memory leaks * Fully implemented the ViVeWheelSuspension resource * Even more variables renamed for clarity of usage * Even more documentation added * Moved the Synic EKI Rally's resources into folders * Officially added the Vigero ZX, after several days of it sorta just existing in the filesystem. It is still buggy. VERY buggy. * Changed how gear shifting assistance shows up in the config GUI
* Improvements to the torque graph * Heavy modification of the wheel calculations in order to improve performance and make the easier to read * Beginning to implement the transmission abstraction * Lots of variable renames and documentation added * Beginning of markdown docs in the repo, may or may not keep around * Lots of information added to the README * Fixed the splash screen *
* RPM now behaves almost like how it does in upstream again * Added more documentation (ofc) * Renamed a performance monitor that I forgot to rename. * Variable renaming (ofc)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I have been working on the Godot 4 version (as you know), modifying the codebase to increase performance, code maintainability, and add several features.
It's kinda difficult to cover every last thing I have done in this fork, but I'll name a couple:
Bugfixes
New features
Codebase changes
ViVe*
, short for "VitaVehicle".GearAssist
, are now resource classes, so they can be more easily worked with.multivariate
has moved out ofVitaVehicleSimulation
and into theViVeCar
class (the car)ViVeCarControls
, which handles inputs of all types, as well as stores all the Control Config options. Theoretically, this means you can store that Resource when switching vehicles to cleanly and easily retain control settings. (Though, this has not been implemented). Furthermore, controls are now mostly divorced; when you're using a controller, it will ignore keyboard input, and etc. The misc controls still work universally, though.ViVeEnvironment
. This allows for easy and safe retrieval of the current scene, car, etc. without a ton of parent calls.process()
orphysics_process()
whatsoever now. The onlyControl
based systems that still update with the latter methods are the onscreen debug stats.If you have any more questions about codebase changes, please let me know, cause I more than likely have forgotten some things.