SyntaxBomb - Indie Coders

General Category => Worklogs => Topic started by: Matty on December 12, 2023, 08:39:21

Title: 3d Fantasy Land Battle Scene Thingy
Post by: Matty on December 12, 2023, 08:39:21
Hello again.

Felt like trying out a different way of rendering some stuff (blitz3d), by using only a single instance of a mesh and calling 'renderworld' with cameraclsmode set to false for both zbuffer and color buffer.

You can see the results here, and in the zip file (source code and executable provided)

from Matt

source and executable (https://mattiesgames.com/assets/fbs.zip)



(https://mattiesgames.com/assets/fbs02.jpg)

(https://mattiesgames.com/assets/fbs01.jpg)
Title: Re: 3d Fantasy Land Battle Scene Thingy
Post by: Derron on December 12, 2023, 11:25:49
The "position jittering" of the units is something to improve as it destroys a "natural look".

Despite that - looks good and I guess with some more nature objects (stones, hills, swamps, rivers, ...) it will look a lot more interesting.

Regarding "lighting" I guess some simple "clouds"  (above camera) could shed some nice subtle (!) shadows on the scenery.


Let's see what you come up with next here.


bye
Ron
Title: Re: 3d Fantasy Land Battle Scene Thingy
Post by: Matty on December 12, 2023, 18:00:24
Thanks Ron,

An update:

itch page (in development)

itch page (https://matty77.itch.io/3d-fantasy-battle-thingy)

source code still included.

screenies:
(https://mattiesgames.com/assets/fbs02a.jpg)
(https://mattiesgames.com/assets/fbs01a.jpg)

PS - I probably should have built this a few weeks ago an entered in the 80s competition as inspired by Broderbund's Ancient Art of War from 1984.
Title: Re: 3d Fantasy Land Battle Scene Thingy
Post by: Matty on December 13, 2023, 06:32:23
Title: Re: 3d Fantasy Land Battle Scene Thingy
Post by: Matty on December 13, 2023, 06:48:15
One of my 'design dilemmas' with all my games in more recent years.

I'm not a gamer. I don't play games. I haven't really played games since about 1998-2004 (Baldur's Gate 2, Doom 3). Those are the last games I really ever played properly.

But - I do like creating software, and games and stuff - and I do play my own games, even if I never play anyone else's anymore.

Also - because I know I have an audience of 1 (me), I know I only really have to make them for my own requirements and needs. (There's a tonne of games for myself I've made over the last decade that no one will nor should ever see).

So I sometimes wonder if I should turn this, or some of my other 'battle viewer thingies' into a game. Problem is - almost every time if I turn it into a game I'll turn it into something I no longer enjoy - because I mainly like just sitting back and watching the battles like a screen saver.

So yeah - sometimes I wonder if I should turn these demos into a game, but since I'm the only one who enjoys them, and I don't enjoy playing proper games...it's hard to justify the effort.
Title: Re: 3d Fantasy Land Battle Scene Thingy
Post by: Matty on December 13, 2023, 06:52:44
In any case...what you see in these videos and screenshots and in the game if you download it from itch.io is approximately 24 hours work.
Title: Re: 3d Fantasy Land Battle Scene Thingy
Post by: William on December 14, 2023, 00:15:11
yeah, i would be playing games wishing i were coding my own, now its i want to code a game that i would play because thats fun.. i used to be a demigod player but i turned to coding some several years ago. some bug of runescape classic that someone exploited turned my interest on that that was what was possible through an online game world and software. think it was the christmas cracker hack someone did in 2001. im one of those original players (to which i did not know during 2006+ so not really sure i really did play then or not, i only remember like posting on forums really early then on XP PC asking about game dev, somehow someone told me or google that there were code software, old posts on thegamecreators forum but that an rs person told me about blitz.

but im getting old its old.. i still look young, to me but i dont want to be one of those people chasing after their youth or what have it be. but i really dig coding and theres many ideas i've had i wish to explore.. but that its taking sooo much time. its cool to  me because like im one of those internet users, you know? but maybe its something not so very cool. and maybe the fun is robbed of it.
Title: Re: 3d Fantasy Land Battle Scene Thingy
Post by: Matty on December 15, 2023, 07:08:02
Game (https://matty77.itch.io/3d-fantasy-battle-thingy)

(https://mattiesgames.com/assets/game_01.gif)

(https://mattiesgames.com/assets/img-0006.jpg)

(https://mattiesgames.com/assets/img-0021.jpg)
Title: Re: 3d Fantasy Land Battle Scene Thingy
Post by: Matty on December 15, 2023, 11:20:39
River added:

(https://mattiesgames.com/assets/game_river.gif)
Title: Re: 3d Fantasy Land Battle Scene Thingy
Post by: Matty on December 15, 2023, 18:04:13
Rough Ground Added:

(https://mattiesgames.com/assets/game_rough.gif)
(https://mattiesgames.com/assets/game_rough2.gif)
Title: Re: 3d Fantasy Land Battle Scene Thingy
Post by: Matty on December 16, 2023, 01:47:46
Added an alternate camera view:

(https://mattiesgames.com/assets/game_pov_1.gif)

(https://mattiesgames.com/assets/game_pov_2.gif)
Title: Re: 3d Fantasy Land Battle Scene Thingy
Post by: Matty on December 16, 2023, 09:27:40
(https://mattiesgames.com/assets/a01.jpg)(https://mattiesgames.com/assets/a02.jpg)(https://mattiesgames.com/assets/a03.jpg)(https://mattiesgames.com/assets/a04.jpg)(https://mattiesgames.com/assets/a05.jpg)(https://mattiesgames.com/assets/a06.jpg)(https://mattiesgames.com/assets/a07.jpg)(https://mattiesgames.com/assets/a08.jpg)(https://mattiesgames.com/assets/a09.jpg)(https://mattiesgames.com/assets/a10.jpg)
Title: Re: 3d Fantasy Land Battle Scene Thingy
Post by: Matty on December 17, 2023, 14:58:47
Updated:
itch page: Game (https://matty77.itch.io/3d-fantasy-battle-thingy)

Title: Re: 3d Fantasy Land Battle Scene Thingy
Post by: Matty on December 20, 2023, 05:10:56
Hello Syntaxbombers.....

If anyone wishes to help me out by telling me some stats that you get when the game is running, that would be appreciated.

Itch.io link is below:

https://matty77.itch.io/3d-fantasy-battle-thingy (https://matty77.itch.io/3d-fantasy-battle-thingy)

When the game loads (10 - 20 seconds on my pc) press '1' (along the top of keyboard) to show in game stats. Press 'tab' to change between the main two camera views. Press 'F1' for in game help on what other keys do in the game.

The debug info shown by pressing '1' - I'm interested in the following values:

rtime (render time)
fps
and avgfps

I'd be also interested to know the approximate age/year of manufacture of your PC. For example, I'm developing this on an entry level gaming PC from 2014. So about 10 years.

Much appreciated,

Matt.
Title: Re: 3d Fantasy Land Battle Scene Thingy
Post by: mainsworthy on December 20, 2023, 05:45:36
this is fantastic
Title: Re: 3d Fantasy Land Battle Scene Thingy
Post by: Matty on December 21, 2023, 11:19:13
Thanks mainsworthy.

The 'game' now has audio and music

https://matty77.itch.io/3d-fantasy-battle-thingy (https://matty77.itch.io/3d-fantasy-battle-thingy)

I've also uploaded the high quality textures for the characters in this version on the itch.io page.

It's also been somewhat optimised.

There's a global quality setting in the config.txt file (0-100) that can be used to manage performance on slower machines. My machine is pretty slow and I run it at 95% quality, so that can't be that bad.
Title: Re: 3d Fantasy Land Battle Scene Thingy
Post by: Matty on December 21, 2023, 20:33:32
Title: Re: 3d Fantasy Land Battle Scene Thingy
Post by: Matty on December 22, 2023, 08:09:31
Game Feature - other developers may find this interesting, I'm happy to share it with you:

My game is a stand-alone executable that plays battles one after the other that are generated randomly.

However, if you for example have a fantasy campaign that lacks the battle component and wish to use my 3d fantasy battle viewer to play out the battle for your users then it's possible to place a text file in the user's local appdata folder on their PC called "localstorage.txt" and place a variety of lines indicating the units present in the battle, the terrain type, whether to simply play the battle once and then exit, and so on.  The game will play out the battle and record the results, casualties etc, in the same localstorage.txt file which you can then easily parse to get the results for your own campaign.

It's a feature I was going to use if I ever built a campaign mode. But it's very easy to implement.

Simply: open localstorage.txt for writing in the relevant folder, write the relevant lines, execute the game.exe, then read back from localstorage.txt the results of the battle - in plain text.

from Matt
Title: Re: 3d Fantasy Land Battle Scene Thingy
Post by: Matty on December 22, 2023, 18:23:47
The game has a simple added gameplay feature now - you can play a simple campaign of a sequence of battles in which you play cards from a hand dealt to you every few seconds of some choices of actions you can take in the battle. The battle continues in real time while you play the cards.

(https://img.itch.zone/aW1hZ2UvMjQxOTE2MS8xNDQzMjMyMi5qcGc=/original/0PxSVt.jpg)
Title: Re: 3d Fantasy Land Battle Scene Thingy
Post by: Matty on December 23, 2023, 13:13:37
I would appreciate finding out how it runs on other peoples' machines than my own.
Title: Re: 3d Fantasy Land Battle Scene Thingy
Post by: chalky on December 23, 2023, 15:09:49
Quote from: Matty on December 23, 2023, 13:13:37I would appreciate finding out how it runs on other peoples' machines than my own.
I tried running it but Windows Defender (Win11) insists the .exe is infected with a trojan - and won't let me launch [or delete] it. I don't have Blitz3D on my laptop so sadly cannot run it from the IDE. Looks good though from your videos.
Title: Re: 3d Fantasy Land Battle Scene Thingy
Post by: Matty on December 23, 2023, 16:47:06
Running Windows Defender scan on my entire development folders and gaming folders shows nothing at my end, but I won't dispute your computer's claim.
Title: Re: 3d Fantasy Land Battle Scene Thingy
Post by: Matty on December 24, 2023, 17:56:14
;D Merry Christmas  :P

Game Link (https://matty77.itch.io/3d-fantasy-battle-thingy)

In time for Christmas morning - you can download and play the game from the itch site.

Enjoy. Developed in Blitz3D. Source code included.

(https://mattiesgames.com/assets/a4.jpg)

(https://mattiesgames.com/assets/a5.jpg)

(https://mattiesgames.com/assets/a3.jpg)
(https://mattiesgames.com/assets/a2.jpg)

(https://mattiesgames.com/assets/a1.jpg)
Title: Re: 3d Fantasy Land Battle Scene Thingy
Post by: Matty on December 25, 2023, 07:14:09
Download link https://matty77.itch.io/3d-fantasy-battle-thingy (https://matty77.itch.io/3d-fantasy-battle-thingy)
Gameplay Video:

Title: Re: 3d Fantasy Land Battle Scene Thingy
Post by: William on December 25, 2023, 22:26:43
same thing with the trojan i couldnt run my bmx app server.exe (which is just Gnet) but the blitzmax ide were able to compile and run the client app. w11
Title: Re: 3d Fantasy Land Battle Scene Thingy
Post by: Matty on December 26, 2023, 03:40:08
Thanks William.

Yes - Microsoft themselves describe their anti-malware tool as being 'reputation based' which in my understanding simply means if a executable's code signature isn't on their 'whitelist' of accepted executables then it's flagged as 'security risk'.
Title: Re: 3d Fantasy Land Battle Scene Thingy
Post by: Matty on December 27, 2023, 08:30:21
Itch Link (https://matty77.itch.io/3d-fantasy-battle-thingy)

An example of magical effects in the game:

Title: Re: 3d Fantasy Land Battle Scene Thingy
Post by: Matty on December 28, 2023, 22:40:23
Well ain't that curious.

Windows Defender with up to date virus definitions on my PC and on a library PC - my PC reports no infected file, library PC reports trojan as per comment above by chalky.

Same anti viral software, both up to date virus definitions, same executable. On one pc - infected, on another, not.
Title: Re: 3d Fantasy Land Battle Scene Thingy
Post by: Matty on December 29, 2023, 18:01:52
Link (https://matty77.itch.io/3d-fantasy-battle-thingy)

Title: Re: 3d Fantasy Land Battle Scene Thingy
Post by: Matty on December 30, 2023, 11:31:47
This is about as complete as I can make it with the feedback I've received. I'm happy with it. It's done, as far as I'm concerned.

Game (https://matty77.itch.io/3d-fantasy-battle-thingy)

Title: Re: 3d Fantasy Land Battle Scene Thingy
Post by: Matty on January 01, 2024, 15:24:25
https://matty77.itch.io/3d-fantasy-battle-thingy
Title: Re: 3d Fantasy Land Battle Scene Thingy
Post by: chalky on January 01, 2024, 17:45:02
Really enjoying these videos. Some impressive stuff going on here... :D
Title: Re: 3d Fantasy Land Battle Scene Thingy
Post by: Matty on January 01, 2024, 23:30:10
Thanks Chalky, I'm trying to keep the scope small enough to play to my strengths while hopefully making something that is still interesting and fun to play - and looks good enough for a modern user.
Title: Re: 3d Fantasy Land Battle Scene Thingy
Post by: Matty on January 02, 2024, 05:34:32
;;;;;;;;;;;;;;;;;;;;;;;;;;
;A simple program for generating
;a skybox environment, then rendering
;it to bitmaps, and then demonstrating
;using it to display a fake background
;based on a pre-rendered mesh
;
;
Graphics3D 1920,1080,0,2 ;set our 3d display
showbox = 0 ;flag - change this to 1 when you want to see the skybox in action

.start
pcamera = CreateCamera() ;camera
CameraRange pcamera,2,2000
CameraZoom pcamera,1
CameraClsColor pcamera,165,193,211 ;sky color
CameraFogMode pcamera,1 ;turn on fog
CameraFogRange pcamera,100,800
CameraFogColor pcamera,165,193,211 ;match sky color with fog

terraintype$ = "grass"

If showbox = 1 Then ;yeah a goto I know - this is just 'cause it's easy to do this way right now
Goto envbox
EndIf

;set up our lighting scheme - 4 lights, an a low ambient light, directional lights
;pointing across in a few different ways
Dim lights(4)
AmbientLight 10,10,20
pivot = CreatePivot()
light = CreateLight(1)
lights(0) = light
PositionEntity light,300,150,-200
PointEntity light,pivot
LightColor light,185,160,120
light = CreateLight(1)
lights(1) = light
PositionEntity light,-300,150,-200
PointEntity light,pivot
LightColor light,185,160,120
light = CreateLight(1)
lights(2) = light
PositionEntity light,300,150,200
PointEntity light,pivot
LightColor light,185,160,120
light = CreateLight(1)
lights(3) = light
PositionEntity light,-300,150,200
PointEntity light,pivot
LightColor light,185,160,120

mountains = LoadMesh("mountains.b3d") ;load our 3d mountain range.
;This mountain range is really just a height map of a jagged donut saved as a mesh and texture loosely.

gtex = LoadTexture("grass.png",1)
ScaleTexture gtex,0.125,0.25
EntityTexture mountains,gtex


;load our tree/foliage mesh. You could do an awful lot more than what I've done here
TextureFilter("leaves_DF.tga",1+2)
treemesh = LoadMesh("elm.b3d")
HideEntity treemesh

;load some more foliage...
rivergrass = LoadMesh("rivergrass.b3d")
HideEntity rivergrass
camera = pcamera


;put our camera in the middle of the yard and raise it up a little.
MoveEntity camera,0,20,0
rtime = MilliSecs()


For angle = 1 To 4 ;we're going to take 4 snapshots - with a zoom of 1.0 it means the fov is 90 degrees, so...makes sense
If image<>0 Then FreeImage image:image = 0
image = CreateImage(1920,1080) ;this image is merely to allow us to watch it render...while it renders...

TurnEntity camera,0,90,0 ;turn the camera
SetBuffer BackBuffer()
CameraClsMode camera,True,True ;render the mountain range..and put it in the zbuffer/colour buffer
ShowEntity mountains
RenderWorld
HideEntity mountains ;hide the moutnains
CameraClsMode camera,False,False ;change the camera to not clear the zbuffer or colour buffer...we'll simply keep rendering stuff into it until we've got a nice picture.
ShowEntity treemesh
ShowEntity rivergrass
;you could do this step a million and one different ways, this is how I've chosen to do it.
;for example you could simply line pick a million times to get the height of the mountains
;all over the place....we're planting trees here...millions of them....
For s = 1 To CountSurfaces(mountains)
surf = GetSurface(mountains,s)
For v = 0 To CountVertices(surf) - 1
x# = VertexX(surf,v)
z# = VertexZ(surf,v)
y# = VertexY(surf,v)
TFormPoint x,y,z,0,pcamera ;just checking if the tree will be inside the camera view
If TFormedZ()<0 Or Abs(TFormedX())*0.95>TFormedZ() Then Goto skipit
If KeyHit(1) Then End
If MilliSecs()>stime Then ;this is just to let us see the render updating as we go...gives us something to look at while it works in the background
stime = MilliSecs()+1000
CopyRect 0,0,1920,1080,0,0,BackBuffer(),ImageBuffer(image)
SetBuffer FrontBuffer()
DrawBlock image,0,0
Delay 2
SetBuffer BackBuffer()
EndIf
fog=fog+1
If fog Mod 12 = 0 Then
;this gives us our weirdly nice volumetric cloudy effect
;we're changing the fog range slightly every few renders....
;that gives the effect of misty clouds that actually look like fog
CameraFogRange camera,Rnd(80,120),Rnd(700,900)
EndIf
If Abs(TFormedX())>TFormedZ()*0.8 Then CameraFogRange camera,100,800
If y > 2 Then
For i = 1 To 50
;plant a shit-ton of trees for each vertex in the mountain range above a yheight
PositionEntity treemesh,x+Rnd(-20,20),y+Rnd(-25,5),z+Rnd(-20,20)
RotateEntity treemesh,Rnd(-20,20),Rnd(360),0
sc# = Rnd(0.2,0.6)+Rnd(0.2,0.6)+Rnd(0.2,0.6)
ScaleEntity treemesh,sc,sc,sc
RenderWorld ;render the tree, hide it, reposition it, show it, render again...I think you get it.
HideEntity treemesh
ShowEntity rivergrass
For j = 1 To 10 ;plant a shit ton of grass around each tree
PositionEntity rivergrass,EntityX(treemesh)+Rnd(-10,10),EntityY(treemesh)+Rnd(-2,2),EntityZ(treemesh)+Rnd(-10,10)
RotateEntity rivergrass,Rnd(-20,20),Rnd(360),0
sc = 2.0+Rnd(-0.5,1.5)
ScaleEntity rivergrass,sc,sc,sc
RenderWorld
Next
HideEntity rivergrass
ShowEntity treemesh
Next
Else
;we're on the flat...put a bunch of grass down
ShowEntity rivergrass
HideEntity treemesh
For j = 1 To 50
PositionEntity rivergrass,x+Rnd(-20.0,20.0),y+Rnd(-2.0,2.0),z+Rnd(-20.0,20.0)
RotateEntity rivergrass,Rnd(-20.0,20.0),Rnd(360),0
sc = 2.0+Rnd(-0.5,1.5)
ScaleEntity rivergrass,sc,sc,sc
RenderWorld
Next
HideEntity rivergrass
If Rand(0,100)<5 And (TFormedZ()*TFormedZ()+TFormedX()*TFormedX())>300*300 Then
ShowEntity treemesh
PositionEntity treemesh,x+Rnd(-20,20),y+Rnd(-2,2),z+Rnd(-20,20)
RotateEntity treemesh,Rnd(-20,20),Rnd(360),0
sc# = Rnd(0.2,0.6)+Rnd(0.2,0.6)+Rnd(0.2,0.6)
ScaleEntity treemesh,sc,sc,sc
RenderWorld

HideEntity treemesh
EndIf
EndIf
.skipit
Next
Next
HideEntity treemesh
HideEntity rivergrass
SaveBuffer BackBuffer(),terraintype$+"_background_"+angle+".bmp" ;save the skybox images.....
Next
rtime = (MilliSecs() - rtime)/1000
Color 255,255,255
Text 0,0,"Render Time:"+rtime+" seconds."
Flip
Delay 4000
ClearWorld()
showbox = 1
Goto start
End



.envbox

If boxtex1<>0 Then FreeTexture boxtex1
If boxtex2<>0 Then FreeTexture boxtex2
If boxtex3<>0 Then FreeTexture boxtex3
If boxtex4<>0 Then FreeTexture boxtex4
If boxsprite1<>0 Then FreeEntity boxsprite1
If boxsprite2<>0 Then FreeEntity boxsprite2
If boxsprite3<>0 Then FreeEntity boxsprite3
If boxsprite4<>0 Then FreeEntity boxsprite4


boxtex1 = LoadTexture(terraintype+"_background_1.bmp",1+16+32)
boxtex2 = LoadTexture(terraintype+"_background_2.bmp",1+16+32)
boxtex3 = LoadTexture(terraintype+"_background_3.bmp",1+16+32)
boxtex4 = LoadTexture(terraintype+"_background_4.bmp",1+16+32)
boxsprite1 = CreateSprite()
boxsprite2 = CreateSprite()
boxsprite3 = CreateSprite()
boxsprite4 = CreateSprite()
EntityTexture boxsprite1,boxtex1
EntityTexture boxsprite2,boxtex2
EntityTexture boxsprite3,boxtex3
EntityTexture boxsprite4,boxtex4
ScaleSprite boxsprite1,1920/10,1080/10
ScaleSprite boxsprite2,1920/10,1080/10
ScaleSprite boxsprite3,1920/10,1080/10
ScaleSprite boxsprite4,1920/10,1080/10
SpriteViewMode boxsprite1,2
SpriteViewMode boxsprite2,2
SpriteViewMode boxsprite3,2
SpriteViewMode boxsprite4,2
PositionEntity boxsprite1,0,0,192
PositionEntity boxsprite2,-192,0,0
PositionEntity boxsprite3,0,0,-192
PositionEntity boxsprite4,192,0,0
pivot = CreatePivot()
PointEntity boxsprite1,pivot
PointEntity boxsprite2,pivot
PointEntity boxsprite3,pivot
PointEntity boxsprite4,pivot
FreeEntity pivot
EntityFX boxsprite1,25
EntityFX boxsprite2,25
EntityFX boxsprite3,25
EntityFX boxsprite4,25
TurnEntity boxsprite1,0,180,0
TurnEntity boxsprite2,0,180,0
TurnEntity boxsprite3,0,180,0
TurnEntity boxsprite4,0,180,0
EntityOrder boxsprite1,10
EntityOrder boxsprite2,10
EntityOrder boxsprite3,10
EntityOrder boxsprite4,10
Repeat
TurnEntity pcamera,0,.1,0
RenderWorld
Color 15,15,15
Rect 0,900,1920,180,1
Color 190,190,190
If font = 0 Then font = LoadFont("Arial",30)
If font<>0 Then SetFont font
Text 10,1000,"This SkyBox Was Generated By First Rendering Millions of Foliage elements to bitmap in blitz, then setting the renders as textures for four simple sprite elements"
Text 10,1040,"Technically this could be done with anything, not just trees and foliage. You could render a scene of billions of polygons as a skybox, as long as you happy to wait."
Flip
Delay 15
Until KeyHit(1)

End
Title: Re: 3d Fantasy Land Battle Scene Thingy
Post by: Matty on January 02, 2024, 13:31:15
Excuse the low resolution video quality - unfortunately I'm using a 10 year old PC to make this, which was not the fastest PC to start with and so capturing video is difficult if the machine is already working pretty hard to render frames for a game.....but I think you should be able to see what's going on.


Title: Re: 3d Fantasy Land Battle Scene Thingy
Post by: Matty on January 02, 2024, 14:18:34
Animations might be a little nicer:

(https://img.itch.zone/aW1nLzE0NTMyMjU2LmdpZg==/original/5R7NyA.gif)

(https://img.itch.zone/aW1nLzE0NTMyMjY3LmdpZg==/original/dvynqR.gif)

(https://img.itch.zone/aW1nLzE0NTMyMjYzLmdpZg==/original/EdZOlL.gif)

(https://img.itch.zone/aW1nLzE0NTMyMjQ4LmdpZg==/original/5dfMAd.gif)
Title: Re: 3d Fantasy Land Battle Scene Thingy
Post by: Matty on January 03, 2024, 07:02:06
(https://mattiesgames.com/assets/howitisdone.jpg)

The method/algorithm is very simple:

You have your update loop as per normal.

Then in your 'rendering' section of the code you do this:

;set the camera for the very first render to clear the zbuffer and colour buffer
cameraclsmode camera,true,true
;hide all the entities in the game except for the main level/background entity.
renderworld
;set the camera mode for all subsequent renderworlds to not clear the zbuffer or colour buffer
cameraclsmode camera,false,false
;then for example - you have a single 'knight' entity that was loaded, but you want 10,000 of them
;on the map....
showentity knightmesh
for i = 1 to 10000
  positionentity knightmesh,knightx,knighty,knightz
rotateentity knightmesh...etc..etc
setanimtime knightmesh,whatever frame it should be on
renderworld
next
hideentity knightmesh
;and then repeat for all the other 'things' in the game.....
;by not clearing the zbuffer or colour buffer blitz will simply render that single model, as long as it
is the only one not hidden, into its right position, depth sorted and lit etc, correctly.
You can do thousands of models this way...and by using setanimtime you can have each of them
in a different pose.
The key thing is to only have a single entity unhidden for every renderworld.
Title: Re: 3d Fantasy Land Battle Scene Thingy
Post by: Matty on January 03, 2024, 07:40:52
Here are some smaller skirmishes where it's a bit easier to see what's going on in the combat....



This uses one of the hidden modes in my game that lets me get the computer to play battles against itself with various sized forces, in this case small skirmishes.
Title: Re: 3d Fantasy Land Battle Scene Thingy
Post by: Matty on January 03, 2024, 15:14:35
I kind of have to stop further development on this for the following basic reasons:

1. I lack the skills to polish the current elements of the game without adding mess to the game in the same way as a window cleaner who has only dirty rags can't clean the windows further no matter how much effort they apply.

2. Certain features that the game would benefit from such as a strategy map mode I can't add because I lack the skill to keep the quality consistent with the battle mode if I did.

I've only got the skills to produce what I've already produced. Additional features or attempts to polish will only make a mess of what's already there. I simply lack the skills to enhance things without making a mess of it. So I have to leave it as it is currently and declare it 'finished'. Any further work by me will only make it worse not better. Like a cleaner whose cleaning cloths are all dirty, and there's no fresh water to replace them with.
Title: Re: 3d Fantasy Land Battle Scene Thingy
Post by: Matty on January 05, 2024, 11:30:50
Some minor graphical enhancements....

skybox, grass changes, fog changes...

(https://img.itch.zone/aW1hZ2UvMjQxOTE2MS8xNDU2MDgxOC5qcGc=/original/oG%2BomJ.jpg)

(https://img.itch.zone/aW1hZ2UvMjQxOTE2MS8xNDU2MDgxOS5qcGc=/original/8ZAwQB.jpg)

(https://img.itch.zone/aW1hZ2UvMjQxOTE2MS8xNDU2MDgxNy5qcGc=/original/ktI7C%2B.jpg)
Title: Re: 3d Fantasy Land Battle Scene Thingy
Post by: Matty on January 05, 2024, 19:50:41
Game Link (https://matty77.itch.io/3d-fantasy-battle-thingy)

Title: Re: 3d Fantasy Land Battle Scene Thingy
Post by: Matty on January 06, 2024, 05:02:34
Isn't it just the way coding goes:

I optimise huge sections of the program so that it runs well on my machine and the - once I've got it running at a decent speed, I start adding sufficient extra content to slow it down again.

It's like when management wants you to clear away the garbage from an area - merely so they can use it to store new garbage that's just come in.
Title: Re: 3d Fantasy Land Battle Scene Thingy
Post by: Matty on January 06, 2024, 05:06:02
And why is it that my best products/games have my worst, ugliest, poorly designed code that breaks every rule while any product I create that is coded in a 'beautiful manner' following all sorts of proper conventions are usually totally uninteresting products in the end.
Title: Re: 3d Fantasy Land Battle Scene Thingy
Post by: Matty on January 06, 2024, 10:40:26
Game Link (https://matty77.itch.io/3d-fantasy-battle-thingy)

A few more little magical effects:

The blue overlay and other such effects, including the shadows, are now done by rendering the models with coloured fog that is limited to their entity only.

(https://img.itch.zone/aW1nLzE0NTcwNzE4LmdpZg==/original/Unxs6m.gif)
Title: Re: 3d Fantasy Land Battle Scene Thingy
Post by: Matty on January 06, 2024, 12:17:45
Game Link (https://matty77.itch.io/3d-fantasy-battle-thingy)

Latest work on my video:

Things completed include:
Optimisations and performance enhancements and automatic adjustments in game.
Magic effects for some of the cards.
Trees and vegetation outside the main playing area.
Shadows that look better than they did before and with less performance hit.

Title: Re: 3d Fantasy Land Battle Scene Thingy
Post by: Matty on January 06, 2024, 18:48:23
A comment on my pace of code writing, from a couple of data files attached below.

Files:
1. Original Code on 12 Dec 2023
2. Current Code on 7 Jan 2024 (27 days later)
3. Code Growth Report File (also shown below)

Start of Report
Lines of Code Written on 12 Dec 2023:539
Lines of Code Written By Current Date 7 Jan 2024:10276
Difference in Line Count:9737
Total Days:27
Average Change/Growth Per Day:361
End of Report.

Title: Re: 3d Fantasy Land Battle Scene Thingy
Post by: Matty on January 06, 2024, 19:23:06

In a little under 30 days...video difference:
Title: Re: 3d Fantasy Land Battle Scene Thingy
Post by: Qube on January 07, 2024, 04:06:28
Some really nice looking work here ;D I must apologise as I'm guilty of watching the progress and not commenting which is a bit unfair with all the hard work you're clearly putting into this. Keep up the good work, your skills have come on leaps and bounds over the years.
Title: Re: 3d Fantasy Land Battle Scene Thingy
Post by: Matty on January 07, 2024, 05:00:50
Thanks Qube. No worries.
Title: Re: 3d Fantasy Land Battle Scene Thingy
Post by: 3DzForMe on January 07, 2024, 06:45:43
Great work Matt, love the detail - down to the snowflakes! :o ;D
Title: Re: 3d Fantasy Land Battle Scene Thingy
Post by: Matty on January 07, 2024, 09:38:59
Thanks 3DzForMe - I enjoy making it.
Title: Re: 3d Fantasy Land Battle Scene Thingy
Post by: Matty on January 07, 2024, 18:11:09
Download Game Link (https://matty77.itch.io/3d-fantasy-battle-thingy)

Sometime between 2008 and 2013 I bought a bunch of 3d models from Arteria, finally they're seeing some use by me.

Title: Re: 3d Fantasy Land Battle Scene Thingy
Post by: Matty on January 08, 2024, 10:46:25


I've also added 'personal combat challenges' with taunts and such - two enemy 'heroes' engage in single combat before a battle 1/3 of the time in the game. You are able to influence the outcome of this combat but it's really just a bit of fun before the battle.
Title: Re: 3d Fantasy Land Battle Scene Thingy [IMAGE HEAVY]
Post by: Matty on January 08, 2024, 16:38:18
Game Link (https://matty77.itch.io/3d-fantasy-battle-thingy)

Latest version's screenshots: (there's a few below)

(https://img.itch.zone/aW1hZ2UvMjQxOTE2MS8xNDU5NjYxMy5qcGc=/original/EUhjbJ.jpg)(https://img.itch.zone/aW1hZ2UvMjQxOTE2MS8xNDU5NjYxNy5qcGc=/original/mRytZI.jpg)(https://img.itch.zone/aW1hZ2UvMjQxOTE2MS8xNDU5NjYxNC5qcGc=/original/JPDZ3H.jpg)(https://img.itch.zone/aW1hZ2UvMjQxOTE2MS8xNDU5NjYxMi5qcGc=/original/2PxNNZ.jpg)(https://img.itch.zone/aW1hZ2UvMjQxOTE2MS8xNDU5NjYxNS5qcGc=/original/UVFYxP.jpg)(https://img.itch.zone/aW1hZ2UvMjQxOTE2MS8xNDU5NjYxNi5qcGc=/original/ihBrDw.jpg)(https://img.itch.zone/aW1hZ2UvMjQxOTE2MS8xNDU5NjYxOC5qcGc=/original/nkWWH0.jpg)
Title: Re: 3d Fantasy Land Battle Scene Thingy
Post by: Matty on January 08, 2024, 23:15:30
A comment about optimisation for 3d graphics in blitz3d.....

In the end, if you've done all you can elsewhere to be efficient then it simply comes down to finding a way to minimise the number of triangles drawn each frame without impacting the visual quality negatively.
Title: Re: 3d Fantasy Land Battle Scene Thingy
Post by: 3DzForMe on January 08, 2024, 23:56:14
@Matty, going back a while, I managed to do a (proto-type) Knight rider-esque game in BLitz3D with the help of the JV-ODE physics lib, which I enjoyed the challenge of back in the day, the graphics were not a 'patch' on the level of polish you are achieving. Its fair to say, you are doing exceedingly well with your project - great work!
Title: Re: 3d Fantasy Land Battle Scene Thingy
Post by: Matty on January 09, 2024, 01:49:20
Thanks for the compliment.

It helps greatly that there's a tonne of good animated 3d models for blitz3d on some of the older game asset sites that work really well, with some slight adjustments in milkshape3d.

The foliage is all from dexsoft, which I'm not sure exists in the same way any more - purchased almost two decades ago. Same with the arteria stuff. The characters are all from 3drt, and despite the fact they've stopped producing more content a long time ago - some of their stuff is very good for this kind of thing.

The 2d work is from shutterstock, as is some of the music, and the sound effects are from a variety of libraries purchased between 2004 and 2024.

from  Matt
Title: Re: 3d Fantasy Land Battle Scene Thingy
Post by: Alienhead on January 09, 2024, 05:00:55
Whoa, that's a lot of skinned mesh on screen. Gpu Instancing?  Mind if I inquire what engine this is? just for curiosity's sake.
Title: Re: 3d Fantasy Land Battle Scene Thingy
Post by: Matty on January 09, 2024, 09:38:03
Thanks Alienhead. It's vanilla, plain old blitz3d 108 with no userlibs or dlls etc.

Earlier in the thread I explain how I get it to do it efficiently in blitz.

But simply it's done like this:

ent = loadmesh(animated mesh) ; don't need to make any copies of it....
type creature
field ent
field x,y,z,etc
end type

;split your main loop into two sections - update and render....
;in your render do this:
cameraclsmode camera,true,true
showentity 'all your backdrop stuff'
renderworld
hidentity 'everything in the game'
cameraclsmode camera,false,false
for c.creature = each creature
    showentity c\ent
  position it at the c\x,c\y,c\z etc etc
    renderworld
  hideentity c\ent
next

In other words - you only render 1 model per renderworld command but you do it for every model in the game with the clsmode set to false,false (don't clear zbuffer or colourbuffers) and make sure there's only ever one model unhidden during any renderworld command.

Additional / edit - source code is available in the itch.io download. If you're worried about downloading an exe, you can always ignore/delete the exe and just run/look at the code.

Additional part 2 - in an earlier post in this thread I include source code as a text file attachment, have a look if you want.
Title: Re: 3d Fantasy Land Battle Scene Thingy
Post by: Alienhead on January 09, 2024, 10:46:14
That is very interesting, so basically you invented a ghetto-style delayed renderer in blitz3d. :0

Nice.
Title: Re: 3d Fantasy Land Battle Scene Thingy
Post by: Matty on January 09, 2024, 13:20:24
There's a few other little tricks including:

Setting the animation frame directly using setanimtime each time you position and render a unit.
Doing a quick bounds check to decide whether to call renderworld at all using the tformed commands, knowing that abs(tformedx())<tformedz()/"zoom of the camera" for entities within the frustrum.
Sorting the entities to be rendered in the list in order of 'entity number' so that they're all grouped together rather than the graphics card switching from entity to entity all over the place semi-randomly.

Alternatively, and this is semi joking - "I'm living in a dream world where I've found a solution to a problem I'm having with my game development but unfortunately like so many dream solutions they're complete wishful thinking and when I wake up none of the techniques I've discovered for myself will have any real use or ability to do what they seem to do in the dream world."

But mostly, it's the cameraclsmode.

There are nice features of doing that - you can have per entity fog for example which can be used for nice effects.
Title: Re: 3d Fantasy Land Battle Scene Thingy
Post by: Alienhead on January 09, 2024, 14:09:22
We share a common interest. I have long since desired having 1000's of animated mobs on screen at once. I came up with several techniques, one being exporting stop-animation, exporting a models animation per frame and removing the rig then just show/hide the current frame animation ( this technique actually allowed me a few hundred animated mesh on screen but it was to much a resource hog).

I have since moved on to a technique that seems to be catching on, gpu-instancing, actually bake the animation sequences to a texture then have the mesh renderer shader position the rig accordingly. The animation and rig never touch the cpu, it's all the compute shader doing the work, so it's extremely fast.

This tech is used in unity and people are getting 3k - 10k animated mesh on screen. The only problem is it doesnt seem to be 100% compatible with raedon gpu's so I haven't really sold out to it yet.

All in all, I have to hand it to you. I used blitz3d from beta to the bitter end and never came up with a animation technique that worked.

My hats off to you. :)

PS: Here's the technique if your interested in reading more.  ( 15k animated mesh )
https://assetstore.unity.com/packages/tools/animation/mesh-animator-animate-massive-crowds-26009

He's got a paper wrote up somewhere,  demonstrating the process, I just can't see to find it right now.


Title: Re: 3d Fantasy Land Battle Scene Thingy
Post by: iWasAdam on January 09, 2024, 14:18:38
actually bake the animation sequences to a texture then have the mesh renderer shader position the rig accordingly. The animation and rig never touch the cpu

That is a very interesting way of approaching things. It gives an opening to all sorts of concepts...
Title: Re: 3d Fantasy Land Battle Scene Thingy
Post by: Matty on January 09, 2024, 15:39:44
Thanks for all the positive feedback and interest.

I've added a few more features to the latest download on the itch site: ( Game Link Inc Source Code (https://matty77.itch.io/3d-fantasy-battle-thingy))

Including 'formations' that are (edit: randomly chosen) set before a battle. You can see how it looks with the overhead view here:

(https://mattiesgames.com/assets/e0003.jpg)
Title: Re: 3d Fantasy Land Battle Scene Thingy
Post by: Matty on January 10, 2024, 10:13:02
Game Link (https://matty77.itch.io/3d-fantasy-battle-thingy)

If anyone has tried the game I thought I'd share some undocumented keyboard commands that you might not be aware of:

"0" (along top) - show debug info such as frame rate and related data, this is for my use mainly when optimising.

"d" - let the computer play the game by itself in demo mode and show the cards it plays while alternating between camera views. (the computer also learns over time to become better at picking good cards)

"p" - let the computer play the game by itself in demo mode but remain in cinematic view mode and don't show the cards or other 2d overlays.

"r" - if at the main front combat demo mode when a game is not in progress generate a new layout of troops and terrain for a new battle (in other words, don't wait for the fight to end)

"F10" - pause

Arrow up/down - zoom in / out

Arrow left / right while in overhead view - rotate battlefield.
and those are the main ones...

"Tab" - immediate switch camera view

"[" "]" force vegetation increase/decrease level of foliage present 

Title: Re: 3d Fantasy Land Battle Scene Thingy
Post by: Matty on January 10, 2024, 14:56:26
Game Link (https://matty77.itch.io/3d-fantasy-battle-thingy)

Hello there again. Even though my computer is very old and I can't run the game at full quality settings at a decent frame rate (I need to set it at about '60%' quality for my PC) I wanted to see how it looked at max settings. So I deceived my program into thinking it was running at 60fps when it was actually running at 5ps, set a bunch of variables falsely to make the game think it was running normally, and then recorded it with fraps at 5fps, before uploading to YouTube after editing it back to 60fps approximately.

This is how the game mostly looks on a more recent PC than mine (mine is from 2013/2014).  It runs fine at lower quality settings, but at these settings it needs a better PC. The main issue is the vegetation, I simply have far too much from my old PC on these settings. At a reduced quantity of vegetation on my PC it runs fine.

Video below:

Title: Re: 3d Fantasy Land Battle Scene Thingy
Post by: Matty on January 11, 2024, 08:21:14
Bug Fix: Memory Leak - I was not freeing the sky box texture before loading over a new one again...oops...fixed. (latest version "_1w.zip") on itch site.
Title: Re: 3d Fantasy Land Battle Scene Thingy
Post by: Matty on January 11, 2024, 12:51:08
Game Link (https://matty77.itch.io/3d-fantasy-battle-thingy)

Trailer:

Title: Re: 3d Fantasy Land Battle Scene Thingy
Post by: Matty on January 12, 2024, 07:26:26
Game Link (and source code) (https://matty77.itch.io/3d-fantasy-battle-thingy)

I now have a day night cycle and also no longer use a pre-rendered skybox but rather generate billboard
rows of trees to place in the background to look like a forest in the distance, near the horizon.

The rows of trees are generated at runtime from the standard tree meshes I use, once every so often,
a quick render of a texture is completed (copyrect/masking pixels) and then it is applied to a sprite
that is placed multiple times along the horizon.

You can see footage of it in action in the second video below.

Day night cycle



Background foliage

Title: Re: 3d Fantasy Land Battle Scene Thingy
Post by: Matty on January 12, 2024, 10:19:07
Game Link (https://matty77.itch.io/3d-fantasy-battle-thingy)

YouTube (no audio) of some random battles....so far....

Title: Re: 3d Fantasy Land Battle Scene Thingy
Post by: Alienhead on January 12, 2024, 15:10:33
Excellent project.
Title: Re: 3d Fantasy Land Battle Scene Thingy
Post by: Matty on January 12, 2024, 17:09:59
Thanks Alienhead for the positive comment.

I've updated the game files on the itch site (Game Link (https://matty77.itch.io/3d-fantasy-battle-thingy)) including the current source code. You can download the source without downloading the rest of the game if that is your interest.

It now includes a number of enhancements, and improvements as well as the features you've seen on the videos so far.

I've also put together an 11 minute video of just a rendered output demo of the game in action, minus the card system.

This video was rendered at 5fps and then sped up. But that's simply because I can't run it at this quality setting on my 10
year old PC. I can run it at about 60% quality settings on my PC in real time/game play speed.

Video below:



Title: Re: 3d Fantasy Land Battle Scene Thingy
Post by: Matty on January 13, 2024, 16:34:13
Game Link (https://matty77.itch.io/3d-fantasy-battle-thingy)

The download and source code has been updated.

Current image:
(https://img.itch.zone/aW1hZ2UvMjQxOTE2MS8xNDY0OTY5OS5qcGc=/original/LdQqEL.jpg)
Title: Re: 3d Fantasy Land Battle Scene Thingy
Post by: Matty on January 14, 2024, 18:53:40
Another update, source code and media and executable are available on the itch.io site.

I've tidied the source code a little, ran it through a code formatter I wrote to order the code a bit more logically.

Below videos are three videos of gameplay although I'm cheating a little and letting the computer control the card game while I sleep and it renders. After a little while, came back, found some battles I liked the look of and uploaded to YouTube.

Game Link: Game Link (https://matty77.itch.io/3d-fantasy-battle-thingy)





Title: Re: 3d Fantasy Land Battle Scene Thingy
Post by: Matty on January 14, 2024, 21:59:01
And now for something a little different.

I'm on a disability pension because I'm too sick to work most jobs especially during the day time hours. As an interesting point though - from this graph of 'files created' versus 'creation time (hour of day)' you can see that I'm basically unproductive during the daylight hours, and most productive at night: (Edit this is from December 12th onwards)

(https://mattiesgames.com/assets/interesting_graph.jpg)
Title: Re: 3d Fantasy Land Battle Scene Thingy
Post by: Matty on January 15, 2024, 06:30:02
There are two command line parameters that can be issued to the game before running which are -speed and -quality. These indicate to the game whether you prefer the game to prioritise speed or quality when self optimising at runtime.

I've included two simple batch files in the download that simply call "game.exe -speed" or "game.exe -quality" when launching the game for the user to choose one of either.

Title: Re: 3d Fantasy Land Battle Scene Thingy
Post by: Matty on January 15, 2024, 12:01:01
Real Time Video Capture on my ancient PC:

This is at about 60% quality settings. The game looks much better on a modern PC with all the settings turned up to full.

Game Download Link (https://matty77.itch.io/3d-fantasy-battle-thingy)

Title: Re: 3d Fantasy Land Battle Scene Thingy
Post by: Matty on January 15, 2024, 13:00:34
Title: Re: 3d Fantasy Land Battle Scene Thingy
Post by: Matty on January 16, 2024, 00:01:58
Game Link (https://matty77.itch.io/3d-fantasy-battle-thingy)

Real time render on high quality settings on my PC - computer is playing the cards....

Analogy/ Metaphor:

Optimising 3d games is like exercise. For every 100 calories you burn above and beyond your normal/every millisecond you trim from the render loop - that's another chocolate bar/graphical effect you can add into the end result....putting you back where you started....

Title: Re: 3d Fantasy Land Battle Scene Thingy
Post by: Matty on January 16, 2024, 07:15:29
Additional foliage added. This is with the quality forced to 100% or maximum without caring about the framerate.....

Link (https://matty77.itch.io/3d-fantasy-battle-thingy)
(https://img.itch.zone/aW1hZ2UvMjQxOTE2MS8xNDY4MTY5Mi5qcGc=/original/OlUqgI.jpg)

(https://img.itch.zone/aW1hZ2UvMjQxOTE2MS8xNDY4MTY4Ny5qcGc=/original/TqkXwQ.jpg)
(https://img.itch.zone/aW1hZ2UvMjQxOTE2MS8xNDY4MTY4OS5qcGc=/original/JCs6Yn.jpg)
Title: Re: 3d Fantasy Land Battle Scene Thingy
Post by: Matty on January 16, 2024, 09:31:44
Title: Re: 3d Fantasy Land Battle Scene Thingy
Post by: Matty on January 16, 2024, 14:57:38
Game Link (https://matty77.itch.io/3d-fantasy-battle-thingy)

Played around with the camera setup a little bit, and also the foliage levels.

Some minor changes to the code around those bits and pieces.

Here's a video (again!)

It would really benefit from having LOD levels for the creatures/soldiers. When you watch the zoomed out camera view it can be a little laggy sometimes.  But it runs well enough.

Title: Re: 3d Fantasy Land Battle Scene Thingy
Post by: Derron on January 16, 2024, 16:22:14
For me the archers act too ... odd.
Not more than 10 meters to the enemy and they still shoot their arrows 45° into the air ... wonder where they would land.

And yes, it is OK for me if they do not go into close combat and continue shooting arrows - they just should shoot them ... in direction of the enemies, not the horizon.


Armory of the knights is a bit "dull" ... or let me rephrase it - it does not look like metal but reminds me on the "chrome look" of cheap plastics (so not overly shiny but a bit "rough").

I guess if you are able to improve the visual look of the armory, improve animations (it is a bit "stop motion"-esque - no tweened animation steps ?), take care of "where go arrows to", "where does a sword land") then it would begin to look more convincing.
And of course it helps you to improve your stuff :)


bye
Ron 
Title: Re: 3d Fantasy Land Battle Scene Thingy
Post by: Matty on January 16, 2024, 21:31:36
Thanks Derron I've released both a patch exe and a new source code download New complete download on the itch site that addresses the shininess of the armour and the behaviour of the archers.

I've also fixed the z-sorting issue with the small bushes and such that were scattered around the map. They use a masked texture now instead, although larger things like trees still use alpha.

Arrows now are aimed higher or lower depending on how far away the enemy is - close enemies get a flat arc, further enemies get a higher arc.

The armour of the knights, and certain undead units has been made less shiny, which should address some of what you were saying.

Game balance has also been altered, I have reduced the overall effectivness of archery in game since it was far too powerful before.

Game Link  (https://matty77.itch.io/3d-fantasy-battle-thingy)
Title: Re: 3d Fantasy Land Battle Scene Thingy
Post by: Matty on January 17, 2024, 16:43:30
Game Link (https://matty77.itch.io/3d-fantasy-battle-thingy)

I've uploaded a zip file to the itch.io site that includes an updated executable, updated source code, and documentation and examples of options/switches that can be passed to the game on launch.

It is possible to set various parameters for the game before launching it - and in the zip file I've included some sample batch files that call the game with those parameters.

The parameters include, but this is not a full list, but for the most part these are the useful ones:

---------------------------------------------
-- GAME SWITCHES / OPTIONS -
---------------------------------------------

The following switches can be passed to the executable to alter how the game runs:

-zero
Run the game at zero quality setting for maximum performance. Also uses no lighting.

-force100
Run the game at 100% quality settings and force it to stay there.

-veg1 to -veg10
Set the game's vegetation level and force it to stay there

-speed
Auto Self Optimise the game for speed while running at the cost of quality.

-quality
Auto Self Optimise the game for quality while running at the cost of speed.

-screensaver
Run the game in screensaver mode, if a key is pressed or the mouse buttons are pressed then it will exit. Game sits in battle loop.

-debuginfo
Show runtime debugging information on screen. This can also be brought up by pressing the '0' key during a normal game.

-loop:n
Render the screen every 'nth' frame. A performance setting. A value of 1 means render the screen every frame, a value of 2 would mean render the screen every second frame, and so on.

FPS3 or FPS5
Only used if -force100 is also used, will lock the framerate at either 3 or 5 FPS which is useful if you want to perform
an offline render at a consistent framerate.

You can combine these options together as well.

Below is a screenshot showing the difference, on my PC at least, between maximum quality settings and minimum quality settings visually.



(https://mattiesgames.com/assets/settings.jpg)
Title: Re: 3d Fantasy Land Battle Scene Thingy
Post by: Matty on January 17, 2024, 21:38:06
This is a bit of a problem....

If I want to create real time video of my game running normally - then on my old PC I can't run it at maximum quality. But what game developer posts video trailers of their game running on "low-medium quality settings'. They don't. They do so at the highest quality their game supports. Because almost always, game developers have access to machines that are capable of running their games at the highest quality settings.  My computer is over 10 years old. It simply can't run at the maximum quality settings easily. I can run it lower than that, and record video, but who advertises their product by showing it off running at less than its best?
Title: Re: 3d Fantasy Land Battle Scene Thingy
Post by: Derron on January 17, 2024, 23:24:21
If your gpu is only capable of rendering 2 frames per second, do not update physics faster - also only update 2 times this second. So instead of having 60 updates a second + dynamic FPS you do as they did when not knowing how to program: have a single loop which updates, renders ...
And then instead of relying on actual "millisecs()" you will have your own "system time" (or here: "engine time") which you advance as you like.

Normally you have things like a "world time" (or game time) which you can manipulate to modify how fast an "ingame day" progresses. Next to this you could have a "engine time" which you normally would equal to "millisecs()" (or whatever floats your boat regarding real application/system time).

This way you could have eg your goal of 25 images per second:
- engine time :+ 1.0/25
- update physics
- render image (and store image as png)
- engine time :+ 1.0/25
- update physics
- ...

Any "animation" or movement or ... must be based on "engine time", not "real application/system time". Means if you advance faster, game "plays faster", if you advance slower, game goes into "slow mo mode".

At the end of your "demo" (assume it can replay exactly the same) it is up to you to simply render out all pngs as a movie clip.
Re run the "demo" without high gfx and record the audio.
Mix audio and created movie clip - and it should all fit together.

Of course this only works if you do not use "random numbers" but only pseudo random numbers with a fixed starting seed for both "records".


Edit:
PS: I tried to run the game via wine - it started up and then when it wrote "Planting a Tree or Two" it short after segfaults / EAVs. Maybe some resource it was not able to load (eg case sensitivity of folder/file names)

drawlprog("Planting a Tree or Two...")
Formations()
TextureFilter("leaves_DF.tga",1+2)
TextureFilter("leaves_d.tga",1+2)
TextureFilter("fresh_DF.tga",1+2)
TextureFilter("buske_DF.tga",1+2)
TextureFilter("gran_DF.tga",1+2)
TextureFilter("tree1_branch.png",1+2)
TextureFilter("nassla_DF.tga",1+2)
should these files be in the download archive?

bye
Ron

Title: Re: 3d Fantasy Land Battle Scene Thingy
Post by: Matty on January 18, 2024, 17:10:14
Now with added zombies, mounted knights and winged fiends!
Game Link (https://matty77.itch.io/3d-fantasy-battle-thingy)

Derron, the TextureFilter command simply looks for files containing that as part of the name, so no, those filenames are not exactly in the game, but longer versions of their name are..
I cannot guarantee a Windows game like this will run properly under emulation on Linux.  I do know that Windows is not case sensitive but Linux is, so that could be a problem if the emulation expects Windows programs to be case sensitive with their file loading.


Title: Re: 3d Fantasy Land Battle Scene Thingy
Post by: Alienhead on January 18, 2024, 20:24:56
Your doing stuff in blitz3d that the big engines are struggling with hehe.

I got $5 on the bowmen.

Title: Re: 3d Fantasy Land Battle Scene Thingy
Post by: Matty on January 19, 2024, 10:22:15
Yeah...a lot of my code at the moment is an attempt to try and get the quality of the real time visuals as close to the 'non real time rendered' mode as I can. 

It's all about deciding what to cull from the rendering side of things and yet still retain the illusion of good quality.

When it's a non real time render you don't have to care about optimisation all that much. But when it's running in real time - I'm aiming for a minimum of 15-20fps visual frames per second with as close to the maximum quality settings as I can. 

The game has a heap of auto optimisation settings that switch graphical features on and off depending on the average render time for the past 'n' seconds of runtime. That's why in some of the real time videos I've posted you can sometimes see trees and things vanish and reappear at times. The game is simply deciding 'frame rate too slow - remove this stuff' and the a few moments later the frame rate goes back up and it decides to put certain visual elements back in.

Some of the commandline switches you can pass to the game at launch force certain graphical features to remain at a particular level, regardless of frame rate.
Title: Re: 3d Fantasy Land Battle Scene Thingy
Post by: Matty on January 19, 2024, 15:46:32
Game Link (https://matty77.itch.io/3d-fantasy-battle-thingy)

I've uploaded an updated version of the game to the itch.io website.

It includes a variety of bug fixes and optimisations and enhancements.

It also includes a logfile option if the game crashes, you can run it with a "-logfile" parameter and get a log.txt file written in the game folder (if your account allows this).  



There's a lot more switches you can specify at launch.

Video below was captured in real time while running the game with these parameters:

game.exe -clocktime -speed -hourbyhour -extragrass -smoothcam -nounitshadows -nolore

The framerate was as you see here while the video was capturing.

Title: Re: 3d Fantasy Land Battle Scene Thingy
Post by: Matty on January 19, 2024, 20:40:51
And this is with the overhead camera being used:

Title: Re: 3d Fantasy Land Battle Scene Thingy
Post by: Matty on January 19, 2024, 21:54:28
Game Link (https://matty77.itch.io/3d-fantasy-battle-thingy)

And this is the non real time rendered version on my PC using the overhead view:

Title: Re: 3d Fantasy Land Battle Scene Thingy
Post by: Derron on January 19, 2024, 23:30:09
Is the non-realtime one using "high quality" and you make a movie out of it at the end or what does it mean?

Asking as the video is a bit "blurry" and looks like it is overly high "jpg compressed".


This aside:
- movement of trees/grass is too exaggerated (slow wind mill but heavy plant movement)
- animation of the sorcerer is too ... flickery. For me Magic "pulses" and "grows" - this one looks like small energy bolts which randomly jump from "not there" into "everywhere" (yes a flash is "fast" but I think people assume "seeing things grow". The "flickery" thing might indicate too few animation frames - looks a bit like a warcraft 2 effect, some "pixel effect", not 3D-Effect.
- units overlap a lot - which destroys immersion. Maybe you can find a way to use some simple bounding boxes and units trying ot avoid colliding with others
- add variations to units - dunno if you can use multiple textures on a unit - prepare different "shoulder textures", "arm textures", head, ... and then mix things. This will make units look "similar" but not "the same" - judging on the "warrior"-textures I guess you can do that. It just needs to be done for other creatures too (simple effects like hue variations for fur/claws/ ... could do already)
- more smooth animations. Dunno how you switch between animations - maybe there is a way to "tween" between things (like "morphing"). This would make things look less "stop motion"
- Maybe think about having "banners" on the field or other units just there for the "moral"

Not to talk about catapults/trebuchets, fire balls, ... :-)


PS: you should consider trying out godot (the game toolkit) with the assets you already collected - I guess it could be a nice little experiment.

PPS: Hope you still enjoy tinkering with it - say if my critics push you too hard.

bye
Ron
Title: Re: 3d Fantasy Land Battle Scene Thingy
Post by: Matty on January 20, 2024, 00:20:16
About the video blurry - yeah some of them are created from a series of jpgs rendered out at runtime and then put together with ffmpeg.

However - I don't seem to have any tools to create videos that are of a high quality and also give a file size of the resulting movie that is small enough for me to upload to YouTube in a rather timely fashion. My internet is slow, and so files large enough to get rid of the blurriness will take many hours for me to upload, maybe longer.
Quote- movement of trees/grass is too exaggerated (slow wind mill but heavy plant movement)

Yeah - I can see that myself too but while I agree with you, I kind of like it, personal preference I suppose.



Quote- animation of the sorcerer is too ... flickery. For me Magic "pulses" and "grows" - this one looks like small energy bolts which randomly jump from "not there" into "everywhere" (yes a flash is "fast" but I think people assume "seeing things grow". The "flickery" thing might indicate too few animation frames - looks a bit like a warcraft 2 effect, some "pixel effect", not 3D-Effect.
The sorcerer has been a pain in the butt to try and get to work right. He was kind of an afterthought. I will probably look into fixing him some more though.

Quote- units overlap a lot - which destroys immersion. Maybe you can find a way to use some simple bounding boxes and units trying ot avoid colliding with others
Potentially I can simply disallow units from getting as close to each other as they do. It wouldn't be too hard, it's just a case of getting the numbers right for the radial distances for both combat and 'pushing units away from each other'  - a bit of trial and error will fix that.

Quote- add variations to units - dunno if you can use multiple textures on a unit - prepare different "shoulder textures", "arm textures", head, ... and then mix things. This will make units look "similar" but not "the same" - judging on the "warrior"-textures I guess you can do that. It just needs to be done for other creatures too (simple effects like hue variations for fur/claws/ ... could do already)
True....I ...could do that perhaps...I'll think about it. I agree it would improve the look.

Quote- more smooth animations. Dunno how you switch between animations - maybe there is a way to "tween" between things (like "morphing"). This would make things look less "stop motion"
Unfortunately not going to be possible with the way I do it.  Due to the method I use to render the game, and the way I animate the models it simply is an impossibility. Or very hard at least.
Although there might be say a bunch of knights on foot shown on screen - there's only one entity/mesh for all those knights. So I don't use the standard animate command to animate the entity, I
simply position it where it needs to be, call 'setanimtime' for the relevant frame or partial frame of animation, render it in position and then move on to the next item in the list, using the same entity handle
as before and just updating the position and animation frame for each 'unit' or 'tree' or whatever. The 'entity' doesn't retain any sense of where it's up to in terms of animation - other than a variable
called 'frame' and 'mode' on the unit list.


Quote- Maybe think about having "banners" on the field or other units just there for the "moral"
Funny enough there are actually 'moral' units on the battlefield, they're just probably not all that obvious to the user. There are leader units on the field
who look slightly different than their regular counterparts, either with a magic sword or a different armour - and these boost moral of units nearby, preventing
them from fleeing as easily. I guess it would make sense perhaps to maybe, like the old Samurai, stick a banner on their back that waves about in the wind as they
walk around the field?

QuoteNot to talk about catapults/trebuchets, fire balls, ... :-)
Ain't gonna happen anytime soon. I can only use the 3d models I have access to. If there's no way for me to purchase such models
that a) fit with the current look and b) are cost effective and c) work with blitz then it's not going to happen.


QuotePS: you should consider trying out godot (the game toolkit) with the assets you already collected - I guess it could be a nice little experiment.
Perhaps...perhaps...not likely I'll do that but I can see it would be a good thing. To be honest I'd almost consider though seeing how easy it would be
to port it to BlitzMax and use the minib3d or similar 3d library just to see if it works.  I'm pretty sure though that if someone else wanted to, given I've supplied
my code and assets, they could very easily do that too with it - and maybe even make the code neater and tidier than how I've done it.

Thanks for all the comments and interest though, much appreciated.
Title: Re: 3d Fantasy Land Battle Scene Thingy
Post by: Matty on January 20, 2024, 09:38:09
Added some stuff I've had locked away in the game for a while until I knew what to do with it....

(https://mattiesgames.com/assets/game.jpg)
Title: Re: 3d Fantasy Land Battle Scene Thingy
Post by: Derron on January 20, 2024, 10:33:20
Yeah banners / flags  - that is what I am talking about. Other army styles had "drums" (in fantasy games surely "war drums").


Regarding 3d models: maybe check for some kitbash stuff so you can "build" things with it without having to buy more and more models. Often the immersion of some "real building" is made out of the "decoration" around a building. So a miller needs some waggon with bags full of wheat, or blocks of pressed what in front of a door.
A Butcher needs a wood block and an axe to tell: here things end for sure!
... all the rest is just to make them look "used" (like having fences/walls around some ground etc).


Regarding units: Can you individually scale units (while they share the same "mesh" ?). Asking as some soldiers are 1,90m while others might just be 1,72m ... Every little bit of "variation" will help to make it look less "cloned units" like.


I wonder why you can't "modify" the animation of a single entity. If you can change the "animation frame" then it is more a matter of adding / predefining more animation "steps" in the models? Or something like creating custom animations which do the transition from "anim1" to "anim2" ?
Dunno how hard it is to add animations to the b3d files (or add them then via code). But copying existing animations and modifying some bones here and there (so that the walking looks a slight bit different, or the arms move a bit less swifty or ...) will help. And then you simply do not use the same "anim1" on all units but some use "anim1_variation1".

In Blender I would suggest to use some kind of randomness/jitter when it comes to moving/rotating bones. Dunno if blitz3d allows such stuff too.


What else could add to some more natural movement? People do not walk from A to B ... they sometimes check their surroundings, or slow down reconsidering decisions. Some units prefer holding their shield up (are more defensive) than others. ...
A lot of (minor) things. Not overly important to include it "now".


Would like to see how the "collision avoidance" looks. You want to avoid that "I cannot go through here, so let me walk around the whole group" thing - so normally a unit would cry to others that It has to go "through" and then people would possibly move a bit to the left, others to the right ... etc.
So it might not already be good enough to add collision avoidance - but also a kind of "movement wishes" system (make place for others). This surely makes it way more complex  - but will look way better than a unit stupidly running around a group of units instead of going "through" :D


Regarding godot (and others) - I guess they offer a LOD system and other "goodies" so would be interesting if they are able to cut the mustard for you regarding performance on the gtx660 gt (which I had a long time too - and consider it still quite capable for such .. "older 3d visuals").

Regarding Blitzmax: Yeah, you can always try with MiniB3d (I am not a user of it) - codewise it will improve as your code for now is a mass of code lines which I prefer to see "structured" (classes, methods,... :)). With this code restructuration/converting I surely could help - or others too. You could always (re-)join the discord channel for some more "live-esque" help.


bye
Ron
Title: Re: 3d Fantasy Land Battle Scene Thingy
Post by: Matty on January 20, 2024, 11:05:51
Scaling would be quite possible.

It would not be hard to slightly randomise the scaling of the warriors etc. I already do that with the trees and stuff using a similar method. It would be very easy to do. That...could be done.

Randomising the animations slightly...yeah that could also be done...but...it would be a bit of trial and error. There's way too many frames of animation for me to go through and deliberately modify things from model to model. But adding a simple '+-2-5 degrees' of motion to each limb *might* look okay? I don't know...it could look really weird too. I could try it I guess...I'd have to create a list of limbs at load time, store the reference to the bones, and then before 'renderworld' for each unit just add a +- variation to a few limbs each time. Maybe it would look okay, not sure.

EDIT: Just tried the random scale thing - altering the humanoid sizes between 1.7 and 1.9m in height....wasn't really all that noticeable when the game is in motion, at least not to my eyes.  I tried making the difference larger, more extreme - but then it just looks funny...as they're a bit too different.
Title: Re: 3d Fantasy Land Battle Scene Thingy
Post by: Matty on January 20, 2024, 13:30:38
The soldiers now become bloodied as the battle progresses as does the landscape. The landscape doesn't get too dirty though.

Whenever a death is registered in the game the soldiers have a field marked 'bloodied' set to 1. Then when they're rendered I apply a multiply blended blood texture with semi random uv scrolling to make it look different on everyone to the relevant soldier. Ground is similar.


(https://mattiesgames.com/assets/bloodtexture.jpg)
Title: Re: 3d Fantasy Land Battle Scene Thingy
Post by: Matty on January 20, 2024, 18:23:09
Latest video.  Available here (https://matty77.itch.io/3d-fantasy-battle-thingy) still.  Captured in real time on my pc with audio.

Launch command: game.exe -rptfps -speed -veg5 -extragrass -clocktime -nolore -windowed

Title: Re: 3d Fantasy Land Battle Scene Thingy
Post by: Derron on January 21, 2024, 10:33:57
Things I noticed:
- arrow man are on a frenzy - shooting an arrow at least once a second. People might be able to "do things fast" but somewhen they become exhausted and need to rest. So either slow it down "at all" or allow them to have "fast moments" but then need to rest/slow down "even more" for a period of time
- units have "walk animations" while not moving along (eg. colliding with another unit and so stopping to actually move)
- some units "jitter" (see 6:40 in the video and 6:49 for a single unit)
- some units "slide" (around 7:10) 

Small ideas:
Rare elements like "left handers" - could this be done with just mirroring the units? Assume it depends on the textures (if they contain faux-lighting). For animations it might then need to be "offset" by half the animation when it comes to synchronizing "uniform walking" (left, right, left, ...foot)

Generally the "speed" of attacks should be randomized a bit - in the sense of some arrow man needing generally longer to "target", some are faster. And then of course timing "between" attacks could be varying - in the sense of having a kind of "constant damage per minute" but within the minute the attacks are distributed with slight randomness

If you use multitextures for units (eg metallic armory parts - and "chest/tabbard/clothing" in a second) then you could possibly avoid having multiple textures for color variations but have different "light affections" for individual units (so to say "slightly darker/brighter lights") - dunno if that is possible with blitz3d.

All ideas above are to add slight variations to make things less "clone wars" like.


Is ground fog an option? Dunno how much performance these things cost. Same to say for burning arrows (lighting effects). Also of interest is - could you identify what lowers FPS so much for you? Maybe combining distant foliage to "clumps" could help to decrease amount of objects. Assume today many foliage elements would be added via shaders (which is not feasible with b3d).

Ground texture is surely also something to "improve" (have a good ground texture might avoid having to add too much ground foliage elements). Objects in the distance might be replaceable with some kind of "sky dome"-wallpaper (containing forests, some hills,  ... in the far distance).

So would be interesting to see if FPS is just limited by render stuff or if simulation already becomes a bottleneck (so cpu).


bye
Ron
Title: Re: 3d Fantasy Land Battle Scene Thingy
Post by: Matty on January 21, 2024, 16:01:58
Thanks Derron for the comments again.
Game Link On Itch Website (https://matty77.itch.io/3d-fantasy-battle-thingy)

A lot of what you describe could be done. I do liken some of it to the old expression 'how long is a piece of string'. If you're going for realism you'll never reach the target even though you might get close.

But yeah - a lot of what you describe is quite easily possible. Edit - a lot of that I've just done and uploaded. Left handers now in the armies. Lighting variation per foliage element and per unit (very easy).  Archers (except undead) need to rest every few arrow shots for a brief moment, varies slightly from archer to archer.

The actual simulation takes about 1 millisecond. Rendering units takes about 10-30 ms depending on how many are on screen. Rendering foliage takes about 10-30ms depending on how many on screen. I already do some of what you say with the foliage, but yeah - there's some good points there.

Thanks.

Another video below. This one rendered not in real time because I simply enjoy making the high quality renders. I added a form of hair to some of the units to vary them slightly.

Video captured before the changes were made, so the changes described above aren't in it.

Title: Re: 3d Fantasy Land Battle Scene Thingy
Post by: Matty on January 21, 2024, 20:04:30
To let you know the ease with which these features you asked for were added, here's the difference in code required to do it in my game:

Create Lefthanders:
pseudocode:
if model_id mod 10 < 4 then scale model on x by -1, and reverse the lighting direction

Resting Archers:
every arrow fired add 1 to a counter, if counter > n then set archer target to null, set archer targeting delay to n seconds, reset counter

Lighting variation:
during render loop for foliage and units - before render command, multiply lighting brightness by pseudorandom multiplier (same value from frame to frame, but different for each 'thing' in the game) from 0.8 to 1.2, then render. As each 'thing' in the game is rendered individually it's very easy to do.

Title: Re: 3d Fantasy Land Battle Scene Thingy
Post by: Derron on January 22, 2024, 00:17:29
Without testing it ... only add what you also consider "add-worthy" (or what makes looks "better" than before / saves performance / ...).

regarding lefthanders: think it is 10% of the world (so not 40% :D).


What I also saw when watching the last video a bit again ... the "unit colors" of the warriors is a bit ... too intense? If you do not use it for "team colors" then maybe desaturate them a bit. "Colours" were expensive in the medieval ages. This is why many things looked brownish/greyish. Some colours were forbidden for "non royals" ... 
UK-folks have a lot "red yellow" (at least on their flags) so that still suits - but maybe "less vibrant" ?
Might have been impacted on some "reflectiveness" (light + "metal") while the tabbards and other clothing are not reflective so much and will only look vibrant on sunny days :)


Regarding archers and arrows: are the arrows "meshes" or drawn differently? in the video they look like "black lines + feathers" :)
But this is not what I want to write about.
Is it expensive in b3d to check if an archer has a "free sight" on their target? For now a lot of arrows "fly through" whatever-units. An archer would not shoot without "free sight" to the target (except when shooting in an "arc" towards the sky).
Means archers should target before shooting.

As arrows are less easy to evade (you cannot counter it with your own sword or shield that easily) it explains why a bowman does not shoot as often as a swordsman swirls his sword around. Sword blows can be countered (if you are a swordsman too - archers are not able to do that so easily, just body evasion etc).
So archers shoot less often (and have to target etc) and even their "damage" can be lower than with a sword blow - but arrows are more often "hitting" (not evaded).

Magic needs to be casted, casts could take longer or be aborted on incoming damage (depends on "will" of the magician to ignore incoming damage/pain etc).

Beasts can survive more incoming damage but are eg less "smart" and easier to "engage" into useless combats (they do not flee when fighting 3 persons without any chance) or similar.

At the end this is surely something balancing guides for RTS games already told ... but they did things their way for a reason ;)


bye
Ron
Title: Re: 3d Fantasy Land Battle Scene Thingy
Post by: Matty on January 22, 2024, 00:44:17
Thanks Derron....

Regarding your question "is it computationally expensive for the archers to gauge sight to their target before shooting?"

Another one of those 'how long is a piece of string question'. If I was really pedantic I'd take into effect things like the weather, shadows, the density of the terrain and such. But to be honest - you get as good a result in the end simply by putting a delay in the archers' time to choose a target. Same effect in the end and basically no computation needed.

My philosophy is to try and represent an effect through more abstract means sometimes. It's like the difference between two types of tabletop wargames. The old Warhammer tried to simulate every archer shot, every sword strike. The old DBA/DBM games simply applied a single dice throw and a couple of modifiers to entire regiments of troops when determining a combat outcome. All depends on what you're going for.

Also - yep I know left handers are less common than that, but if you want the army to look varied you have to exaggerate the proportions somewhat to give that effect.
Title: Re: 3d Fantasy Land Battle Scene Thingy
Post by: Matty on January 22, 2024, 02:44:39
Latest images - these are snapshots taken at my game's highest quality setting.

(I modify the program to run the game without rendering anything, then at random intervals draw the scene, take a picture, and continue)

Game Link (https://matty77.itch.io/3d-fantasy-battle-thingy)

(https://img.itch.zone/aW1hZ2UvMjQxOTE2MS8xNDc0NzQzMS5qcGc=/original/1VrIad.jpg)

(https://img.itch.zone/aW1hZ2UvMjQxOTE2MS8xNDc0NzQzMy5qcGc=/original/sNEhrP.jpg)

(https://img.itch.zone/aW1hZ2UvMjQxOTE2MS8xNDc0NzQzNC5qcGc=/original/dQ2Fw6.jpg)
Title: Re: 3d Fantasy Land Battle Scene Thingy
Post by: Matty on January 22, 2024, 03:49:11
And in motion:

(frames captured at a low frame rate but high quality then saved from images as a video)

Title: Re: 3d Fantasy Land Battle Scene Thingy
Post by: blinkok on January 22, 2024, 05:24:55
Looks awesome
I think it would make a great tower defense style game
Title: Re: 3d Fantasy Land Battle Scene Thingy
Post by: Matty on January 22, 2024, 17:24:33
I've updated the download on the itch.io website, if you want to try the game you can download it from here:

(link) (https://matty77.itch.io/3d-fantasy-battle-thingy)

I've posted a lot of videos of the game running as 'rendered frames' not in real time. But this is how it looks in real time on my PC. You can see the frame rate counter and the triangle count per frame at the top of the screen.

There's some numbers in the middle of the screen at the bottom which is more debugging information from my process that tries to autooptimise and learn how to best optimise the game.

There is actually a game in here, it's a card game, but personally - I made this more just to watch fantasy battles.

The card game isn't what is going to draw anyone to play this game/toy.

Title: Re: 3d Fantasy Land Battle Scene Thingy
Post by: Matty on January 23, 2024, 06:04:03
Game link (updated) (https://matty77.itch.io/3d-fantasy-battle-thingy)

Fog added during the nighttime, dawn and when it is snowing. Fog is created by making 4 infinite planes, adding an alpha texture with a cloud like image on it, scrolling the texture, adjusting the alpha, and placing them 4 planes at a stepped height above each other.  When a transition occurs to daytime, or away from snow, the alpha fades and the fog vanishes, and in reverse when the fog appears at the relevant times.

There's also a subtle lighting effect around the flaming swords and stuff. You won't notice unless you see it moving usually, but I take the position of some of the magical effects and add an rgb value into an array that is a low resolution map of the gameplay area.  Then when rendering each of the elements, foliage, units etc, I simply do a lookup of the array, read the rgb value and add it to the ambient light for that particular element. You can partially see it in one of the screenshots below around the knights with their flaming swords.

(https://img.itch.zone/aW1hZ2UvMjQxOTE2MS8xNDc2MDY1My5qcGc=/original/cEEOwn.jpg)


(https://img.itch.zone/aW1hZ2UvMjQxOTE2MS8xNDc2MDY1Ni5qcGc=/original/i5nyk0.jpg)
Title: Re: 3d Fantasy Land Battle Scene Thingy
Post by: Matty on January 23, 2024, 10:41:50
A new "trailer" video for my itch site:Game (https://matty77.itch.io/3d-fantasy-battle-thingy)

Title: Re: 3d Fantasy Land Battle Scene Thingy
Post by: Derron on January 24, 2024, 10:08:37
Regarding ground fog:
- nice how fast you were able to implement it
- I think it should sometimes be "less" intense (height and intensity)
- in a lot of shots (lower angle, top view is not affected - of course) it is visible that you use some kind of "layers" (as the "gradient" from no density to full density is "blocky")
(https://imgur.com/4L8Zds5.png)

One way would of course be to add more layers - with the cost of performance I guess.

Did you play with having a kind of "cloud texture" (so no "fog every" but a kind of "big isles" texture)? What I want to say is that fog is not "everywhere" but sometimes a bit "puffy/clumped" - and if you have 1 or 2 layers (think especially the "top ones") which have some flogging/grouping/clumping of density this might tear that "layer"-ish effect you currently have - as it then does not "cut" elements on the same height (no "clump" means the "lower" fog-layer will be seen earlier).

Maybe you can also come up with a solution to have some kind of "local fog" (so fog does not go beyond horizon) ... so more "waft of mist"-things. Fog is not always "everywhere" (depends on the fog) if it is ground fog I guess it depends on ground moisture, temperature ... and "extracted" water from that ground moisture.
So wet graslands will have fog while a forest with big trees holding rain away ... will have less fog (but it gets the one which is "not ground fog" but simply "air moisture fog").

Why am I telling this? Because adding various "styles" of fog - will add variety compared "battle scenario with ground fog".


Same btw to say to the already mentioned "too strong waving of trees" ... they do not dance in the wind randomly. Have some "wind force" (keep the simulation simple - just avoid harsh random "u turns") and apply these to plants. Wind can be "regional" (so some area has Northwind, way beyond the forest area has a north-west-wind ...). Maybe think of some "wind grid" and move the grid over the area - each grid cell has some "wind" velocity. And between the grid cells you "tween" (mix velocities of the individual cells).

This will surely look for a more ... homogenous and less "exaggerated" movement of the plants.


AND YES! - once you have these "wind velocity" thing ... you might even use the effective velocity to move the fog-layers around (as movement will be more visible with that "cloud"-textures).

AND YES! - if you have wind velocity, you could even have things like units being able to scent things (if you do not do "mass fights" btw some hunt ... dunno). Not to say that even arrows could be affected by wind a bit (strong side winds = lower hit chance etc, back winds = faster ) ... simply use the velocity for speed and hit chance multiplier mods (1.05x speed etc).



Keep on improving - and for "trailers" better upload with best quality you can "do" and let it upload over night instead of sacrificing quality (and have "artifacts") just to avoid upload time.


bye
Ron

Title: Re: 3d Fantasy Land Battle Scene Thingy
Post by: Matty on January 24, 2024, 12:51:11
Thanks Derron,

I've had a go at implementing some of what you've suggested and it looks pretty good. Not perfect but I've got some ideas I might add in.

I haven't uploaded a new version yet but hopefully in the next 8 or so hours there'll be a new version on the site.

I've made some changes including:
1. Fog adjustments as described by you above.
2. More unit variations (different textures for the human soldiers plus additional shield designs) (I had a texture cd from cgtotal from decades ago...hundreds of textures to choose from)
3. Lighting - undead give off an eerie green glow in the nighttime, during the day it doesn't show, but during the night they and the nearby vegetation are lit by an eerie green light.

I'm hoping to add the following:

Maybe some kind of clumped fog, when there's fog, that bubbles away like marsh mist, some kind of animated, texture - if you've ever seen the movie Alien when Kane and the others investigate the alien ship and they find the eggs, the scene - the fog that sits above the eggs has this moving texture of sorts...I'm going for something like that, but in localised small patches...haven't done it yet though...
Title: Re: 3d Fantasy Land Battle Scene Thingy
Post by: Matty on January 24, 2024, 14:21:05
Thanks again Derron...

The video below shows less dense fog, patchy fog (clumps), and also the undead green lighting and the additional variation in the human clothing etc.

It has been uploaded to itch and you can play it here:

Game Link (https://matty77.itch.io/3d-fantasy-battle-thingy)

The fog now is on about 10-20 day cycle where its strength varies from day to day in the game. It only ever appears in the nighttime or dawn times of the game, or when it is snowing. The height of the fog and the thickness varies from day to day.

A couple of changes were made for the patchy fog, a different set of textures with transparent regions were used for the fog, but also a set of 'cubes' with an animated 'bubbling' texture of sorts placed randomly around the place.

You can see the changes in the source code upload.

If you have an existing copy of the source code then you can see the changes easily by running it through a diff command on linux or an fc command on windows (fc source_code.bb old_source_code.bb > diff.txt) will write the differences to a text file.



Title: Re: 3d Fantasy Land Battle Scene Thingy
Post by: Matty on January 24, 2024, 19:36:42
A short gameplay video..

I've shown plenty of videos of 'demo battles' - this is the actual gameplay. A rather relaxed and calm card game where you simply get dealt a hand of cards every few seconds, as does the opponent, and you play one to affect the events of the battle:

Title: Re: 3d Fantasy Land Battle Scene Thingy
Post by: Matty on January 24, 2024, 23:19:11
A video summary (less than a minute) of a few of the new features....

Title: Re: 3d Fantasy Land Battle Scene Thingy
Post by: Matty on January 25, 2024, 08:51:30
I appreciate your feedback Derron because often, almost always - I'm blind to things that would make the game better, or things that need fixing.
Title: Re: 3d Fantasy Land Battle Scene Thingy
Post by: Derron on January 25, 2024, 12:49:48
the video "fog and light 2" has the new fog?

(https://imgur.com/Au3m1O6.png)

I hoped the "cloudy fog texture" reduces the "cut" effect of the fog you see on the building (right wall of the mill) - that it is no longer a "line" because of the "randomly more/less transparent areas".


your last video (new features) - for me it looks as if the "patchiness" of the fog is an animated texture - with the animation steps being rather "crude". So instead of smooth transition it does some "stop motion"-big-steps.
Dunno how to smooth such stuff out ... maybe it needs 2 "layers" for each fog-layer and you alpha-transition between those two then (so "crossfading"). But this will require possibly a "0.5 * alpha" (as both add to each other then).

To test out such an effect maybe create some test-app which has a ground, 2 buildings and maybe some grass/tree - so you can judge how organic and artificial objects "stand out".


But yeah nice you added so much of my ideas :D


bye
Ron
Title: Re: 3d Fantasy Land Battle Scene Thingy
Post by: Matty on January 25, 2024, 13:33:55
The cut lines still occur - because the transparent regions in the planes don't necessarily line up with where the buildings and stuff are.

The texture scrolls over time, slowly, so the way I do it the lines will still be there.

But when the game is in motion, and the player is focused on the troops running about fighting each other, I don't think they're going to take a huge amount of notice of the buildings in the background.
Title: Re: 3d Fantasy Land Battle Scene Thingy
Post by: Matty on January 25, 2024, 13:51:56
Any tips on how to improve the framerate of a scene that looks like the below in Blitz3d?

(image attached - not linked...my webhost is playing up)

source code also attached if you feel like looking through it?

It's not essential, I can accept my PC is too old to run this well at maximum quality, and that I have to run at a reduced quality setting, but if there's a way to reduce render times from 160ms down to say 60ms at this quality level, I'd love to know.

At this quality setting it can get upwards of 20 million triangles on screen in one frame.
Title: Re: 3d Fantasy Land Battle Scene Thingy
Post by: Matty on January 25, 2024, 14:55:58
Edit: I'm confused about something:
Line 9315-20 is an error on my game, the first "freetexture eltex" should be commented out otherwise the program ought to crash.

It was running perfectly with no changes for the last few days until a few minutes ago when the game decided to suddenly crash out on that line - which is correct, it should crash out. My question is - why wasn't it crashing out for the past few days when there's been no changes to that section of the code. It should have fallen over any time in the last few days, but it didn't until tonight?

eg: 
line 1 freetexture tex
line 2 freetexture tex (should crash because texture already freed)

no change to the above, no crash for first few days, then crash .. tonight?

Title: Re: 3d Fantasy Land Battle Scene Thingy
Post by: Derron on January 25, 2024, 16:03:42
It always depends on what is stored at the pointer "tex" --- if it frees something "nasty", then it segfaults :D


> The cut lines still occur - because the transparent regions in the planes don't necessarily line up with where the buildings and stuff are.

Hmm ... I guess to make them visible the "transparent spots" need to come very often and this might lead to some "fizzy" look


> The texture scrolls over time, slowly, so the way I do it the lines will still be there.

hmm maybe it is not "tiling" (repeatable) ? I just think I saw some "jumps" of the fog texture and wondered "why" this happens.


bye
Ron
Title: Re: 3d Fantasy Land Battle Scene Thingy
Post by: Matty on January 26, 2024, 07:08:45
Real time game video:

Title: Re: 3d Fantasy Land Battle Scene Thingy
Post by: Matty on January 26, 2024, 08:12:05
A bit of humour......

"Wow - graphics have improved, they're almost....photorealistic!"

Title: Re: 3d Fantasy Land Battle Scene Thingy
Post by: Matty on January 26, 2024, 09:20:48
Game Link (https://matty77.itch.io/3d-fantasy-battle-thingy)

The upload has been updated, there is also an optional patch file that can be downloaded that includes some settings that should give both better performance and quality on most PCs.

I'll post a video later of how the game looks running in real time with the patch applied.
Title: Re: 3d Fantasy Land Battle Scene Thingy
Post by: Matty on January 26, 2024, 18:00:50
The download page on the itch store page (link) (https://matty77.itch.io/3d-fantasy-battle-thingy) now has a simple blitzplus "launcher.exe" gui file that lets you set the command line parameters on running the game before it runs.

It looks like this:

Title: Re: 3d Fantasy Land Battle Scene Thingy
Post by: Matty on January 27, 2024, 03:59:05
I have posted this video before I'm sure, a few days ago...but I'm using it to highlight a point that most of us come up against when we make games for a hobby:

"There's approximately 7 billion human beings on this planet, and there's got to be at least a handful who quite probably would enjoy installing and playing this game - especially as it is currently free of charge.  But....is it possible for me to find them and provide it to them? Unfortunately that' s the nature of the beast, the answer to that question is going to be 'No' no matter how much better I improve it."



Yeah - I mean - if a game like below can acquire 10 million users in its lifetime then I'm sure one that looks a little bit better might be able to get say..I don't know - 10 users in its lifetime?


(https://mattiesgames.com/assets/bf.jpg)

Similarly - with over 480,000 reviews for the 'bee game' - I'm sure I could possibly realistically expect say ? 5-10 reviews? in my game's lifetime?
Title: Re: 3d Fantasy Land Battle Scene Thingy
Post by: Derron on January 27, 2024, 09:33:42
I guess there are a lot of idle games which are less "successful".

Idle games have a different target group than "battle viewer"-games (I guess yours is more niche).

Yours is fantasy-based which is "good" but I guess also an rather "crowded" scenario ("bad").

Theirs is "android" (so where the masses of "players" exist now) while yours is Windows-only.


Instead of having a look at games with high download counts maybe check for "rather good looking" games with almost no downloads - guess you will find a lot of them.

Reaching for the stars is good - but while you reach for it look around - you will see thousands of hands reaching into the air.  This is why it is good that you want to create the game for yourself TOO.



As I said some posts ago - you are talented in adopting new languages too (jscript etc) so I guess you should really give godot or unity a try. Take some readymade free models for your tries and if it is something you would try further we could talk about bringing the b3d models to eg gltf or whatever Godot likes (I tried with b3d -> milkshape 3d -> blender -> gltf but the animations were a bit complicated and I had a 4 MB gltf alone with the anims, think stored keyframes or so).

Godot/Unity would make it easier to play the game on mobile phones, tablets etc too - and I guess you would also gain more visual effect-capabilities with their engines.


bye
Ron
Title: Re: 3d Fantasy Land Battle Scene Thingy
Post by: Matty on January 27, 2024, 14:59:28
Some optimisation done......as well as an update to the launcher and the upload on itch site.

Game Link (https://matty77.itch.io/3d-fantasy-battle-thingy)

On vegetation level 2, and a few other settings as below, the game runs quite fast on my PC:

(https://mattiesgames.com/assets/optimise01.jpg)

(https://mattiesgames.com/assets/optimise02.jpg)
Title: Re: 3d Fantasy Land Battle Scene Thingy
Post by: Matty on January 27, 2024, 15:26:35
Game Link: Game Link (https://matty77.itch.io/3d-fantasy-battle-thingy)

YouTube Video:


Main Changes to Code (optimisation)
;sorting foliage at beginning of battle
If foliagesorted# < 1.0 Then
 foliagetime = MilliSecs()
 foliagesortattempts = foliagesortattempts + 1
 ;For rf.renderfoliage = Each renderfoliage
 If foliagesorted = 0 Then
 rff.renderfoliage = First renderfoliage
 foliagesorted = 0.1
 EndIf
 While Abs(foliagetime - MilliSecs())<5
 rfent = rff\f\ent
 For rf2.renderfoliage = Each renderfoliage
 rf2ent = rf2\f\ent
 If rf2ent < rfent
 tmpent = rff\ent
 tmprf.foliage = rff\f
 rff\ent = rf2\ent
 rff\f = rf2\f
 rf2\ent = tmpent
 rf2\f = tmprf
 EndIf
 Next
 rff = After rff.renderfoliage
 If rff = Null Then
 foliagesorted = 1.0
 Exit
 EndIf
 Wend
 ; If Abs(foliagetime-MilliSecs())>5 And foliagesortattempts < 20 Then Exit
 ;Next
 
 EndIf
;sorting units by entity handle and animation frame (this way we can assist the render process by
;sending the same entity without updating the mesh animation every single time we call a render
;command
If uff.renderunit = Null Then uff.renderunit = First renderunit
 If uff.renderunit<>Null Then
 ufftime = MilliSecs()
 skipit = 0
 If pcammode > 0 Then
 TFormPoint uff\u\x,0,uff\u\z,0,pcamera
 If TFormedZ()<0 Or Abs(tformedx2())>TFormedZ()/czoom Then skipit = 1
 EndIf
 While Abs(ufftime - MilliSecs())<2 And skipit = 0
 If uff\u\cat = cat Then
 For rv.renderunit = Each renderunit
 If rv<>uff Then
 skipthis = 0
 If pcammode > 0 Then
 TFormPoint rv\u\x,0,rv\u\z,0,pcamera
 If TFormedZ()<0 Or Abs(TFormedX2())>TFormedZ()/czoom Then skipthis = 1
 EndIf
 If rv\ent = uff\ent And skipthis = 0 Then
 If rv\frame < uff\frame Then
 tmpu.unit = rv\u
 tmpuframe = rv\frame
 rv\u = uff\u
 uff\u = tmpu
 rv\frame = uff\frame
 uff\frame = tmpuframe
 EndIf
 EndIf
 EndIf
 Next
 EndIf
 ;Next
 uff.renderunit = After uff.renderunit
 If uff.renderunit = Null Then
 uffsorted = 1
 Exit 
 EndIf
 Wend
 If skipit = 1 Then
 uff.renderunit = After uff.renderunit
 EndIf
 EndIf
Title: Re: 3d Fantasy Land Battle Scene Thingy
Post by: Matty on January 28, 2024, 00:39:22
Every day I upload multiple improvements to the itch site.

I also keep a copy of my upload - which contains media, executable, data files and source code. It's useful because I can actually compare progress in terms of the quality and performance of the game over time.

Here's two screenshots (one inside the other) of the game from as it stands currently versus as it was two weeks ago (13-Jan).  It's running 17ms per frame faster with more stuff on screen today than it was then thanks to the work done since then. So yeah - it looks better and runs better with more stuff in it than it did two weeks ago:

(https://mattiesgames.com/assets/improvements.jpg)

video:

Title: Re: 3d Fantasy Land Battle Scene Thingy
Post by: Derron on January 28, 2024, 07:48:07
Just a question about your video:
"older version" - avg FPS 35
"newer version" - max FPS is 25 or so

Not the best to convince you improved it fps-rate wise :)


Regarding "looks comparisons" - there it would be kinda nice if you have a fixed random seed, a static "update rate" and a replay-able camera movement. So to say a way to "replay" a specific game scene which runs the same across computers, across game executions etc.
This would allow you to do comparisons about looks, performances ... and also might help to see if glitches happen (eg foliage z-ordering etc).

In old Warcraft III and other lockstep-based-games the action of your keypresses etc was stored and evaluated on specific "ticks" in your game. So to say your camera movement could be "key framed". On Logic tick 10 tell the camera to move to the left, on 12 to the top by 5 degrees ...
And if you (in the "render phase") tween between start and target positions it should also become auto-smooth.


Generally camera "smoothing" could be an interesting feature as it could add some "cinematic" feel.


Regarding keeping versions:
Just make your project folder a (local) .git repo. Commit your changes and you can always go back. Saves disk space if you only save the "diffs". When doing your release builds you (git) export and thus skip the .git-folders (containing the history of your files).

bye
Ron
Title: Re: 3d Fantasy Land Battle Scene Thingy
Post by: Matty on January 28, 2024, 08:36:35
The frame rate you describe above of '35' for the older version is not the actual frame rate. In that period when I was making the game I had two frame rate counters, one for the logic updates and one for the rendering, it's the second one you should be looking at on that display which is about a third of the rate - so in actual fact the frame rate for the older version was more like 12 or 13fps.

I've uploaded a new version with some variations on the grass - to try out some different looks, along with some more optimisations.
Title: Re: 3d Fantasy Land Battle Scene Thingy
Post by: Matty on January 28, 2024, 08:44:29
Oh...for what it's worth:

I've scanned the downloaded executable on a number of computers with up to date virus definitions and it's shown zero trojans or anything according to the two computers I've tested it on (my own and the public library in my home town).

So whatever the other user found earlier in the thread at the beginning of this thread - it doesn't seem to be showing up anymore.
Title: Re: 3d Fantasy Land Battle Scene Thingy
Post by: Matty on January 28, 2024, 16:28:39
Updated game.link (https://matty77.itch.io/3d-fantasy-battle-thingy)

Changed grass.
Added optimisations.
image:
(https://mattiesgames.com//assets/imgs.gif)
Title: Re: 3d Fantasy Land Battle Scene Thingy
Post by: Matty on January 29, 2024, 05:50:06
A bit of fun...... (recorded in real time in windowed mode) It's running at about 17-18fps which is smooth enough to play but it's better when it's over 20fps.  This is with the settings as high as I can go on my PC.  My optimisation technique mainly is to cull elements from the render loop in order to keep the framerate at a certain level...eg there's a shit-ton of grasses on the map, but I cull a percentage of them from the render loop to keep the framerate higher than a minimum level. Basically : "draw fraction = current frame rate / desired frame rate" or similar.

Title: Re: 3d Fantasy Land Battle Scene Thingy
Post by: Derron on January 29, 2024, 07:44:57
Did you play with "clumping" grass foliage together if more far away?

Especially foliage with "similar rotation/scale" might be able to get replaced by "multiple grass elements in one object" if more far away. Similar to LOD to reduce details this would be a "merge objects" thing.

Yet I consider "grass" to be something a shader/particle system should care of - to save on draw calls.


PS: copyrighted music in youtube videos ... better avoid that.

bye
Ron
Title: Re: 3d Fantasy Land Battle Scene Thingy
Post by: Matty on January 29, 2024, 08:14:45
Re Clumping - kind of.

At load time I generate 'addmesh clumps' of grasses rather than placing individual grass elements.  Also however - I have an auto optimisation feature that groups entities into a single render pass if the system determines doing so will result in a speed increase, and it then does so, until the framerate settles down again and then returns to grouping them individually. Certain lighting features don't work when the entities are grouped - so when that auto optimisation switches on you lose certain graphical niceness.

But yeah - it runs okay now.
Title: Re: 3d Fantasy Land Battle Scene Thingy
Post by: Matty on January 30, 2024, 09:42:30
Updated Link (https://matty77.itch.io/3d-fantasy-battle-thingy)  (there's a patch file with a different executable and source code that fixes a problem with the grass I'd been having as well as a new full download - the patch is for the current download)

Video:

To create the video I launch the game with the following command line parameters:
game.exe -windowed -clocktime -smoothcam -force100 -veg1 -FPS5 -loop:1

Windowed is so that my console app in Java can capture the screen image and record it to disk, clocktime is not needed, I just like to have a timestamp captured on screen, smoothcam is a default parameter most of the time that simply smooths the motion of the camera a little bit, force100 causes the game to ignore all autooptimisations and 'pretend' it's running at maximum framerate when it's not really, veg1 sets the vegetation level to highest, FPS5 locks the display framerate to a maximum of 5 fps (for the video capture we prefer a consistent framerate) and loop:1 tells the game to run the update loop and render loop at the same rate of 1 each per loop.

At the end of the recording process I have a few thousand sequentially numbered .png files which I pass off to ffmpeg (ffmpeg -framerate 29 -i f-%08d.png -b:v 24M movie.avi ) and then I can do what I like with the video from that point.
Title: Re: 3d Fantasy Land Battle Scene Thingy
Post by: Matty on January 31, 2024, 18:35:03
Game Link (https://matty77.itch.io/3d-fantasy-battle-thingy)

I've updated the pdf manual for the game, and updated the game zip file.

PS - about the game music and audio - the game music and audio is played semi randomly from subfolders within the audio folder of the game. You can simply replace those files with whatever audio you like before running the game and it will play them instead.  

Here's a screenie:

(https://img.itch.zone/aW1hZ2UvMjQxOTE2MS8xNDg4NTA5Mi5qcGc=/original/JQZhtx.jpg)
Title: Re: 3d Fantasy Land Battle Scene Thingy
Post by: Matty on February 01, 2024, 07:22:31
Derron - a few posts back you mentioned about seeing if I could port the game across to a more modern engine like Godot, etc.

I've used Unity in the past briefly and I can be fairly confident that in neither Unreal, Unity, Godot, or almost any other such engine this game will not run with their off the shelf rendering solution.

The power of blitz is that you can do things in non standard ways - if your game requires it.

When I used Unity, which was a while ago, they had - for example - a brilliantly featured animation toolset that allowed you to manage your 'creatures' animations really amazingly with one glaring exception to the whole package. There simply was not an option to run a simple command the equivalent of 'SetAnimTime' to set an animated 'entity's' animation frame to a specific exact frame that you wanted at an instant. That's just not how those engines work.  They're designed to use 'labelled' animation cycles that have transitions mapped between them all. They're not designed to simply go "I want frame x - now, and then I want frame y, on the next frame'. Heck - even being sure that something you want to happen on a specific render frame is nearly impossible.

Those engines are good for very standard methods of doing things.  But for some games, such as rts games and the like they're absolute crud.  They're just no good for games with a design like many old strategy games.

There's no way a total war like game could easily be done in Unreal, Unity or Godot based on their design philosophys. It just wouldn't work without massive customisations. And I'm not about to spend the time learning their system, just to customise them to work against their way of doing things to make one game.
Title: Re: 3d Fantasy Land Battle Scene Thingy
Post by: Derron on February 01, 2024, 09:41:39
I think it depends on what you want from the engine ... and if what you want is really what you need.

So why do you need to set a specific frame for "render frame" 1 and another specific animation frame for "render frame" 2?

What differs between setting it manually - and defining an animation "strip" for it? I assume because of the animation frame number being kinda "dynamic" (or depending on something).
If so you would need to check how such things are to be handled in the engine of your choice/tries.
And maybe while checking how things work you ask someone who asks you then why you want to do things that way - and with some luck you both then find out that you do not need to do it the way you "think" you should do :-)

What I want to say is: just because they (and thousands of developers) do things a specific way today - it must not be the best truth available.
But the same accounts for you: just because you (and thousands of developers) do things the way they are used to do - it must not be the best truth available.

I guess the modern engines have the benefit of decoupling "animation design" from the code - you want to "if nextAnimTime then SetAnimPos(bla)" while they prefer "SetAnim(animName)". Setting up the animation can be done by the artist in the team (which might be the one-man-show-dude or a real second person :D).


The animation thing aside: I was more interested in the visual gain you get "for free" when using a more modern engine. Or if it has a better performance (or scales better for more recent hardware or ...).
Also you will find out that the "visual coding process" can be rather interesting - something like "hot coding" or "hot editing" (change values while playing) which you might already know from JScript-game-tests but should be something not working so easily with Blitz3D.



I myself did not try Unity (but @Qube did) or Unreal. I only tried Godot and I tried to use my "classic approach" there too - so setting Animations on specific game events/moments in the game etc. But I guess a lot of the "hassle" I had there is something a "new" developer would not have - because they won't try to fit old habbits into new designs.

But what I can say is - for animated "menus/huds/...", so all the stuff running on top of your "game world" these tools and their basic designs are quite cool. Your game cards would be individual "scenes" which you can design / make interaktive easily (so eg animate cut out elements in the card, having particles inside and whatever you want ... including nice animations during close/open/...swirl in / out ...).
So adding "sugar" to all your game elements is way easier there - with the benefit of being all visual. So it is a bit like the benefit @iWasAdam has with his toolset.


So yeah, you might have limits with these engines - regarding your approaches in the past - but it is up to you to check if the advantages you get "for free" are worth the hassle of reconsidering your approaches. If you 100% need them, then yes, unity, godot, ... might not be the right tool for you. But if you reconsider things (or maybe are willed to sacrifice something, dunno) then it should always be at least an option to try them out.
To repeat myself: I bet at least visual-wise you would improve quite a bit (just think of weather effects, fog, fire, ...). But cannot judge how good it works on your computer hardware (guess GLES3 runs on smartphones so ... with some tricks a lot should be possible).


PS: just a thought I want to write down because it flew through my mind just yet ... If you want to use your bought b3d-models with modern engines it should be rather "easy" to import the meshes and textures into more recent formats. But you might have trouble getting the animations converted (efficiently). With tools like mixamo or other online services of today - you might be able to import the meshes (at least the human-like ones) and add way more sophisticated animations. Something you might have issues to get into such a game with Blitz3D and most probably outdated tools for b3d-models.


PPS: Total war .. should run with very low fps on your computer (at least it does on my fathers - think it was rome - but he plays some of the games in the series, and all of them run far from "smooth" :D).


PPPS: maybe of interest for you to watch/read

A talk about AI and mass units in unity (game: assassins creed):
https://www.youtube.com/watch?v=Rz2cNWVLncI

And because you might have read about "ECS" being the way to go for massive unit game logic:
https://godotengine.org/article/why-isnt-godot-ecs-based-game-engine/


bye
Ron
Title: Re: 3d Fantasy Land Battle Scene Thingy
Post by: Matty on February 01, 2024, 12:45:47
I would find it difficult to believe any of those engines could run my game with the number of soldiers running about at the framerates I get with blitz3d on my machine. They might be able to make an individual frame look a million times better with effects, but I seriously doubt any of them could make a scene with as many animated meshes at the framerates I can get with blitz3d on my old Pc.
Title: Re: 3d Fantasy Land Battle Scene Thingy
Post by: Derron on February 01, 2024, 13:00:05
Maybe give it a try - maybe start with just having a plane + some dozen of models.
Check FPS then ... and then duplicate the models and check how fps goes down (to estimate the "costs" of additional units).
I guess modern engines do "LOD" for you automatically, dunno if that is done with Blitz3D too.

For grass/trees or similar "grouped" stuff you can use mesh groups or multi meshes - think you can have thousands of grass patches in a multi mesh rendered in a single draw call - it depends on the spatial distance of course.

Such optimizations might not be able with Blitz3d - so while certain elements might be slower to do with modern engines, others might be trivial or at least performance wise way better.


Giving it a whirl at least has a good chance to "convince" me more than a "tried it in the past" thing :)


bye
Ron
Title: Re: 3d Fantasy Land Battle Scene Thingy
Post by: Matty on February 01, 2024, 14:26:26
This is a TEST:

My game is saving images every so often, then a program runs in the background to upload it to my website, and display it here ... it updates about every 30 seconds while my game is running...or such.

Just testing the upload process really. Seeing if I can communicate while the game is running.

(https://mattiesgames.com/assets/gameimage.php)

Edit - interesting....because the game is running in Windowed mode and still continues to run...the images keep rendering and uploading to the website .... so you can refresh this page every minute or so and you'll get a different output image.....even when the game is not actually on screen on my PC.

Edit 2 - after more than 12 hours .... taken a break for a bit...I'll restart the display in a while..let it run again....slightly different visuals this time....this version of the game isn't available for download - it's quite risky to release something publicly that includes a 'upload an image to my website' code without security stuff involved....so it will likely be my basic game with an include I only use on my own local PC.
Title: Re: 3d Fantasy Land Battle Scene Thingy
Post by: Matty on February 02, 2024, 07:00:06
Test Part 2......

Animated uploaded gif every so often...please stand by...working this out....

(https://mattiesgames.com/assets/gamegif.php)

Look, I don't know about you but I feel a bit 'weirded out' by the quality of what I appear to have produced. It just seems to me that the game I've made is beyond my actual realistic ability. Not saying a game like this can't be made in blitz or anything - just that it doesn't seem to me that it's realistic for me to believe that I created this.  I've been watching it for the last few hours and I can't help but think that it just looks too good to be something I've created. I mean...look at the other junk on my itch page I've made over the last few years, look at my rubbish artworks...it just doesn't seem realistic that I made this.
Title: Re: 3d Fantasy Land Battle Scene Thingy
Post by: iWasAdam on February 02, 2024, 10:40:43
I completely agree - this is an excellent project.

My suggestion would be to now step back and assess things: What is right, what is wrong, what works, etc (you may need to be more objective here??)

From my own view, this is a technical masterpiece, but there are some glaring flaws like pop ins/out of objects near the camera. depth cueing of objects swapping positions, etc

What would 'I' focus on? Hmmm,
1. the vegetation is nice, a bit monotone and doesn't merge well with the floor I'd spend some time just getting that right - maybe lower the grass height - more cosmetic than anything.
2. I'm loving the characters and the animation. Maybe make the characters a bit bigger and less of them. Sometimes less is more. I would also focus on the characters themselves and idenity - you have 2 factions - make them instantly recognisable. This might be with the armour and color, or the race and armour. Maybe have 2 standard bearers - they go out in front of the hoards with the flags

From a step back side of things, this is what I would do:
1. set it in an area - clear everything from the surface and have only a few bits of grass at the edges of the arena - make the arena circular or oval - think roman/greek.
2. Have only 2 fighters. have different fighters with different attacks, etc - much like you have already.
3. Set the battle going and you can instantly see where you need to pay attention to reworking the animation. You will have no distractions like vegetation, so it will be obvious what needs you attention.
4. repeat 2 and 3 many times with lots of different players - cut things out, focus on quality and not quantity

After this you should have a very robust fight and animation system. One that you can gauge how best to make a great game from :)

Title: Re: 3d Fantasy Land Battle Scene Thingy
Post by: Matty on February 02, 2024, 11:58:51
Thanks Adam.

I've thought about it a little more in terms of whether I've made something that seems to be more than I should be able - underneath all the graphics is code that is really not too different in capabilities than my other games like Knights of Grumthorr - the main difference is that I've actually had access to some decent artwork. I liken it to the idea that in say - to use an analogy - in formula one racing there's probably a huge number of people in developing nations who could potentially be great race car drivers, except they've never had the financial resources to participate. Same applies here - you give someone with a decent level of experience and ability in programming the art resources to do a good job and they might just do it.
Title: Re: 3d Fantasy Land Battle Scene Thingy
Post by: Matty on February 04, 2024, 12:00:20
I did what you said Adam, but ended up finding a bunch of minor 'bugs' that needed fixing.

Mainly a few < signs that needed to be <= in terms of placing the right number of units, and a few issues re: unit targeting / selecting targets and also a couple of 'range' issues for two melee units.

There's still some issues with the vegetation, but I'm going to leave that for a bit.

The download on the itch site has been updated:  Game Link (https://matty77.itch.io/3d-fantasy-battle-thingy) as has the source code on there.

I'll repost the 'animated gif' image here, just in case this spawns a new page when I post it....

When my internet 'cap' increases at billing-cycle month end I might make it higher resolution, currently I've used my internet 'cap' this month so my upload and download speeds are all throttled.

(https://mattiesgames.com/assets/gamegif.php)
Title: Re: 3d Fantasy Land Battle Scene Thingy
Post by: Pakz on February 08, 2024, 20:37:28
That looks very nice! I kind of get that old Amiga Settlers vibe from the scene.
Title: Re: 3d Fantasy Land Battle Scene Thingy
Post by: Qube on February 09, 2024, 15:26:27
Don't be disheartened, Matty. Believe me, you are far from alone or the only one. I bet most of the users on this forum could put their hands up and fire off a load of shit that's happened, happening and effecting their lives right now. I for one could spout for a while.

One thing that no-one can touch is your passion for coding, creating and sharing. Only you can let that spoil things. The only world we need is one where the monitor lights up our face while we tap away the keyboard, click the mouse, pull our hair out and make whatever the f*ck we want ;D
Title: Re: 3d Fantasy Land Battle Scene Thingy
Post by: Matty on February 10, 2024, 15:19:24
Thanks Qube, I understand and appreciate the comment.

(Your words were in reply to a message I'd overlaid over the animated gif, but the animated gif has since been replaced...but they're understood...from Matty)

(https://mattiesgames.com/assets/gamegif.php)
Title: Re: 3d Fantasy Land Battle Scene Thingy
Post by: Matty on February 23, 2024, 06:01:47
This is something I'll never understand about any of my games where I've polished them to what is for me a high level (at least to my abilities).....

If you put the raw, unpolished, really poor looking early efforts up against my own higher polished efforts after applying a tonne of advice and fixing things.....for some reason I can't help but be more charmed by my earlier unpolished efforts than the work that ends up having a tonne of polish applied.

It's like there's something at least to me, that's more charming about that raw, unpolished, unfinished, crappy looking work than when I've tried to do it up to look as good as I can.
Title: Re: 3d Fantasy Land Battle Scene Thingy
Post by: Pakz on February 23, 2024, 08:12:17
I was asking chatGPT for some tips on art and studying reference art. This to get better at serving myself and a target audience. Things like where to place shadows are still difficult for me to grasp.

Having just rectangles as a placeholder has always been something fun for me. But there's so much that can be learned to like I guess.
Title: Re: 3d Fantasy Land Battle Scene Thingy
Post by: Derron on February 23, 2024, 08:51:27
Quote from: Matty on February 23, 2024, 06:01:47This is something I'll never understand about any of my games where I've polished them to what is for me a high level (at least to my abilities).....

If you put the raw, unpolished, really poor looking early efforts up against my own higher polished efforts after applying a tonne of advice and fixing things.....for some reason I can't help but be more charmed by my earlier unpolished efforts than the work that ends up having a tonne of polish applied.

It's like there's something at least to me, that's more charming about that raw, unpolished, unfinished, crappy looking work than when I've tried to do it up to look as good as I can.
I would say the opposite - the later incarnations of this project look way better than before - and also contain "logic improvements" (targeting, aiming, shooting, movement).

But of course you always have pareto optimums .... 80% of the work done in 20% of the time. Polishing is part of the missing 20% of the to-do-work :)
(btw not everything you did during the last weeks I would call "polishing" ... some stuff is "essential" for me - eg game logic)

bye
Ron
Title: Re: 3d Fantasy Land Battle Scene Thingy
Post by: iWasAdam on February 24, 2024, 12:04:22
check this out for some inspiration...