World like from Minecraft

Software: Away3D 4.x

Rayen123, Member
Posted: 25 November 2011 08:46 PM   Total Posts: 70

I am trying make level like minecraft (just only 20x20x20 cube), but it has low fps. How I can optimalize it for more lot of cubes (etc. 200x200x200) with high fps ? Thanks
s.txt

( I think its posible, look this http://www.youtube.com/watch?v=c0IwvN4IdH4&t=43 )

 

File Attachments
Cubes.as  (File Size: 5KB - Downloads: 367)
   

Rayen123, Member
Posted: 11 December 2011 05:58 PM   Total Posts: 70   [ # 1 ]

Hi, I found solution.
I dont render cube, but only PLANE when it was needed. For example, # is land, o - nothing

ooooooooo
######ooo
#########

so I rendered planes only

______
      |__

And all planes I added to Object3Dcontainer, and Merged it.

Thats all smile (on normal PC it has 60/60fps)

 

   

G3n3ralTao, Newbie
Posted: 20 May 2013 08:40 PM   Total Posts: 2   [ # 2 ]

Hi,

I was wonder if any of your source code is available online. I am currently working on a similar prototype and I wanted to see what approach you used to be able to generate those kind of environments.

Quite impressive! Keep up the good work!

G3n3ralTao

 

   

Rayen123, Member
Posted: 20 May 2013 09:07 PM   Total Posts: 70   [ # 3 ]

Hi,
demo is not online - this version had lot of programming bugs… merging cubes takes lot of memory (1 gb)... It was created in away3d 4.0.0.9 (or ...0.1) beta, If I find source code of it, I will post it here.

Better way to do this terrain is directly to molehill (agal). I created this one

photos - https://www.facebook.com/media/set/?set=a.549469845063140.130509.296644877012306&type=1&l=8f6a8a16cf

live demo - http://agal.geardice.com/ (with pseudethread, generate without freezing UI - http://blogs.adobe.com/aharui/2008/01/threads_in_actionscript_3.html)

Every vertex have XYZ position, UV, and RGB color,... then in AGAL you code that vertex is showed like Texture + RGB (I created that way shadows and ambient occlusion). Then you create only faces what you need.

Terrain I am generating via perlin noise http://www.houseofthead.com/blog/flash-as3-perlin-noise-explained-and-demonstrated-part-1/
Just for example, if you want terrain 20*20*160 cubes,.. generate 20*20 perlin noise,... and then pick pixel at 0,0 from bitmap (in which is generated perlin noise), than calculate picked color from range 0xffffff and 0x000000 and from this percentage create height of terrain at 0,0 (for example picked color is 0x888888 its 50% then terrain at 0,0 is 80 cubes height (50% from 160)). And this repeat in loop for every height.
Best way is create 16x16xHEIGHT mesh with cubes, and then other one.

Cave system is generated by 3D perlin noise (google it).

Everything what you need about molehill and agal is in this book
http://www.packtpub.com/adobe-flash11-stage3d-molehill-game-programming-beginners-guide/book


Michal Deak

 

   

G3n3ralTao, Newbie
Posted: 20 May 2013 10:06 PM   Total Posts: 2   [ # 4 ]

Thank you for the fast respond!

This will help a lot! I’ll give news when I have a few screenshots to share.

Thanks again

 

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X