Pause while for() cycle
Posted: Wed Oct 19, 2011 11:14 am
Hi, guys
Encountered an interesting thing. When PC is making decision ( for () cycle in b_shoot->Mouse Button Up ), game pauses fo 2-3 sec, even animations does not work
for() cycle is about 46.000 times with calculating every iteration
So, the question is - how to split such operation into much quicker parts ? Is it possible?
How can one make AI with lot of calculations and do not stop animation, movement etc?
Encountered an interesting thing. When PC is making decision ( for () cycle in b_shoot->Mouse Button Up ), game pauses fo 2-3 sec, even animations does not work
for() cycle is about 46.000 times with calculating every iteration
- Code: Select all
for (i1=0; i1<6; i1++)
for (i2=0; i2<6; i2++)
for (i3=0; i3<6; i3++)
for (i4=0; i4<6; i4++)
for (i5=0; i5<6; i5++)
for (i6=0; i6<6; i6++)
{ ....operations.... }
So, the question is - how to split such operation into much quicker parts ? Is it possible?
How can one make AI with lot of calculations and do not stop animation, movement etc?