This week saw less direct contribution to the project, and had a greater testing and learning component to it. Most of my time in the past week was devoted to a different Aframe project that involved a multi-user interaction with a cooperative and competitive component. I used this project as a guinea pig to test out Networked-Aframe and some more 'advanced' Aframe design patterns (~25 hours).
Networked-Aframe is a framework built on top of Aframe that integrates WebSockets and component syncing to streamline the process of creating multi-user Aframe projects. The main feature of Networked-Aframe we are interested in was the voice chat support, as we feel it could be a great feature to have for playing the game with friends remotely. However, I also set out to see if there are other features in the framework that could be useful in developing our project. An element I did find useful was component syncing, which uses HTML <template/> tags to create entities that have their components synced across all clients. Only the 'position' and 'rotation' components are synced by default, but implementing custom components is quite simple, as shown below.
The above code, taken from the Networked Aframe GitHub, shows the implementation for syncing the custom 'show-child' component, as well as the 'material' component. However, due to the nature of our project, where each player will be in their own environment and will not need synced entities, using Networked Aframe just for voice chat may be overkill.
Finally, I also took the time to experiment with the Aframe systems element. Systems provide overarching management and services to the entire application, and they are often used to manage the game state or NPC elements of games. These systems rely on events to communicate with various components in the application. My first attempt was not wholly successful, but I figured out a lot of does-and-don'ts for when it comes time to implement such systems in Build-A-Furniture
Networked-Aframe is a framework built on top of Aframe that integrates WebSockets and component syncing to streamline the process of creating multi-user Aframe projects. The main feature of Networked-Aframe we are interested in was the voice chat support, as we feel it could be a great feature to have for playing the game with friends remotely. However, I also set out to see if there are other features in the framework that could be useful in developing our project. An element I did find useful was component syncing, which uses HTML <template/> tags to create entities that have their components synced across all clients. Only the 'position' and 'rotation' components are synced by default, but implementing custom components is quite simple, as shown below.
NAF.schemas.add({ template: '#avatar-template', components: [ 'position', 'rotation', 'scale', { selector: '.hairs', component: 'show-child' }, { selector: '.head', component: 'material', property: 'color' }, ] });
The above code, taken from the Networked Aframe GitHub, shows the implementation for syncing the custom 'show-child' component, as well as the 'material' component. However, due to the nature of our project, where each player will be in their own environment and will not need synced entities, using Networked Aframe just for voice chat may be overkill.
Finally, I also took the time to experiment with the Aframe systems element. Systems provide overarching management and services to the entire application, and they are often used to manage the game state or NPC elements of games. These systems rely on events to communicate with various components in the application. My first attempt was not wholly successful, but I figured out a lot of does-and-don'ts for when it comes time to implement such systems in Build-A-Furniture
Comments
Post a Comment