# Hyperfy Discord - 2025-01-27

## Overall Discussion Highlights

### Hyperfy V2 Development
- **Script Editor Improvements**: Autocomplete functionality for the script editor using Monaco with JSDocs generated from markdown documentation is being implemented
- **Sky and HDR Consolidation**: Sky and HDR nodes are being consolidated into a single 'sky' node with properties for background, HDR, time, intensity, and fog
- **App Inspection**: Enhanced features allowing precise adjustments and the ability to freeze apps to prevent accidental movement
- **First-Person Camera**: Implementation with toggle functionality (key 'C') is available
- **Client/Server Organization**: Discussions about separating client and server code into different files to improve readability
- **UI Components**: Development includes pointer events with event bubbling similar to web standards

### Platform Infrastructure
- **Hyperfy V2 Status**: V2 is released but still in early development with limited features
- **HyperWorld.Host**: Running on Hyperfy v2, offering hosting services but currently with barebones functionality
- **Digital Ocean Deployment**: Users troubleshooting node version issues and environment configuration when deploying Hyperfy worlds
- **World Persistence**: Currently worlds remain running even without users present

### Content Creation
- **360° VR Experiences**: MetaRick demonstrated a technique using a sphere with inverted normals to project 360° video content
- **Object Duplication**: Discussion about how duplicated objects with position-setting scripts all stack at the same coordinates by design
- **3D Model Integration**: Users working on implementing food-related designs and character races

### Marketplace & Monetization
- **App Marketplace Plans**: HPrivakos shared plans for an open repository of scripts and an app marketplace on hyperworld.host
- **Fee Structure**: Proposed marketplace would include fees that benefit both the platform and the Hyperfy DAO
- **Token Utilization**: Discussions about using a portion of vesting tokens to fund hackathons and tournaments

### AI Integration
- **Agent Development**: Hyperfy is collaborating with companies to develop a no-code solution for launching Eliza agents with Hyperfy integration
- **Current State**: Users can currently run their own Eliza server that connects to Hyperfy agents in-world

### Roadmap & Vision
- **Long-term Goals**: Ashxn outlined four key objectives:
  1. Enable non-technical users to build and explore worlds
  2. Allow developers to create powerful apps/tools/platforms
  3. Enable 3D artists to bring content to life without code
  4. Create environments where AI agents can freely co-exist in worlds

## Key Questions & Answers

### Development & Technical
- **Q**: How can I spawn a model programmatically?  
  **A**: There is a non-documented way to make boxes: `const box = app.create('mesh'); box.type = 'box'; box.setSize(1,3,1); app.add(box);`

- **Q**: Why does clicking a child UI container trigger both child and parent click events?  
  **A**: This is expected behavior using event bubbling similar to web standards. You can prevent bubbling with `e.stopPropagation()` in the child handler.

- **Q**: How do I get the playerId for `world.getPlayer('playerid')`?  
  **A**: You can get it from events like `world.on('enter|leave', e => e.player)` and trigger/contact events.

- **Q**: How do I switch to first-person view?  
  **A**: Press the 'C' key to toggle between third and first-person views.

- **Q**: Is position supposed to override duplicate positions?  
  **A**: Yes, duplicated objects share the same script, so position settings affect all linked instances.

### Platform & Infrastructure
- **Q**: If we host a hyperfy using our own server, can we develop something to let this world connect to any chains we want?  
  **A**: Yes, there's a Solana branch on the official repo, and the same approach could be done for any chain.

- **Q**: Where are the tutorials to easily deploy on Digital Ocean?  
  **A**: Found at https://github.com/hyperfy-xyz/hyperfy/wiki/Deploy-a-world-(Digital-Ocean)

- **Q**: Is Hyperfy good for a 360 VR cinema experience?  
  **A**: It's possible by projecting video onto a sphere with inverted normals, as demonstrated by MetaRick.

- **Q**: Would you argue that Hyperfy worlds are persistent despite the fact that the DAO could turn off the Hyperfy server?  
  **A**: Nobody can stop Hyperfy, not even if the team or DAO wanted to.

### Marketplace & Integration
- **Q**: What would be the easiest way to integrate the ability for visitors to buy merch in a Hyperfy world?  
  **A**: In v1 you can use a WebView to show your store website in-world or attach click listeners to digital versions that open a buy page in a new tab.

- **Q**: How will scripts and code modules be shared in Hyperfy?  
  **A**: We plan to have an open repository of scripts and also an app marketplace on hyperworld.host

- **Q**: Will there be monetization for the script marketplace?  
  **A**: We plan to take small fees on paid apps and share between us and the Hyperfy DAO

- **Q**: Where are we at with agents?  
  **A**: You can run your own Eliza server that connects to Hyperfy agents in-world right now. We're also working with companies on no-code solutions.

## Community Help & Collaboration

### Development Assistance
- **Ashxn** helped **Lastraum** with UI event bubbling, explaining behavior and providing code example using e.stopPropagation() to prevent events from bubbling up to parent containers
- **Ashxn** helped **peezy** with spawning models programmatically, providing non-documented code to create box primitives
- **peezy** shared a utility function to traverse up the node hierarchy to find the root parent of an app
- **peezy** implemented autocomplete functionality for app and world objects with documentation snippets

### Infrastructure Support
- **devilsadvocate.sol** helped **emotionull** troubleshoot deployment errors on Digital Ocean, identifying potential node version error and missing .env file as likely causes
- **HPrivakos** provided step-by-step commands for installing NVM and Node.js v22 on a server
- **maximus** shared peezy's documentation link as an alternative reference for Digital Ocean deployment

### Content Creation
- **MetaRick** demonstrated a working example using a sphere with inverted normals to project 360° video content
- **voxvienne** suggested using a light app with the video as source to get dynamic illumination from the VR scene
- **ash** explained the linking behavior of duplicated objects and provided code example for relative positioning

## Action Items

### Technical
- Implement client/server file separation for scripts to improve code organization (mentioned by peezy and Saori)
- Fix the sky app to properly show which files are currently in use (mentioned by ᲼)
- Add world.getPlayer() functionality to get the local player on client (mentioned by Ashxn)
- Implement world.getApps() to retrieve all apps in a world (mentioned by devilsadvocate.sol)
- Convert first-person camera implementation from core to an app (mentioned by peezy and ᲼)
- Add player anchor points for vehicles (like jet cockpit) (mentioned by Ashxn)
- Implement modular code system for Hyperfy objects (mentioned by Morph)
- Create open repository of scripts for Hyperfy (mentioned by HPrivakos)
- Develop app marketplace on hyperworld.host (mentioned by HPrivakos)
- Investigate issue with GLB file uploads on Hyperworld.Host (mentioned by Zen)
- Consider decoupling position for duplicated objects (mentioned by general hyper)
- Investigate crash in the eliza app for v2 (mentioned by .hyp shaman)
- Make play.hyperfy.xyz more of a curated playground with ball, pets, jet, tank, rickbot, etc. (mentioned by Ashxn)
- Try local implementation again for agents (mentioned by bitpixi)

### Documentation
- Document the new pointer events (onPointerDown, onPointerEnter, onPointerLeave) (mentioned by devilsadvocate.sol)
- Create a documentation world ("learn.hyperfy.xyz") for interactive learning (mentioned by devilsadvocate.sol, ᲼, and Saori)
- Document joint and avatar node functionality (mentioned by devilsadvocate.sol)
- Document behavior of linked scripts in duplicated objects (mentioned by general hyper)
- Create patterns for handling object positioning (mentioned by ash)
- Create comprehensive documentation for V2 (mentioned by Saori)
- Add .env configuration issues to troubleshooting documentation (mentioned by devilsadvocate.sol)
- Create brand documentation before executing marketing campaigns (mentioned by ckbubbles)
- Review the shared Hyperfy 2 infrastructure documentation (mentioned by DevStarlight)

### Feature
- Add multiple scripts per app to better organize code (mentioned by Ashxn and Saori)
- Implement AI code completion for the script editor (mentioned by Saori and peezy)
- Add a world.emit() example for turning lights on/off with multiple switches (mentioned by devilsadvocate.sol)
- Create code marketplace where developers can sell addons for $HYPER (mentioned by Morph)
- Implement tournament system with HYPER prizes (mentioned by Saori)
- Organize hackathon for app development (mentioned by Saori)
- Develop UI for sharing apps (mentioned by Saori)
- Implement AI-ready platform capabilities (mentioned by cru)
- No-code Eliza agent with Hyperfy integration (mentioned by Ashxn)
- Implement world swapping capability (mentioned by general hyper)
- Add option to duplicate as group vs individual objects (mentioned by general hyper)
- Develop a section on the website for brand assets and social media content (mentioned by devilsadvocate.sol)
- Create an invite-only world for sharing apps and knowledge (mentioned by Saori)
- Implement experience leveling, cosmetics/titles, and leaderboards for stock exchange world (mentioned by Uuuuuuuuu)