Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Procedural generation strategies
- --------------------------------
- Before deciding what algorithm to use, you need to remember that there probably isn't a perfect algorithm. There rarely is. So whatever you choose it will have advantages and disadvantages. You have to think in terms of trade-offs.
- Typical trade-offs are:
- Run-time;
- Memory usage;
- Quality of solution;
- Variety of solutions;
- Work time (To design+write your algorithm).
- --------------------------------
- [1] Generate a random solution.
- - Predictable fast run-time.
- - The solution could be good or bad. Expect bad.
- --------------------------------
- [2] Generate random solutions over and over, until you find one "good enough" that passes some tolerance.
- - It will find a good solution, providing the search terminates.
- - Unpredictable run-time. May not terminate at all if the tolerance is set too high.
- --------------------------------
- [3] Generate a fixed number of random solutions, and pick the best of those.
- - Predictable run-time. Could be fast or slow, depending on the number chosen.
- - Not guaranteed to find a good solution every time. It might even be a terrible solution some times.
- --------------------------------
- [4] Generate a random solution, then iteratively modify it to get better solutions.
- - Should be fast.
- - May find a "local maximum", whereby your modifications won't improve it, because the much better solutions are too different from what you ended up with.
- --------------------------------
- [5] Solve the problem on paper, and hand-pick solutions you like.
- - Very fast run-time, as the computer is just picking a random thing from a list.
- - Potentially good solutions, because you've hand-picked them.
- - Lacks variation, as the solutions are limited to the few you've chosen.
- - Depending on the nature of the problem, it could use a lot of memory to store all these picked solution. It might be a lot of work.
- [...]
Advertisement
Add Comment
Please, Sign In to add comment