[Suggestion] Voicepack rework

6 replies [Last post]
KoBeWi
KoBeWi's picture
User offline. Last seen 3 days 13 hours ago. Offline
Joined: 2010-12-25
Posts: 564

I recently tried to make my own voicepack. I noticed that taunts are a bit of inconsistent mess. They are named after quote and it's not always clear when it plays. E.g. sndNutter and sndWatchIt have the same description, so does that mean they play randomly? Also, why there are 6 (six!) firepunch sounds? It's not a weapon that's used so frequently. (maybe now it doesn't sound like serious problems, but whatever)

I propose a complete rework of taunts. They are too stiff and non-intuitive.
>First, all sounds should be named after what they are used for. So if sndNutte and sndWatchIt do the same, they should be called e.g. SelfTeamDamage1 and SelfTeamDamage2.
>Second, the number of sounds for each action should be arbitrary. Why so many firepunch sounds? Maybe I want few random jump sounds?

That makes it a bit complicated to do (mostly because Pascal), but the game should scan voicepack for names and make arrays of sounds for the same function. Then during gameplay, a function playTaunt(name) would be called, which would choose random sound from that group and play it. For older voicepacks, first it would be determined if there are some old-named sounds in the pack and then they'd be assigned to proper arrays.

That's it. I can make a list of current taunts and new proposed names. Also, maybe we could allow for empty taunt groups to be potentially filled by creators (i.e. taunts not used in default voicepack, like some theme features used only by me ¯\_(ツ)_/¯) and make taunts for more actions. That would make a nice customization.

Lyberta
Lyberta's picture
User offline. Last seen 3 years 30 weeks ago. Offline
Joined: 2016-09-10
Posts: 177

KoBeWi allegedly wrote:
That makes it a bit complicated to do (mostly because Pascal)

Should be actually easy for someone who knows Pascal. I mean just a loop with string concatenation and checking if file exists.

Yes, I would really like good names in code.

KoBeWi
KoBeWi's picture
User offline. Last seen 3 days 13 hours ago. Offline
Joined: 2010-12-25
Posts: 564

Lyberta allegedly wrote:
Should be actually easy for someone who knows Pascal.
Maybe. I'm not really that much into Pascal to know what it can, but after seeing how theme config is read, I have rather low expectations.

It would be complicated at least comparing to other languages. E.g. in Ruby it would look like this:

(Dir.entries("voicepack") - [".", ".."]).each {|filename|
    groups[filename.sub(/\d+.ogg/, '')] << loadSoundFile(filename)}

It loads the file and puts it into correct group by truncating number and extension from filename. It could be one line, but I broke it into 2 for forum readability.

EDIT:
List of proposed names (for files). Skipped sounds have their equivalent (e.g. sndBoring and sndCoward) and each sound can have a number at the end, e.g. EnemySkip1, EnemySkip2 and either one of them will be played randomly. I tried to be descriptive, but some of them might need clarification (better name). Also, there could be more added as I mentioned.

sndBoring - EnemySkip
sndByeBye - Goodbye
sndComeonthen - Ready
sndEnemyDown - EnemyKilled
sndFirePunch1 - FirePunch
sndFirstBlood - FirstBlood
sndFlawless - FlawlessVictory
sndHello - Greeting
sndHurry - HurryUp
sndIllGetYou - Threat
sndIncoming - AirStrike
sndJump1 - LongJump
sndJump2 - BackJump
sndJump1 - HighJump
sndKamikaze - Kamikaze
sndLaugh - Laugh
sndMelon - Melon
sndMissed - EnemyMiss
sndNooo - CloseExplosive
sndNutter - SelfTeamDamage
sndOoff1 - StrongHurt
sndOops - CloseOwnExplosive
sndOw1 - WeakHurtVampirism
sndOw2 - WeakHurt
sndPoisonCough - PoisonSickness
sndReinforce - CrateDrop
sndSameTeam - OwnTeamDamage
sndStupid - SelfDamage
sndCover - FireInTheHole
sndUhOh - CloseHeavyExplosive
sndVictory - Victory
sndYesSir - TurnStart
sndRegret - AfterThreat

As you can see, there are groups that are sum of two groups, e.g. WeakHurt and WeakHurtVampirism are both WeakHurt.

Lyberta
Lyberta's picture
User offline. Last seen 3 years 30 weeks ago. Offline
Joined: 2016-09-10
Posts: 177

KoBeWi allegedly wrote:

I'm not really that much into Pascal to know what it can, but after seeing how theme config is read, I have rather low expectations.

Couldn't be worse than in C, right?

Right?

Please?!

nemo
nemo's picture
User offline. Last seen 10 hours 12 min ago. Offline
Joined: 2009-01-28
Posts: 1861

I think the names happened because when Armagon started recording voices he was familiar with the format of, well, the precursor in this genre, and used same names he did for his mods there. It's also why not all the files are used. Slowly over time that has improved.

--
Oh, what the heck. 1PLXzL1CBUD1kdEWqMrwNUfGrGiirV1WpH <= tip a hedgewars dev

Wuzzy
Wuzzy's picture
User offline. Last seen 4 days 14 hours ago. Offline
Joined: 2012-06-20
Posts: 1301

Well, changing the file names is not something we can just do. We would break all previous voice packs. Some of them are very old but they still work. No reason to break them now.
So I think the names are here to stay, sorry. At least every name is documented in the HWKB. This is much more important.

I agree it would be nice to allow proper voice variants in Hedgewars. It could be useful if you have excess recordings or you have your creative day. Smile

I'm envisioning a system like in Minetest. In Minetest, every sound can have up to 11 variants. The naming syntax permits the names of the form NAME.ogg and NAME.NUMBER.ogg with NUMBER from 0-9.
You just need to drop in the files, and Minetest randomly selects a random file to play every time.

Hi, I am a Hedgewars developer. Smile

KoBeWi
KoBeWi's picture
User offline. Last seen 3 days 13 hours ago. Offline
Joined: 2010-12-25
Posts: 564

Wuzzy allegedly wrote:
Well, changing the file names is not something we can just do. We would break all previous voice packs. Some of them are very old but they still work. No reason to break them now.
So I think the names are here to stay, sorry. At least every name is documented in the HWKB. This is much more important.
Replying with quote, because why not:
KoBeWi allegedly wrote:
For older voicepacks, first it would be determined if there are some old-named sounds in the pack and then they'd be assigned to proper arrays.
So it would be backward-compatible.

Basically what you said sounds like "we could've done a terrible mistake somewhere midway, but we just need to live with that". This is a rather bad approach that causes errors of the past to accumulate and eventually makes everyone hate contributing to the project, especially open source. From my experience, since you know the new format and old format, there's always possibility to convert old stuff if the system changes. And if the conversion happens inside application, that's backward compatibility.

Copyright © 2004-2023 Hedgewars Project. All rights reserved. [ contact ]