Arena¶
Arena APIs expose level lifecycle and local-space actor utilities through
UnaryAPI.
Key Functions¶
load_arena: Load an arena level asset using an anchor transform and return the arena GUID.reset_arena/destroy_arena: Reset or tear down an arena identified by its GUID.list_arenas: Inspect all arenas currently loaded on the server, including visibility and actor counts.set_arena_visible: Toggle whether an arena participates in rendering and gameplay logic.spawn_actor_in_arena: Spawn an actor inside the arena's local coordinate system.set_actor_pose_local/get_actor_pose_local: Write or read an actor's transform expressed in local arena coordinates.local_to_world/world_to_local: Convert transforms between arena-local and world space.arena_simple_move_towards: Drive a pawn toward a target in arena-local space using the built-in simple movement helper.arena_destroy_actor: Remove an actor from the arena.
API References¶
tongsim.connection.grpc.unary_api.UnaryAPI.load_arena
async
staticmethod
¶
load_arena(
conn: GrpcConnection,
level_asset_path: str,
anchor: Transform,
make_visible: bool = True,
) -> str
Dynamically load an arena level and return its GUID identifier.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
Arena GUID string. |
Source code in src/tongsim/connection/grpc/unary_api.py
524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 | |
tongsim.connection.grpc.unary_api.UnaryAPI.reset_arena
async
staticmethod
¶
reset_arena(conn: GrpcConnection, arena_id: str) -> bool
Reset the specified arena to its initial state.
Returns:
| Name | Type | Description |
|---|---|---|
bool |
bool
|
True on success. |
Source code in src/tongsim/connection/grpc/unary_api.py
563 564 565 566 567 568 569 570 571 572 573 574 575 576 | |
tongsim.connection.grpc.unary_api.UnaryAPI.destroy_arena
async
staticmethod
¶
destroy_arena(conn: GrpcConnection, arena_id: str) -> bool
Destroy a loaded arena instance.
Returns:
| Name | Type | Description |
|---|---|---|
bool |
bool
|
True on success. |
Source code in src/tongsim/connection/grpc/unary_api.py
548 549 550 551 552 553 554 555 556 557 558 559 560 561 | |
tongsim.connection.grpc.unary_api.UnaryAPI.list_arenas
async
staticmethod
¶
list_arenas(conn: GrpcConnection) -> list[dict]
List all arena instances with resource path, anchor, visibility and actor count.
Returns:
| Type | Description |
|---|---|
list[dict]
|
list[dict]: Entries include |
Source code in src/tongsim/connection/grpc/unary_api.py
596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 | |
tongsim.connection.grpc.unary_api.UnaryAPI.set_arena_visible
async
staticmethod
¶
set_arena_visible(
conn: GrpcConnection, arena_id: str, visible: bool
) -> bool
Toggle arena visibility for rendering and logic.
Returns:
| Name | Type | Description |
|---|---|---|
bool |
bool
|
True on success. |
Source code in src/tongsim/connection/grpc/unary_api.py
578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 | |
tongsim.connection.grpc.unary_api.UnaryAPI.spawn_actor_in_arena
async
staticmethod
¶
spawn_actor_in_arena(
conn: GrpcConnection,
arena_id: str,
class_path: str,
local_transform: Transform,
timeout: float = 5.0,
) -> dict | None
Spawn an actor inside an arena's local coordinate system and return its identity.
Returns:
| Type | Description |
|---|---|
dict | None
|
dict | None: Dictionary with |
Source code in src/tongsim/connection/grpc/unary_api.py
623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 | |
tongsim.connection.grpc.unary_api.UnaryAPI.set_actor_pose_local
async
staticmethod
¶
set_actor_pose_local(
conn: GrpcConnection,
arena_id: str,
actor_id: str,
local_transform: Transform,
reset_physics: bool = True,
) -> bool
Place an actor at an arena-local transform (converted to world space and teleported).
Returns:
| Name | Type | Description |
|---|---|---|
bool |
bool
|
True on success. |
Source code in src/tongsim/connection/grpc/unary_api.py
654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 | |
tongsim.connection.grpc.unary_api.UnaryAPI.get_actor_pose_local
async
staticmethod
¶
get_actor_pose_local(
conn: GrpcConnection, arena_id: str, actor_id: str
) -> Transform | None
Retrieve an actor's transform expressed in arena-local coordinates.
Returns:
| Type | Description |
|---|---|
Transform | None
|
Transform | None: Arena-local transform, or |
Source code in src/tongsim/connection/grpc/unary_api.py
681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 | |
tongsim.connection.grpc.unary_api.UnaryAPI.local_to_world
async
staticmethod
¶
local_to_world(
conn: GrpcConnection,
arena_id: str,
local_transform: Transform,
) -> Transform | None
Convert an arena-local transform to a world transform.
Returns:
| Type | Description |
|---|---|
Transform | None
|
Transform | None: World transform, or |
Source code in src/tongsim/connection/grpc/unary_api.py
702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 | |
tongsim.connection.grpc.unary_api.UnaryAPI.world_to_local
async
staticmethod
¶
world_to_local(
conn: GrpcConnection,
arena_id: str,
world_transform: Transform,
) -> Transform | None
Convert a world transform to arena-local space.
Returns:
| Type | Description |
|---|---|
Transform | None
|
Transform | None: Arena-local transform, or |
Source code in src/tongsim/connection/grpc/unary_api.py
723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 | |
tongsim.connection.grpc.unary_api.UnaryAPI.arena_simple_move_towards
async
staticmethod
¶
arena_simple_move_towards(
conn: GrpcConnection,
arena_id: str,
target_local_location: Vector3,
orientation_mode: int = 0,
given_forward: Vector3 | None = None,
timeout: float = 3600.0,
) -> tuple[dict | None, dict | None]
Move an arena-local actor toward a local target location.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
arena_id
|
str
|
Arena identifier. |
required |
target_local_location
|
Vector3
|
Destination expressed in arena-local coordinates. |
required |
orientation_mode
|
int
|
Orientation mode (0 keep current, 1 face movement, 2 given). |
0
|
given_forward
|
Vector3 | None
|
Forward vector used when |
None
|
timeout
|
float
|
RPC timeout in seconds. |
3600.0
|
Returns:
| Type | Description |
|---|---|
tuple[dict | None, dict | None]
|
tuple[Vector3 | None, dict | None]: Current location and optional hit metadata. |
Source code in src/tongsim/connection/grpc/unary_api.py
779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 | |
tongsim.connection.grpc.unary_api.UnaryAPI.arena_destroy_actor
async
staticmethod
¶
arena_destroy_actor(
conn: GrpcConnection, arena_id: str, actor_id: str
) -> bool
Remove an actor that was spawned inside the specified arena.
Returns:
| Name | Type | Description |
|---|---|---|
bool |
bool
|
True on success. |
Source code in src/tongsim/connection/grpc/unary_api.py
761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 | |