gongpha / gdQmapbsp

A simple plugin that loads Quake's MAP/BSP files into Godot 4 interactively
MIT License
42 stars 5 forks source link

Player update #9

Open victorbstan opened 1 year ago

victorbstan commented 1 year ago

Why?

Player code needs improvement

What?

gongpha commented 1 year ago

Can you elaborate on "Camera was in awkward position" ? Your change seems to make the player looks shorter than the original.

Comparisons (can be observed at the position of the nails on the wall) :

The original (vkQuake)

https://github.com/gongpha/gdQmapbsp/assets/13400398/a218407c-9956-47de-81c6-cb854d882f0c

Your changes

https://github.com/gongpha/gdQmapbsp/assets/13400398/887e91fa-9322-41cf-9fa0-626937a93a86

Before the changes

https://github.com/gongpha/gdQmapbsp/assets/13400398/c44dd397-a6ef-4b14-bd27-04eb48abe7b2

And the swimming code you've noted as WIP looks OK. But it didn't work as expected yet.

https://github.com/gongpha/gdQmapbsp/assets/13400398/80a02c8a-f0ce-45ae-b93c-25a5f884dfe9

victorbstan commented 1 year ago
Screenshot 2023-06-28 at 9 36 20 AM Screenshot 2023-06-28 at 9 19 49 AM
victorbstan commented 1 year ago

https://github.com/gongpha/gdQmapbsp/assets/315297/0d34945a-175c-4b59-8964-778fbc939021

gongpha commented 12 months ago

Haven't you added water sounds, right ?

and it'll be better if you'd fix the collision box when a player is trying to swim up to a water surface. I would appreciate it ^^

https://github.com/gongpha/gdQmapbsp/assets/13400398/db21055d-7e53-4269-a1d4-eba9f515d9c5

victorbstan commented 12 months ago

No water enter sounds ("splashing") yet, but that would be easy to add.

The player is currently able to bounce on top of the water, by jumping or swimming up, which is not ideal, but no worse than before.

I think as an improvement, perhaps the player should not be able to swim/jump up more than half the bbox height out of water. But that would also mean that there needs to be updates to how "getting out of water" works when near a step or solid object -- perhaps by increasing the valid step height while in liquid to include the total height of the player?

gongpha commented 12 months ago

After my investigation. Let's say there are 2 crucial height points to check :

image

Both points can be a very short box or something similar and must touch the water to be considered as they're moving in water.

See how :

https://github.com/gongpha/gdQmapbsp/assets/13400398/d46d2587-b0da-4bd4-91d7-9c08d6ed1a51

In the clip, You can see the player would fall out immediately when their feet are out of the water.


Why needed Point B ? Point A alone will do stuff anyways.

Check out E4M2.

https://github.com/gongpha/gdQmapbsp/assets/13400398/b31b888b-11a5-4a54-bee4-23fbd4dcc5e7

The pool in E4M2 has a very thin water volume. The player couldn't even move in the water volume, despite Point A colliding with it. This is because their feet are already out of the water, making Point B doesn't collide.

Or even if Point B collides with water (their feet are inside the water) if Point A (their upper half body) doesn't collide with the water. It wouldn't be considered that they're moving in the water.

And sure, our implementation could do. which it shouldn't.

https://github.com/gongpha/gdQmapbsp/assets/13400398/d7c32266-a311-4ef7-b0d8-2ba9d513a171

This is my pure assumption. But should work in this situation :)

gongpha commented 12 months ago

Also, I found a good source about the Quake metrics https://book.leveldesignbook.com/process/blockout/metrics/quake

So, I will write it some of them here. And include Godot units too.

Metric Quake unit Godot unit (1/32)
Collision hull size 32 x 32 x 56 1 x 1 x 1.75 (current is 1.5)
camera height above floor 46 1.4375
Maximum run speed 320u/sec 10u/s
Fall damage height (for handling fall damage sound) 256+ 8+
Underwater height (above floor) 29+ 0.90625+
victorbstan commented 12 months ago

We can use func _get_submerged_level() to check 3 levels, bellow mid-point (bbox entered fluid volume) is 1, mid-point (half point of character bbox) is 2, and eye level (camera/around) is 3.

victorbstan commented 12 months ago

There's also something we can decide to do, is ask if we want to implement "all the features", or work in a more incremental way, where we can have more peace-meal player improvements across many PR's. I don't know if we will successfully implement all the player features at once.

Also I will be away this weekend, so won't touch this until later Monday or Tuesday.

victorbstan commented 12 months ago

To make it more like in the original behaviour func _get_submerged_level() can be modified to add another point collision check at the foot level which would represent A and return 1...

victorbstan commented 11 months ago

Swimming should feel more like traditional game now (maybe not exactly, but closer) (should address: https://github.com/gongpha/gdQmapbsp/pull/9#issuecomment-1615264167) Also getting out of water is easier now, as there's a separate "stairstep_liquid" which applies while in liquids, that is much higher than normal stairstep.

gongpha commented 11 months ago

Looks better ! Also, I suggest you change the gravity as well. It seems a bit low. Compared with the original which falls faster.

it's around 800 or 25 in Godot unit.