(July 2024) Monthly WIP Screenshot Thread

Added a vehicle to continue improving gameplay.

Note this car model is not the same as the one found jme test. :innocent:

3 Likes

Completed HUGE milestones.

  1. Added a map. Then screenshot shows that I’m roaming grid row 2 column 3.

  2. Dynamically loads areas. I created a 3x3 grid.

Right now the 9 areas load dynamically.

In the far future they will also shift if I want to create an sandbox game. I don’t want that right now (maaaybe in the future).

Character is at the initial origin area. O represents the character
xxx
xOx
xxx

Character moves to area (1,2).
xOx
xxx
xxx

Grid will shift the character to the center again.
xxx
xOx
xxx

  1. Can open the map by using the keyboard or the gamepad.
7 Likes

Some time ago I made a feature to add Decals to my levels, but that’s only good for static decoration.
So I used the same technique to attach decals to the scene during game play.

Here is in action with my pet project where I test stuff (not a real game):

Something you can notice is decals don’t just attach on walls (bullet holes and blood splats) but also to animated meshes.
I had to make a hack to make it work, first I copy the necessary vertex buffers (BoneIndex, BoneWeight, BindPosePosition and BindPoseNormal) to the new mesh which I attach it to the node where the animation is and finally I disable Hardware skinning for that particular SkinningControl so it will also update the decal mesh from then on.
The assumption is that just a few animated models will have decals at a time (e.g. injured NPCs) so the performance lost is not that bad (there’s probably a better way but I’m happy with this so far).

12 Likes

Very impressive work! I always wondered if animated decals were possible for things like blood or tatoos, but never managed to get far enough to start working on it. So it’s great to hear that it works!

I’m also wondering if this step can be skipped.

I had similar issues when I tried attaching clothing to an animated character. At first it appeared to not work and the clothes would not animate, but when I detached then re-atached the animComposer with a new skinningControl, the animComposer suddenly began animating the clothes and everything worked.

The same thing also happened in the SDK, where newly attached clothing items would not follow the animations until the scene was saved and reloaded.

Here’s the code I calll after I attach a new clothing mesh to my animated models to make it work without changing the hardwareSkinning mode, hopefully this will also work for your procedurally generated decals too:

    public void refreshAnimationRig(){

        spatial = agent.getSpatial();

        animComposer = ((Node) spatial).getControl(AnimComposer.class);
        skinningControl = ((Node) spatial).getControl(SkinningControl.class);        
        
        dynamicAnimControl = ((Node) spatial).getControl(DynamicAnimControl.class);
        
        armature = null;
        if(dynamicAnimControl != null){
            armature = dynamicAnimControl.getArmature();
        }
        else if(skinningControl != null){
            armature = skinningControl.getArmature();
        }
        
        spatial.removeControl(skinningControl);        
        
         //important to recreate a new SkinningControl, and to not use the old one
        spatial.addControl(new SkinningControl(armature));

        agent.getApp().enqueue(()->{
            agent.getAgentSkeleton().reInitializie();     // recreate hitboxes a frame later to avoid crash from doing it before the controls are ready
        });                
    }
3 Likes

Very interesting! I will definitively give it a try. Frankly disabling HW skinning is one of the first things I did when troubleshooting my code I and didn’t even try turning it on after, so this is encouraging me to fix it, Thanks!

ps: A quick test threw a NPE but is possible I’m missing copying the HW specific vertex buffers, I will try more tomorrow.

3 Likes

That was it, I just had to copy the HW* vertex buffers and recreating the skinning control made it work.
Thank you so much for the tip @yaRnMcDonuts :monkey_face:

4 Likes

Long time no OpenKeeper (Dungeon Keeper 2 remake) news… Finally had some time/energy/motivation to dig into my game project and not just the jME and its SDK.

Poorly narrated and hastily recorded… I’ve started implementing the keeper spell casting. And as a proof, here are some imps getting conjured:

11 Likes

This month I continue to optimize and improve my editor.
I’m planning on making a small game to validate my editor, and I’m currently trying to make some skills and some in-game items.

Make a skill that attacks with a sword.

Make the sword-slashing effect for skills

11 Likes

Finally de-coupled the bullet form the character node. Previously if you translated the player, the bullet followed.

In the image you can see that I move to different places while the trajectory of the bullet is unchanged.

Features with this test build:

Can change the bullet model geometry to anything else.
The speed is controlled by a scale float value.
I’m NOT fighting against the JMonkey APIs. I don’t introduce custom functions.

It’s important to note that I was able to gracefully implement this solution because I’ve been studying about rotations. I still have some more study to do about rotations, but I’ll get there.

3 Likes

Super cool!

1 Like