Modding:Modding Efficiently: Difference between revisions

From Vintage Story Wiki
Line 21: Line 21:
=== Efficient Search Methods ===
=== Efficient Search Methods ===


More often than not, you'd want your code to find something in the game world. As you might already know, computers are not exactly the best at parallel processing like human eyes are, so they have to sequentially look through the entire search space. When doing so, first and foremost, the most efficient search method is one that never runs, within a search space that is of size zero ;-)
More often than not, you'd want your code to find something in the game world. As you might already know, computers are not exactly the best at parallel processing like human eyes are, so they have to sequentially look through the entire search space. When doing so, keep in mind that, first and foremost, the most efficient search method is one that never runs, within a search space that is of size zero ;-)<br> In other words, sometimes you can avoid searches altogether through other clever means! If you still need to do a search, here's some more optimal ways than the brute force way:
In other words, sometimes you can avoid searches altogether through other clever means! If you still need to do a search, here's some more optimal ways than the brute force way:


<ul>
<ul>
Confirmedusers, Bureaucrats, editor, Administrators
1,778

edits