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

Username:   Password: 
 RegisterRegister   
 A Need For Speed : My Program Has to be like 10* faster!!
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
GreenTiger




PostPosted: Mon May 24, 2004 10:00 pm   Post subject: A Need For Speed : My Program Has to be like 10* faster!!

I think the title is self-explanatory. Either I write really bad code or I need a new comp to keep up with it. Either way, my comp is like 5* faster than the school ones, and my proggy is SLOW.

A lttle help, please?

Oh, a sample is available at http://ccc.horizonhouse.ca/CompSci/early.rar
You might need winRar to extract. www.winrar.com
Thanks.
Sponsor
Sponsor
Sponsor
sponsor
guruguru




PostPosted: Mon May 24, 2004 10:22 pm   Post subject: (No subject)

Looking at the ginormous size of your file, I'd say you can't do anything about it.

Turing is damn slow. Live with it.
GreenTiger




PostPosted: Mon May 24, 2004 10:25 pm   Post subject: (No subject)

Most of the size is the BMPs don't worry. The files used by Turing itself is only around 5 K combined or so,

yes, I know turing is damn slow, isn't that mainly because it uses only CPU and RAM?

When it's fully compiled, will it run any faster?

<EDIT>

Oh, and when I say it needs to be 10* faster, I mean that because like my character doesn't run properly unless I reset my system and run it then. And that's on my comp, like 2.5 AMD Athlon, I know it's not top of the line, but the school comps don't even clock a gig, I wish I was kidding.

I think my program will crash the school computers before it even does anything on them.
Tony




PostPosted: Mon May 24, 2004 11:27 pm   Post subject: (No subject)

i haven't looked at your code (i dont feel like installing winrar) but you should try to optimize it's performance by cutting w/e calculations you can.

Take another look at your loops and see if you can terminate them earlier at any points.

Move you character a larger distance at a time (such as 2 pixels each move instead of 1) - that should counter balance the slow performance.

Needless to say take out any delay

Check for collision every other frame. Collision defection could be a CPU intencive processes. If you check for it every other time, you should noticibly speed up your game. The only trade off will be that the collision will occur during the 2nd frame half the time (should not cause too much of a problem if you treat collision event appropriatly when detected)

Replace any commonly used functions with an array of precalculated values (this would usually be used for trig functions if angles are kept integers)
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
GreenTiger




PostPosted: Mon May 24, 2004 11:39 pm   Post subject: (No subject)

Thanks, those ideas helped a bit. I found something that didn't need to be in one of my nested loops (only needed to be in the main loop) and that helped speed it up alot. I also did something similar with collision detection, and I'm going to make an if statement so they don't animate all the time. Thanks, that should make it a bit faster. Even still, that's only with one person on the screen. I need to have around 5 average.

Any other ideas? Sorry about the winrar, BTW, I'll put it in a zip at my earliest convenience.

(The updated files, BTW are uploaded to my site, too, just the isorewrite2.t at
www.horizonhouse.ca/CompSci/isorewrite2.t)

<EDIT> Okay, all the files from the previous RAR are now in ZIP format at http://www.ccc.horizonhouse.ca/CompSci/Final%20Project/ and all the updated files are put online in the same directory. For now, worldstarts can be ignored. I need help getting my isorewrite perfect. It's the one with the big, slow loop, however it's only the unit. ENGINEMODULE is the actual file to run.
Mazer




PostPosted: Tue May 25, 2004 6:53 am   Post subject: (No subject)

You said it runs slowly unless you restart and run the game then? Are you using processes with unending loops? Because that could be a contributing factor there.
MyPistolsIn3D




PostPosted: Tue May 25, 2004 10:41 am   Post subject: (No subject)

Did you do it in 3.11 or 4+ adam? Itd prob be better in 4+.
poly




PostPosted: Tue May 25, 2004 4:40 pm   Post subject: (No subject)

adam your pc is a athlon 2500 is it not? It isnt 5 times faster than the school computers there p4 2.2ghz i believe.
Bob565656




PostPosted: Wed May 26, 2004 8:59 pm   Post subject: a solution!

sup man, usually slow running shit is a result of large bitmaps. If you happened to have bipmaps bigger than 100kb, change them to jpg rite away! I know ur going 2 sacrifice a little bit of quality, but you WILL get the speed.

I ran into this prob when I converted a movie into frames, and each frame was a 1mb bmp file. It ran sooooo slow in Turing, i changed it to jpg and it did the trick. gl, cyaz
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 1  [ 9 Posts ]
Jump to:   


Style:  
Search: