Saturday, 29 September 2007

Slowly but progressing and the warthog

Working on finalizing the first version of River to support different orientations, heading towards the still water part. Meanwhile a new contributor has appeared on the horizon of jcrpg! Sirgazil's first work is a very nice warthog model. Check the picture! When I will get to wild life programming this will be very useful, just like theotherhiveking's wolf model! Hope to see many such quality models in the future. :-)

Wednesday, 26 September 2007

Moving to GPLv3

I've decided to do the future development of the project and release it under the license GNU General Public License version 3. You can still get the previous versions under LGPL with the sources included on the sf.net download page of the project. Be aware that from now on there is no possibility to incorporate future jcrpg sources into a proprietary software. The whole project source base in the SVN is committed now with the new header and the COPYRIGHT file is changed too.

Monday, 24 September 2007

Aquatic

Currently working on the river. Getting close to completion. Some hours of coding...then heading to the lakes and seas, the still waters. If all these are complete a release with all the goodies (cool bumped ground, water with reflection, some optimization here and there) will be born. Then comes the rounds of fixing here and there again and the wildlife.

Update: River bed's been created and is mostly working. :-) Added some blocky curves to the river, steeps are using waterfalls now. Check the new screenshot.

Sunday, 23 September 2007

jcrpg packaged

Looking through the google, I've spotted that Toni Graffy at http://packman.links2linux.de/ created some RPM install packages of jcrpg for openSuse. You can have them here. That's cool! :-)

PS.: Bri has created a classic RPG forum at http://com3.runboard.com/bitomoander.
He's already created a lot of subforums for games including jcrpg! We can chat there about it!

Friday, 21 September 2007

What is jcrpg?

Here stands the brief feature list of the Java Classic RPG framework and the reference game.

Java Classic RPG is a totally open source project (including source and media). Its source is released under GPLv3 License, media is generally GPL, CC or Public Domain depending on the contributor/source's wish.

Complete features:

- Classic tile based world view in opengl 3D
- Ground with small terrainblocks using its heightmap, smooth
- Cave with various parameters (height, size, density, levels)
- Plains, forests
- Economy, populations (partially working) with residences
- Classic keyboard input with four direction movement
- Neoclassic look around in 45 degrees.
- Changing day and night with orbiters and optional lighting and route parameters
- Climate with belts
- Flora engine with climate dependency: continental, jungle, desert and arctic implemented
- Configurable graphics detail level 3D core (based on JMonkeyEngine) with optional grass, water reflection, billboarded trees, fog state, bloom effect, shader based wind animation etc. that can load .obj and .3ds models.

- UI widgets & detailed map system (partially)
- Water system
- Wildlife engine (partially working, group based)
- 3D model animation (md5 based partially complete)
- Audio system playing sounds and music (.ogg)
- Strong skill system (skills partially added, coding of using them is being developed)
- Save/Load of game
- World generator for Geographies / Climates / Waters
- Ecology generator (partially)
- Object system (partially)
- Turn based combat (playable)
- Character leveling

Features of the future:

- Civilization engine (group intelligence instead of personal)
- Special NPCs for plots
- Plot, scripting, quest system
- External map editor
- Other tools
- The reference game
- ?

Basic documents: architecture, game logic.

Last modified 13 August 2008

Thursday, 20 September 2007

Waters and slashdotation

Currently working on waters. First the river is being born. Not an easy task. Will be the first time to use the so called Surface interface of geographies. Water will be a special part among the World class' subelements. It will be a semi intelligent thing. Based on an X-Z coordinate it will replace geography surfaces with its own bed (settable width and depth). In SVN we only have a different Geography extension river currently, which is not a good approach, I will rewrite the code and extend World class to make use of Waters. The water surface will be using JMonkeyEngine's cool built-in shader based WaterRenderPass with reflection. Check the screen shot.

Meanwhile Qubodup has mentioned jcrpg in his submittal on slashdot, resulting a 4500+ webhit on sourceforge project webpage. Thanks Qubodup and slashdot.org for the marketing. :-) And looking at webhit statistics I also stumbled into a sticky thread at rpgcodex.com forum which is about indie RPGs and has recently posted and linked on jcrpg. Great! :-) I'm a casual reader of their site and often find there interesting forum topics.

Thursday, 13 September 2007

Part time job

Little time for jcrpg nowadays. Yet working on it. I've added some new bumps to the ground (looks less bare, yet you can turn it off for less stress on GPU), grass to the mountain slopes, little changes here and there. After that I've started working on water concept of jcrpg. Thinking first about it, and some very little programming too.

Saturday, 8 September 2007

Invent ARB vertex trick

I've been experimenting with the vertex shader to go beyond the way one sinusoid function gave movement to the whole scene resulting in way too much ordered wind movement. It's not an easy task in ARB dialect. :-) Here is my solution (read the comments):

        if (doGrassMove) {
// creating 5 diffs to look random
diff = 0.059f * FastMath.sin(((passedTime / TIME_DIVIDER)
* windPower)) * windPower;
newDiffs[0] = diff;
diff = 0.059f * FastMath.sin((((passedTime + 500) / TIME_DIVIDER)
* windPower * (0.5f)))
* windPower;
newDiffs[1] = diff;
diff = 0.059f * FastMath.sin((((passedTime + 500) / TIME_DIVIDER)
* windPower * (0.6f)))
* windPower;
newDiffs[2] = diff;
diff = 0.059f * FastMath.sin((((passedTime + 1000) / TIME_DIVIDER)
* windPower * (0.8f)))
* windPower;
newDiffs[3] = diff;
diff = 0.059f * FastMath.sin((((passedTime + 2000) / TIME_DIVIDER)
* windPower * (0.7f)))
* windPower;
newDiffs[4] = diff;
diffs = newDiffs;

if (vertexShader) {
vp.setParameter(new float[]{diffs[0],diffs[0],0,0}, 0);
vp.setParameter(new float[]{diffs[1],diffs[1],0,0}, 1);
vp.setParameter(new float[]{diffs[2],diffs[2],0,0}, 2);
vp.setParameter(new float[]{diffs[3],diffs[3],0,0}, 3);
vp.setParameter(new float[]{diffs[4],diffs[4],0,0}, 4);
}


And the shader:


!!ARBvp1.0
PARAM mv[4] = { state.matrix.modelview };
PARAM mv2[4] = { state.matrix.projection };
TEMP pos,projpos;
TEMP a,b,c,div1,div2;
################################
# Apply modelview transformation
DP4 pos.x, mv[0], vertex.position;
DP4 pos.y, mv[1], vertex.position;
DP4 pos.z, mv[2], vertex.position;
DP4 pos.w, mv[3], vertex.position;
################################
# Add offset
TEMP f0,f1,f2,f3,f4;
TEMP t0,t1,t2,t3,t4;

# create different fraction parts
ADD f0, vertex.position, 0.0;
ADD f1, vertex.position, 0.1;
ADD f2, vertex.position, 0.2;
ADD f3, vertex.position, 0.3;
ADD f4, vertex.position, 0.4;

# get fraction and substract 0.5 to have
# negative values too
FRC f0, f0;
SUB f0, f0, 0.5;
FRC f1, f1;
SUB f1, f1, 0.5;
FRC f2, f2;
SUB f2, f2, 0.5;
FRC f3, f3;
SUB f3, f3, 0.5;
FRC f4, f4;
SUB f4, f4, 0.5;

# multiply different sinusoid external
# params by the texcoord y
# (highness of the quad) into t[] values
MUL t0, program.local[0], vertex.texcoord[0].yyyy;
MUL t1, program.local[1], vertex.texcoord[0].yyyy;
MUL t2, program.local[2], vertex.texcoord[0].yyyy;
MUL t3, program.local[3], vertex.texcoord[0].yyyy;
MUL t4, program.local[4], vertex.texcoord[0].yyyy;

# The trick: multiply with the different fractions,
# some of them may result in f[x] being 0, giving
# the randomness to the movement
# as one of the displacement will fall off
MUL f0, t0, f0;
MUL f1, t1, f1;
MUL f2, t2, f2;
MUL f3, t3, f3;
MUL f4, t4, f4;

# multiply with 2, bigger movements
MUL f0, f0, 2;
MUL f1, f1, 2;
MUL f2, f2, 2;
MUL f3, f3, 2;
MUL f4, f4, 2;

# add all the f[] offsets to position
ADD pos.xz, pos, f0;
ADD pos.xz, pos, f1;
ADD pos.xz, pos, f2;
ADD pos.xz, pos, f3;
ADD pos.xz, pos, f4;

################################
# Apply projection matrix
DP4 projpos.x, mv2[0], pos;
DP4 projpos.y, mv2[1], pos;
DP4 projpos.z, mv2[2], pos;
DP4 projpos.w, mv2[3], pos;
MOV result.position, projpos;
MOV result.texcoord[0], vertex.texcoord[0];
MOV result.color, vertex.color;
MOV result.fogcoord, vertex.fogcoord;

END

Friday, 7 September 2007

Reacting on user feedback

In my few free moments for programming I've been concentrating on Charlie's report in previous post about fog and low view distance cave blueness. For the first I've experimented a while with the fog color and distances while adding per quad sinusoid movement to the grass with the help of fraction (frc) vertex command. Then a quick ugly solution for the cave blueness: sky sphere is culled when inside the cave. :-) Maybe I will add a better solution later.

P.S.: Testing performance and bloom I took two additional higher resolution (1280x1024) screenshots to the original two demonstrating distance fog and bloom together. :-)

Tuesday, 4 September 2007

Fix patch - as usual

I've found minor issues and some major just after releasing the pre-alpha test. Problems with tree foliage billboarding. Had to fix the rotation quaternion. After that found new major issues with renderToViewport and its performance when I set bigger view distances than 40, and hacking at it I've found some other memory affecting problems too. Download at the usual place.

Monday, 3 September 2007

The Cave the Batch and the Shader

Release time! :-) Highlights:
"Optimization release with addition of the new Cave geography. Many parts of 3D core was optimized. Vertex/fragment shaders were added for grass/foliage wind effect. Geometry batching was added to terrain tile/model/grass/foliage loading. Cave inside the mountain is now available."

Downloads at the usual place: link. Feel free to post comments on your experience, bugs, performance, anything. ;-) You will need about 300MB free RAM to run it.

Sunday, 2 September 2007

Batch problems

Batch raised the need for a vertex shader for wind animation. It was done yesterday. Now the problem of fog...vertex program made fog of JME ineffective. I had to write a new one and with a lot of trouble I succeeded in that. The new quad batching of trees and the random rotation gave another big problem which is still just partially solved...too much rotation made billboarding very hard for me...still working on it. :-) But at last all is much faster. If that's finished I will release a pre-alpha again for testing purpose, before heading on to adding waters.

Twitter