Collision detection and you; another cry for help

Make games! Discuss those games here.

Moderators: Bob the Hamster, marionline, SDHawk

Post Reply
User avatar
Meowskivich
Blubber Bloat
Posts: 2199
Joined: Tue Mar 06, 2012 12:38 am
Location: Earth
Contact:

Collision detection and you; another cry for help

Post by Meowskivich »

So, I've recently run into problems with collision detection. At least the activation of NPCs through collision detection.
In my wip game, Merciful Mungbeans, I have some sections that have "timing puzzles" where you're meant to dart between these globs of magic that send you back to the start if you mess up, and the NPCs activation doesn't exactly hold up to my needs.

I started out with "step on", but that only works sometimes, as it only works when both you and the NPC occupy the same space AND you're the second one to enter the space at the same time. If you happen to just stand still you can let the NPCs just waltz through you with no activation.

Next, I tried "on touch", but it's wacky as it will activate just being in a space adjacent to the hero. This may seem good, but no. You can be standing still, heck, not even on a possible path towards the NPCs, but you'll still activate it. This is not good, as you can't really camp out waiting for your precise opportunity to slip by to continue on your path.

My questions be these:
1- is there some sort of way of making a GOOD collision detection?
and
2 - there's no current way of it in the OHRRPGCE, can one of the crew make a thing that actually activates the NPCs upon, regardlessly, the NPCs and heroes occupying the same space, not just if you enter the same space after the NPC did?
Last edited by Meowskivich on Sat Jul 20, 2013 8:55 pm, edited 1 time in total.
dOn'T MiNd mE! i'M jUsT CoNtAgIoUs!!!
Play Orbs CCG: http://orbsccg.com/r/4r6x :V
User avatar
marionline
Metal Slime
Posts: 673
Joined: Sat Feb 26, 2011 9:23 pm

Post by marionline »

Maybe you could use an each-step collision checking script?
Or do you just want to use the OHR without scripting?

In the plotscript dictionary there are 'NPC at spot (x, y, number)' and 'NPC at pixel (x, y, number)' commands, you could compare them with your hero's position and if it's identical, teleport the hero back to beginning.

I am not sure if it matters who was on a tile first, but the Hero would need to be able to step on the NPCs of course.

Maybe one could also use moving zones and slices, but I do not know well about theses, so I'll best not make any more assumptions.
User avatar
Spoonweaver
Liquid Metal King Slime
Posts: 6247
Joined: Mon Dec 08, 2008 7:07 am
Location: Home
Contact:

Post by Spoonweaver »

well, I've got good news and bad news.

The bad news is that there's no built in way to have the kind of collision detection you're looking for.

The good news is, you can script in almost any kind of collision detection you want.
Each step scripts won't really cut it though. It's better if you just set up a loop script.
I have an example built into my somekindaninja script which you can download and view at your leisure. It's in my techdemos listing.
TMC
Metal King Slime
Posts: 4101
Joined: Sun Apr 10, 2011 9:19 am

Post by TMC »

Yes, the built in collision detection is terrible and we should add some alternatives (we won't want to change the way it behaves in old games because I think a lot of games rely on it). Step-on NPCs not activating if they walk underneath you is also intentionally kept for backwards compatibility.

But I don't understand how you want collision detection to work.
User avatar
Meowskivich
Blubber Bloat
Posts: 2199
Joined: Tue Mar 06, 2012 12:38 am
Location: Earth
Contact:

Post by Meowskivich »

step on, only it works when they occupy your space as well.

As in

step on works like:
NPC occupies spot A, hero moves from spot B to spot A, NPC activates
hero occupies spot A, NPC moves from spot B to spot A, NPC does not activate

what I want:
NPC occupies spot A, hero moves from spot B to spot A, NPC activates
hero occupies spot A, NPC moves from spot B to spot A, NPC activates

I'm not saying replace step on, just...make a new one, like, occupied space? you ca probably think of a better name for it.
Last edited by Meowskivich on Sun Jul 21, 2013 3:27 am, edited 1 time in total.
dOn'T MiNd mE! i'M jUsT CoNtAgIoUs!!!
Play Orbs CCG: http://orbsccg.com/r/4r6x :V
Post Reply