Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backend of our AudioServer #1

Open
CoasterFreakDE opened this issue Apr 24, 2024 · 5 comments
Open

Backend of our AudioServer #1

CoasterFreakDE opened this issue Apr 24, 2024 · 5 comments
Labels
enhancement New feature or request

Comments

@CoasterFreakDE
Copy link
Member

CoasterFreakDE commented Apr 24, 2024

We can take parts of @Joeywp 's integration from CraftVenture: https://github.com/Craftventure/open-plugin-parts/tree/main/net/craftventure/audioserver

For better immersion, the park audio should be played from defined speakers and not globally as on CV.

The Audio Server has to be able to perform various actions:

  • Multiple spacial audio streams at the same time
  • Global / Mono audio for background music
  • Realtime changes for player movement
@CoasterFreakDE CoasterFreakDE added the enhancement New feature or request label Apr 25, 2024
@Joeywp
Copy link

Joeywp commented Apr 25, 2024

Would not recommend to take parts from it, but rather use it for inspiration. That code is from 2015 and is kinda dated by now. Part of it is because I used to do a lot of calculations on the client to save on resources at the server, but nowadays I would rather do that on the server as it caused several issues in the past. Would be best to do most logic (like overrides) on the server and have a dumb client. Would also recommend to use KotlinX serializable over of moshi and to use sealed classes for the packets.

Could also recommend trying to put a much code into a common Kotlin module, so you can share it between a website version of the AudioServer (perhaps done using Kotlin Compose Desktop), perhaps a desktop version and of course the server itself.

@CoasterFreakDE
Copy link
Member Author

Thanks for the advice. <3

Yeah, I would definitely use KotlinX serializable and most of the logic on the server side.
Moreover, for the first iteration we focus on just the audio part, but the system should also be easily extendable to allow more integrations later on.

As for the common module, we first need to discuss which language and framework to use for the website.
If it is not JVM-Based, a common module wouldn't make sense.

@CoasterFreakDE
Copy link
Member Author

CoasterFreakDE commented Apr 28, 2024

I think it would be best to use Server-Sent Events for the main part of the audio server.
As we use way more requests from the server to the client, it is way more performant to use SSE for server to client messages and for client to server simple rest requests.

image

https://ktor.io/docs/3.0.0-beta-1/sse-client.html#example
https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events

@CoasterFreakDE
Copy link
Member Author

CoasterFreakDE commented Apr 30, 2024

We decided to add a standalone audio-server instance for calculations, audio manipulations and more.
The Minecraft server(s) send their positioning and audio data via RabbitMQ to our standalone Audio Server, which processes the information and then sends the audio directly to the website.

@CoasterFreakDE CoasterFreakDE transferred this issue from BlockVentureMC/VentureLibs Apr 30, 2024
@CoasterFreakDE
Copy link
Member Author

CoasterFreakDE commented Apr 30, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants