Commit 51d7d32
committed
feat: Tweak teleporting when stuck
Currently qw tries to teleport at the end of its movement plan, when
it's stuck, before trying random movement. This can waste valuable
teleport scrolls in situations where qw is very temporarily stuck. This
commit puts a random movement plan before the teleport plan that's only
active if we've been stuck less than 50 turns. After 50 turns of still
being stuck, qw will attempt it's plan to teleport. The final plan of
the movement cascade is still the main random movement plan, which lasts
for 1000 turns total before qw quits the game.
We reset the stuck counter whenever a level transition is made so that
this approach can work. There was no reason to make it cumulative across
a session in the first place, since when qw is stuck, it's never moving
between levels.1 parent fc7b4b4 commit 51d7d32
2 files changed
+19
-10
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
228 | 228 | | |
229 | 229 | | |
230 | 230 | | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
231 | 240 | | |
232 | 241 | | |
233 | 242 | | |
| |||
328 | 337 | | |
329 | 338 | | |
330 | 339 | | |
331 | | - | |
332 | 340 | | |
333 | 341 | | |
334 | | - | |
335 | | - | |
336 | | - | |
337 | | - | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
338 | 345 | | |
339 | 346 | | |
340 | 347 | | |
| |||
616 | 623 | | |
617 | 624 | | |
618 | 625 | | |
| 626 | + | |
619 | 627 | | |
620 | 628 | | |
621 | 629 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
125 | 125 | | |
126 | 126 | | |
127 | 127 | | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
128 | 134 | | |
129 | 135 | | |
130 | 136 | | |
131 | 137 | | |
132 | | - | |
133 | | - | |
134 | 138 | | |
135 | 139 | | |
136 | | - | |
137 | | - | |
138 | | - | |
139 | 140 | | |
140 | 141 | | |
141 | 142 | | |
| |||
0 commit comments