array limit?

Posted By: MMike

array limit? - 02/13/08 15:07

How big can be the array index?

var id[n], n ->oo ?
can it be 1000? 1000000000000000000000? more?
-what is the limit?
- Is the frame rate affected ?
Posted By: Fenriswolf

Re: array limit? - 02/13/08 15:27

Hello,

in C-Script an arrays length should be limitid to 1048576 (which is the range of var).

Iterating through an array of that size may decrease FPS.
Especially when using a sorting algorithm or something similar.
Posted By: MMike

Re: array limit? - 02/13/08 15:33

ok but between a array of 100 and 1000 .. the frame rate is almost equal right?

BtWay, the execute command, what is the speed of it? manual has no information concerning that..
Posted By: Futurulus

Re: array limit? - 02/14/08 05:01

Iterating through an array of 100 or 1000 just to check values, even every frame, shouldn't change the frame rate much.

execute(), I believe, is fast enough that you can call it a few times each frame without serious consequences.

If you're thinking about calling execute() 100 or 1000 times each frame, the frame rate will drop noticeably, although maybe not disastrously, depending on the commands executed.
Posted By: MMike

Re: array limit? - 02/14/08 13:25

hum.. well i have a execute command that is recieving commands from a UDP message from Adobe Flash program i did.. So it comunicates with an webcam..

Ok so ... the webcam is tracked and the flash sends me the values, that are processed to identify movement..
and when a string is recieved from the flash from socket UDp server .. like " create(x,y,id);
i then just use:

if recieved>0 then:
Execute(recieved_string);


the execute will assign each id value an array[1000] .. so ... we are dealing with arrays every frame.. yes..
it runs very very fast of course each time frame.. but it is not decreasing the frame rate that much.. .. and im working with a laptop.. no core duo.. or something fast..

And im getting my webcam interative game working now ) im happy..
© 2024 lite-C Forums