-
-
Notifications
You must be signed in to change notification settings - Fork 180
Release notes version 0.36
You can see what Blender developers did in blender release notes:
https://wiki.blender.org/wiki/Reference/Release_Notes from 3.0 to 3.6!
Instance Collections (which replaced groups), can now be converted during bge runtime.
Previously, convertBlenderObject() was only used to convert single Objects into GameObjects at runtime.
But in some case, it can be interesting to convert several objects at the the time in order to recreate relationships between them (to import complete rigged characters, to import a raggdoll made with several objects, or more generally to import several objects with some relations...)
Then convertBlenderObject was adapted to support Instance Collections conversion.
The BGUI library has been reworked to be OpenGL agnostic. Now it is totally based in blf, gpu, bge and bpy modules. If you want to see the modifications done from original BGUI library check this repository: https://github.com/lordloki/bgui We included the BGUI module in the modules folder similar to other specific modules as 'gpu_extras', etc. Only to remark that the video widget because we didn't find a way to refactor it yet.
These are 3 examples that work perfectly: https://github.com/UPBGE/upbge/files/8693534/examples.zip
Now you can do multiplayer games easier!!
You can see a video about how to use it here: https://www.youtube.com/watch?v=5Asubrvm6Z0 and here: https://www.youtube.com/watch?v=RnAEyy0DtGQ
This patch does 2 things:
-
When we append a cube which has an action actuator, then convert the cube with convertBlenderObject, the action is registered in logic manager and can be played without doing anything on user side.
-
It adds an API to register a bpy.types.Action in the logic manager. Like that we can append only an action and play it. A counterpart is added to unregister the Action from the logic manager. It doesn't free the Action itself but you need to unregister the action from the logic manager before freeing it with bpy.data.actions.remove(Action, do_unlink=True). parenthesis: convertBlenderObject and derived methods counterpart is endObject. libLoad had a libFree counterpart which was unregistring loaded actions. So we added this counterpart for Actions only.
It allows for example to composite the main render pass with a full soft shadows pass or to display each frame a fully antialiased render.
If we set samples to 16 for example, the scene (COMBINED pass or other passes like SHADOWS, MIST, AO...) will be rendered 16 times in 1 frame (just for ImageRender) so the performances cost is very high.
See render_passes (v3d.shading.render_pass) documentation in API.
It was only available for ImageRender previously.
This adds code to duplicate completely a gameobject with its data.
Limitation:
- It concerns only the object and not it's potential children for now to simplify.
- As there is an existing bug when creating softbody with scale not applied, I didn't took into account scale when spawning a softbody (only position and orientation (not ori.scaled(scale))
2 test files:
Update LOD physics shape in the same time than render shape
It is possible to use the VR inspection addon to enter into the VR mode in the game engine
There are a very good non-free templates to reduce the difficulty of entry that VR may have. They are here: https://www.patreon.com/upbge_vr
Disclaimer: The template's author is not associated to UPBGE Team in any form. We point to his template because they are really good.
Now it is possible to use almost every compositor nodes in the game engine. You have to activate it this way:
To note that the specific SMAA antialiasing option was removed as it was added SMAA in realtime compositor
Additionally, refactor world & material code. Now, the 3 nodetrees are evaluated under the NodeTree code.
Current gaming mouses use to have 4 or even 6 buttons normally. Now, we add to support for these buttons. Support is added for logic bricks and python. Buttons 6 & 7 can need external configuration as they are positions for programmable buttons.
The grease pencil action animation can be done animating timeoffset modifier frame parameter.
This way we can capture high resolutions from Camera under Windows.
Additionally a fallback format is introduced. With this change whether the format introduced is not compatible with the camera specs then UPBGE captures in the default camera format avoiding black screens.
Logic Trees are now applied as Python Components, not as Logic Bricks anymore. If you encounter any issues with different behavior, try removing and re-applying your trees. They also use an external python module now which can be installed/updated in the addon preferences.
Added nodes to retrieve data about the current VR/XR Session like Headset Position, Orientation or Controller Position, Buttons and Aim.
A new system was written from scratch to build UI systems using nodes. This system supports various Widget types like different Layouts, Buttons, Labels, Images etc.
A set of simple Nodes has been added to build local network systems and send/receive data from one client to another. There's an option to serialize and rebuild data.
A simple node to manage object spawning within specific parameters. There are some predefined behaviors now: Static, Simple Bullet and Physical Bullet. More behaviors will be added in the future.
These nodes allow loading of file data like shaders, meshes and textures from an empty scene. This makes it possible to easily implement loading bars and even display what is currently being loaded before switching to the main scene without the application freezing.
- Simple GLSL Filter Nodes
- Custom Attribute access via Property nodes
- On-Screen Message printing
- Access to every Logic Nodes feature through python
The object must have a physics controller for the friction to be applied, otherwise the friction value will be returned as 0.0.
Using convertBlenderAction(bpy.types.Action)
libLoad had an option to load actions. When libFree was called, the actions loaded were unregistered from logic manager.
Then an API to unregister actions from logic manager is added.
It doesn't free the Action itself. To totally delete the action, bpy.data.actions.remove(Action, do_unlink=True) has to be called after the action has been unregistered from the logic manager.
With recent custom bge loop refactor, it was not possible anymore to set evaluated scene render options before ImageRender pass.
It can be interesting to set these options:
- It is better to use evaluated scene before when we set the render options because the depsgraph is not notified to do an extra draw pass for no reason.
- We might want to set background transparent or disable post processing effects before ImageRender pass.
To make this possible again, pre_draw callbacks are implemented and inserted after BKE_scene_graph_update_tagged and before the image render bge draw loop.
Side note:
ImageRender often requires to hide some objects before the ImageRender pass. I think that for performances, it would be better to use ob_eval.hide_viewport = True than to use kxob.visible = False because KX_GameObject::SetVisible is using depsgraph which can be a bit slow. Furthermore, there if ob_eval visibility state is changed, it is just during ImageRender pass, there should be no need to restore visibility after bge.tex.refresh() contrarly to if we use kxob.visible
Additionally, little improvements to Vibration actuator and vibration actuator API.
Example of use for new API:
import bge
joysticks = bge.logic.joysticks
for joy in joysticks:
if joy is not None:
if joy.hasVibration is True:
joy.strengthLeft = 0.9
joy.strengthRight = 0.1
joy.duration = 2000 # 2 seconds
joy.startVibration()
The uplogic module is the groundwork for logic nodes. It is designed to be used via python as well, so everything that works in nodes is also doable with just python. This module also contains various convenience-functions and wrappers. Some of the more interesting features are:
from uplogic.audio import Sound3D
Sound3D(speaker=game_obj, filepath='path/to/file.mp3', volume=1.5, occlusion=True)
for example will play a sound at the position of game_obj
and will have occluding behavior (sound will be dampened by objects)
To establish a connection between two computers, just execute this code on the corresponding machines:
from uplogic.network import Server
server = Server(ip='192.169.0.10')
from uplogic.network import Client
client = Client(server='192.169.0.10')
client.connect()
From there you can communicate with the send
callback: client.send(msg)
To handle messages as a recepient, you can overwrite the on_msg
callback on a client or server:
def on_msg(server, msg):
print(msg)
server.on_msg = on_msg
Similar to Sound, there's a way to easily define an Action and modify its attributes while it's running:
from uplogic.animation import Action
action = Action(game_object=game_obj, action_name='idle', start_frame=0, end_frame=50)
if action.frame > 25:
action.speed = 0.2
else:
action.speed = 1.0
Currently this system does not support layer priorities, so it is strongly encouraged to use layers and the layer weight attribute.
Uplogic has its own UI module which is quite heavily inspired by the python kiwy project. To create a UI, simply instantiate your widgets and add them to a canvas or another widget:
from uplogic.ui import Canvas, Button
def on_press(button, widget):
print('Button has been pressed')
canvas = Canvas()
button = Button(bg_color=(0, 0, 0, 0.5), hover_color=(1, 1, 1, 0.5), text='ButtonText')
button.on_press = on_press
When defining a Python Component or Object Extention, you can use these decorators to work with properties defined on the game object instead of attributes on the python object:
import bge
from collections import OrderedDict
from uplogic.decorators import game_props
@game_props('health', 'timer')
class Component(bge.types.KX_PythonComponent):
args = OrderedDict([])
def start(self, args):
print(self.health) # This will print the same as self.object['health']
self.health = 0 # This will set self.object['health'] to 0