#Foxtrot reference game

1 messages Β· Page 2 of 1

trim lagoon
#

Yes

opaque sorrel
#

That does seem a good way of doing it

visual fiber
# trim lagoon Yes

hmm then it needs a ray cast, right? Since I can't really guarantee that the character is at the box's "feet" otherwise

#

I guess I could manually implement that my inserting NavMeshAffector once they stop moving and manually remove it once it starts again?

opaque sorrel
#

I could probably add this as well, as an optional component, I see the use

visual fiber
trim lagoon
#

We only care about the feet stuff wrt path finding and waypoints - both of which don't apply to characters

visual fiber
#

So I need to setup a system that copies a NavMeshAffector from a rigid body to its colliders once it's done loading

#

Do you think oxidized_navigation could maybe also respect NavMeshAffector on rigid bodies?

visual fiber
opaque sorrel
visual fiber
visual fiber
visual fiber
trim lagoon
#

I think I've fixed this bug, gotta write a test to check though

#

@visual fiber was this only happening when you were having dynamic objects be NavMeshAffectors?

#

Just to make sure my hypothesis matches reality πŸ˜›

trim lagoon
#

Awesome!

trim lagoon
#

That's funny, my guess as to what was going wrong was incorrect, but the fix is identical πŸ˜›

#

Still working through the dodgy crash though

#

Also hopefully when Alice returns, I can get a landmass channel going so I don't end up spamming this chat haha

visual fiber
visual fiber
#

btw @indigo atlas, during the rework I found a lot of bugs in avian_pickup that I fixed in 0.1.6. I think it's quite well-behaved now (mostly), so you may want to upgrade your version if you didn't do so already πŸ™‚
Here's some footage covering the edge cases

#

(this uses the "ignore player collisions while holding" strategy we discussed a while ago)

indigo atlas
visual fiber
#

(Unfortunately I had some issues implementing that one with Avian so far)

indigo atlas
indigo atlas
#

Maybe I'll test it. || I like trying to break things.||

visual fiber
visual fiber
#

this is how the picking behaves in TDM

#

notice also how TDM drops the object for you once it would be close enough to the camera to intersect with it

indigo atlas
#

Nice

trim lagoon
# visual fiber <@160128095502860290> assigning a character to the box and chair works pretty we...

I gave up and cheated. dodgy_2d now no longer panics in this case. This was just some floating point error that I didn't know how to fix. The two constraints are parallel but are so close that it also thinks one line invalidates the other, but then upping that epsilon just caused panics in other test cases, so idk. The practical reality is that this is such a rare situation, I think it's safe to use whatever arbitrary velocity it comes up with.

trim lagoon
#

So just update to dodgy_2d v0.5.5 and you should be good to go

visual fiber
#

I'll just report to you in case the fox starts zooming around πŸ˜„

#

BTW, the kind folks of the rendering dev channel helped me through some trouble with HDR. This resulted in three separate Bevy bug reports for multi-camera setups, haha. But now we have quite some nice visuals!

#

You can see that the bloom sometimes goes wild and starts glittering on the edges of objects

#

But other than that, I really like the lighting right now πŸ™‚

visual fiber
cosmic raven
visual fiber
cosmic raven
visual fiber
winter tinsel
agile cypress
#

wow I just yoinked this and started for 0.16 and I just check

#

0.16 is there! with tnua! thx

visual fiber
#

Still haven't bothered with writing the readme as a guide, but eh

agile cypress
#

any ideas?

visual fiber
#

So I suggest using that one to open the maps πŸ™‚

visual fiber
#

It's all setup so that you can cargo run the game once, and it will automatically populate your trenchbroom settings to make it ready

#

(there's a message in the console output)

#

Then you can simply open the .map file in TrenchBroom and everything should just work out of the box

agile cypress
#

Okay, ill navigate this for a bit. I've got some time early tomorrow. Might have some notes that could be useful/could help your guide

#

thanks

#

hehe still xpbd reference in dialogue

visual fiber
#

Knew I forgot something πŸ˜„

agile cypress
visual fiber
#

You can see in there see that it will send out an info! if successful

#

You then open up the .map file in TrenchBroom

#

Does that make sense?

agile cypress
#

yes! all of it, thanks

agile cypress
#

haha noted

visual fiber
#

I think that was
"Note that the total height of the character is length + 2 * radius"

agile cypress
#

ah, and then was moved to the other const. makes sense

visual fiber
#

@opaque sorrel @trim lagoon got a new nav mesh weirdness

#

Don't know how visible it is, but I believe the nav mesh is being generated under the slope

#

Is there any knob I can tweak?

trim lagoon
#

I can't remember, can you see the vertical height of the voxels with oxidized navigation? Might be worth decreasing the size of that if so

#

I don't actually know if that'll help, but I think that should make the slope be modeled better?

opaque sorrel
#

This is the technical reason why the height correction exists 😭 I gotta find the time to fix it's quirks.

As Andriy says it's oversimplifying.

visual fiber
#

Increasing the character radius of the chair had no meaningful effect on this behavior

#

I believe that model does have its origin at the feet, so the navigation character should not need any vertical offset

trim lagoon
#

This is basically just navmesh hole cutting

visual fiber
#

Oooh okay

#

that makes sense, thanks πŸ™‚

#

I guess landmass_oxidized_navigation could have that feature however, right?

trim lagoon
#

I've thought about how to do this without leaving landmass, but I don't think it is practical. I think the long term is that landmass sadly needs to pick a nav mesh generation thingy

trim lagoon
visual fiber
#

For the other 3D people out there, main now has a neat little asset baking script that is used in the release workflow.
It does the following:

  • Compress all textures to ktx2 + bc7
  • Generate mip maps for them all
  • Modify glTFs to point to the new ktx2 textures
  • Compile all TrenchBroom maps to .bsps and run light to generate light maps and light grids
#

All of that runs automatically on release, so you don't have to worry about it πŸ™‚

#

In a nutshell, what the KTX2 stuff does is:

  • Reduce file size
  • Make textures faster to use for the GPU
  • Eliminate aliasing when looking at textures from afar or an angle
agile cypress
#

hey :> idk how, but the gltf rotation fix might not work with bevy_skein...well, it definitely does rotate it, but the transform is still in the original location

#

that was a fun one to figure out hahaha i was losin my mind for a sec

agile cypress
#

seems like something must be going on where the parent is always at the origin or some business

#

I couldn't decipher it tbh

visual fiber
agile cypress
#

so this location right (positive x, positive y in blender world), so if I use the rotation fix...it's perfect! right where I expect it to be (ignore the one to the left, debugging but can't really remove yet lmao)...

however...if I log the distance from the player translation to its translation (global stuff), well, if I sit right where it is prior to the rotation, I'm on it.

visual fiber
#

Are you logging the distance to the entity that holds Mesh or the entity that holds SceneRoot?

agile cypress
#

might be a few reasons for this but not sure...may investigate after this jam im in

visual fiber
#

Then the glTF fix should not affect you at all, as it only rotates the children of that entity

#

(as those are the purely visual components)

agile cypress
#

huh...well, whatever this becomes

#

ig I'll have to look deeper

visual fiber
agile cypress
#

Is this what you mean? pickup is child of Object

visual fiber
agile cypress
#

oh yeah, loaded up

#

that's how we roll hahaha

visual fiber
#

Hehe

#

Alright, try this

agile cypress
#

it's no problem honestly, once I undid the rotation, everything became safe n sound. I'll just draw everything backward

visual fiber
#

could you still try this snippet? (sec)

#

This observer here instead of the plugin

#
fn fix_gltf_coordinates(
    trigger: Trigger<SceneInstanceReady>,
    q_scene_root: Query<&SceneRoot>,
    q_children: Query<&Children>,
    mut q_transform: Query<&mut Transform, With<Mesh3d>>,
) {
    let scene_entity = trigger.target();
    let Ok(scene_root) = q_scene_root.get(scene_entity) else {
        return;
    };

    let Some(asset_path) = scene_root.0.path() else {
        return;
    };

    let Some(extension) = asset_path
        .path()
        .extension()
        .and_then(std::ffi::OsStr::to_str)
    else {
        return;
    };

    const GLTF_EXTENSIONS: [&str; 2] = ["glb", "gltf"];
    if !GLTF_EXTENSIONS.contains(&extension) {
        return;
    }

    let mut iter = q_transform.iter_many_mut(q_children.iter_descendants(scene_entity));
    while let Some(mut transform) = iter.fetch_next() {
        transform.rotate_y(std::f32::consts::PI);
    }
}
#

remove the plugin, otherwise you will get two rotations πŸ˜„

#

I think this is not entirely correct

#

But I'm curious

agile cypress
#

working

#

that works

visual fiber
#

Oh wow, nice!

#

Let me publish a patch then real quick

agile cypress
#

so awesome, thanks lol

visual fiber
#

won't do a patch in that case, sorry

#

but happy that it was of help πŸ™‚

agile cypress
#

no that's totally fine, I'm cool with it! thanks

visual fiber
#

I guess I'll have to bite the bullet at some point and do that rotation fix PR in Bevy itself

agile cypress
#

Honestly it might not even be the rotation fix now that I think about it #general message
I think this was particularly unusual...culling happening like that? no way...anywho

visual fiber
agile cypress
#

I think I’ve found a catch all solution to the gltf animation problem

#

That’s like really simple. Just didn’t know it existed, I’m gonna send up a crate soon

#

Literally the Gltf struct has everything we need to make animations work quickly without having to type out handles to animation clips

visual fiber
#

I'm interested in learning more about this πŸ‘€

agile cypress
#

Do you think it's be good to use a trigger? I'm not exactly sure how bevy_kira_audio's AudioSink::play works looking at it...seems like that would be much clearer, like an analogous interface for something like

//pretend there's a timer here and this is an Update system
fn play_next(
foxes: Query<&GltfAnimation, With<Fox>>,
mut index: Local<usize>
) {
  for fox in foxes {
    fox.play(*index);
    //fox.play("T-Pose") would work if the animation is named in the gltf
  }
  *index += 1;
}

but not that skilled. so instead something like

//pretend there's a timer here and this is an Update system
fn play_next(
mut commands: Commands
foxes: Query<Entity, With<Fox>>,
mut index: Local<usize>
) {
  for fox in foxes {
    commands.entity(fox).trigger(PlayAnimation::new(index));
    //if it's named, PlayAnimation::new("T-Pose") would also work
  }
  *index += 1;
}

would that make sense? This is kinda the last piece.

edit: maybe ill go even simpler. it'll just give you node indexes..

agile cypress
#

the interface is not what I want, but it'll play

#

(you may notice some borrowed code πŸ˜† )

if the animations are named, you can do that too...but really don't love the interface I've got, really should be an extension of a regular animation lpayer, or at least feel like it

agile cypress
#

I'm afraid this may no longer be a game template πŸ˜† I just caught up with the changes to see how to structure trenchbroom in my app, and I think shader_compilation.rs is wild LOL

on a serious note, would there ever be a scenario where a QuakeClass would not point to a gltf/glb type?

#

I haven't yet seen that in the template but it's not something I have found to be easily discoverable

visual fiber
#

The shader compilation is sadly essential for 3D on web IME

visual fiber
#

I believe brush entities are also QuakeClass, and those operate directly on the brushes inside its grouping

#

See the 'LightWindow` for such a brush entity

agile cypress
#

oh good, okay thanks!

visual fiber
agile cypress
#

will do :)

cosmic raven
#

Foxtrot reference game

agile cypress
#

@visual fiber would there be any interest in meshlet processing at runtime? maybe during your loading state?

#

I think I've cracked the code on this

visual fiber
visual fiber
#

Like, run the processing in a little CLI that can be executed by the release workflow, save the meshlet meshes to disk, then load those in release mode instead of glTFs

agile cypress
#

because it indeed is slow

#

I've got a bias though since I have a fast processor, but the fox..lemme see

#

It took no time

#

hmm

visual fiber
visual fiber
agile cypress
#

something's off actually...

#

Let me see...

visual fiber
agile cypress
#

fails on Fox.glb actually, that's why it was so freaking fast

visual fiber
#

I only use .gltf anyways, FYI

agile cypress
visual fiber
agile cypress
#

There's also a few other issues...even if it does get processed

#

but I'll see what's going on with the fox

visual fiber
#

Consider pinging jasmine if it doesn’t work, I'm very positive she’s happy to help πŸ™‚

visual fiber
#

@agile cypress could you try the fox glTF in foxtrot?

agile cypress
#

works

#

LOL

visual fiber
#

Intentionally not upstreaming since the version in Bevy's assets is the same as in the official glTF test resources

agile cypress
#

I'm afraid what will happen when I play animations... 😬

visual fiber
agile cypress
visual fiber
#

Though that message is a year old

agile cypress
#

you'd probably have to "rerig" the meshlet

#

ah

analog kernel
#

In Foxtrot v0.4.0 (commit 274563b), we initially implemented camera smoothing using the bevy-dolly crate. Following the recent refactor, while the explicit camera smoothing configuration appears to have been removed, I've noticed the camera movement has become significantly smoother. Could you help me identify which part of the current implementation is responsible for this improved smoothness?

visual fiber
analog kernel
#

This means the first-person camera is positioned on the player, and the player's movement is interpolated using Avian. For implementing a third-person camera perspective, would using bevy_dolly still be necessary in this case?

visual fiber
#

Mainly what happens when you orbit the camera such that it would collide with terrain

#

If you simply put the camera in a non-colliding distance in one frame, it feels very disorienting

#

Same when you are no longer colliding and want the camera to return to its original distance

analog kernel
#

Thank you, I understand now. The first-person camera is positioned on the player and moves exactly with it. However, the third-person camera isn't part of the player entity - it needs independent smoothing for its movement.