[Ohrrpgce] SVN: james/8927 add hero_collision_check functions similar to the npc_collision_check fu

James Paige Bob at hamsterrepublic.com
Sat Jul 1 08:17:23 PDT 2017


On Saturday, July 1, 2017, Ralph Versteegen <teeemcee at gmail.com> wrote:

>
>
> On 1 July 2017 at 10:09, <subversion at hamsterrepublic.com
> <javascript:_e(%7B%7D,'cvml','subversion at hamsterrepublic.com');>> wrote:
>
>> james
>> 2017-06-30 15:09:36 -0700 (Fri, 30 Jun 2017)
>> 110
>> add hero_collision_check functions similar to the npc_collision_check
>> functions
>> use them for hero pathfinding
>> ---
>> U   wip/game.bas
>> U   wip/game.bi
>> U   wip/pathfinding.bas
>> U   wip/pathfinding.bi
>>
>
> Hmm, quite a bit of duplicated code! It would be tricky to share code, but
> I think it's doable. Were you planning/working on that?
>

I actually tried sharing more code, but it got very ugly. I deleted my
first attempt.



> After quite a lot of inspection I found they already don't agree: I see
> hero_collision_check won't work correctly if you're in a vehicle, or if
> walk-through-walls is enabled. And keeping them in agreement will be a
> nuisance.
>
> Oh, dang, I totally forgot about vehicles, thanks for reminding me!


>
> The "movdivis" checks can be moved from want_to_check_for_walls to
> update_heroes, so that that function can be called from hero_collision_check
>

 I'll look at that




> The vehicle_is_animating() = NO checks, NPC pushing and NPC activation can
> be moved out of the collision block in update_heroes, so that that block
> can replaced with a call to hero_collision_check.
> The fact that hero_collision_check stops when it finds a wall collision
> but update_heroes doesn't, doesn't matter because a wall collision sets
> x/ygo to 0 so that an NPC collision/activation can't happen except in the
> corner case that you're standing on top of a touch-activated NPC.
>
> I am going to have to re-read all that when I am more awake, but thank you
:)


> Also, pixelpos is unused.
>
> I guess we'll need to special case pushing an NPC when using the mouse.
>
>
Oh, yes. I still have some plans for special handling when you click an NPC.

I think the only tricky bit there is when an NPC is both pushable and
activate able.

I'll figure it out
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.motherhamster.org/pipermail/ohrrpgce-motherhamster.org/attachments/20170701/73db143d/attachment-0001.htm>


More information about the Ohrrpgce mailing list