Be a Supporter!

Cubic Zen 3D

  • 2,279 Views
  • 63 Replies
New Topic Respond to this Topic
zenyara
zenyara
  • Member since: Jun. 17, 2005
  • Offline.
Forum Stats
Member
Level 15
Blank Slate
Cubic Zen 3D 2010-11-14 17:00:05 Reply

Everyone wants a "minecraft" in Flash.

Ok, I'm starting an open source project called,

Cubic Zen 3D

[ Using the FlashDevelop platform (ActionScript 3) ]

Project hosted here:

http://www.as3codes.com
Filed under: Cubic Zen 3D

Any graphics, sounds, etc that are added will have a download link which will contain the "assets" folder.

All are welcome to join in since it's "open source" and doesn't require CS x only FlashDevelop.

If you make any upgrades to any of the class files please contribute to this post. Thanks

zenyara
zenyara
  • Member since: Jun. 17, 2005
  • Offline.
Forum Stats
Member
Level 15
Blank Slate
Response to Cubic Zen 3D 2010-11-14 18:56:21 Reply

I want to ask if anyone can host a server so we can make this thing multiplayer asap.

I have the socket code written in PHP that runs on an apache web server.

I have all the needed setup instructions also.

I don't have an extra computer to host the socket on is why I can't do it myself.

zenyara
zenyara
  • Member since: Jun. 17, 2005
  • Offline.
Forum Stats
Member
Level 15
Blank Slate
Response to Cubic Zen 3D 2010-11-16 02:19:39 Reply

WOW I just got through all the errors and now I'm ready to layout the website.

Jephz is helping me. Main link is on as3codes.com

PSvils
PSvils
  • Member since: Feb. 3, 2010
  • Offline.
Forum Stats
Member
Level 01
Game Developer
Response to Cubic Zen 3D 2010-11-16 10:21:11 Reply

Erm, I'd like to participate, but first off, is the whole engine simply going to consist of the Main.as?

I'd like to see more modularity through classes so it's easier to add to the project, and how is your 3d engine different from the tons of other ones out there?

I've been thinking of making my own engine, though not sure, simply because lots of the other ones out there are bloated and slow for games. So I would be interested in this sort of thing...

P.

zenyara
zenyara
  • Member since: Jun. 17, 2005
  • Offline.
Forum Stats
Member
Level 15
Blank Slate
Response to Cubic Zen 3D 2010-11-16 15:23:39 Reply

At 11/16/10 10:21 AM, PSvils wrote: Erm, I'd like to participate, but first off, is the whole engine simply going to consist of the Main.as?

I'd like to see more modularity through classes so it's easier to add to the project, and how is your 3d engine different from the tons of other ones out there?

I've been thinking of making my own engine, though not sure, simply because lots of the other ones out there are bloated and slow for games. So I would be interested in this sort of thing...

P.

Modularity is the best way to go. I am still pretty new to AS3, but I'm getting the hang of it and a good
reason to make this open-source, so the real experts can contribute.

I've tried to use Main as the "director".

Example (Main.as 175 lines):
(this is a snippet from Main)

/*
                 LOAD SPLASH PAGE
*/
		private function loadSplashPage ():void {
			splash = new Splash(this);
			splash.tabChildren = false;
			addChild (splash);
		}
/*
                  LOAD MAIN MENU SCREEN
*/
		private function loadMainMenu ():void {
			mainMenu = new MainMenu();
			mainMenu.tabChildren = false;
			addChild (mainMenu);
		}
/*
                  LOAD PROFILE SELECTION SCREEN
*/
		private function loadProfile ():void {
			profile = new Profile();
			profile.tabChildren = false;
			addChild (profile);
		}
/*
                  LOAD THE WORLD
*/
		private function loadWorld ():void {
			skybox = new SkyBox();
			addChild (skybox);
			// LOAD 3D WORLD
			game = new Game();
			game.tabChildren = false;
			addChild (game);
		}
/*
		public function playAction ():void {
			switch (playOrder[Global.data._scene]) {
				case "splash" :
					// splash page
					loadSplashPage ();
					break;
				case "sponsorMovie" :
					//sponsor movie
					loadIntros ("sponsor");
					break;
				case "companyMovie" :
					//company movie
					loadIntros ("company");
					break;
				case "mainMenu" :
					//main menu
					loadMainMenu ();
					Sounds._start (this);
					break;
				case "profile" :
					//profile
					loadProfile ();
					//Sounds._start (this);
					break;
				case "game" :
					// GAME or EDITOR
					if (Global.data._editing) {
						loadEditor ();
					} else {
						loadWorld ();
					}
					//Sounds._start (this);
					FPS._start (this);
					//addHUD ();
					break;
			}
			Global.data._scene++;
                    }
zenyara
zenyara
  • Member since: Jun. 17, 2005
  • Offline.
Forum Stats
Member
Level 15
Blank Slate
Response to Cubic Zen 3D 2010-11-16 16:17:59 Reply

Ok, I think I've finally hit upon a workable collisions method for all world objects.

Crossing my fingers that it works flawlessly.

I have a simple method for X,Z collisions, but this is more advanced, plus we really want Y collision (up) to jump on top of things.

Going to start testing this out right now and post what I figure out.

zenyara
zenyara
  • Member since: Jun. 17, 2005
  • Offline.
Forum Stats
Member
Level 15
Blank Slate
Response to Cubic Zen 3D 2010-11-16 23:55:54 Reply

It's taking a bit longer to work my way to the collisions testing.

Still fixing up old HUD graphics. Had to fix the dev and others that used to be movieclips so they were fubar inside of FlashDevelop.

I probably have no less than 5 more HUD items to fix before I can start the physics testing,

plus the blocked-up world stress test.

I'll probably be using Collada .DAE for the blocks since I noticed poor performance (they were not staying solid) on the in-program cubes. It will be easier to skin them, anyhow, using Blender.

PSvils
PSvils
  • Member since: Feb. 3, 2010
  • Offline.
Forum Stats
Member
Level 01
Game Developer
Response to Cubic Zen 3D 2010-11-17 09:56:32 Reply

I say don't worry one bit about graphics yet. It doesn't look like you have an engine setup...as in at all...
3D engine's are a lot of work, I had 3 as2 ones lying around on my previous desktop. And I may be interpreting the purpose of this project...are you looking to make an open source 3d engine, or a whole game that is open source?
Either way, you should write a base class that Main extends that would control screen transitions, and a whole separate class that handles the game engine/objects...

Good luck with the project! I've got a few of my own projects, so maybe the most I'll be able to do is give advice once in a while.

AntiAliasProductionz
AntiAliasProductionz
  • Member since: Apr. 20, 2008
  • Offline.
Forum Stats
Member
Level 08
Blank Slate
Response to Cubic Zen 3D 2010-11-17 12:34:16 Reply

At 11/17/10 09:56 AM, PSvils wrote: I say don't worry one bit about graphics yet. It doesn't look like you have an engine setup...as in at all...

He does have a 3d engine, look at the link in his sig.

zenyara
zenyara
  • Member since: Jun. 17, 2005
  • Offline.
Forum Stats
Member
Level 15
Blank Slate
Response to Cubic Zen 3D 2010-11-18 02:18:54 Reply

Just got everything up that needed to be fixed, plus added a nice preloader screen.

I will be trying out collisions testing, plus adding in a few models from Blender.

PSvils
PSvils
  • Member since: Feb. 3, 2010
  • Offline.
Forum Stats
Member
Level 01
Game Developer
Response to Cubic Zen 3D 2010-11-18 05:44:47 Reply

Didn't notice the 3d engine in your signature! That's one nice engine, but is it a ray caster (I couldn't tilt the camera up or down), and since it looks like you're drawing stuff manually through bitmapData, does it have texture mapping?

But just the 3d engine isn't the only thing I meant, I meant a solid game engine too, for example collision detection (btw, I'm guessing you already checked out simple sphere collisions? Probably would be the best way to go, or use bounding cubes.)

PSvils
PSvils
  • Member since: Feb. 3, 2010
  • Offline.
Forum Stats
Member
Level 01
Game Developer
Response to Cubic Zen 3D 2010-11-18 05:48:54 Reply

Stupid questions...
I should have checked out the latest cubic zen build I guess. It's looking pretty nice, and runs very fast for me! Could you give a few details on your engine specifics? Like, rendering method, clipping, etc. (I'm always fascinated by 3d engines... :) )

zenyara
zenyara
  • Member since: Jun. 17, 2005
  • Offline.
Forum Stats
Member
Level 15
Blank Slate
Response to Cubic Zen 3D 2010-11-18 06:08:45 Reply

At 11/18/10 05:44 AM, PSvils wrote: Didn't notice the 3d engine in your signature! That's one nice engine, but is it a ray caster (I couldn't tilt the camera up or down), and since it looks like you're drawing stuff manually through bitmapData, does it have texture mapping?

Open dev console and type "mode" to switch to FPS camera mode.

Dev is open with the ` key.

zenyara
zenyara
  • Member since: Jun. 17, 2005
  • Offline.
Forum Stats
Member
Level 15
Blank Slate
Response to Cubic Zen 3D 2010-11-18 06:10:39 Reply

At 11/18/10 05:44 AM, PSvils wrote: Didn't notice the 3d engine in your signature! That's one nice engine, but is it a ray caster (I couldn't tilt the camera up or down), and since it looks like you're drawing stuff manually through bitmapData, does it have texture mapping?

But just the 3d engine isn't the only thing I meant, I meant a solid game engine too, for example collision detection (btw, I'm guessing you already checked out simple sphere collisions? Probably would be the best way to go, or use bounding cubes.)

I figured out the sphere radius to radius comparison collision detection and i'm going to try that. First I want to make a decent block or 2 in Blender since I finally got the test collada to load in the site...

I-smel
I-smel
  • Member since: Mar. 2, 2006
  • Offline.
Forum Stats
Member
Level 01
Game Developer
Response to Cubic Zen 3D 2010-11-18 15:14:12 Reply

Why does anyone want a Minecraft in Flash? It wouldn't be as good.

zenyara
zenyara
  • Member since: Jun. 17, 2005
  • Offline.
Forum Stats
Member
Level 15
Blank Slate
Response to Cubic Zen 3D 2010-11-18 18:00:38 Reply

At 11/18/10 03:14 PM, I-smel wrote: Why does anyone want a Minecraft in Flash? It wouldn't be as good.

Why would anyone want anything in Flash? Why do people eat at macdonalds when they can eat at a 4 or 5 star restaurant? Why do birds pee?

davaca
davaca
  • Member since: Nov. 16, 2003
  • Offline.
Forum Stats
Member
Level 42
Blank Slate
Response to Cubic Zen 3D 2010-11-18 18:13:23 Reply

birds don't pee.

also, mcdonalds is cheap


ceci n'est pas un blog.
(get it? It's a link to a blog.)

zenyara
zenyara
  • Member since: Jun. 17, 2005
  • Offline.
Forum Stats
Member
Level 15
Blank Slate
Response to Cubic Zen 3D 2010-11-18 22:48:34 Reply

Enough silliness.

Having issues with my hosting (godaddy) right now so I'm having to wait to do any updates.

zenyara
zenyara
  • Member since: Jun. 17, 2005
  • Offline.
Forum Stats
Member
Level 15
Blank Slate
Response to Cubic Zen 3D 2010-11-19 03:23:08 Reply

Ok the server issue was fixed and the newest version is up. Haven't gotten around to collisions just yet because I had to work out a few other things, but they're next on the list.

I fixed jumping diagonally. It's probably more of a super jump, but it works.

http://www.as3codes.com/blockout

PSvils
PSvils
  • Member since: Feb. 3, 2010
  • Offline.
Forum Stats
Member
Level 01
Game Developer
Response to Cubic Zen 3D 2010-11-19 05:19:05 Reply

Looks cool! The jumping is way too unpractical though. I tried to jump on the boxes, and I would always over shoot. The jump is TOO superman-ish.
Other than that, nice! (btw, what 3d engine are you using then, your own? If so, do you share the source anywhere?)

P.

zenyara
zenyara
  • Member since: Jun. 17, 2005
  • Offline.
Forum Stats
Member
Level 15
Blank Slate
Response to Cubic Zen 3D 2010-11-19 05:58:14 Reply

At 11/19/10 05:19 AM, PSvils wrote: Looks cool! The jumping is way too unpractical though. I tried to jump on the boxes, and I would always over shoot. The jump is TOO superman-ish.
Other than that, nice! (btw, what 3d engine are you using then, your own? If so, do you share the source anywhere?)

P.

The 3D camera stuff is papervision3d. The jumping is like that for testing. Makes it more fun.

I am now working on making a first scene. Should have a new update later today or tomorrow.

I plan on putting up all the source codes in the Cubic Zen folder of http://www.as3codes.com

I don't want to put it up until this thing works properly though. No sense in giving everyone a half-a##ed engine, plus I don't want to keep updating the folders over and over right now. It's coming along very nicely now and I'm starting to play around with Blender.

I'll have this thing all tiled up pretty soon and find out how much it can take, graphically.

My guess is the engine will only allow for small room-like areas, which is fine. I can make dungeon games and room-to-room fighting games with it.

This is all educational and fun.

zenyara
zenyara
  • Member since: Jun. 17, 2005
  • Offline.
Forum Stats
Member
Level 15
Blank Slate
Response to Cubic Zen 3D 2010-11-20 04:11:12 Reply

Well, here is the result of the first blockup test...

Back to the drawing board. LOL

Cubic Zen 3D

zenyara
zenyara
  • Member since: Jun. 17, 2005
  • Offline.
Forum Stats
Member
Level 15
Blank Slate
Response to Cubic Zen 3D 2010-11-20 04:14:08 Reply

That test had:

12 * 12 rows/cols * 15 levels (height)

2160 blocks

zenyara
zenyara
  • Member since: Jun. 17, 2005
  • Offline.
Forum Stats
Member
Level 15
Blank Slate
Response to Cubic Zen 3D 2010-11-20 04:22:31 Reply

Ok next test:

Set all blocks to visible = false;

Got 40 fps! A modest increase...

All kidding aside, the idea is that we could have the blocks only nearest the player appear visible. Or the first layer of blocks nearest the player (at whatever distance).

That's what I'm going to try next

Chickumbleh
Chickumbleh
  • Member since: Jan. 26, 2008
  • Offline.
Forum Stats
Member
Level 12
Blank Slate
Response to Cubic Zen 3D 2010-11-20 11:14:52 Reply

I feel a need to contribute, so I might start working on a texture3D class.

zenyara
zenyara
  • Member since: Jun. 17, 2005
  • Offline.
Forum Stats
Member
Level 15
Blank Slate
Response to Cubic Zen 3D 2010-11-20 13:53:15 Reply

A trick I thought of:

Make a "sprite" version of the blocks
and show the sprite version when they are more than 2 blocks away from player.

I'm actually fixing up my as3codes.com site right now.

I'll be testing out more things on this after awhile.

zenyara
zenyara
  • Member since: Jun. 17, 2005
  • Offline.
Forum Stats
Member
Level 15
Blank Slate
Response to Cubic Zen 3D 2010-11-20 13:57:11 Reply

I have already figured out a working method
for a "movieclip" skybox.

I'll make a template soon and share it as well.

zenyara
zenyara
  • Member since: Jun. 17, 2005
  • Offline.
Forum Stats
Member
Level 15
Blank Slate
Response to Cubic Zen 3D 2010-11-20 20:01:43 Reply

Here's a tile editor I made using php and javascript. No flash.

http://raidforce.com/blockout.php

I used the same code to work out how to tile up the 3D world.

PSvils
PSvils
  • Member since: Feb. 3, 2010
  • Offline.
Forum Stats
Member
Level 01
Game Developer
Response to Cubic Zen 3D 2010-11-21 06:51:55 Reply

How are you setting up your level info? Are you just pushing shitloads of blocks in the Papervision displaylist?
The thing is, if this game will only have cubes/sprites contained within cubes, then you can trace line-of-sight really really easily, or in most cases you won't even have to do that. What I would do is set up a 3d array which represents the world (I'm thinking a way around going 3d array, since that'll take up some memory...). Then you just use bresenham's line drawing (modify to go 3d), and trace line of sights, and only add the blocks the player can see. Because on my computer, even Minecraft classic which is in Java, aka much much faster than Flash, lagged, even when I was looking at a wall (it didn't cull all the blocks on the other side).

I think a combo of line of sight and heavy fog should do the trick to boost some FPS. And before you trace line of sight, you could check if there are adjacent blocks blocking all possible ways for the player to see the current block, and cull it immediately.

Culling is key. Or a different rendering method, since in the end, it's the graphics drawing Flash can't cope with,.

P.

zenyara
zenyara
  • Member since: Jun. 17, 2005
  • Offline.
Forum Stats
Member
Level 15
Blank Slate
Response to Cubic Zen 3D 2010-11-21 10:37:56 Reply

It's clear to me that only bitmap data methods are efficient in flash so I'm trying to go that route. This is really a test to see what is possible.

So far it seems that what is possible would be essentially room-to--room fighting games where you have doors that lead into the next thus loading another 3d scene (small room or hallway.