My new little project, Mythruna: A morphable-world RPG of sorts

ahoehma said:
Cool! :D

Please share your knowledge about day/night simulation.

What data structure do you use for the boxes?

How do you implement the "open world"?

regards
Andreas

http://code.google.com/p/bloxel/


Wow. Any one of these topics could fill the chapter of a book (at least one each). :)

Seriously, though, the day/night sim was hard to get right and involved a lot of very specific tweaking before it looked right in my engine. I don't want to go too in depth here. The sky is a giant cylinder with one texture. The texture has the colors for day->night, etc. transition and I set the texture coordinates around the cylinder appropriately. The sun is a big sphere, the moon as well. The stars are a big point mesh. There are at least half a dozen or more different parameters that are keyed off of time. Lots of run, tweak, build, run again to get it all right. There are probably two or three days of work just in getting all of the parameters to where I like them and I'm still not entirely happy with it. ;) (and one or two effects still left to add)

The world data structures are still a work in progress but are from a simple perspective, a giant partitioned 3D array of 'cells'. The trick is all of the partitioning, caching, geometry generation, etc. that took to get that idea working... and it's a lot to go into in a small space and part of the fun is trying a bunch of stuff to see what works. :) I can tell you this: rendering each individual block is not going to work. :)

What do you mean by "open world" in this case?

Of all of that, lighting propagation was the single hardest thing I worked on. Nearly the entire second week of development was taken up with that and it's still not completely done. It's "good enough" and I guess pretty darned good, at that, at least from what I set out to do.

Besides, I can't give away all of my tricks... what fun would that be. :D
-Paul

The could be pretty interesting.



Btw, I got this error message when I tried to run it (it started up, but when I pressed play, it gave me an error):



[java]Uncaught exception from thread:Thread[LWJGL Renderer Thread,5,main]

java.lang.IllegalStateException: Cannot render mesh without shader bound

at com.jme3.renderer.lwjgl.LwjglRenderer.setVertexAttrib(LwjglRenderer.java:1808)

at com.jme3.renderer.lwjgl.LwjglRenderer.setVertexAttrib(LwjglRenderer.java:1813)

at com.jme3.renderer.lwjgl.LwjglRenderer.renderMeshDefault(LwjglRenderer.java:2012)

at com.jme3.renderer.lwjgl.LwjglRenderer.renderMesh(LwjglRenderer.java:2042)

at com.jme3.material.Material.renderMultipassLighting(Material.java:532)

at com.jme3.material.Material.render(Material.java:697)

at com.jme3.renderer.RenderManager.renderGeometry(RenderManager.java:386)

at com.jme3.renderer.queue.RenderQueue.renderGeometryList(RenderQueue.java:132)

at com.jme3.renderer.queue.RenderQueue.renderQueue(RenderQueue.java:179)

at com.jme3.renderer.RenderManager.renderViewPortQueues(RenderManager.java:522)

at com.jme3.renderer.RenderManager.flushQueue(RenderManager.java:502)

at com.jme3.renderer.RenderManager.renderViewPort(RenderManager.java:664)

at com.jme3.renderer.RenderManager.render(RenderManager.java:684)

at com.jme3.app.SimpleApplication.update(SimpleApplication.java:216)

at com.jme3.system.lwjgl.LwjglAbstractDisplay.runLoop(LwjglAbstractDisplay.java:144)

at com.jme3.system.lwjgl.LwjglDisplay.runLoop(LwjglDisplay.java:141)

at com.jme3.system.lwjgl.LwjglAbstractDisplay.run(LwjglAbstractDisplay.java:198)

at java.lang.Thread.run(Unknown Source)

[/java]



Running on Windows XP, with two ATI Radeon 9600/9550/X1050 Series…

normen said:
Got a chance to actually try it on my MacBook Pro and it worked great, the mac application is pretty convenient :) Fantastic work, things like these push jME3 development more than donations ever could ;)


Awesome. The only other Mac that tried it produced really ugly results. Good to know it may have been specific to that machine (or class of machine).

re: "the mac application" being pretty convenient: Pretty darned convenient that the JME3 platform gave me that check box! Or I'd be completely lost there. :)
nomnom said:
The could be pretty interesting.

Btw, I got this error message when I tried to run it (it started up, but when I pressed play, it gave me an error):

[java]Uncaught exception from thread:Thread[LWJGL Renderer Thread,5,main]
java.lang.IllegalStateException: Cannot render mesh without shader bound
<snip>
[/java]

Running on Windows XP, with two ATI Radeon 9600/9550/X1050 Series...


I'm pretty sure that means one of my shaders failed to link for some reason. It's the console messages before that I'd be really interested in seeing if possible. 8)

This is a nice project / game, although I’ve never played anything much like it. It’s a nice relaxing atmosphere which allows a lot of freedom to the player. Was curious if there was an option to rotate certain pieces so they can fit together better? If not maybe it could be a function on the mouse wheel or another type of input, and possibly show a shadow outline of the piece selected to be placed. Imo it might give a little better predictability to the piece the user wants to build. Just an observation so far. I like the your idea though and it is a pleasant environment so far.



And if you would like tomorrow I could try to run this on my nvidia ion net book if your curious.

Placement is very basic at the moment. It will get more intuitive later. I was mostly just exploring if different non-cube blocks would even work and they were tricky to get right in the engine at any rate… between lighting propagation, etc… A lot more complicated than full 1 meter blocks. Having the control to place any specific block type anywhere I wanted was part of exploring what would work and what won’t. One of the reasons the block icon at the bottom of the screen is fully rendered in perspective is to give the user an idea of what they are about to place, ie: which of the four wooden posts, etc…



The final interface will be more general. Select “wood” and then have sub-block selection that builds up full blocks depending on where you click. Or something like that. Where you can paste the partial walls in one quarter at a time and the interface would pick the right pieces to make it work.



I’ll admit that I was inspired a lot by the game minecraft… though the idea of a completely morphable world had been the underpinning of most of my engine pipe-dreams for almost a decade. It just never occurred to me to make a world of lego blocks. :slight_smile: My long-time engine goals have been to have something really dynamic, where rivers might carve new landscapes, storms could fell trees, etc… a world where the user can manipulate every aspect of it is the extreme of that and fun in its own right. Even if I never get back to those original ideas, this will be a fun engine to play with.



Always curious about how well it functions on different hardware so that would be great. If I were more organized, I’d probably put together a page on the mythruna wiki to track this stuff.

pspeed said:
Always curious about how well it functions on different hardware so that would be great. If I were more organized, I'd probably put together a page on the mythruna wiki to track this stuff.

The offer for a group still stands, you could enable the forum and put up threads for bugs, user input etc., just PM me.
pspeed said:
want to go too in depth here. The sky is a giant cylinder with one texture. The texture has the colors for day->night, etc. transition and I set the texture coordinates around the cylinder appropriately. The sun is a big sphere, the moon as well. The stars are a big point mesh. There are at least half a dozen or more different parameters that are keyed off of time. Lots of run, tweak, build, run again to get it all right. There are


Interesting. I want hack such a feature for our bloxel-sandbox too. (this kind of code could be a good distribution to jme3 ... maybe?!) I tried to use a BIG sphere to simulate the sky but then I ask myself: is the size of such a sphere (view-distance*2 x view-distance*2) critical for performance, big texture etc ... currently I have not enough experience with jme/3d engine to make a proper decision :)

A point I'm currently not understand completely ... if the sky-sphere is located in 0,0,0 with a radiius of 2000 and the player walk 2000 into the north ... could it happen that the player looks outside the world? I guess this is not possible with [java]setQueueBucket(Bucket.Sky)[/java] ... but I don't know.

pspeed said:
trying a bunch of stuff to see what works. :) I can tell you this: rendering each individual block is not going to work. :)


that's right .. bruteforce doesn't work :)

pspeed said:
What do you mean by "open world" in this case?


I mean world infinity in all directions ... For our game we implemented a very simple dynamic "chunk-loader", so if the player comes in a new region of the game a new chunk will create with some terrain inside. Later we want implement a "real" infinitely world where the player can leave the planet :)

pspeed said:
Besides, I can't give away all of my tricks... what fun would that be. :D


Yep. I forced myself to find a own solution before I look into others code :D ... like solving euler-problems (http://projecteuler.net/)

Andreas
ahoehma said:
A point I'm currently not understand completely ... if the sky-sphere is located in 0,0,0 with a radiius of 2000 and the player walk 2000 into the north ... could it happen that the player looks outside the world? I guess this is not possible with [java]setQueueBucket(Bucket.Sky)[/java] ... but I don't know.


Hint: either don't move the camera or make sure that the sky sphere/box moves with the camera. And you definitely want it in the sky bucket, too. And then it need not be very big at all. I used a cylinder because the texture coordinates were more predictable and my trick rmaps them frequently.

ahoehma said:
I mean world infinity in all directions ... For our game we implemented a very simple dynamic "chunk-loader", so if the player comes in a new region of the game a new chunk will create with some terrain inside. Later we want implement a "real" infinitely world where the player can leave the planet :)


That's the key. As you add new 'chunks' (in your case), drop the old ones. The tricky bit is generating the new data at the edge. In my case, I had a terrain generation tool I wrote five or six years ago that builds up geometry by formula. As long as I only use purely fractal based generators in my generator stack, I can plug in any x,y coordinate and get an elevation... no matter what the x,y coordinate is. There are other approaches but that is mine.

-Paul
That’s the key. As you add new ‘chunks’ (in your case), drop the old ones. Th


Since the player can change "every" bloxel in the entire world ... we can't remove "old" chunks ... we have to find a serialize/de-serialize method for chunks far away from player's position to save memory ...

... btw ... you dynamic water is very cool ... please give me a little (only a little) hint how to hack such liquid boxes :)
ahoehma said:
Since the player can change "every" bloxel in the entire world ... we can't remove "old" chunks ... we have to find a serialize/de-serialize method for chunks far away from player's position to save memory ...


Yeah, you have to page in/out from disk on the fringes and a cache helps. I haven't implemented this part yet but I have lots of background in journaled transactional storage and so it is the least risky part of my project for me... and as soon as I create storage then I start to feel locked into a block type structure, etc... and I still like to play around with that.

ahoehma said:
... btw ... you dynamic water is very cool ... please give me a little (only a little) hint how to hack such liquid boxes :)


Oh, man, that's such a hack drawing from knowledge of quake 1 engines. There are probably better ways to do it but I just pass a time-based sin and cos as uniforms to my water shaders. The shaders use this to displace the vertex and texture coordinates based on their grid positions. Which value to put where is the only tricky part and different approaches would give you different style of waves. I may use something different someday for lakes or swamps...

amazing work, came to jme to start a similar game. blown away by your work :slight_smile:

Thanks! It’s stuff like this that keeps me going.



…new release soon with networking… was supposed to be today but life keeps getting in the way. Maybe tomorrow. :slight_smile: