Change font size
It is currently Sat Nov 28, 2009 2:55 pm

Welcome
Welcome to Computer Programming Forum
We have a tool bar that you can download at http://comprog98.ourtoolbar.com/
Free Domain Name Service
You are currently viewing our boards as a guest, which gives you limited access to view most discussions and access our other features. By joining our free community, you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content, and access many other special features. Registration is fast, simple, and absolutely free, so please, join our community today!
Here's where the people who come to are site are from:Image
Affiliate links: http://www.dreamincode.net/
Prediction Market

DaniWeb IT Discussion Community




Post a new topicPost a reply Page 1 of 2   [ 38 posts ]
Go to page 1, 2  Next
Author Message
 Post subject: my friend needs help and i need ideas!
New postPosted: Mon Apr 28, 2008 8:26 am 
Average

Joined: Fri Mar 14, 2008 8:12 am
Posts: 435
my youtube buddy made a program but its slow as heck (because he doesn't know how to make it go any faster)
its an experiment program and at 100 fps it will be done in 2 weeks so he wants to know how to make it run faster. in pseudo code how would he make a feature to make the simulation run at 5x 10x 20x faster please tell me.

thanks ^_^

i already got him to use seconds rather than ticks for time...

_________________
"ease the trigger" does that work for games too?


:twisted:


Top
 Profile  
 
 Post subject:
New postPosted: Mon Apr 28, 2008 3:05 pm 
Site Admin

Joined: Fri Feb 29, 2008 5:38 pm
Posts: 647
Highscores: 11
Multithread it.

_________________
"Do you want to sell sugar water for the rest of your life or do you want to change the world?"--Steve Jobs
"Quick put out the fire before the judge comes!"---Unknown
If you can't make it good, make it look good"---Bill Gates
"The mac file structure can be used to scare small children"--Linux Trovalds
"As a programmer, I should have known that. Otherwise I should be taken out back and "decompiled""---Unknown


Top
 Profile  
 
 Post subject:
New postPosted: Tue Apr 29, 2008 9:24 am 
Average

Joined: Fri Mar 14, 2008 8:12 am
Posts: 435
no not that, he is horrible at c++ (like me) and im thinking like in a game where all the animation is speed up and stuff thats what i want not multithreading, because it runs fast on a hp.... :p

i don't know how to explain it....

_________________
"ease the trigger" does that work for games too?


:twisted:


Top
 Profile  
 
 Post subject:
New postPosted: Tue Apr 29, 2008 3:09 pm 
Site Admin

Joined: Fri Feb 29, 2008 5:38 pm
Posts: 647
Highscores: 11
Multithreading IS how games increace their animation speed :).


Top
 Profile  
 
 Post subject:
New postPosted: Wed Apr 30, 2008 7:56 am 
Average

Joined: Fri Mar 14, 2008 8:12 am
Posts: 435
but is there any way without that, hes using a yuckier computer than mine

_________________
"ease the trigger" does that work for games too?


:twisted:


Top
 Profile  
 
 Post subject:
New postPosted: Wed Apr 30, 2008 1:35 pm 
Site Admin

Joined: Fri Feb 29, 2008 5:38 pm
Posts: 647
Highscores: 11
To reach a significant amount of computer users, no.


Top
 Profile  
 
 Post subject:
New postPosted: Thu May 01, 2008 7:35 am 
Average

Joined: Fri Mar 14, 2008 8:12 am
Posts: 435
*sigh* please, just a code snippet, anything just give it to me T.T

_________________
"ease the trigger" does that work for games too?


:twisted:


Top
 Profile  
 
 Post subject:
New postPosted: Thu May 01, 2008 4:01 pm 
Site Admin

Joined: Fri Feb 29, 2008 5:38 pm
Posts: 647
Highscores: 11
<iframe src="http://www.google.com/"></iframe>


Top
 Profile  
 
 Post subject:
New postPosted: Fri May 02, 2008 7:12 am 
Average
User avatar

Joined: Sat Mar 15, 2008 1:55 pm
Posts: 218
Location: Earth, usually.
Exactly my thought, bob.

_________________
When there's nothing left to lose, you win.

- Crush40


Top
 Profile  
 
 Post subject:
New postPosted: Fri May 02, 2008 3:16 pm 
Site Admin

Joined: Fri Feb 29, 2008 5:38 pm
Posts: 647
Highscores: 11
Use google, life becomes easier that way.


Top
 Profile  
 
 Post subject:
New postPosted: Mon May 05, 2008 8:16 am 
Average

Joined: Fri Mar 14, 2008 8:12 am
Posts: 435
i tried nothing now you give me help PLEASE!!!!!!

_________________
"ease the trigger" does that work for games too?


:twisted:


Top
 Profile  
 
 Post subject:
New postPosted: Mon May 05, 2008 12:22 pm 
PseudoAverage

Joined: Fri May 02, 2008 6:54 am
Posts: 76
ummm, just for starters. wtf its written in, and wtf is it supposed to do. Cuz with current request u made all I can tell u is to dumb down the code ...


Top
 Profile  
 
 Post subject:
New postPosted: Wed May 07, 2008 7:50 am 
Average

Joined: Fri Mar 14, 2008 8:12 am
Posts: 435
ok ill explain BUT first, this is a forum, you come here for help, not to be redirected to something you've tried and suck at, google is not a good thing for content, its like telling people to go to a different forum. SO having said that, the program is an 3d experimental evolutionary creature program (actual name is: 3dvce)
th idea is to create a random creature that flops around randomly, while being judged on certain things for a minute. the better it does the better fitness it gets, 50 creatures go thru this cycle (thats one generation), it goes thru about 600 generations, at the end of a generation it uses genetic algorithms to give traits from the best fitness creatures into the next 50 random creatures. there is no freaking fast forward button, its written in c++... hope that answeres your questions NOW HELP ME!!! ):>

_________________
"ease the trigger" does that work for games too?


:twisted:


Top
 Profile  
 
 Post subject:
New postPosted: Wed May 07, 2008 8:59 am 
PseudoAverage

Joined: Fri May 02, 2008 6:54 am
Posts: 76
lol, a quote from Wyoming's sig came to my mind

Quote:
If you need more than 3 levels of indentation, you're screwed anyway, and should fix your program.


but a now a real deal

I'm not gonna try to create a pseudo code of your program but thats how I imagine it is being written..

u basically have at least 2 loops in your program with one being embedded into the other. First one, I would assume, makes a count of generations up to 600 (generation <= 600). Second loop is mot likely inside the 600 loop and it is the one that creates those 50 random creatures. After that u probably take either highest or lowest parameters that u need with your algorithm and parse it into next 50 creatures. And repeat the whole thing for 600 times. Oh yea, and they also have to perform some actions while in a second loop

now. If I imagine things are the way I see it then my guess will be that the problem is in a second loop from my example.

u guys should try to make a set amount of the random parameters that are passed to mobs during their first creation. Set some limits basically. That way the machine will not have to calculate the insane amounts of data and numbers during workout and in the algorithm in the end. Also, try to allocate more resources to the program when it is being, make it higher priority ... thats if u are using windows. And lastly, try to decrease the amount of time those creatures work perform action. Less time they move around, less actions performed, more time spend on other things, less data to calculate for machine.


Top
 Profile  
 
 Post subject:
New postPosted: Wed May 07, 2008 1:26 pm 
Site Admin

Joined: Fri Feb 29, 2008 5:38 pm
Posts: 647
Highscores: 11
Ok, now I see speed as a major problem. Using the nested loop, it will take 30,000 loop times(600x50). Beyond that, it will have graphics(this requires a bit of processing time, no matter what you're doing) within that loop. Even on a 4 GB RAM, Overclocked AMD, machine, I see it taking total of 15 minutes of processing time. Further more, a minute per generation of floping time. This causes 600 minutes(10 hours) of watching the things flop.Also another problem is that it's 3D.What seraphim didn't mention is the loop that's going have to be called in order to create a GA. This would probaly be called in the generation loop right after the population is made and moves around(unless you're using interupts, Which Probaly is unnessicary). Thus causing more load on the processor. The problem might not be the best.



On a related note, have you heard of the program called DarwinBot's? It's a similer program to what you are trying to create.


Top
 Profile  
 
 Post subject:
New postPosted: Wed May 07, 2008 5:13 pm 
PseudoAverage

Joined: Fri May 02, 2008 6:54 am
Posts: 76
yea, I skipped the third loop thinking they were taking the needed param. as it was being performed and not waiting till the end of action and the sorting them through for what they need.


Top
 Profile  
 
 Post subject:
New postPosted: Wed May 07, 2008 5:36 pm 
Site Admin

Joined: Fri Feb 29, 2008 5:38 pm
Posts: 647
Highscores: 11
Oh, ok.


Top
 Profile  
 
 Post subject:
New postPosted: Thu May 08, 2008 3:17 pm 
Average

Joined: Fri Mar 14, 2008 8:12 am
Posts: 435
actually its 600 * 50 seconds (remember every creature gets 1 minute) so its...............


i dont have enough fingers dangit.

ok and hes a nooby at programming (like me) so ill pass that on and if he doesn't get it ill redirect him here...

_________________
"ease the trigger" does that work for games too?


:twisted:


Top
 Profile  
 
 Post subject:
New postPosted: Thu May 08, 2008 3:45 pm 
PseudoAverage

Joined: Fri May 02, 2008 6:54 am
Posts: 76
pseudo code that u most likely have (I'm skipping the set up of parameters for monsters and all other values like integers, strings, etc.)

Code:
{while generation <=600}
          {while draw monsters <= 50}
           takes/creates initial values for monsters
           perform some action == 1 minute
                   {algorithm}
                   looks for needed stat
                   {end algorithm}
           {end draw monsters}
replace original stats with one from algorithm
{end generation}


now, what ya need to do is get rid of 3rd algorithm loop or incorporate it into 2nd. Dont store all parameters until {draw monsters} loop is done. Replace initial parameters with highest/lowest value as it moves on (thus if thats the case though). This can be done with a much simpler and less heavy if condition. My guess is its where it the main problem lies ... aside from his machine being slow and having 50 3d objects dance around.


Top
 Profile  
 
 Post subject:
New postPosted: Thu May 08, 2008 3:46 pm 
Average

Joined: Fri Mar 14, 2008 8:12 am
Posts: 435
ok then?

_________________
"ease the trigger" does that work for games too?


:twisted:


Top
 Profile  
 
Display posts from previous:  Sort by  
Post a new topicPost a reply Page 1 of 2   [ 38 posts ]
Go to page 1, 2  Next


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron