[MTE 5.5] Update deprecated vector codestyle. #1860
Labels
No Label
#P1 CRITICAL
#P2: HIGH
#P3: elevated
#P4 priority: medium
#P6: low
#Review
annoying
API
bug
code quality
combat
commands
compatibility
configurability
contribution inside
controls
core feature
creative mode
delayed for engine release
documentation
duplicate
enhancement
environment
feature request
gameplay
graphics
ground content conflict
GUI/HUD
help wanted
incomplete feature
invalid / won't fix
items
looking for contributor
mapgen
meta
mineclone2+
Minecraft >= 1.13
Minecraft >= 1.17
missing feature
mobile
mobs
mod support
model needed
multiplayer
Needs adoption
needs discussion
needs engine change
needs more information
needs research
nodes
non-mob entities
performance
player
possible close
redstone
release notes
schematics
Skyblock
sounds
Testing / Retest
tools
translation
unconfirmed
mcl5
mcla
Media missing
No Milestone
No project
No Assignees
6 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: VoxeLibre/VoxeLibre#1860
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
In the next MTE 5.5 release, as stated in MTE/PR#11039:
We will need to update all manual-style vectors to fit with the new-style vectors.
vector.new
is availlable in mt < 5.5, so we can already support 5.5, right?we also have new metatable operations in 5.5. so instead of
vector.add(p, d)
, it could be written simpler asp + d
(the new-style could be slower though bc metatables. someone would need to profile that, if new-style is adopted).anyways, you're right, we can support 5.5 now. but i'd rather wait until 5.5 is released in case there's more changes.
That's true if they make any other changes to the vector codestyle but it was reviewed, tweaked and tested, and then merged. It looks like whatever changes follow, they're unlikely to break compatibility.
with this, we could just start doing it now (and because MTE 5.5 is close to release).
hum... maybe not on master, but on a separated branch yes (I still often use 5.4.1)
@EliasFleckenstein03 thoughts?
We should not work on this right now, since vector is an essential thing used in many different places. Let's wait until a good portion of the 0.72 proposed changes are done and merged and then work on it to not get loads of merge conflicts that have to be resolved manually.
We use absolute world position, always - be it vectors, tables, areas, direct coordinates specifications, whatever.
We don't use relative vectors for now.
Let's wait final 5.5 and then check if we will start using them.
The issue is invalid for now.
No need to use vectors instead of tables right now. There more likely can be problems with new vectors than with tables we use, and a quick fix could be backmerging old vector library from 5.4 into mcl2, but it's about future prediction which isn't a goal
Not using new style vectors will be deprecated by 5.5
From our CONTRIBUTING.md, we must use modern API
positions are vectors (see lua_api.txt)
The issue is fully valid and must be reopened
My position has moved on this.
When working on the error handling for mobs, I realised that if you set an incorrect vector in the new style, it fails on creation as it uses an assert method. This is really quite significant. When you set a variable in 20 places, if it's a table, it will succeed and fail when it tries to read. Good luck trying to figure out where it got incorrectly set (this happened in an unfixed crash (for self.acc). Using new style vectors will fail early and tell you exactly where you are incorrectly using it. This prevents data getting into a bad state, and us crossing our fingers and hoping it's good.
We shouldn't always dive to migrate because something is deprecated, as things can be depracated for years, but this is a superior option and makes sense why they have done this.
Moving across to new vectors will decrease risk where a vector setting operation goes awry for a particular case or due to incorrect state. There is a lot of value in this and I think we do need to start migrating across.
Obviously big PRs are a nightmare to review and a merge conflict waiting to happen, so small chunks for this will be useful, and probably not all at once so it isn't exhausting to review/test.
We need to consider moving forward with this. I appreciate AFCMS was definitely leading the charge on this at one point, and you were spot on with that! So credit where it is due. If I had discouraged you in the past in regards to this, I apologise.