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

Add: Shuttle sounds #1058

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Add: Shuttle sounds #1058

wants to merge 2 commits into from

Conversation

dj-34
Copy link
Collaborator

@dj-34 dj-34 commented Jan 23, 2025

Что этот PR делает

Добавляет звуки для шаттлов помимо arrival и emergency с Пары.
Подробности в Чейнджлоге и в изображениях.

Также есть некоторые моменты, которые я возможно исправлю позже (в будущем, если будет не все равно/будет и так нормально):

  1. Наружный звук прибытия не звучит на дальнем и не имеет изменного звука в зависимости от расстояния по примеру с отбытием.
  2. Звук отлета хотел бы видеть времена получше, возможно его хвост стоит чутка улучшить.

Почему это хорошо для игры

В отличии от имплементации на Паре, здесь я провел несколько улучшений:

  1. Используются проки кора, благодаря чему оно консистентно. Звуки слышны как на шаттле, так и вне его. Также учитывается расстояние и применяется соответствующий прок.
  2. Позволяет в игре заменять звук шаттла админскими кнопочками.
  3. Возможность расширения - позволяет иметь кастомный звук каждому шаттлу.
  4. Учитывает время взлёта, полёта и посадки, благодаря чему звук всегда будет проигрываться когда надо.

Изображения изменений

shuttle_sounds_1.mp4
shuttle_sounds_2.mp4

Тестирование

5000 часов и ГОДЫ тестирований на локалке.

Changelog

🆑
sound: Добавлены звуки отлёта шаттлам, всем кроме шаттла прибытия и отбытия - у них свои звуки.
code_imp: Теперь при стыковке (как для тех кто снаружи, так и для тех кто внутри шаттла) будет проигрываться звук прилета.
code_imp: Теперь при отстыковке (как для тех кто снаружи, так и для тех кто внутри шаттла) будет проигрываться звук отлёта. Также используемый звук меняется от расстояния.
/:cl:

Copy link

sourcery-ai bot commented Jan 23, 2025

Reviewer's Guide by Sourcery

This pull request introduces new departure and arrival sounds for shuttles, improving the auditory feedback during shuttle operations. It also allows for customization of these sounds via admin controls and considers the timing of different flight phases to ensure accurate sound playback.

Sequence diagram for shuttle sound playback during departure and arrival

sequenceDiagram
    participant S as Shuttle
    participant P as Player
    participant A as Audio System
    Note over S: Mode: SHUTTLE_IGNITING
    alt 3 seconds before ignition
        S->>A: Play hyperspace_warmup sound
        A->>P: Play sound based on location
    end
    Note over S: Mode: SHUTTLE_CALL
    alt 2 seconds before arrival
        S->>A: Play hyperspace_end sound
        A->>P: Play sound in shuttle areas
        S->>A: Play arrival sound at destination
        A->>P: Play sound at docking point
    end
Loading

Class diagram for shuttle sound system modifications

classDiagram
    class obj_docking_port_mobile {
        +bool sound_played_start
        +bool sound_played_end
        +sound custom_hyperspace_warmup_sound
        +sound custom_hyperspace_end_sound
        +get_custom_sound(phase)
        +check()
    }
    note for obj_docking_port_mobile "New sound-related attributes and methods added"
Loading

State diagram for shuttle sound system

stateDiagram-v2
    [*] --> IDLE
    IDLE --> IGNITING: Departure initiated
    IGNITING --> CALL: Launch
    CALL --> IDLE: Arrival

    state IGNITING {
        [*] --> NoSound
        NoSound --> WarmupSound: 3s before launch
    }

    state CALL {
        [*] --> InFlight
        InFlight --> ArrivalSound: 2s before docking
    }

    state IDLE {
        ResetSoundFlags: sound_played_start = false
        ResetSoundFlags: sound_played_end = false
    }
Loading

File-Level Changes

Change Details Files
Added custom departure and arrival sounds for shuttles.
  • Added custom_hyperspace_warmup_sound and custom_hyperspace_end_sound variables to the /obj/docking_port/mobile object.
  • Implemented get_custom_sound proc to allow overriding default sounds.
  • Modified hyperspace_sound to use custom sounds if available.
  • Added logic to play sounds at the correct time during shuttle ignition and arrival phases.
  • Added logic to reset sound flags when the shuttle is idle.
code/modules/shuttle/mobile_port/mobile_port.dm
modular_bandastation/aesthetics_sounds/code/shuttle.dm
Modified the sound playback logic to use core proking for consistent sound experience.
  • Utilized core proking to ensure sounds are audible both inside and outside the shuttle.
  • Ensured sound volume is affected by distance.
code/modules/shuttle/mobile_port/mobile_port.dm

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!
  • Generate a plan of action for an issue: Comment @sourcery-ai plan on
    an issue to generate a plan of action for it.

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@github-actions github-actions bot added the 🔉 Звук Нам скорее всего нравится как это звучит. label Jan 23, 2025
@ss220app ss220app bot added the 📜 CL валиден Этот чейнджлог будет успешно опубликован label Jan 23, 2025
@dj-34 dj-34 force-pushed the shuttle_sounds branch 2 times, most recently from ff58774 to b208469 Compare January 23, 2025 17:55
@Gaxeer Gaxeer added the 🔬 Testmerge Active Находится в тестмерже на сервере label Jan 23, 2025
Copy link
Collaborator

@Gaxeer Gaxeer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Код стоит переписать. В дискорде обсудим

code/modules/shuttle/mobile_port/shuttle_move_callbacks.dm Outdated Show resolved Hide resolved
Comment on lines +704 to +705
/obj/docking_port/mobile/proc/get_custom_sound(phase)
return null
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

в модуль

Copy link

github-actions bot commented Feb 7, 2025

This PR has been inactive for long enough to be automatically marked as stale. This means it is at risk of being auto closed in ~ 7 days, please address any outstanding review items and ensure your PR is finished, if these are all true and you are auto-staled anyway, you need to actively ask maintainers if your PR will be merged. Once you have done any of the previous actions then you should request a maintainer remove the stale label on your PR, to reset the stale timer. If you feel no maintainer will respond in that time, you may wish to close this PR youself, while you seek maintainer comment, as you will then be able to reopen the PR yourself

@github-actions github-actions bot added the 💩 Stale Кажется всем похуй на этот ПР. Жизнь сурова... label Feb 7, 2025
@dj-34 dj-34 added 🛡️ Stale Exempt ПР не может быть устаревшим. Но всем всё равно на него похуй. and removed 💩 Stale Кажется всем похуй на этот ПР. Жизнь сурова... labels Feb 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🔬 Testmerge Active Находится в тестмерже на сервере 📜 CL валиден Этот чейнджлог будет успешно опубликован 🛡️ Stale Exempt ПР не может быть устаревшим. Но всем всё равно на него похуй. 🔉 Звук Нам скорее всего нравится как это звучит.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants