generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: Speeding up a loop (nearly 100x)?

Previous Thread :: Next Thread 
JimmyChance is not online. JimmyChance
Joined: 01 Nov 2009
Total Posts: 3681
20 Nov 2014 03:09 PM
I am making a maze generator, and the script takes such a long time to generate a 20 x 20 maze. Here is how it follows:

10 x 10 maze - nearly instant

20 x 20 maze - 10 - 12 seconds to make the path, then 40/3 seconds to make the rest of the maze

100 x 100 maze - > 5 minutes (it hasn't even finished the path making)

The generation timing is in the "unnamedFunction()" in the loop.

script:

codepad.org/aQQjYAdv
Report Abuse
robotmega is not online. robotmega
Joined: 16 May 2009
Total Posts: 14084
20 Nov 2014 03:30 PM
http://blog.roblox.com/2012/02/an-optimization-for-lua-scripts-2/
Report Abuse
eLunate is not online. eLunate
Joined: 29 Jul 2014
Total Posts: 13268
20 Nov 2014 04:23 PM
You can cut out a lot of the stuff with loop optimisations. If you know some things are immutable, or can be cut out / cut down, then make them so. If you're using a lot of Lua functions, make all of them local because local variables are faster hehe
Report Abuse
ArbiterOfDeath is not online. ArbiterOfDeath
Joined: 20 Jun 2011
Total Posts: 1458
20 Nov 2014 04:55 PM
Also, some algorithms are faster than others. I have in my free models a maze maker that runs fast for you to use or get some ideas from. I have a hexagonal maze generator somewhere if you want that, and I have a geodome generator + maze on top here: http://www.roblox.com/Labyrinth-of-Betrayal-LOB-place?id=125625913

Oh, btw, I like mazes and pathfinders. Working on a really advanced pathfinder for a few months now. Navmesh + theta* + actions like gettings in cars.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image