<div dir="ltr"><div><div><div>There's no need for the npc_collision_check overload without the hero_collision_exception argument, because FB lets you make byref arguments optional, by giving them a default value. That results in a temporary variable getting initialised to the default value and passed to the function. I do this in several places. One of those little things I like about FB.<br><br></div>I see you made a small back-compat breaking change here, by changing the determination of NPC tile X/Y position for the purpose of wall/zone checking, using the center rather than the top-left of the walkabout. Of course, this only happens when the NPC finishes a step, so there's only a difference if the NPC is mis-aligned, in which case collision checking is quite broken anyway. I wonder, does any game actually rely on that brokenness? It seems unlikely actually. I tested Siv: journey of an egg and didn't notice any problems.<br><br></div>Actually I don't think that change to using the tile center helps at all; it's still going to be broken. I suggest fixing misalignment by walking NPCs/heroes less than 20 pixels (whether by walknpc or builtin movement) so that it realigns at the next tile boundary, and doing collision checking like a pixel-base-moving NPC/hero until then.<br><br></div>Script commands would be great. I think there are two approaches: high level "do NPC/hero obstacle checking exactly like the engine does" that might be useful for scripting eg pathfinding, and could be affected by a pixel-based-movement option, or low level "check for collisions with walkabouts" that would be a building block for scripting your own movement. So there could be commands for both, if they would actually get used. But maybe the latter would not get used enough to bother... I know recently I've said several times "use the wall checking commands and do your own collision checking with 'find colliding slice'", but have have to look into those specific use-cases actually were.<br>Plus, unfortunately the wall checking commands I added recently don't support NPC zones or one-way walls.<br><div><br> <div><div class="gmail_extra"><div class="gmail_quote">On 18 March 2017 at 08:48,  <span dir="ltr"><<a href="mailto:subversion@hamsterrepublic.com" target="_blank">subversion@hamsterrepublic.<wbr>com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">james<br>
2017-03-17 12:48:56 -0700 (Fri, 17 Mar 2017)<br>
389<br>
Clean up perform_npc_move() refactoring the collision detection for walls, zones, hero, and other npcs<br>
into the new npc_collision_check() function which can be used in other places (for example, new movement types)<br>
<br>
Haven't decided yet whether to expose a plotscripting interface towards this, leaning towards<br>
yes, but don't want to interfere with future non-tile-algined movement support<br>
---<br>
U   wip/game.bas<br>
______________________________<wbr>_________________<br>
Ohrrpgce mailing list<br>
<a href="mailto:ohrrpgce@lists.motherhamster.org" target="_blank">ohrrpgce@lists.motherhamster.o<wbr>rg</a><br>
<a href="http://lists.motherhamster.org/listinfo.cgi/ohrrpgce-motherhamster.org" rel="noreferrer" target="_blank">http://lists.motherhamster.org<wbr>/listinfo.cgi/ohrrpgce-motherh<wbr>amster.org</a><br>
</blockquote></div><br></div></div></div></div>