<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On 20 March 2017 at 15:51, James Paige <span dir="ltr"><<a href="mailto:Bob@hamsterrepublic.com" target="_blank">Bob@hamsterrepublic.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><br><div class="gmail_extra"><div class="gmail_quote"><span class="">On Fri, Mar 17, 2017 at 9:46 PM, Ralph Versteegen <span dir="ltr"><<a href="mailto:teeemcee@gmail.com" target="_blank">teeemcee@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><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></div></div></div></div></blockquote><div><br></div></span><div>Cool! I'll fix that. I didn't realize (or had forgotten that) I could do that :)<br></div><span class=""><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div></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></div></div></div></blockquote><div><br></div></span><div>I am slowly working my way up to fixing the getting-stuck-mid-tile bug.<br><br></div><div>Even though it is technically backcompat breaking, we have not yet identified a single game that relies on the bug. If we ever find one, I'll dust off the old code, wrap it in a backcompat bitset, and turn that bitset on with some kind of IF gamename = "game_that_needs_to_be_broken.<wbr>rpg" check<br></div></div></div></div></blockquote><div><br></div><div>OK, I guess we can worry about it later. Enabling backcompat bits for specific games would be a whole new thing. In some cases that would be the best way to handle back-compat problems. I think we can come up with better ways than predicating on the file name though.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div></div><span class=""> <blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><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></div></div></blockquote><div><br></div></span><div>Yeah, I know that doesn't fix anything, I still figured it was more correct to determine which tile's walls to check based on the center rather than the top left corner.<br><br></div><div>Yes, that does sound like a good plan for fixing misalignment.<br></div><span class=""><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div></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.</div></blockquote><br></span></div><div class="gmail_quote">The other thing I am doing (besides chipping away at the tile misalignment bug) is to add a couple new NPC movement types.<br><br></div><div class="gmail_quote">Specifically I want a less random version of Chase and Avoid. I have one that is *almost* working but I still need to clean up some edge cases and test it better.<br><br></div><div class="gmail_quote">I also definitely want a movement type for follow-right-hand-walls and follow left-hand-walls which will allow for some pretty fancy NPC movement using just zones and no scripts.<br><br></div><div class="gmail_quote">I have also been thinking about full-on A-star pathfinding. but won't dare touch that until I have the other stuff working.<br></div></div></div></blockquote><div><br></div><div>Looking forward to it :)<br><br></div><div>I guess you'll recompute the A* path each step rather than hanging onto it? For exposing to scripting, this is something that wants arrays and garbage collection.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><br>---<br></div><div class="gmail_quote">James<br></div><div class="gmail_quote"><br></div><br></div></div>
<br>______________________________<wbr>_________________<br>
Ohrrpgce mailing list<br>
<a href="mailto:ohrrpgce@lists.motherhamster.org">ohrrpgce@lists.motherhamster.<wbr>org</a><br>
<a href="http://lists.motherhamster.org/listinfo.cgi/ohrrpgce-motherhamster.org" rel="noreferrer" target="_blank">http://lists.motherhamster.<wbr>org/listinfo.cgi/ohrrpgce-<wbr>motherhamster.org</a><br>
<br></blockquote></div><br></div></div>