Excerpts from the Shooter development journey :)

The video quality is slightly poor.

6 Likes

Looks great and quite performant! What type of hardware is used ?

Is some specific approach with models/materials/animations used ? Bc I have some performance issues with animated pbr models, it would be interesting for me to try something that might help.

I see also some “particles” system, is it self-made or something known used, like 3DPS from Kagamma?

Also interesting how much info is shown in this profiler panel, it is different from original castle profiler UI, is it self-made also ?

What I specifically liked is Jinga animation :sweat_smile: from capoeira ! but I suppose popular animations like mixamo are used , or ? Fog effect with pressurized flow effect from smoke grenade also looks stunning.

What I didn’t like: sounds are felt somewhat jagged and interfering each-other, maybe too intense for background noise, a gun crosshair is a lit tiny sphere, which looks strange :sweat_smile: , materials on the character models look like Phong materials or some plastic, esp. on player hands holding gun, this is clearly seen when you change skins of player.

In general - it is feature-rich and feels close to complete state which is really great!

thanks for sharing !

2 Likes

Thanks a lot for the detailed feedback.

Hardware:
CPU: Intel i5-9600K
GPU: GTX 1650

So it’s not high-end hardware :slight_smile:

Models / Materials / Animations approach

Each model uses only one material. I use combined textures.
All textures are compressed (KTX).

For characters:

I use one shared armature (skeleton) in Blender

I only change the mesh, not the skeleton

Animations are split by bones:

upper body
lower body
full body
fingers, etc.
I export keyframes from Blender and use them at any time in any current animation.

Particle system
I use Effekseer (Kagamma) for particles.

“Jinga / Ginga” animation & fog effect
Thanks :sweat_smile:

Yes, the smoke is cool. I only have the .efk file, not the .efkproj — I forgot how I downloaded it.

Sounds
Yes, walking / running sounds are currently bad.

“a gun crosshair is a lit tiny sphere, which looks strange :sweat_smile:”
Yes, I can change the effect for any weapon (sniper, rifle, smoke, etc.).

Materials (plastic / Phong look)
Materials on the character models look like Phong or plastic, especially on the player hands.

Yes, especially the hands — I was going to fix them but got lazy :sweat_smile:.
In the future, I will change the texture.

Profiler panel
Yes, it is self-made :slightly_smiling_face:
I use a VCL form inside a DLL.
Each player owns one profiler instance.

In general, it is feature-rich and feels close to a complete state, but there is still one big adventure left:

Networking :slightly_smiling_face:
I will try to make it an online shooter game.

Finally, I use physics in a separate thread. I tested it, and it looks good.
Maybe it’s not 100% safe, but for now it works great :slight_smile:

When I have time, I will make a demo that summarizes all of this work.

2 Likes

This looks great. How do you make the rifle scope? Is it a TCastleViewport, if yes, how do you get it in a circle form?

1 Like

Thanks
It’s not a circular viewport. The scope is a real 3D model (scene) attached to the weapon’s transform, and I just zoom the camera. :slight_smile:

I use a scene for the scope (not a TCastleTransform reference) because the scope has a bone, and I use its position for raycasting.

2 Likes

Note: one can make TCastleViewport in a circle form using TCastleMask, see Mask UI. Mask can “filter” a circular shape from a viewport.

Our example examples/3d_games/explore_impressive_castle (examples/fps_game in the past) shows this used, for a circular minimap in top-right.

( I’m just making a note in case you need this feature. For the rifle “zoom in”, the way @hal09 has done on the movie is cool. Alternative for me (but it depends on the rifle / zoom look) would be to switch rifle to “UI over the viewport” and then zoom the camera (changing field of view). )

1 Like

Hello everyone,
I made a demo to show the animation method from the video. I hope it’s clear and organized !

i m using delphi for this demo.

Basically: export bone data with a script (one bone / multiple bones / all bones), then load it and play it on any character with the same skeleton.

2 Likes

It has an error:
Fatal: Can’t find unit System.TypInfo used by GameViewMain

just remove System. in such cases, leave only TypInfo in uses block

1 Like

It didn’t make any difference.

i m using delphi for this demo

try delphi 11, 12 , 13

1 Like

I experimented, and I can compile the demo from @hal09 using FPC, and on Linux :slight_smile: It rocks.

Note: One needs FPC 3.3.1 (stable FPC 3.2.2 will not be enough) to have support for reference to... . You can install such FPC version using e.g. fpcupdeluxe.

Here’s a list of changes:

  • Remove System. prefix from a few standard units in the uses clause. It’s mostly search+replace System. → ‘’ (nothing).

  • Remove Threading from the uses clause. FPC doesn’t have it (for now), it’s also not used in this code.

  • Add to all units (early, e.g. before interface keyword):

    {$ifdef FPC}
      {$mode delphi}
      {$modeswitch functionreferences}
      {$modeswitch anonymousfunctions}
    {$endif}
    

    Reason: This will allow:

  • Add

    type
      {$ifdef FPC}
      TProc<T> = reference to procedure (Arg1: T);
      {$endif}
    

    at the top of unit uPlayerManager, since FPC misses TProc<T>.

  • To help FPC determine RandomFrom overload, change it to

    const
      Ints: array[0..2] of Integer = (0, 1, 2);
    ....
    Player := CreatePlayer(TCharacterType(RandomFrom(Ints)));
    
  • Add to Local[TBoneCharacterType(BoneIndex)] using more manual way:

    procedure AddArray(var Source: uPlayerConst.TSingleArray_; const Values: array of Single);
    var
      I: Integer;
    begin
      SetLength(Source, Length(Source) + Length(Values));
      for I := 0 to Length(Values) - 1 do
        Source[High(Source) - I] := Values[High(Values) - I];
    end;
    
    ....
    
        if (BoneIndex >= 0) and (BoneIndex <= Ord(High(TBoneCharacterType))) then
        begin
          AddArray(Local[TBoneCharacterType(BoneIndex)],
            [Frame, LocX, LocY, LocZ, RotX, RotY, RotZ, RotW]);
        end;
    
  • Remove {$ifdef FPC}@{$endif} from the {$ifdef FPC}@{$endif} Utility.Handler. (in this case, @ is wrong, as Handler is a variable already)

  • Add TypInfo to GameViewMain uses clause.

2 Likes

Thank you @michalis
I followed your notes and successfully compiled the demo using FPC 3.3.1.
I also noticed a big performance difference:

FPC 3.3.1 → around 300 FPS
Delphi → around 120 FPS
!!!

I think I should seriously consider moving to FPC 3.3.1 :slight_smile:

1 Like