|
| 28 Sep 2012 11:28 PM |
| using wait(1/1000) most likely would not work and would drastically slow down performance. Anyone else know a fast method? |
|
|
| Report Abuse |
|
|
| |
|
|
| 29 Sep 2012 01:47 AM |
| I'm not really sure if this forum is the right place to ask and doing a 1/1000 of a second could generate serious lag depending on the power of your computer. |
|
|
| Report Abuse |
|
|
|
| 29 Sep 2012 02:05 AM |
| I don't think you can emulate a CPU that's more powerful than your own. |
|
|
| Report Abuse |
|
|
|
| 29 Sep 2012 02:40 AM |
@Arceus; Lol'd
☜▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬☞ |
|
|
| Report Abuse |
|
|
jobro13
|
  |
| Joined: 05 Aug 2009 |
| Total Posts: 2865 |
|
|
| 29 Sep 2012 05:48 AM |
| 1/1000 second is a whole year in computer time. |
|
|
| Report Abuse |
|
|
TheMyrco
|
  |
| Joined: 13 Aug 2011 |
| Total Posts: 15105 |
|
|
| 29 Sep 2012 06:12 AM |
"1/1000 second is a whole year in computer time."
Can't tell if trolling. Anyways, on Roblox, the max wait time is ~0.03 (wich equalss wait()), but there might have been an update that allows 60 FPS (~0.015 sec), wich would mean wait(0) I believe. |
|
|
| Report Abuse |
|
|
|
| 29 Sep 2012 08:31 AM |
| Just an fyi the CPU is only 20 MHz irl. |
|
|
| Report Abuse |
|
|
jobro13
|
  |
| Joined: 05 Aug 2009 |
| Total Posts: 2865 |
|
|
| 29 Sep 2012 09:13 AM |
Its not trolling.
Most PICs (Programmable Integrated Circuits) use a crystal with a 20 MHz frequence.
The clock speed is 1/f. f = 20 MHz = 20 * 10^6 Hz
Thus Clockspeed = 1/(20*10^6) = 5,0 × 10-8 seconds.
1/1000 second = 1^-3 second.
In other words, what we think is fast (1/1000 second - your eye cant even see a movement in that speed), a computer can do THIS ammount of "thinkings":
(1^-3)/(5,0 * 10^- 8) = 20 000 000 = 20 million things in 1 thousand of seconds.
To compare: 20 million seconds are 333 333,333 hours. These are 14 221.875 days, which are 621,876712 years.
See? I'm not trolling.
|
|
|
| Report Abuse |
|
|
| |
|
|
| 29 Sep 2012 01:43 PM |
| If you go into your ROBLOX Studio Settings, you can change the default wait time from 0.03 to 0.00. I did it. |
|
|
| Report Abuse |
|
|
jobro13
|
  |
| Joined: 05 Aug 2009 |
| Total Posts: 2865 |
|
|
| 30 Sep 2012 09:51 AM |
You can, using a buffer size. Works like this;
while true do for i=1, buffer do --do stuff here. end wait() end
|
|
|
| Report Abuse |
|
|
|
| 30 Sep 2012 10:01 AM |
| @jobro That's a good suggestion, but the only problem is that the cpu has jumps in it so it would start executing at a different address. |
|
|
| Report Abuse |
|
|
jobro13
|
  |
| Joined: 05 Aug 2009 |
| Total Posts: 2865 |
|
|
| 30 Sep 2012 11:35 AM |
Ah!!
Ur using assembly yes? Nice! I'm doing something similair on my game too, a fully functional Lua Assembly interpreter :)
Good, my suggestion is that you store a jump adress in a table. Example (maybe you want to convert the numbers to hex!)
local adress={[1]=function() print("HI") end, [2] = function(a) print(a) end}
local buffsize = 32
local curradress = 1
function JMP(A) curradress = A end
function CALL() adress[curradress]() end
while true do for _ = 1,buffsize do CALL() end end
|
|
|
| Report Abuse |
|
|
jobro13
|
  |
| Joined: 05 Aug 2009 |
| Total Posts: 2865 |
|
|
| 30 Sep 2012 11:36 AM |
| Dont forget the wait() sorry forgot that :( |
|
|
| Report Abuse |
|
|
| |
|
jobro13
|
  |
| Joined: 05 Aug 2009 |
| Total Posts: 2865 |
|
|
| 30 Sep 2012 12:47 PM |
Base - 16 numbers. Normally we use base - 10 (numbers 0,1,2,3,4,5,6,7,8,9) and hex uses 0,1,2,3,4,5,6,7,8,9,a,b,c,d,f
So 10 in hex is a. |
|
|
| Report Abuse |
|
|
|
| 30 Sep 2012 12:56 PM |
| The only flaw is that it would most likely go back to the default wait() time on multiplayer servers. |
|
|
| Report Abuse |
|
|
jobro13
|
  |
| Joined: 05 Aug 2009 |
| Total Posts: 2865 |
|
|
| 30 Sep 2012 01:04 PM |
| No, it will not. Look you cannot time things shorter than 1/30 second (default wait time). But you can define the number of operations within these 1/30 seconds. So you can actually emulate it - but not very realistic. |
|
|
| Report Abuse |
|
|
|
| 30 Sep 2012 01:19 PM |
Hmmm.. if 20 MHz is .00000005 of a second, and the min wait time is 1/30 of a second..
*gets pen and paper* |
|
|
| Report Abuse |
|
|
|
| 30 Sep 2012 01:22 PM |
| That's 666666.66(forever more 6's) iterations per wait(). Ugh. |
|
|
| Report Abuse |
|
|
jobro13
|
  |
| Joined: 05 Aug 2009 |
| Total Posts: 2865 |
|
|
| 30 Sep 2012 01:26 PM |
Dont do that.
Normal lua can just do a while true do loop without a wait. On roblox, everything stalls...
If you really want to emulate it, then use the normal Lua on your pc. Be warned tough, you can get an overheated processor like that. |
|
|
| Report Abuse |
|
|