Forum

> > CS2D > General > Player hitbox/Bullet
ForenübersichtCS2D-ÜbersichtGeneral-ÜbersichtEinloggen, um zu antworten

Englisch Player hitbox/Bullet

7 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt Player hitbox/Bullet

Mora
User Off Offline

Zitieren
I need player's hitbox values. Idk why but i thought is -11,-11,22,22 (or 22x22 square)

There also question. Do bullet check walls each 1 pixel or is higher value?

alt Re: Player hitbox/Bullet

Ranu
User Off Offline

Zitieren
If I understand correctly, you wanna be checking the players hitboxes (even while they're moving) from the server? That'd be very unreliable either way.

alt Re: Player hitbox/Bullet

Mora
User Off Offline

Zitieren
So that must be that I'm right yeah. Also I remember I can turn on debuglag and compare it with my 22x22 texture.

alt Re: Player hitbox/Bullet

Mora
User Off Offline

Zitieren
Yeah, I have already did test with debuglag 1.
So the another question is still:
Do the bullets wall check every pixel or more?

alt Re: Player hitbox/Bullet

DC
Admin On Online

Zitieren
Yep 12 pixel distance. Or more precisely (pseudo code)
1
if (abs(x - playerX) <= 12 && abs(y - playery) <= 12) { "IT'S A HIT!" }
I think that makes actually 25 pixels? When taking a distance of 0 pixels into account?

Regarding general hit detection precision: It's not necessarily 100% pixel perfect but it should be close to it in most cases. The raycast kind of thing that's going on (the bullet) is moved Sin(rot) and -Cos(rot) pixels each iteration - with float precision until the max distance is reached or something stops the bullet. Simple as that. Not using any fancy algorithms like Bresenham or something. Therefore it might miss some pixels because of float precision etc.
1× editiert, zuletzt 10.05.24 19:12:08
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antwortenGeneral-ÜbersichtCS2D-ÜbersichtForenübersicht