-
Notifications
You must be signed in to change notification settings - Fork 18
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
tremulous: bucket system #107
Conversation
dGr8LookinSparky
commented
Jan 11, 2020
- initial implementation of the bucket selection systems for the engine and game logic.
- initial implementation of bucket selection playback looped sounds for the menus.
- initial implementation of bucket selection main menu music.
- initial implementation of the bucket selection systems for the engine and game logic. - initial implementation of bucket selection playback looped sounds for the menus. - initial implementation of bucket selection main menu music.
@dGr8LookinSparky how do you enable this? I couldn't get it to change the menu song. |
As a side note, I'm cleaning up the bucket selection code a bit, and will have this pushed to this branch shortly. @cengique , it should happen automatically, everytime you start the client, it should play different music (randomly selected), until all of the music has been selected. Basically when you turn on the client it will select one of the main menu music files, then when you turn off the client and start the client again, another music file would be randomly selected. Also the main menu music would change when you disconnect from a server and get back to the main menu. |
@dGr8LookinSparky it definitely doesn't change the song for me, no matter how many times I restart. |
that is odd, do you see a cvar in the console called ui_mainMenuSelectedMusic, if so, what value is it set to? |
@dGr8LookinSparky it's not set. I tried setting it to "1", but didn't change. |
it isn't meant to be set by the user, that is suppose to track which songs have been previously played. |
I see. It still stays empty. |
check to see if there are music files in |
|
Looks like you definitely have the files. were there any error messages in the console? |
hmm, not really. |
maybe try to see if connecting to a server, and then using the command |
@cengique , is it playing any music at the main menu? if so, is it just the old default music, or another one? |
…me logic use the same main code, instead of duplicate code.
@cengique , I'm not sure if this would help the issue you are experiencing, but I just updated this branch with a new commit (was mainly for cleaning up the bucket selection code). |
@dGr8LookinSparky I pulled the new commit, but no change. It's playing the old theme song. |
Music doesn't change when I connect to a server and |
@cengique , which OS and distro are you currently testing on? |
@cengique , I just thought of a possible cause of your issue, make sure that vorbis is not disabled. The original default main menu music file is in .wav format, but all of the other files I've included in .ogg. Maybe if vorbis is disabled, the file search would not include the .ogg files. |
@dGr8LookinSparky I realized it may be using my older builds, so I deleted the build directory completely. This time, I'm getting an stuck at a black screen. It gives an error during initialization and it loops forever:
|
@cengique , yeah, not deleting your build folder before building does often cause issues. With this setup, after you delete the build folder, and then rebuild, you have to redownload the default pk3 files, which you can do by executing from the root of the repo the script Regarding using tremulous in gdb (if the not deleting your build directory was causing this issue, you may not have to use gdb for this particular case, I don't know how familiar you are with using gdb outside of trem, but gdb is a very useful tool that can come in handy for you in the future, and I recommend getting at least some familiarity with it for trem development), first you have to ensure that when you build, instead of using just
If you aren't familiar with using gdb, it is generally pretty straight forward to find information on its usage on the interwebs. In particular, the most commonly used commands to know are: If you are running tremulous in gdb, the way to temporarily exit tremulous so that you can entire gdb commands is with |
@dGr8LookinSparky oh I forgot about this step! I will try tomorrow.
I've used |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Corrupt file?
@dGr8LookinSparky ok, I don't know what changed, but after I built the debug version and ran it in gdb, it actually ran without crashing. Now, even the regular build runs. It may have something to do with setting the command line arguments correctly. |
Hmm, @cengique how does that particular heatbeat.wav file sound outside of trem when you play it in a separate media player like vlc (or whichever media player you prefer)? |
Oh jeeze, @cengique , I just downloaded that file from the branch, and played it in vlc, and I do hear the static, I'm not sure why that is, I'll look into recommitting a good version. |
I like the music options, by the way! Except the very quiet one. I'll keep an eye out for the Q_strncpyz error and check it with gdb. I could not see any obvious candidates in the code you committed. Did you get this bucket system from the Quake repo? |
I coded it from scratch. I did implement this bucket system more generally in the ui (not just for the main menu music), it could potentially be used by any menu that wants to have multiple music files chosen in this way to be played in the background. Also more general than that, this bucket selection system could be used by anything that wants that kind of selection, like potentially for the map rotation system for example (like if you want a set maps chosen for a particular range of number of players, but want the maps randomly selected, while not playing more than one of them twice before all of the others are selected) . |
That's cool! Although there could be memory bugs lurking with untested code, which would explain the error. I keep getting dropped from Der Bunker and I think it's related to this crash. |
There could potentially be a memory leak, as I made use of dynamic array lists. Although I don't think this system would cause you to be dropped from that server, as this system is currently only being used in the ui, the ui has an internal allocator system, when the ui shuts down that allocator is cleared, and that server would use a different server. Did you see if you are dropped from other servers like GrangerPub, GrangerLab, Unitremia, that zombie mod server, etc? I do have this bucket system in the engine code (which would include the client), but it is currently unused there (except I do have a part of the code that is suppose to free the memory used by buckets on shutdown). |
You're probably right, I was thinking that it cannot be the reason for me to drop. I got the "connection lost" message, but everyone else was fine. It may also be some other part of the client crashing. Will try to use a debug version if this happens again. |
@cengique , I removed the heartbeat.wav file and then readded it and recommitted it with a fresh copy from the 1.1 data pk3 (which sounds fine without any static when I played that directly from that copy), but when I pushed to github, and downloaded that copy, it still has the static for some reason. Then I downloaded the other music files I included, and they all are corrupted in some way. Black_mistUntitled_3.ogg and tremfusion_heartbeat.ogg have numerous skips in them, Finally_Heartbeat.ogg and Granger_Foley_v1.ogg have problems with even playing at all. This is when I tried playing those files on vlc. I don't know why this is happening, nor how to fix it currently. |
I posted this on the github community forums: |
@dGr8LookinSparky this may have to do with what type of file |
This is the culprit @dGr8LookinSparky : All files in the repo are treated as |
Nice find @cengique ! I may have time on Sunday to fix that up, then if all goes well, hopefully we can merge this shortly :) . |
@cengique , I merged the recent updates from the master branch into this branch, which includes an adjustment to the .gitattributes file, and it looks like that did the trick for not distorting the main menu music files! When you get a chance, feel free to test out this branch and confirm that the music works as it is suppose to. Then, unless you find any other issues, I think this pull request should be ready for merging into master. |
All good now! |
* tremulous: - initial implementation of the bucket selection systems for the engine and game logic. - initial implementation of bucket selection playback looped sounds for the menus. - initial implementation of bucket selection main menu music. - Update .gitattributes
* tremulous: - initial implementation of the bucket selection systems for the engine and game logic. - initial implementation of bucket selection playback looped sounds for the menus. - initial implementation of bucket selection main menu music. - Update .gitattributes