Re: Pyglet based Voxel-Cube placing engine.

937 views
Skip to first unread message

Tristam MacDonald

unread,
Sep 17, 2012, 6:40:03 PM9/17/12
to pyglet...@googlegroups.com
On Mon, Sep 17, 2012 at 1:05 PM, David Hagler <proz...@gmail.com> wrote:
I was toying with the notion of "yet another one of those voxel games"  - and created this....


Let me know if you have any issues working with it, runs some whoping 3000fps on my desktop - and like 60 on my laptop.

Follow the repo if your interested, upcoming milestones..

* proper normals with simple ambient lighting.
* chunk based voxel bitmap provider - trying to come up with a format for arbitrarily large sizes - like MC but with a much higher height ceiling (64k or 'unlimited', still decided on format specifics)
* chunk based rendering, heirarchy of display lists
* dynamic chunk updates for block removal/addition.
* block level lighting
* view lighting to mimic the voxel's concept of lighting. (smooth lighting basically)
* division into client/server model

Who wants to implement "powerrocks"? ... haha

Do you have any screenshots handy? I don't have a pyglet-capable machine at the moment. 

--
Tristam MacDonald

Nathan

unread,
Sep 18, 2012, 12:04:15 PM9/18/12
to pyglet...@googlegroups.com
On Mon, Sep 17, 2012 at 11:05 AM, David Hagler <proz...@gmail.com> wrote:
I was toying with the notion of "yet another one of those voxel games"  - and created this....


Awesome!  I like it!  This serves as a decent demo for how to use pyglet mouse/keyboard to move around a 3D space, as well.

Let me know if you have any issues working with it, runs some whoping 3000fps on my desktop - and like 60 on my laptop.

Vsync is probably on by default on your laptop, but off on your desktop.  The benefits of vsync include not wasting your time updating a frame that an LCD/LED display won't display anyway (since they generally only can display 60 fps) and eliminating tearing.  If you just want to see your true fps, turn vsync off.


Follow the repo if your interested, upcoming milestones..

* proper normals with simple ambient lighting.
* chunk based voxel bitmap provider - trying to come up with a format for arbitrarily large sizes - like MC but with a much higher height ceiling (64k or 'unlimited', still decided on format specifics)
* chunk based rendering, heirarchy of display lists
* dynamic chunk updates for block removal/addition.
* block level lighting
* view lighting to mimic the voxel's concept of lighting. (smooth lighting basically)
* division into client/server model

I'm looking forward to it!  Any plans for non-cube-based voxels?
 
Who wants to implement "powerrocks"? ... haha 

I don't understand the joke.  What's a powerrock?

~ Nathan

Nathan

unread,
Sep 18, 2012, 12:06:42 PM9/18/12
to pyglet...@googlegroups.com
On Mon, Sep 17, 2012 at 4:40 PM, Tristam MacDonald <swift...@gmail.com> wrote:

Do you have any screenshots handy? I don't have a pyglet-capable machine at the moment. 


If you've ever played minecraft, it just looks like a big room made of minecraft dirt, stone, and bedrock blocks.  Moving around works smoothly, and some collision detection is working. 

~ Nathan

Nathan

unread,
Sep 18, 2012, 3:43:16 PM9/18/12
to pyglet...@googlegroups.com
On Tue, Sep 18, 2012 at 1:16 PM, David Hagler <proz...@gmail.com> wrote:
Powerrocks was a tongue in cheek reference to a redstone analog. :D

Ah, okay I get it.
 
The current implementation was just a "how do I get this to render" so the "character movement/collision detection is very naive (intentionally).

> I'm looking forward to it!  Any plans for non-cube-based voxels?
Indeed, this is my first foray into opengl stuff altogether so I need to learn more about rendering, and optimizations, like those non-cube-voxels will
need to have special rendering considerations that I don't know of yet :P

I'm thinking of making this into some sort of generic framework for mc-clone voxel engines, but it might move from python/pyglet at that point. (we'll see)
my idea was you could mix and match plugins, so - you want animals, get the animal plugin, want skylands get a skylands generator, caves... you get the picture.
but trying to figure out an interface to allow them to all cooperate and still maintain some sort of sanity... well thats another story altogether.

So far (not knowing how mc does it, but I suspect I'm onto something here) I'm thinking layers -

map fill : layer - just generates on/off states for blocks that are considered "surface".
environment tagging : (biomes) - just tags information for the xy -2d section of the map (similar to mc)
layer fiil: dirt/sand for biomes
mineral fill : adds the good stuff to dig for!
overlay: trees/castles/mines .. etc...

I'm going to allow advanced attribute tags on the blocks so you could tag overrides on specific blocks at some point, like override this particular block to a rainforest environment, or
this block cannot have gravity many in clusters would make zero-g areas :) 

So, sounds like you're sticking to a mostly-a-minecraft-clone design for the moment?
 

I have an ambitious list of goals, but work always comes first :P

I know, work's always getting in the way!  :)

~ Nathan 

Nathan

unread,
Sep 18, 2012, 6:15:21 PM9/18/12
to pyglet...@googlegroups.com
On Tue, Sep 18, 2012 at 6:34 AM, Kalessin <pab...@gmail.com> wrote:
Nice work, I'm interested in seeing where this goes. 3000fps is quite impressive

I had a go at a similar engine to teach myself OpenGL, you can check it out at https://github.com/pabennett/glblox 

Its using Python+Pyglet and a bit of c++


I managed to find and install the gletools dependency from https://bitbucket.org/pyalot/gletools/

...but it appears that gletools is broken.  :-(

glblox $ python main.py 
Traceback (most recent call last):
  File "main.py", line 19, in <module>
    from gletools import ShaderProgram
  File "/Users/nathan/.pythonbrew/pythons/Python-2.7.3/lib/python2.7/site-packages/gletools-0.1.0-py2.7.egg/gletools/__init__.py", line 9, in <module>
    from .texture import Texture
  File "/Users/nathan/.pythonbrew/pythons/Python-2.7.3/lib/python2.7/site-packages/gletools-0.1.0-py2.7.egg/gletools/texture.py", line 13, in <module>
    import Image
ImportError: No module named Image
 
~ Nathan

Scott Porter

unread,
Sep 18, 2012, 7:11:08 PM9/18/12
to pyglet...@googlegroups.com
It looks like you don't have PIL.
--
You received this message because you are subscribed to the Google Groups "pyglet-users" group.
To post to this group, send email to pyglet...@googlegroups.com.
To unsubscribe from this group, send email to pyglet-users...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/pyglet-users?hl=en.

Greg Ewing

unread,
Sep 23, 2012, 6:02:54 AM9/23/12
to pyglet...@googlegroups.com
David Hagler wrote:
> I'm thinking of making this into some sort of generic framework for
> mc-clone voxel engines

> So far (not knowing how mc does it, but I suspect I'm onto something
> here) I'm thinking layers -

If there's anything you want to know about how MC works,
I may be able to help. I've made a few small mods for MC
recently, and learned a fair bit about its internals in
the process.

> *map fill* : layer - just generates on/off states for blocks that are
> considered "surface".
> *environment tagging :* (biomes) - just tags information for the xy -2d
> section of the map (similar to mc)
> *layer fiil*: dirt/sand for biomes
> *mineral fill* : adds the good stuff to dig for!
> *overlay*: trees/castles/mines .. etc...

I haven't delved much into MC's terrain generation, but I
think it does something broadly similar. I believe it uses
Perlin noise functions for things like terrain height,
caves and ore deposits.

--
Greg
Reply all
Reply to author
Forward
Message has been deleted
Message has been deleted
0 new messages