PDA

View Full Version : Large Link Hitbox Doesn't Detect Collision Properly



ywkls
02-07-2016, 06:48 PM
I'm working in verson 2.50.2 and created a quest with a 1 x 2 sprite. Almost immediately, I noted that the sprite wasn't colliding with enemies, spikes or eweapons except on its bottom half. I ended up scripting a solution to this, but having to do that is just painful. I could probably provide file to demonstrate this, but I'd have to remove all of the scripts and that's gonna take some time. I'll include one if requested.

ZoriaRPG
02-12-2016, 11:53 PM
For the record, this was intentional, as the large Link sprite was intended for overhead view, as Z3 or MC. The hitbox area was designed to be his feet, to collide with Solid Damage Combos, and such, so that the upper-portion was not generating exztra damage, or causing overlap problems with solid combos, and such.

If we properly add Link->Extend, and fix the other attribs tied to it (e.g. HitWidth, HitXOffset), we should be able to fit custom hitboxes for Link in a future build. I looked at the code, and there's nothing that really makes any relationship with these values to the actual hit detection. We'd need to add that, and do a partial rewrite of the collision code to support it.

Another thing we might be able to do as a stopgap, is change the hitbox for Large Link in SideView mode. That might be more straightforward, and would allow sidescrollers to use the large sprite with fewer bugs.

ywkls
02-14-2016, 01:46 AM
For the moment, I'm using a script to fake it. It isn't perfect, but it's the only solution available.

ZoriaRPG
02-15-2016, 06:31 AM
For the moment, I'm using a script to fake it. It isn't perfect, but it's the only solution available.


Many bugs have methods to circumvent them, but that doesn't mean that we shouldn't try to squash the things. :kitty:

Tamamo
02-18-2016, 04:12 PM
What it does is make Link's collision rectangle 1 full tile 16x16 pixels.

Tamamo
02-23-2016, 04:02 PM
ZoriaRPG
Actually those settings work just fine, I just tested it.

ywkls
02-24-2016, 12:13 AM
ZoriaRPG
Actually those settings work just fine, I just tested it.

What settings are you talking about? I can create an example quest pretty quickly that demonstrates that things like spikes, fireballs and enemies don't seem to affect anything but the bottom of a 16 x 32 sprite.

ZoriaRPG
02-24-2016, 11:51 AM
ZoriaRPG
Actually those settings work just fine, I just tested it.

I know they work in overhead view, to give a larger hitbox, but the settings are misleading, as in sideview, the entire sprite should be the hitbox.

I think the easiest change would be to change the hitbox dimensions for Link in sideview mode, in general, as he should have a 16x16 hitbox by default in sideview, which can be 16x32 in large sprite mode.

Once we implement Link->Extend and hitbox modification, it'll be solved too, but we might be able to push the above change change into the next build.

Saffith
02-24-2016, 12:54 PM
People use large sprites in different ways. Some people want a 16x32 Link, some want 16x24, some want 16x18. Enlarging the hitbox would work better in some cases and worse in others.

ZoriaRPG
02-24-2016, 11:43 PM
People use large sprites in different ways. Some people want a 16x32 Link, some want 16x24, some want 16x18. Enlarging the hitbox would work better in some cases and worse in others.

That's my general fear with hardcoding that kind of change; namely: 'What will this break?'.

Ideally, we'll just make sizing Link's hitbox viable.

Downloader
11-03-2018, 11:30 PM
Any word on this Link->Extend function lately?

ZoriaRPG
11-12-2018, 04:47 AM
Any word on this Link->Extend function lately?


Not yet, and it's somewhat tricky. I will eventually get to this, but IDK when.

The issue is that the internal checking for collision with Link is not uniform. Everything uses a different routine to do this, and it needs to be unified, first.

What I need to do, is add a set of collision routines in FFCore, and move all internal collision checking to those. For Link, this means collision with enemies, collision with ffcs, collision with weapons, collision with items, collision with map flags, and collision with combo types.

Ideally, all collision events will process through FFCore, setting up a series of internal pair-based collision flags, that the user will be able to easily read by script. Dispose of manual collision checking in FFScript, and allow ( if type->Collision(ptr) ). That way, internal engine collision becomes more sane, and script collision checking returns engine collision.

Anyway, once there is uniform collision checking for Link, adding all of the hitbox vars will be easy, and those will also exist in Link's ZQuest config, where I plan to add a number of settings, including hitbox size, sprite size, defences, states ( e.g. visibility, transparency, diagonal movement, and tile overlap, other values).

None of these should remain as 'rules', but rather, be transformed into initial settings that the user can modify by script at any time.

Downloader
11-15-2018, 08:54 PM
https://youtu.be/0ThmYaZbaIM
Here's a little demo of something I whipped up this last month.
npc->Extend worked like a charm but I had to use an FFC and write to Link->Action to mimic a larger hitbox for the LoZ II style.
Since the game is for moving screens anyway I had to re-write the collision myself anyway so not having a Link->Extend didn't really set me back on that category, but would've helped tremendously.

I would really only need the Link->Extend to cover NPC and EWeapon collision as the solidity collision is already wrote up in my code.

ZoriaRPG
11-19-2018, 07:35 PM
https://youtu.be/0ThmYaZbaIM
Here's a little demo of something I whipped up this last month.
npc->Extend worked like a charm but I had to use an FFC and write to Link->Action to mimic a larger hitbox for the LoZ II style.
Since the game is for moving screens anyway I had to re-write the collision myself anyway so not having a Link->Extend didn't really set me back on that category, but would've helped tremendously.

I would really only need the Link->Extend to cover NPC and EWeapon collision as the solidity collision is already wrote up in my code.

Sure. You can map an ffc over Link, or any game object that you want, and use it as a fake hitbox. You could also store coordinates in an array, and use those with fully-custom collision events. Those are still hacks.

Downloader
11-20-2018, 12:35 AM
Sure. You can map an ffc over Link, or any game object that you want, and use it as a fake hitbox. You could also store coordinates in an array, and use those with fully-custom collision events. Those are still hacks.
I am aware of those options. Actually though, with the way I coded this game in the demo video and prior demos, making a quest level is as simple as clicking and dropping the combos on the screen the same as a quest file without.

ZoriaRPG
11-20-2018, 03:11 AM
I am aware of those options. Actually though, with the way I coded this game in the demo video and prior demos, making a quest level is as simple as clicking and dropping the combos on the screen the same as a quest file without.

I'm not entirely sure what you're making. I'll eventually get Link->Hitbox* done, but it'll be a while.

I'm not overly fond of rescripting the whole blasted engine as an option to pass on to users.

Some of us are bonkers-enough to do that stuff, but that's our issue.:D

What version are you using for this engine?

Downloader
11-20-2018, 05:15 AM
I'm not entirely sure what you're making. I'll eventually get Link->Hitbox* done, but it'll be a while.

I'm not overly fond of rescripting the whole blasted engine as an option to pass on to users.

Some of us are bonkers-enough to do that stuff, but that's our issue.:D

What version are you using for this engine?

I've been using build 2.5 build 28.
The most recent work I did on ZC/ZQ/ZScript is pretty much turning out to be a Zelda II-esque sideview platformer.
As it stands right now Link is centered the whole time, but I did write parameters before that would allow for the player to go to the edge of the screens when going to the edge of the map segments, and the remnants of the code are still there.

I hadn't released my code to anyone until recently when a friend asked me about it and showed interest.
https://1drv.ms/u/s!AulnLkDim5HhjCNDbBorPUmrD916
There's a link to the .qst file in my OneDrive account.
You're welcome to take a look if you're interested.

I spent so much time, money, and effort on this over the last decade I wasn't really fond of the idea of just releasing it to anyone either, but Joe got me convinced that I should share it.

The frame-rate drops pretty hard for the first second or so because the code reads and saves all the combo data for the destructible and enemy combos so they can repop in certain situations.

Layer 1 is the enemy combos, layers 2 is background, layer 3 is collision combos, layer 4 is elevators that activate on push of InputUp and down, layer 5 is destructable/weapon interaction combos, layers 6,7, and 8 appear and dissapear on a timer, and layer 9 is mobile platforms that move on their own.

The whole thing is one big gigantic map that I plan on making a huge dungeon with eventually that consists of 18 maps with 9 layers a piece and they are all connected without any screen transitions.

I've only got a few NPCs done so far.

Like I said before though, the edge of the screen thing I already got done before and could be repeated. In theory, this could become an exact LOZ II replica, but I don't want to spend the rest of my life copying behaviors and combo the whole thing out piece by piece just to have it done.

To make it more like Zelda II, one would just have to quit the whole N[1] shifting the screen up and down to stabilize it and make Link->Y change instead, then use N[5]-N[8] as parameters that tell the game when to stop scrolling and start adjusting the Link->X coordinate instead of N[0].

Edit: I'm using Windows version, forgot to mention.

Edit again: Sorry, I fibbed. I was using v2.5 build 28.

ZoriaRPG
11-20-2018, 09:43 PM
I've been using build 2.5 build 28.
The most recent work I did on ZC/ZQ/ZScript is pretty much turning out to be a Zelda II-esque sideview platformer.
As it stands right now Link is centered the whole time, but I did write parameters before that would allow for the player to go to the edge of the screens when going to the edge of the map segments, and the remnants of the code are still there.

I hadn't released my code to anyone until recently when a friend asked me about it and showed interest.
https://1drv.ms/u/s!AulnLkDim5HhjCNDbBorPUmrD916
There's a link to the .qst file in my OneDrive account.
You're welcome to take a look if you're interested.

I spent so much time, money, and effort on this over the last decade I wasn't really fond of the idea of just releasing it to anyone either, but Joe got me convinced that I should share it.

The frame-rate drops pretty hard for the first second or so because the code reads and saves all the combo data for the destructible and enemy combos so they can repop in certain situations.

Layer 1 is the enemy combos, layers 2 is background, layer 3 is collision combos, layer 4 is elevators that activate on push of InputUp and down, layer 5 is destructable/weapon interaction combos, layers 6,7, and 8 appear and dissapear on a timer, and layer 9 is mobile platforms that move on their own.

The whole thing is one big gigantic map that I plan on making a huge dungeon with eventually that consists of 18 maps with 9 layers a piece and they are all connected without any screen transitions.

I've only got a few NPCs done so far.

Like I said before though, the edge of the screen thing I already got done before and could be repeated. In theory, this could become an exact LOZ II replica, but I don't want to spend the rest of my life copying behaviors and combo the whole thing out piece by piece just to have it done.

To make it more like Zelda II, one would just have to quit the whole N[1] shifting the screen up and down to stabilize it and make Link->Y change instead, then use N[5]-N[8] as parameters that tell the game when to stop scrolling and start adjusting the Link->X coordinate instead of N[0].

Edit: I'm using Windows version, forgot to mention.

Edit again: Sorry, I fibbed. I was using v2.5 build 28.

Hmm, interesting. I gave it a try. I take it that there is as yet, no way to attack?


Here's some reference material, should you ever want to look at any of it:

http://timelord.insomnia247.nl/zc/scrolling/

Downloader
11-21-2018, 03:22 PM
Hmm, interesting. I gave it a try. I take it that there is as yet, no way to attack?


Here's some reference material, should you ever want to look at any of it:

http://timelord.insomnia247.nl/zc/scrolling/


Regular attack is Ex3 instead of the B button, and Link starts out with UpStab and DownStab also, just jump and input up or down.

I'll check out what you got, thanks.