Character personal space

  • #1, by darren-beckettSunday, 05. July 2015, 23:48 9 years ago
    Is there a way to make characters give each other space, resulting in them walking around each other?

    Great Poster

    384 Posts


  • #2, by afrlmeMonday, 06. July 2015, 00:16 9 years ago
    Yes I believe so, if you are willing to dive into a bit of Lua scripting. I already wrote a script that allows you to check a radius around a given position. I suppose if you used that in combination with a loop then you could check when 2 characters enter the same radius & then perform some other function to determine which way the npc should side-step.

    Imperator

    7278 Posts

  • #3, by darren-beckettThursday, 09. July 2015, 17:14 9 years ago
    This is something that should be built into VS, surely most characters need some kind of body mass?

    Great Poster

    384 Posts

  • #4, by afrlmeThursday, 09. July 2015, 17:32 9 years ago
    hehe you would think so, but it's not a common feature of 2D adventure games. 3D yes. The only games I can think of that really required collision detection were a few of the games done by Revolution Software during their early days.

    In Lure of the Temptress for example they integrated basic collision detection & AI into their NPC characters as the NPC characters would randomly walk around the scene to do random tasks. If you or the NPC crossed paths then if I remember correctly, the characters greeted each other or one stopped while the other stepped around them. It's been a lot of years since I played it (was on amiga 600 - showing my age I guess). Actually I believe GOG gives you the game for free these days along with Beneath a Steel Sky when you register an account. I think Beneath a Steel Sky might have also had collision detection, but not 100% sure.

    Here's the radius function I wrote. It's currently written for checking if mouse cursor is inside of a specified radius based on position given, however it wouldn't be too complicated to rewrite the function to check radius around playable character against the radius of an NPC character - well at least I don't think it should be! grin

    P.S: in general most point & click adventure games tend to feature statically placed NPC characters. It's rare to see dynamic non playable characters in adventure games unless the developer is willing to put the effort into writing basic AI for the characters & even then the characters will most likely be playable characters that you can switch between such as in the game Resonance or the Blackwell series.

    Imperator

    7278 Posts