I haven't even started working on anything, so this is more a hypothetical debate than anything else but: What is the fastest method of checking passability in a plotscripted game? In previous attempts, I've iterated through every maptile to generate a passability slice (A line a couple pixels wide positioned in the right way) which is parented to a passability container. When the hero tries to move, it'd generate a "feeler" and if that feeler was colliding with one of the passability slices, the move would not happen. This worked well enough without slowdown.
But I remain curious: If you're gonna have a bunch of stuff moving around, what's the fastest way? FindCollidingSlice? SliceAtPixel? Or should I quit worrying about nothing and just build the damn thing?
Fastest Way to Check Collisions
Moderators: marionline, SDHawk
You didn't specify whether you're doing pixel-based or tile-based movement.
If you're just doing tile based movement then the easiest thing is to use check hero wall/check npc wall. It's not affects by any 'suspend' commands.
I don't think using slice collisions is going to be very much faster (and potentially a fair bit slower on a large map) than just writing the check manually using "read pass block". I can't say which would be faster. However, it might be significantly less work to use slice collision tests instead of writing the check yourself. It's definitely a pain to have to check up to 4 different tiles.
There's definitely no point worrying about speed here unless you have hundreds of things bouncing off walls.
If you're just doing tile based movement then the easiest thing is to use check hero wall/check npc wall. It's not affects by any 'suspend' commands.
I don't think using slice collisions is going to be very much faster (and potentially a fair bit slower on a large map) than just writing the check manually using "read pass block". I can't say which would be faster. However, it might be significantly less work to use slice collision tests instead of writing the check yourself. It's definitely a pain to have to check up to 4 different tiles.
There's definitely no point worrying about speed here unless you have hundreds of things bouncing off walls.
Last edited by TMC on Sat Oct 08, 2016 5:45 am, edited 1 time in total.