Comments (6)
Feature proposals are tracked here, this is for bugs. Please open a proposal instead.
from godot.
Is this not a bug, or are Packed Arrays
not supposed to be a better version of the normal Array
?
from godot.
They're designed to be tighter and more performant storage, not a plain superior version, implementing these features would require writing new dedicated methods for them, as they do not exist in the underlying type, unlike Array
, see here
So this isn't a missing intended feature, but something that can be discussed as an improvement
from godot.
The Packed*Array
types are primarily designed to do two things:
- Store data efficiently, by not storing
Variant
but the real data type - Pass data back and forth between scripting and the engine, especially for servers, in a way that avoids having to constantly convert between
Array
and what ever specific data type is required
Internally they just use an engine data type called Vector
, which lacks a lot of the features Array
does, the special methods in PackedByteArray
for example is only available to scripting on PackedByteArray
and are implemented in the bindings, not on the Vector<uint8_t>
type itself. The same would likely have to be done for the suggested methods, as they would not be very relevant to Vector
itself as we don't use those methods in the engine core
The one exception really would be sort_custom
which already exists, but it'd have to be bound in a custom way as the built-in one doesn't take a Callable
but a comparator
Further the pop
methods have been suggested before but can't be trivially implemented, as they'd be unable to return a value, unlike Array
where they can return Variant()
there's no way really to return clearly a null
for int
for example. There'd be questions if pop_back/front/at
should crash or not when the container is empty etc (like general access does with Vector
). See:
from godot.
Related Issues (20)
- Scale is applied after orienting the ring emitter shape in Particles making it skew the shape
- reflection probe resoloution never changes despite changing the reflection atlas if reflection probe is in UPDATE_ALWAYS mode HOT 24
- MultiplayerSynchronizer in a bad state after saving branch as scene that it was referencing.
- Are res:// and user:// paths broken on Android? HOT 2
- Adding Shortcut for Remote Debug adds but doesn't works. HOT 2
- Autocompletion fails when script is attached in the current scene HOT 1
- Crash to desktop when setting an AnimationTree AnimationNodeBlendSpace2D's blend mode before creating points. HOT 1
- Toggling distraction-free mode with external script editor enabled opens a new editor every time. HOT 2
- Resource on Dictionary
- Regression in "GDScript: fix segfault on invalid script" with `const foo : GDScript= preload(...)`
- `Geometry2D.is_polygon_clockwise` always returns false for some triangles. HOT 2
- Editing StringName argument adds extra `&`
- Tooltips don't scroll when editor is in `Single Window Mode`
- Missing "Manage Groups" Button in "Scene -> Node -> Groups" Menu HOT 2
- Error when using `TextEdit`'s minimap with horizontal scrolling
- [glTF] Very high light range values of imported lights are causing shadows not to render HOT 5
- RichText Justified Behavior is Not Correct HOT 6
- GDScript editor IntelliSense is displaying the wrong type for a defined variable HOT 3
- Null references not working as intended in Godot 4.3 dev6? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from godot.