Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Game slows down when music is added
Index -> Programming, Turing -> Turing Help
Goto page 1, 2  Next
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
NikG




PostPosted: Tue Sep 05, 2006 6:13 pm   Post subject: Game slows down when music is added

I just tried adding some background music to my rts game and I noticed a HUGE reduction in the framerate (from 40+ to 6 fps!). I expected some lag but not this much!
All I did was add the Music.PlayFileLoop command... any ideas why this is happening or how I can get around it?
Sponsor
Sponsor
Sponsor
sponsor
Windsurfer




PostPosted: Tue Sep 05, 2006 6:17 pm   Post subject: (No subject)

Don't play music?
Turing sucks! There isn't much you can do when it comes to media, apart from using less.
Windsurfer




PostPosted: Tue Sep 05, 2006 6:18 pm   Post subject: (No subject)

Don't play music?
Turing sucks! There isn't much you can do when it comes to media, apart from using less.

Okay, actually, i hear playing midis are easier on a machine than mp3s or wavs, but i didn't notice much difference.
NikG




PostPosted: Tue Sep 05, 2006 6:21 pm   Post subject: (No subject)

Actually, I was using a midi.

If you don't mind my asking, Windsurfer, how did you manage to get around this problem in Forces?
Windsurfer




PostPosted: Tue Sep 05, 2006 6:31 pm   Post subject: (No subject)

I didn't get around it... Forces still runs slow, by my standards. I'm still using Music.PlayFileReturn() to play anything. It's just that the rest of my program uses little resources.

I just remembered, though... What version of Turing are you using? I hear 4.1 may speed up displaying of images and sound by up to 50%
NikG




PostPosted: Tue Sep 05, 2006 10:37 pm   Post subject: (No subject)

Windsurfer wrote:
What version of Turing are you using? I hear 4.1 may speed up displaying of images and sound by up to 50%
Darn! 4.0.5
[Gandalf]




PostPosted: Wed Sep 06, 2006 3:55 am   Post subject: (No subject)

Windsurfer wrote:
I hear 4.1 may speed up displaying of images and sound by up to 50%

It seems everyone thinks there is some magical speed boost in Turing 4.1... It increased the speed of images in certain situations (ie. by using GIFs instead of BMPs with Pic.SetTransperentColour), not sounds, or even graphics in general.
Clayton




PostPosted: Wed Sep 06, 2006 2:32 pm   Post subject: (No subject)

NikG wrote:

...any ideas why this is happening or how I can get around it?


learn another language?

there's really nothing to do the help with lag issues when dealing with media in turing, your best bet is to just take out music altogether.
Sponsor
Sponsor
Sponsor
sponsor
NikG




PostPosted: Wed Sep 06, 2006 6:43 pm   Post subject: (No subject)

SuperFreak82 wrote:
NikG wrote:

...any ideas why this is happening or how I can get around it?


learn another language?
Haha. Well I'm not about to convert my rts into another language anytime soon (if ever) so I guess I'll have to settle for no background music.

I know I've seen this question asked before, but is there a site where I can get some decent sound effects for my game? Guns firing, explosions, cheers (like when you finish a mission in C&C) and the like...
BenLi




PostPosted: Wed Sep 06, 2006 6:54 pm   Post subject: (No subject)

a suggestion actually. You should check other things and not only the playing music command. For example in last year's final project, I acheived an enormous increase in frame rate when i simply took out the Pic.Merge commands and re-ordered the code.
do_pete




PostPosted: Thu Sep 07, 2006 9:14 am   Post subject: (No subject)

NikG wrote:
I know I've seen this question asked before, but is there a site where I can get some decent sound effects for my game? Guns firing, explosions, cheers (like when you finish a mission in C&C) and the like...
Just search free sound effects on Google.
r.3volved




PostPosted: Thu Sep 07, 2006 9:45 am   Post subject: (No subject)

Been a long time sinc I touched any turing...does it have threading abilities? or multi-process?
Clayton




PostPosted: Thu Sep 07, 2006 2:35 pm   Post subject: (No subject)

um for general purposes, NO!

however, if you have a program, or wish to make a program where multi-threading is absolutely necessary then yes there *is*, but if you plan to multi-thread in turing, dont be surprised when you come up with many, many problems, this is because processes in turing suck, if you need more info go here
[Gandalf]




PostPosted: Thu Sep 07, 2006 3:29 pm   Post subject: (No subject)

BenLi wrote:
I acheived an enormous increase in frame rate when i simply took out the Pic.Merge commands and re-ordered the code.

Indeed, Pic.Merge is probably the single slowest feature of Turing... Well, close to it.

SuperFreak82 wrote:
however, if you have a program, or wish to make a program where multi-threading is absolutely necessary then yes there *is*, but if you plan to multi-thread in turing, dont be surprised when you come up with many, many problems, this is because processes in turing suck, if you need more info go here

Actually, processes are.. decent for multi threading. The problem is that threads are simply not the way to go for most of the problems that people post.
Clayton




PostPosted: Thu Sep 07, 2006 4:56 pm   Post subject: (No subject)

ok, i should have rephrased that, processes suck in turing when used improperly
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 2  [ 25 Posts ]
Goto page 1, 2  Next
Jump to:   


Style:  
Search: