I must say I’m not 100% sure about the first statement. If you’re making Doom-like RPG (that is rather TES: Arena / Daggerfall :D) then you don’t need grid-based movement and let the player roam freely. You can just use TCastleWalkNavigation and it will do everything for you. Just use 3D FPS game template from Castle Editor and it’ll get you started.
If you want something more like Anvil of Dawn / Eye of the Beholder, with grid based movement, then you’ll need to control the input by yourself. Imho it’s much more convenient to do so through a custom navigation class that will take care of the movement between grid tiles. Maybe not the best example of the code, this is a very old project, but a working example can be found here EugeneLoza / Duungeeon · GitLab
Ah, it could make sense to update Castle Game Engine for you, because PreciseCollisions was one of the few fixes I’ve had to make it to work with latest version - and it’s how it’ll be working in the future.
And yes, I didn’t know about Doom RPG. Makes perfect sense!
No specific reason. In complex projects I keep the idea of “viral license” that requires derivatives to be opensource too. CGE also uses LGPL license (with linking exception).
Duungeeon was planned to be a full and complete game, not just a small abandoned demo But in its current state indeed a more permissive license would work better. Should I alter it? I don’t have anything against MIT if you may find reusing chunks of code useful However, I’d rather encourage you to write those better - that code does what it is supposed to, but it’s not good. If I’ll return to the idea of making this kind of game (maybe next week? Unlikely but still) I’ll be rewriting a lot of stuff from the scratch, just copying ideas, not actual code.
If you don’t have PreciseCollisions defined, then indeed the first thing you should do is update – take latest CGE from Download | Castle Game Engine .
As for camera movement: to be clear (as I don’t know Doom RPG), you want camera like in “Eye of Beholder” or @eugeneloza 's Dungeeon? So
view from first person
movement by 1 grid tile back / forward
rotation by 90 degrees
To do such movement in an “instant” way, your code is along the lines I would do. Just change MainViewport.Camera.Translation or MainViewport.Camera.Rotation in response to key.
If you want to move/rotate smoothly (not instantly), using TCastleCamera.AnimateTo is the simplest option. My example examples/eye_of_beholder shows this.
As for the sprite sheet size: the size just follows the sprite sheet frame size in pixels. It makes sense in 2D games, it is indeed unnaturally large for typical 3D games – simply scale it down, i.e. set Scale to something like 0.01 0.01 0.01 (scale 100x smaller in all 3 dimensions).
Attach a TCastleScene with a sprite sheet of your weapon as a child of the camera. See pointers from Camera | Manual | Castle Game Engine . So place a weapon just as we do in examples/fps_game, however in your case the weapon will be just a sprite sheet, properly scaled and rotated.
There are other ways of doing this (e.g. additional TCastleViewport with Transparent = true, only to display the weapon), but for start I would recommend the simplest approach above.
See “3D FPS game” template for an example how to shoot at enemies.