# Hyperfy Discord - 2025-02-22

## Overall Discussion Highlights

### Technical Development
- **Effects System Improvements**: Ashxn proposed moving from `player.setEffect()` to `world.setEffect()` and later to `control.setEffect()` to better track app lifecycles and prevent players from getting stuck with effects. The new system includes a "turn" option that makes players face the camera direction.
- **Documentation Efforts**: Omka is working on consolidating documentation from various sources into hyperfy.how, with plans for in-world documentation and UI components including a search node for .hyp files or commands.
- **Physics Implementation**: Ashxn clarified that Hyperfy runs physics on CPU with WASM supporting SIMD, addressing concerns about NVIDIA RTX 50-series GPUs no longer supporting PhysX.
- **World Cleaning Tool**: Discussions about the `world-clean.mjs` script (accessible via `npm run world:clean`), which removes unnecessary files from Hyperfy worlds. Ash warned that the cleaner should not be run while a world is active as it could delete files not yet saved to the database.
- **Websocket Configuration Issue**: A critical bug was identified where http:// was incorrectly used instead of ws:// or wss:// in the .env file, causing loading problems specifically on iOS devices and Safari.

### AI & Agents
- **Fine-tuning vs. Context Debate**: Users discussed trade-offs between fine-tuning LLMs versus using context for AI agents, with cost efficiency and accuracy being key considerations. Fine-tuning was deemed better for static baseline behaviors, while context works better for dynamic information.
- **Implementation Progress**: One user shared progress on getting a Mistral model working with Hugging Face's API, while another mentioned developing a Python-based agent with API integration.

### 3D Design & Optimization
- **Material Batching Approach**: TheMattEmpire proposed applying materials within Hyperfy rather than embedding them in GLB files, potentially enabling custom shaders.
- **Optimization Techniques**: Discussions about palette texturing with small (16x16 or 32x32) textures to create lightweight assets, with emphasis on the technical limitations of browsers compared to native applications.
- **Avatar Optimization**: Consensus that web-based environments require much more optimization (suggested 15k polygons or fewer for avatars) compared to triple-A games that use avatars with approximately 80k polygons.

### Community Projects
- **Racing Game Development**: TheMattEmpire is working on road components for a racing kit, including ramps, slopes, and bridges, with plans to separate features into different kits for modularity.
- **Pet Companion App**: ~/MayD524/Hyperfy is developing an app that follows players, avoids obstacles, teleports when stuck, and is fully networked, currently working on reducing the model size and fixing bugs.
- **NPC Controller**: Ashxn shared a demo of an NPC controller that can traverse colliders and has gravity.
- **Documentation Search Tool**: Omka is developing a search tool with JSON data.

### Platform Evolution
- **V1 to V2 Transition**: Saori confirmed that V1 apps will eventually be ported to V2 and made available on marketplaces like hyperworld.host, though this will be partly community-driven.
- **Hosting Solutions**: Discussion about pricing models for HyperWorld instances, with estimates ranging from $3.2-9 per world per month, with potential bulk discounts. HypPrivakos mentioned running hyperworld.host with a $5 USD plan.

## Key Questions & Answers

### Technical Implementation
- **Q**: How can we prevent players from getting stuck with effects when an app is modified?  
  **A**: Move from player.setEffect() to world.setEffect() to track app lifecycle and cancel effects when apps are deleted/modified (Ashxn)

- **Q**: How do you hide an avatar from a script?  
  **A**: Use avatar.active = false to completely unmount nodes (Ashxn)

- **Q**: What does `node world-clean.mjs` do?  
  **A**: It cleans all the unnecessary leftovers from 'deleting' (Omka)

- **Q**: Should world-clean run during server startup?  
  **A**: It might be risky as it could potentially delete the wrong things (ash)

- **Q**: How do you get rid of the grass in Hyperworld?  
  **A**: Currently no no-code way to turn it off; in v1 the grid was just an app you could delete (Ashxn)

### AI & Agents
- **Q**: What's the difference between fine-tuning and using context?  
  **A**: Fine-tuning changes the weights on the model to better suit specific needs, while context is information fed to the model at runtime (maximus)

- **Q**: When would you want to tune a model vs feed it context?  
  **A**: It's a balance - fine-tuning is good for baseline behaviors while context works better for dynamic information; efficiency is a big factor (maximus)

### 3D Design & Optimization
- **Q**: What's the ideal polygon count for web avatars?  
  **A**: Around 15k is medium, but it depends on your end experience and must consider material count and texture resolution (TheMattEmpire)

- **Q**: What limits web performance more - polygons or textures?  
  **A**: For filesize, textures are worse than polygons. For processing cost, it depends (TheMattEmpire)

### Platform Questions
- **Q**: Do we still need an NFT to create a world?  
  **A**: For v2, no NFT is needed (Omka)

- **Q**: Will the apps from V1 be ported over to V2 at some stage?  
  **A**: Yes (Saori)

- **Q**: I still don't understand how PhysX works in the browser without a Nvidia card  
  **A**: It's just a physics engine that simulates based on colliders (Ashxn)

- **Q**: Is R2 compatible with S3?  
  **A**: Yes, R2 is S3-compatible (HypPrivakos)

## Community Help & Collaboration

1. **Effects System Implementation**  
   Ashxn helped Shiffty implement throwing mechanics with the new effects system by adding a "turn" option to effects that makes players face camera direction.

2. **Avatar Source Access**  
   Saori helped devilsadvocate.sol with downloading VRM files from avatars by sharing code showing how to access avatar source URL with app.avatar.src.

3. **PhysX Clarification**  
   Ashxn helped devilsadvocate.sol understand how PhysX works in browser without Nvidia card by explaining it's just a physics engine that simulates based on colliders.

4. **World Creation in V2**  
   Omka helped IamKR understand that NFTs are no longer required to create worlds in V2 and provided links to setup instructions.

5. **Optimization Requirements**  
   TheMattEmpire helped devilsadvocate.sol understand optimization requirements for web-based 3D assets by explaining that web browsers have hard limits unlike native clients.

6. **iOS Loading Issue Resolution**  
   Ash identified a critical websocket URL configuration issue causing loading problems on iOS devices, advising to use ws:// or wss:// instead of http://.

7. **World Cleaning Safety**  
   Ash provided detailed explanation of how running world-clean while a world is active could delete files not yet saved to database.

8. **Fine-tuning vs. Context Education**  
   Maximus shared educational resources including articles from DataCamp and Medium to help devilsadvocate.sol understand the difference between fine-tuning and context for AI models.

## Action Items

### Technical
- Move setEffect to control system for better app lifecycle management (Ashxn)
- Add a toggle for disabling the default ground/grid (MetaRick)
- Implement hidden props for sensitive data (devilsadvocate.sol)
- Add jump button and interaction equivalent for mobile (Ashxn)
- Fix chat functionality on mobile (devilsadvocate.sol)
- Migrate v1 apps to v2 (Saori)
- Implement Python-based agent with API integration (devilsadvocate.sol)
- Test performance differences between tuned models and context-fed models (devilsadvocate.sol)
- Explore material batching approach where materials are applied within Hyperfy rather than embedded in GLB files (TheMattEmpire)
- Fix download error on opensourceavatars.com website (ToxSam)
- Don't run world-clean.mjs while a world is running to prevent data loss (ash)
- Debug why world-clean kills some hosted worlds exceeding 1GB (HypPrivakos)
- Implement a force save command for worlds (ash)
- Create a save/shutdown/clean/restart cycle for safer world cleaning (HowieDuhzit)
- Fix the .env.example file to use ws:// or wss:// instead of http:// for websocket URLs (ash)
- Investigate why the world-clean feature is deleting necessary files (ash)
- Reduce pet companion model size from 17mb (~/MayD524/Hyperfy)
- Fix bugs in pet companion app before release (~/MayD524/Hyperfy)
- Ensure VR racing compatibility at 90 FPS minimum (TheMattEmpire)

### Documentation
- Create documentation search tool with JSON data (Omka)
- Add each app that can be remade from v1 to GitHub board (Saori)
- Avoid using Mona's content in documentation (TheMattEmpire)
- Create explanatory materials about fine-tuning vs context (devilsadvocate.sol)
- Consolidate documentation from various sources into hyperfy.how (Omka)
- Create in-world documentation (Omka)
- Develop .hyp or commands search node for in-world reference (Omka)
- Decide whether to keep Blender exporter documentation or direct users to Hyperfy Tools (Omka)
- Create a tutorial on using Coolify for Hyperfy deployment (ash)
- Document the proper workflow for running world-clean safely (ash)
- Update documentation to specify the correct websocket protocol (ws:// or wss://) for different browsers (ash)

### Features
- Create permission system with different admin levels (devilsadvocate.sol)
- Add ability to download VRM files directly (devilsadvocate.sol)
- Implement secrets storage in world settings (devilsadvocate.sol)
- Port V1 apps to V2 (Saori)
- Explore fine-tuning as a service (FTAAS) (MetaMike)
- Token flywheel implementation when market recovers (coard)
- Create a rigging course (15 minutes max) (᲼)
- Create a "make your first animation for hyperfy avatars" course (peezy)
- Add option to disable auto-save and implement a manual save button/command (ash)
- Add bridges to the road kit (TheMattEmpire)
- Create separate kit for boost and power ups (TheMattEmpire)
- Add pit road elements to racing kit (TheMattEmpire)
- Consider adding over-banked curves to road kit (Agent12)