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

feat: sound effects system #1017

Merged
merged 2 commits into from
May 8, 2023

Conversation

marcosvf132
Copy link
Contributor

@marcosvf132 marcosvf132 commented Apr 26, 2023

Co-Author

@dudantas
Client: https://github.com/dudantas/tibia-client/releases/tag/13.16.13209

Old PR

Old PR changes moved to this one to separate features by commits

Preview

Tibia.-.Marcos.Teste.2022-09-30.11-04-06.mp4

13.10

image

WIP

  • This PR implement a huge amount of features ingame that need time and test to verify all of then and to adjust the details on it.

Musics and anthem

  • Musics and anthem are not on this PR yet because i'm still catalogating then all, check for further commits on this PR.

Features implemented so far

Player combat

  • Player weapon sounds are implemented, with future adjustments like a specifc sound on a different item.
  • Wand and rods so far have the same sound, which will be changed on the next commits.

Monster combat

  • There is a script that run on monster spell declarations that automaticlly detect which spell sound it should be.
  • If the user want's to select a custom sound to a spell, can use the following tags:
    image
    image

Item movement

  • All items have sound on their movement, some can have the wrong sound, if you know an item that does not have the sound so accurated, please help me improving it.

Npc sounds

  • The NPC Canary does emit sounds on his sourrounds, check the new functions label on this description for more information.

New function

Enums

  • We have a LOT of sounds on tibia (512 so far), all those sounds are catalogated on the /src/creatures/creatures_definitions.hpp file, rigth here:
    image

NOTE: You can use then all on LUA env

C++

Sound movement

  • The item sound movement comes from this new function, based on item loot category. I know this is not 100% accurated but its the best shot so far.
  • The sound can change if the it's is being moved inside depot or player backpacks/inventory on the game.cpp call.
    image

Sound notification to spectators

  • On this topic we have 2 new functions, the first one is used to send a unique sound to the spectators on the area. It already check the sound source if it's coming from the own player, other player, a creature or it's meant to be a global sound. This source type is used on the client to balance and mix the volume as the player desire.
    image
  • This second function is used on distance weapons or any other sound that must be reproduced on a sequence. Like a casting sound and an impact sound.
    image

OnThink sounds

  • Some creatures emits sounds while in battle or when you get close to then. The first function is for the NPCs:
    image
  • The monsters sounds:
    image

Player client functions

  • The player.h functions are used to send the sound to the client, can be used to send a sound directly to the player client and not send to all the players on the area.
    image

Player sound functions

  • Functions that return the sound ID by the weapond attack and impact sound.
  • Impact function:
    image
  • Attack function:
    image

LUA

Spell (local spell = Spell("spell"))

  • We have the possibility to add sounds on the spell, can be the sound when casting the spell AND the sound when the spell hits the target/area.
  • Casting sound:
    image
  • Impact sound:
    image

Bestiary charm

  • We have the possibility to add sounds on the spell, can be the sound when casting the spell AND the sound when the spell hits the target/area.
    image

Npc

  • You can add sound effects on the NPC just like the old text system, can be used as a environment sound as a blacksmith sound, hitting a wood, casting a spell etc.
  • A random sound will be picked on the list to be reproduced.
    image

Position

  • You can used this function to send sounds on the specific position, just like the position:sendMagicEffect(...)
    image
    image

The optional 'actor' on this function right here can be used to specify if you want to send the sound pretending is was coming from the creature. If you don't send a creature on the param, it will be sent as a global sound.

XML

  • The imbuement system can emits sounds too, you can set a sound on the imbuements.xml files be using the id:
    image

@dudantas dudantas changed the title [Enhancement] - Sound effects feature feat: sound effects feature Apr 26, 2023
@dudantas dudantas changed the title feat: sound effects feature feat: sound effects system Apr 26, 2023
@vitorfrancisco
Copy link

13.11 ou 13.10 pra fazer funcionar? to tomando crash no 13.11

@elsongabriel
Copy link
Contributor

elsongabriel commented Apr 27, 2023

13.11 ou 13.10 pra fazer funcionar? to tomando crash no 13.11

então mano. teve uma atualização na main, que mudou a versão 12.91 para 13.16.
consequentemente o client 13.11 e 13.10, não vai mais permitir logar-se.

o PR anterior #531 foi fechado, e novos PR's com as funcionalidades do client 13 foram abertos.

@LeoBorges18

This comment was marked as off-topic.

@dudantas
Copy link
Member

13.11 ou 13.10 pra fazer funcionar? to tomando crash no 13.11

13.16

@dudantas dudantas force-pushed the sound-effects-feature branch from 0c62666 to 33f9d59 Compare April 28, 2023 20:15
@Issolofreedom
Copy link

Sons dos potions não estão saindo.

@dudantas dudantas force-pushed the sound-effects-feature branch 2 times, most recently from 8827e2e to 370d085 Compare April 29, 2023 18:27
@dudantas dudantas force-pushed the sound-effects-feature branch from 5167510 to d23b736 Compare April 29, 2023 20:30
@Issolofreedom
Copy link

NPC Chuckles em yalahar fazendo o client crashar

@QuebradaZN
Copy link
Contributor

NPC Chuckles em yalahar fazendo o client crashar

Testei lá e aqui não aconteceu.

Aqui tambem, testei e não crashou o Client!

@LeoBorges18
Copy link

NPC Chuckles em yalahar fazendo o client crashar

Testei aqui e não crashou tb

libergod referenced this pull request in libergod/canary_baiak May 2, 2023
@dudantas
Copy link
Member

dudantas commented May 8, 2023

Sons dos potions não estão saindo.

Isto vai ficar para depois.. Aparentemente o id do som está errado, se alguém souber o id me avisa.

@QuebradaZN
Copy link
Contributor

Sons dos potions não estão saindo.

Isto vai ficar para depois.. Aparentemente o id do som está errado, se alguém souber o id me avisa.

Dos Foods Tambem não!

@dudantas dudantas force-pushed the sound-effects-feature branch from dda63df to 3f55083 Compare May 8, 2023 16:45
The sound system will be split into two commits, one for the core (required) and the other for the scripts (optional).

This commit contains the "core" part of source and lua, they are needed for the scripts with sound modifications to work correctly and are needed for the server and the sounds to work correctly.
@dudantas dudantas force-pushed the sound-effects-feature branch 2 times, most recently from 052b32a to 9626610 Compare May 8, 2023 17:27
@elsongabriel
Copy link
Contributor

testado.. e agora tá ok..

@Lanemosme
Copy link

Pessoal, andei fazendo uns testes aqui, e o cliente tá crashando quando usado uma mana potion, e algo bem aleatório, as vezes crasha e as vezes não, mais alguém passando por isso?

This commit contains the non-mandatory files for the sound system, which are not absolutely necessary, but if not added, certain sounds will not work. To see the commit where the "core" part was added, look at the commit before this one.
@dudantas dudantas force-pushed the sound-effects-feature branch from 9626610 to 4bcd2e9 Compare May 8, 2023 22:09
@dudantas
Copy link
Member

dudantas commented May 8, 2023

Pessoal, andei fazendo uns testes aqui, e o cliente tá crashando quando usado uma mana potion, e algo bem aleatório, as vezes crasha e as vezes não, mais alguém passando por isso?

Aqui não tive isso. Não sei se faz sentido também, porque a alteração que teve foi o som, aí daria debug sempre. Você ta usando a branch limpa? Client 13.16?

@Lanemosme
Copy link

Pessoal, andei fazendo uns testes aqui, e o cliente tá crashando quando usado uma mana potion, e algo bem aleatório, as vezes crasha e as vezes não, mais alguém passando por isso?

Aqui não tive isso. Não sei se faz sentido também, porque a alteração que teve foi o som, aí daria debug sempre. Você ta usando a branch limpa? Client 13.16?

Acabei de atualizar tudo aqui, já testei também, problema resolvido 👊🏻

@sonarqubecloud
Copy link

sonarqubecloud bot commented May 8, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 13 Code Smells

0.0% 0.0% Coverage
2.4% 2.4% Duplication

@dudantas dudantas merged commit bb02277 into opentibiabr:main May 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants