Jump to content
A 2021 backup has been restored. Forums are closed and work in progress. Join our Discord server for more updates! ×
SoaH City Message Board

Difficulties w/ Grassy areas w/ Damizean's Engine


Recommended Posts

Hello again.

I'm having some issues with Damizean's 360 Engine..again :e

See, the problem is that his collision detection is tooprecise. What am I do to with grassy levels where the pixels kind jump all over the place?

Is there a way to make detection like, smoother?

Or should I just hand make smooth obstacles, and layer them with the non-obstacle grass?

Help is much appreciated :D

Link to comment
Share on other sites

It shouldn't be that much of an issue since it's spaced a good deal apart, a few pixels shouldn't matter, but it'd still be a little bumpy. Anyway, I don't know much of MMF (but am assuming it works the same as his GM engine), but there are three options I see.

One is the simplest and is to round the angle to the nearest 15 or so degrees, but this can look jerky in loops or on slopes that could be one or the other.

Next is to use a small circle to detect the slope instead of the dot. It could be a tad slower and might be hard to implement, but it'll keep the grass from effecting it too much.

The last is to use the grass background as a non-collisiding tile and have a seperate, flat, invisible layer to do all the collision detecting (the way you mentioned). This is simple and peobably the best way for Game Maker, but, again, I don't know if it's worth it in TGF/MMF.

Edit: A little elaboration on the first option since it's the option I'd choose if the third's too tedious:

First of all, it's best to divide it into 22.5 degree segments. To round them you first divide by 22.5 then round then multiply by 22.5.

That's simple enough, but to make it smoother in one of my engines, I made it to where you have to go, say, 5 + 22.5/2 pixels beyond the middle of the angle you're on to change to the next angle. This is a little tricky to implement, though, since you have to take into accound that angle1-angle2 won't always give you the correct answer.

  • Like 2
Link to comment
Share on other sites

You don't need to break them up. Why don't you just turn off the fine collisions for each of the flat pieces? That way it treats the object as a block with a flat surface instead of a block with a bunch of ridgy things on top.

To do this, right-click on the background object, go to Properties, then to Obstacle. Uncheck the box that says "Collision with box". Sorry if you've already tried this method >_>.

For the slopes, I've always had the grass flat on slopes anyway, but if for some reason you have the bumps on the slopes too, you may need to do what Damizean originally suggested. Treating a slope like a block would like...completely defeat the purpose of it being a slope...

Link to comment
Share on other sites

Ugh. Just make completely black and flat (Or sloped depending on the object) backgrounds and make THEM the level. (Ie make them have collisions) Then, paste all the visual backgrounds on top. (As safety, you might wanna make sure the black backgrounds invisible) The black backgrounds will mark the "silhouette" of the level that your character can collide with. All the rest of the background can be for show and visuals.

Link to comment
Share on other sites

Or just use a damn separate object for the grass, for position concordance!

The problem is that it gets very tedious. We're trying to suggest possible alternative methods that could significantly cut down on the workload. Either way, I'm pretty sure just about every method known has been suggested by this point >_>.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...