Closed benloh closed 9 months ago
@jdanish Here's a first pass at selecting character types. I'm still doing QA and documentation, but I think it basically works. Please give dev-bl/character-type
a whirl to see if this does what you want.
In wetlands_beaver_building, the dropdown list includes all characters (not just pozyx enabled ones) and when I switch to predator using fake track, it generates this error and pops back to beaver.
Also note the character name is split on two lines so takes up a lot of space?
Ah. I had implemented it so that ANY blueprint could be selected. I'll add in the filter.
The predator bug looks odd. But I'll take a look.
@jdanish regarding the character name split issue, because the character names and the tag ids are potentially quite long, and we don't really want to make the stage area any smaller, the only solution is to truncate or make the tag or character name shorter. I don't want to reduce the size of the font too much or it will be hard to read on screen. Are you OK with truncating the name? Or do you want to increase the width of the left sidebar? We can probably get away with reducing the right sidebar.
I’m ok with truncating the name. Thanks!
Gabby reports that this mostly works well. However, if you click setup to change the map, and then save, the character controller characters do not reappear unless you reload the screen. I have a video from her if you need, but I think that's clear?
All currently reported issues should be addressed:
One addition note for the record:
Errors coming from dynamically switching a tag's blueprints touch the following features:
Addresses #760
Features
Pozyx tags are now listed in the "CHARACTER CONTROLLERS" panel on Main.
FakeTrack and PTrack controllers are also listed.
Any input source (pozyx, faketrack, ptrack) can select a new character blueprint at any time.
When the blueprint is changed, a new agent is created and the old one is removed. So any state that the agent had is lost.
If none of the scripts have set controllable inputs (e.g. no blueprints have
isPozyxControllable
orisPTrackControllable
set to true), the "CHARACTER CONTROLLERS" panel on Main will select the first blueprint by default and issue a warning on the dev console. This is to prevent the app from crashing.FakeTrack functionality has been restored. Transforms weren't properly calculated for faketrack inputs, so nothing was working. 98f01b96c9d8df209253e819f39ce7bbff615aca adds support that defaults to a faketrack transform (e.g. no transform) so that faketrack entities can be displayed and controlled/moved again.
To Test/Implement
Test Mapping
# TAG isPozyxControllable true
set totrue
. This will be the default blueprint that any new tag is set to. (You can set more than oneisPozyxControllable
. If there is more than one, one of theisPozyxControllable
blueprints will be picked at random.)isPozyxControllable
blueprint.isPozyxControllable
.Test "No Controllable Tag" Tracking
isPozyxControllable
andisPTrackControllable
for all blueprints to false.Caveats
Technical Background
During each sim loop, inputs coming from PTrack, Pozyx, Character Controllers, and FakeTrack are mapped to agent instance definitions and agents are then created. We tap into that flow by introducing a way to dynamically select a new agent instance from the list of available agents. The process is something like this (see the input to agent flow whimsical diagram):
instances
state group calledtags
that lists all of the available PTrack, Pozyx, and FakeTrack inputs and their corresponding blueprint names.tags
are listed on the "CHARACTER CONTROLLERS" panel on Main, along with a menu selector for all of the blueprint types that are available.isPozyxControllable
tag.tags
group of theinstances
state with a new blueprint id.dc-inputs
, we add or change the agent definitions using thetags
table.sim-inputs
phase, the agent definitions are mapped to agent instances, either updating or adding a new agent as necessary. The old agent is removed, and a new agent is created. State is not maintained across the two agents.NOTE: WIth this system, ANY blueprint can be controlled by a pozyx tag. The
# TAG isPozyxControllable
tag is not necessary to make it controllable. The corollary to this is that we are not excluding any blueprints either. If exclusion is necessary, we'll need to add a filter to do that.TO DO
isPozyxControllable
set to true.