Friday, 31 August 2007

Foliage batched

After a rather complicated session of hacking the 3D core of jcrpg I can announce that with the previously batched terrain tiles, simple models, quad grass plus the new Foliage batching for the trees...the geometry batch optimization session is mostly complete! Tree foliage batching means a surplus of 20%+ FPS when animations are on and even more 30%+ when it is off. Overall a big boost of performance is working well now, and things mostly look like before, no loss of detail but a big gain of performance. Memory usage became a bit more varying, bigger garbage collections, but it seems to be okay, no signs of memory leak. Shots taken on a 6200Go, resolution is 640x400. (Walking in the forest it's around 80 FPS in that resolution. In 1024x768 it's around 45 FPS, without grass around 52FPS. Outside the forest it's around 70-80 FPS.)
P.S.: After posting this one I've found several weaknesses in memory usage of the new Batching. Fixed them along with the wrong cleanup of hmSolidColorSpatials field of it's fixed in SVN, mem usage is correct...I hope! ;-D


Charlie said...

I know JCRPG is targeted at classic RPGs - but surely it's only a small step between the tile-based movement and implementing free 360 degree movemennt... just a thought...

Anyway, looking really, really nice and great stuff with the optimizing. In an age of bloatware it's great to see somebody really caring about maximizing performance.

Paul said...

Tile based movement is one of the most old-school thing that makes up a classic RPG feeling. :) It was hard to work out the 4 direction movement. Free movement worked out of the box I had to restrict that with new InputHandler implementation... ;) With the current engine it would take some hours to make the free movement working with the game... Anyway it may be considered later, hopefully not a big load of work... but considering what the game will be like, I think players will find 4 direction movement more the game AI will be based on it too.

Another thing to add is that you have free look at the fixed point where you stand in the game. Use cursor keys to look up/down left/right. :) It might help your feeling of freedom. :-D

If I find any way of optimization I will add it if I can... :) (I want wind effect ARB vertex shader as soon as I will have spare time for that. I've found that nvidia cgc tool (shader compiler) will be of great help later.)

bri (dragonbait) said...

free movement would be nice...but this is Java "Classic" RPG. and tile based movement, left, right, forward, back, movement should be the main (style). There is a shortage of "Classic" Style games out there and JavaCRPG would do well to simulate the old classics. i.e. Wizardry 7, Bard's Tale trilogy, Might + Magic II, PoR, Devil Whiskey, etc. Keep it simple. Free movement can always be implemented later. Let's get the "Classic" Style done first. :o)

bri (dragonbait) said...

+ Keep up the good work! This is my favorite crpg in progress since "Pools of Darkness" and the "Devil Whiskey" :o)

qubodup said...

Looking fantastic.. I want you concide one thing in the future, when you start thinking about music.

Baldur's Gate II and Globulation 2 have good ideas about music.

BG2: Nearly all of the Soundtrack is cut into pieces, every piece being about 5-10 seconds long, the "figt scene" and "walking around" music will be cut together, depending on the situation and unlike TES4:Oblivion, you won't realise the difference/transition.

Glob2: They are young and open source, but have an interesting idea: They have afaik only one soundtrack, but if a building has been build, another instrument is faded in (overlayed) and out. I'ts like a sound confirmation that a building has been built. This might be done for fighting scenes too.

Your Classic RPG won't be running on "classic" systems it seems :) Don't forget to implement "make it ugly and smooth"-options - This is something worth doing early, as speeding up speeds up testing and allowes weak cpu owners to help.

You rock! Is this still a one-man show? (Codewise)

Paul said...

Wind vertex shader added to SVN code base! Not perfect yet, but it works and performance is much better! :-)

Paul said...

Hello all!
Thanks for sharing your opinions!

Codewise it is still one-man. I am trying to make it runnable in low-end systems too...we are getting close! On an intel integrated system, the new optimization resulted in ~10FPS in 640x480, minimalistic settings with a view distance set to 20. If it is set to 10 (not too usable for navigating :) ) it makes around 20 FPS. Hopefully it will be usable on geforce4 and such systems too, no possibility to test it though...:)