addObject() 'time' parameter inconsistent #40402
Labels
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
5 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#40402
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?
System Information
Windows 7 64 bit, Nvidia GeForce GT540M Cuda
Blender Version
Never worked. (tested with 2.63 up to current Hash
7fb33e5
)Short description of error
The 'time' parameter of addObject() gives inconsistent results. Generally the added object lives longer as it should. With 'time' set to 1, the object lives 2 logic tics. With 'time' set to 10, for example, the object lives 13 logic tics.
Exact steps for others to reproduce the error
Play the game. Check the messages in the System Console.
AddObject_life_bug.blend
Changed status to: 'Open'
Added subscriber: @raco
It probably has something to do with the built-in standard of 50fps for the Add Object Actuator. Notice in the example blend file that on the 6th tic, life shows 5.
Added subscriber: @Moguri
Yeah, the life/time parameter is a pseudo-second of sorts. It looks like it assumes 50fps, which is not very accurate:
If this is fixed to be actual seconds, it could break existing games. So, this probably isn't worth fixing. On the other hand, it is hard to be precise with the time parameter since it is based on framerate. If precision is an issue, you can always use the Python time module and KX_GameObject.endObject() to handle this yourself.
I don't really see how it would break existing games if the value would be determined by the logic tic rate.
It would alter the timing, which could throw off existing games.
Hi moguri,
Thanks for answering.
I think you're talking about the case where game developers purposely used other values to work around this limitation. For example, setting time to 50 so the object is removed after one second, even when the logic tic rate is 60.
If such a developer would like to run/export his (old) game with a Blender version without this limitation, indeed he would be forced to change time to 60. But if you ask me, I think he would gladly do so, because he'll never have to deal with this limitation ever again, when working on future projects.
I will ask people for their opinion on the Blender Artists Forum and keep you posted.
Thanks
I was thinking more off people you just played with the number until it "felt right." These people will have their games subtly changed. This may be a problem or it may not. Regardless, this won't be fixed for 2.71, since I don't want to introduce any potentially game breaking changes at this stage.
Also, if this is going to be changed, it will be changed to just use seconds, and not be framerate dependent.
Added subscriber: @AngusHollands-4
I feel that whilst this is a valid argument, there are already enough inconsistencies in the engine timing design as it is, and we should address them asap.
If it breaks existing games, it won't be difficult to alert users of the change. New users should find it simpler to use with seconds. I don't believe we should encourage "compatibility" with such bugs, especially when they aren't mainstream features (the life attribute of an object is rarely used by most blend files I've investigated).
Added subscriber: @brita
If we change over to seconds for this, some other (potentially breaking) changes would happen as a result:
I'm all for changing to seconds. You can read about opinions on BA: Your opinion about fixing the addObject 'time' parameter?
Maybe this could be changed from type 'Bug' to 'To do' or 'Design'. I think we all agree that changing to seconds is the best solution.
Changed status from 'Open' to: 'Archived'
Agree on changing to seconds when we feel like breaking compatibility again (3.x?). Moved to the TODO . Thanks for the report.