Tutorials & Examples
Overview
- Each example pairs a concise script with a single learning objective.
- Run commands from the repository root so path-relative imports resolve.
- Ensure
lesson-execis active before launching any client script.
Quick Reference
Walkthrough Highlights
Simple Movement
- Shows connection setup, VSID selection, and directional moves (
move_n_timeshelper in Python,MoveNTimesin C#) culminating in a square walk loop.
Feedback & Error Handling
- Examines
MovementResultproperties, demonstrates invalid move responses, and surfaces idle timeout messages; extend by piping diagnostics into logs or dashboards.
Multiple Agents
- Spawns several agents with unique VSIDs, applies weighted random motion, and respawns on death; adapt to share state or coordinate exploration strategies.
Async Movement
- Invokes
move_async/MoveAsyncto keep applications responsive; polling handles can evolve into event loops orasync Task Mainworkflows.
Async Multi-Agent
- Maintains parallel async handles, restarting them on completion while handling agent deaths; a foundation for actor-style orchestration.
Advanced Solution (C#)
- Demonstrates collaborative exploration with shared map knowledge and heuristics suitable for competitions or grading rubrics.
Custom Server (C#)
- Embeds
ConnectionHandlerinside a standalone host, illustrating how to extend or replacelesson-execwith bespoke infrastructure.
Troubleshooting Tips
- Module not found – run
pip install remote-explorer-game(orpip install -e .when developing locally) from the project root and launch Python from the same directory. - Server not reachable – verify the server URL/port, ensure
lesson-execis running, and watch the console logger for startup errors. - Identifier conflicts – choose a unique two-character VSID per agent, especially when sharing the Test World with classmates.
- Headless runs – when you use
--no-visualizer, enable file logging to track agent lifecycle events without the console UI.
Adapting the Examples
- Always choose unique VSIDs when running alongside classmates to avoid console collisions.
- Parameterize server URLs and usernames via environment variables for easier switching.
- Wrap loops with try/except or try/catch to ensure graceful shutdown on
KeyboardInterrupt. - Combine strategies (e.g., async + multi-agent) to tackle challenge worlds more effectively.
Related Reading
- Getting Started – installation, first agent walkthrough.
- Server Setup – tuning
lesson-exec, adding maps, and building custom hosts. - API Reference – deep dive into
RemoteGameSession,MovementResult, and data types.