Jump to content

How should I design my world?


joshcamas
 Share

Recommended Posts

Hey guys!

 

I've been trying to set up a world in my game. I'm building this world in blender, btw.

 

First I tried making a small world. It worked quite well: http://steinhauer.x10.mx/camera/

 

The terrain is a sculpted plane with texture-painted material. Yay!

 

But... when I made the map bigger, the texture became FAR too large to handle, and such.

 

So I'm (trying) to set up a "chunk" system - many planes side by side become the terrain.

 

Any other ideas? :D

 

Thanks!

-Josh

 

PS: Also, is it possible to load custom properties of objects in babylon? Thanks!

Link to comment
Share on other sites

Hi joshC!  Take a look at our tutorials... https://github.com/BabylonJS/Babylon.js/wiki/Tutorials .  At the bottom of #2 (basic elements) there is talk about Kostar's tiled ground, and a URL to a tasty tutorial he made, regarding it. 

 

As far as custom properties (established in Blender?)... I don't have an answer for that.  But I DO know that adding custom properties to your scene items AFTER they have been imported... is as easy as adding properties to ANY JS object.  Pseudo-speaking, use...

 

var myItem = scene.getWhateverByWhatever(name/id/tag);

myItem.someproperty = whatever. 

 

There are lots of getter methods on the scene class object.  (You know all this already, don't you?  *nod*)  :)

 

I love the title of this thread, by the way.  It is the BIG pre-project question, isn't it? :)

Link to comment
Share on other sites

haha thanks for the link!

 

I couldn't think of a better word for the thread, so that had to do xD

 

EDIT: On another note, I really would like having a editor using babylon, instead of using blender as the world editor.

I've seen worldMonger, but that's not enough. I'm wanting to texture paint the world! Is this possible in babylon?

 

EDIT 2: After some thought, there are 2 possibilities:

 

1) I create the terrain itself in blender, aka sculpt and texture paint it, then in an edited-version of the babylon editor I add rocks and trees and houses

2) OR I use worldmonger's code and combine it with the babylon editor - then I sculpt, texture paint, and then add the rocks and stuff for each terrain chunk.

 

The edited-editor (:D) would not be drag and drop - instead, it would be kinda like the Elder Scrolls' construction kit... you click "add new object type" then say where it is located, and then you can "paste" that into the world whenever you want.

 

Which idea sounds easier and better? Any other ideas? :D

Link to comment
Share on other sites

Dad72 has what appears to be an excellent editor called CastorEngine.  But it is not modeling software.  It is a scene assembly and game-logic tool, as best I can tell.  And, I'd say its in alpha or even pre-alpha... yet it is very powerful-looking.

 

But, generally speaking, yes, you can paint the scene and the ground materials.  Take a look at my world famous (pfft)  Skybox Tour (as seen on the BJS main website).  Hit [ until you get to Ely37 and then pan the camera around.  Nice, eh?  I didn't paint those skybox textures, but somebody did, and why not you, too, Josh?

 

Now painting the texture of heightMapped ground tiles while viewing the scene with Babylon.JS... I don't think anyone is doing that quite yet.  We've been waiting for YOU... to build the Super HeightMap Painter for us.  :)

 

Believe me, you have all the tools you need, including the raycasting mentioned in another thread.  A little bit of 2D paint program, mixed with Blender, exported to Babylon, then tweaked, animated, and game-logic'd in JS, and magic can happen. 

 

Patience is important, and here in the early days of webGL, work-arounds and compromises will be needed.  But again, it's all here or near.  Babylon.JS is a fantastic framework, and it's primary code wranglers are GREAT (smart, nice, accommodating, patient with newbies, etc etc).  Sure, it is a little French around here, but these guys and gals have blazed some excellent trails and are keeping the framework right up on the bleeding edge of "what's happening" for webGL tech.

 

Get comfy in 2D paint, for a while longer, I'd say.  And, make Blender a good friend.  The BJS framework is second to none, and IT will not be the thing that gets in the way of getting things done.  It will be the other tools, or the webGL API, or the speed of JS... that will throw rocks at your project, not the framework.  BJS is feature-packed, and much easier to use than all the other webGL frameworks.  Plus, if you don't have the device you need, then write it, or ask for it, and it will happen if it's possible and wise.  This is a great forum with excellent people hanging around it.

 

Everything you need... is right here... but not necessarily handed to you on a silver platter.  Read read read (and steal code from others.)  :)  And don't forget to look at Dad72's CastorEngine... http://castorengine.com/image.php?class=galerie&id=Images .

Link to comment
Share on other sites

Yee I never planned on not using blender for modeling. I am personally terrible at modeling, but I've worked on a few animations so I know my way around, somewhat.

 

I considered CasterEngine, but I'm assuming it's english translation isn't that great, and plus I like making my own editors and such. :D It looks VERY impressive, and I may end up using it.

 

I'm just wondering if it's possible to edit a texture's... texture during run time. :/

 

Blender simply will not work for sculpting and texturing. Multiple planes requires multiple materials and textures, and each texture needs to be saved and loaded by hand. To even edit multiple planes at once you need a plugin! The problem is if I made my own terrain editor it would need SO many features... to be able to grab, flatten, and so much more. :(

Link to comment
Share on other sites

Yep, you want to load your VW van with painting tools, and drive into the mountains and valleys of a webGL scene, and paint land.  It should save the texture every 2 minutes, and have a 100-level UNDO.  You want to get right into the cracks and crevices of the mountain, and paint little critters peeking out from between the rocks, and get right down to "painting-with-a-needle" level.  You want auto-dithering, opacity, and all the brushes found in PhotoShop.  You also want an image sprayer, packed with grasses and flowers and leafs and moss, and a special sprayer for dirt. :)  Your "paint van" has a half-$million in lights (light up your current work area in about 4000 ways), and also a big screen tv and stereo... and is packed with free music, TV shows, and movies... all of which you can use while painting mountains.

 

And it needs to have full vertex drag'n'drop 3D editing and soft-selection, warps and binds, full vertex and face welding, smoothers and un-smoothers, and this model editor also auto-saves and has a 100-level undo.  It should also do your laundry and fetch groceries, and grow pot for ya.  (yay!)

 

Well?  Have you got it written yet?  :)  I'll take a copy when you get it all done, if that's cool.

 

I'm just chewin' the rag with you, as you know.  Dreaming.  :)  I would guess (I do that often)... that one of the larger hassles of live-editing textures... is writing (the edited texture) to a drive, from a browser.  That activity is somewhat discouraged. 

 

But "submitting" a texture to a server, and then re-loading that texture into the scene from the originating site... might be a little more security-tolerable. 

 

Your dream is a fine one, J... and I suspect that you are not the only person dreaming it.

 

I think you should go for it, J.  Think-out your rough game plan, write up some pseudo code (flow chart)... you would be a Babylon.JS hero if (when) you pulled it off... that's for sure.  What a fun environment that would be, huh?  nod.  I'm with ya!

Link to comment
Share on other sites

I'm not sure at all what I want...

 

:(

 

I have never done terrain design before, but you seem to know what your talking about. Maybe you should write it! > :D

 

Jokes aside, Ima at least *try* to built a extremely simple terrain editor.

 

How will terrain work?

 

My current idea consists of chunks. A chunk is a (something x something) plane, each with a different texture. Each chunk can hold static objects, such as rocks and houses and such. These objects are loaded when the chunk is loaded. :)

 

What's cool is how I'll load chunks to edit in the terrain editor would nearly be the same way these chunks are loaded in my game. :D

 

The static object idea is a far off dream. What I want to build first is simply the planes-loading / saving system. :)

 

I think that I would create a custom "world-file" that the game will load from.

 

Also, these chunks would probably be saved in a 2x2 array.

Link to comment
Share on other sites

Well don't be sad over it, if possible.  Start small, have fun, prepare for lots of mind changes.  You have an excellent free (and easy) framework, a powerful programming language underneath it, an entire planet for an audience, things are actually looking very good, right?  This is an exciting time and you have an exciting environment to play-in.  PARTY!!!  :)

Link to comment
Share on other sites

I've been trying to get the code from worldmonger to this project, but have been having trouble.

 

So I'm going to start from the beginning.

 

Question 1: How do you access a vertex's x, y, and z? Thanks!

 

EDIT: Never mind, got that! 

 

I am however, confused on how to edit these vertices along with the faces...

 

Could someone show an example of editing vertices' positions, and update everything to make it look normal? Thanks!

Link to comment
Share on other sites

hmmm...

 

I put your code into mine, and it got some strange results...

 

The vertices are moved, yes. But it seems the faces are not... correct.

 

Also, the ground is only visible when the camera is moved to a very specific location. If not, it disappears! :o

 

EDIT: nvm! When I subdivided it, thats when it broke! yay!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...