Forum Topic: My First (working) 3d Engine

(7,455 views • 241 replies)

This topic is 9 pages long. [ 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 ]

<< < > >>
None

StaliN98

Reply To Post Reply & Quote

Posted at: 1/27/09 05:00 PM

StaliN98 LIGHT LEVEL 10

Sign-Up: 07/27/07

Posts: 690

Getting the trial for AS3 was great for my progress in flash. Ages ago, I was experimenting with 3D in AS2. I wanted to make a 3D engine from scratch, to be used for retro FPS games (think Wolfenstein 3D, and that generation).
The way I thought to do it, was split the display into many columns, each with a part of a wall texture. Each column would change height according to the perspective of a wall it would be part of. This was obviously a very inefficient way of doing it, and it ran extremely slowly.
But with AS3, I wanted to try again. Instead of using many textured movie clips, though, I would use a single BitmapData, and draw each column of pixels individually. It worked.
Here is my latest test, my next goal is to texture walls, which is easily possible with the system it uses, but may affect the frame rate.
The 3D view is a class, that can have its dimensions set to anything, and quality (size of pixels) changed.
This was made completely on my own, except for when I asked here about the new classes in AS3 (thanks again). What do you think of it so far? Any ideas for a game to make out of it?
http://spamtheweb.com/ul/upload/270109/7 8554_main.php


None

StaliN98

Reply To Post Reply & Quote

Posted at: 1/27/09 05:03 PM

StaliN98 LIGHT LEVEL 10

Sign-Up: 07/27/07

Posts: 690

Damn, forgot the controls:
WASD movement,
LEFT, RIGHT ARROWS turn.
You don't clip with walls yet.


None

Magical-Zorse

Reply To Post Reply & Quote

Posted at: 1/27/09 05:04 PM

Magical-Zorse FAB LEVEL 22

Sign-Up: 05/10/08

Posts: 2,712

Since I don't have cs4, I don't know the full capabilities of 3d, but that looks good.

.

BBS Signature

None

zuperxtreme

Reply To Post Reply & Quote

Posted at: 1/27/09 05:22 PM

zuperxtreme NEUTRAL LEVEL 08

Sign-Up: 01/02/05

Posts: 1,652

Pretty nice, man. Looks good and lag-less. I say keep working on it and then think of what you want to do with it. Have a solid foundation first. :)

(textures, objects, collisions, etc)

BBS Signature

None

14hourlunchbreak

Reply To Post Reply & Quote

Posted at: 1/27/09 05:25 PM

14hourlunchbreak LIGHT LEVEL 24

Sign-Up: 07/27/07

Posts: 3,010

That looks great, except that you can go through walls.


None

StaliN98

Reply To Post Reply & Quote

Posted at: 1/27/09 05:30 PM

StaliN98 LIGHT LEVEL 10

Sign-Up: 07/27/07

Posts: 690

At 1/27/09 05:25 PM, 14hourlunchbreak wrote: That looks great, except that you can go through walls.

Yeah, but what would you do for that ability?
Thanks for the comments, I'll be doing textures and then collision, then maybe entity types.
Also, the NG GUI changed when I clicked to post. I'll miss the winter one.


None

blah569

Reply To Post Reply & Quote

Posted at: 1/27/09 06:48 PM

blah569 DARK LEVEL 22

Sign-Up: 01/18/05

Posts: 2,751

That does look, and feel very nice. Good job! :D

PHP: Main | AS3: Main | Get Firefox | Host large files (fast and free)!
"Thank you for learning me English."

BBS Signature

None

ikool

Reply To Post Reply & Quote

Posted at: 1/27/09 06:57 PM

ikool FAB LEVEL 20

Sign-Up: 03/13/07

Posts: 1,886

Lol, its fun to run through walls... The 3D engine looks great! I hope to see more later.

"Without the users, Newgrounds would just be a website full of hentai." ~ Tom Fulp
Wii FC: 7406 9735 0812 0347 / Brawl FC: 1032-0946-1570 / TvC FC: 0431-9782-5695

BBS Signature

None

Renandchi2

Reply To Post Reply & Quote

Posted at: 1/27/09 07:42 PM

Renandchi2 FAB LEVEL 13

Sign-Up: 07/24/08

Posts: 1,553

That was amazing! Make movement a tad faster, though. And the walls looked badly textured...
But in terms of engine, that was amazing! You can make a great FPS!

Details Tutorial Collab '09! Join now!
PM me if you like my sig! Lovers so far=4
Thanks to littleMonsterGames for the inspiration to make this

BBS Signature

None

Super-Yombario

Reply To Post Reply & Quote

Posted at: 1/27/09 08:02 PM

Super-Yombario FAB LEVEL 06

Sign-Up: 03/16/07

Posts: 1,191

I feel stupid for asking... does this utilize the 3D animation thing in CS4? If so, I had no idea it could cross w/ actionscript. If not, is it possible in AS2?

RIP Ed McMahon - RIP Farrah Fawcett - RIP Michael Jackson
But wait, there's more...
RIP Billy Mays


None

Nano256

Reply To Post Reply & Quote

Posted at: 1/27/09 08:06 PM

Nano256 DARK LEVEL 13

Sign-Up: 02/12/05

Posts: 1,488

At 1/27/09 08:02 PM, Super-Yombario wrote: I feel stupid for asking... does this utilize the 3D animation thing in CS4? If so, I had no idea it could cross w/ actionscript. If not, is it possible in AS2?

Nope it does not use the 3D effects introduced in CS4, and yes the CS4 3D effects can be used with actionscript.

Move on to ActionScript 3.0 already!
The third post below this one is a lie.

BBS Signature

None

Super-Yombario

Reply To Post Reply & Quote

Posted at: 1/27/09 08:08 PM

Super-Yombario FAB LEVEL 06

Sign-Up: 03/16/07

Posts: 1,191

And the last question, I am using Flash 8 atm, I plan to buy CS4 around my birthday. Can I make this in Flash 8?

RIP Ed McMahon - RIP Farrah Fawcett - RIP Michael Jackson
But wait, there's more...
RIP Billy Mays


None

zenyara

Reply To Post Reply & Quote

Posted at: 1/27/09 08:09 PM

zenyara NEUTRAL LEVEL 13

Sign-Up: 06/17/05

Posts: 1,210

At 1/27/09 05:30 PM, StaliN98 wrote:
At 1/27/09 05:25 PM, 14hourlunchbreak wrote: That looks great, except that you can go through walls.
Yeah, but what would you do for that ability?
Thanks for the comments, I'll be doing textures and then collision, then maybe entity types.
Also, the NG GUI changed when I clicked to post. I'll miss the winter one.

I would reference a boundary map for hit testing. Make an above-view 2D map that corresponds to the 3D map and place the checking on that.

Check out the latest updates:

Toga Games (crew)

BBS Signature

None

Super-Yombario

Reply To Post Reply & Quote

Posted at: 1/27/09 08:11 PM

Super-Yombario FAB LEVEL 06

Sign-Up: 03/16/07

Posts: 1,191

Wow, I would've never thought to use 2D hitTests in a 3D engine... that's an excellent idea.

RIP Ed McMahon - RIP Farrah Fawcett - RIP Michael Jackson
But wait, there's more...
RIP Billy Mays


None

Nano256

Reply To Post Reply & Quote

Posted at: 1/27/09 08:17 PM

Nano256 DARK LEVEL 13

Sign-Up: 02/12/05

Posts: 1,488

At 1/27/09 08:08 PM, Super-Yombario wrote: And the last question, I am using Flash 8 atm, I plan to buy CS4 around my birthday. Can I make this in Flash 8?

Yes you can make this in AS2. Also, to use the built-in 3D effects in CS4, AS3 must be used.

Move on to ActionScript 3.0 already!
The third post below this one is a lie.

BBS Signature

None

Super-Yombario

Reply To Post Reply & Quote

Posted at: 1/27/09 08:31 PM

Super-Yombario FAB LEVEL 06

Sign-Up: 03/16/07

Posts: 1,191

Yeah, I know. I got the CS4 trial. I was actually pretty disappointed, I wanted to utilize that for some cutscenes, but I can't. Although, I guess I can always just make an SWF in AS3 with the 3D motions, and add the SWF to the AS2 FLA?

RIP Ed McMahon - RIP Farrah Fawcett - RIP Michael Jackson
But wait, there's more...
RIP Billy Mays


None

starBlinky

Reply To Post Reply & Quote

Posted at: 1/27/09 08:37 PM

starBlinky NEUTRAL LEVEL 08

Sign-Up: 09/24/04

Posts: 520

holy crap, thats some of the best 3D engine in flash Ive seen yet.

I hope you can make a cool game with it.


None

FrickenHamster

Reply To Post Reply & Quote

Posted at: 1/27/09 11:22 PM

FrickenHamster FAB LEVEL 15

Sign-Up: 07/25/08

Posts: 123

Looks awesome. Seems like there are going to be more and more 3D as the days go by. I already know of 2 completed 3d engines ( + this one) being used for games right now.


None

KynetiK-27

Reply To Post Reply & Quote

Posted at: 1/28/09 12:13 AM

KynetiK-27 NEUTRAL LEVEL 10

Sign-Up: 07/23/06

Posts: 746

Outstanding!

I would concentrate on collisions before textures, as textures could potentially drag it down, while collisions are fundamental to playability. You could make a game without complex textures, but you cant without collisions. Functionality before graphics.

I would say the map overlay technique described above would be the best method for the collisions. Mini-maps are extrememly handy, to the player and the maker =P


None

Patcoola

Reply To Post Reply & Quote

Posted at: 1/28/09 01:33 AM

Patcoola LIGHT LEVEL 47

Sign-Up: 03/07/03

Posts: 2,111

At 1/27/09 05:00 PM, StaliN98 wrote: http://spamtheweb.com/ul/upload/270109/7 8554_main.php

awesome guy, runs very fast, i got 48fps and average 47,48
now you all you need is boundaries

Website | Blog | Buy T-Shirts | Flash | Audio

BBS Signature

None

KaynSlamdyke

Reply To Post Reply & Quote

Posted at: 1/28/09 04:17 AM

KaynSlamdyke LIGHT LEVEL 16

Sign-Up: 06/25/04

Posts: 4,918

Nice raycaster. Smooth as silk. Naturally there are a billion improvements and features you've got to add, but this is as good start on a 3d engine.

Current build for ThreedeeTiles : Monkey
Previous: Lamprey, Mountain Goat (Dead Fork)


None

scottmale24

Reply To Post Reply & Quote

Posted at: 1/28/09 04:30 AM

scottmale24 DARK LEVEL 20

Sign-Up: 08/13/01

Posts: 12,281

God dammit. I stop doing flash for like, two years and now everyone's a billion lightyears ahead of me and I can't even remember how to do for loops.

>:(

Seriously, though. That's a pretty amazing job. I am jealous.

Art thread // Epic Quest! // Webcomic
Sig art by Kosmikophobia

BBS Signature

None

AnalogStick

Reply To Post Reply & Quote

Posted at: 1/28/09 06:52 AM

AnalogStick LIGHT LEVEL 07

Sign-Up: 10/13/06

Posts: 952

CS4 has made 3D much easier and much more useful. However one thing you should know is that this method of 3D is not very efficient. Sure it seems lagless when there are only a few objects, but in a real game, there would be a hell load of more objects to render. How high did you set the max FPS?


None

KaynSlamdyke

Reply To Post Reply & Quote

Posted at: 1/28/09 07:49 AM

KaynSlamdyke LIGHT LEVEL 16

Sign-Up: 06/25/04

Posts: 4,918

At 1/28/09 06:52 AM, AnalogStick wrote: CS4 has made 3D much easier and much more useful. However one thing you should know is that this method of 3D is not very efficient. Sure it seems lagless when there are only a few objects, but in a real game, there would be a hell load of more objects to render. How high did you set the max FPS?

A reminder people. Raycasters have been done well since Flash 8 (and Mode 6 engines were a process a lot of people tried before then). This has nothing to do with CS4 and more to do with the increased speed of AVM2. Nothing to do with CS4 at all - you can all pull off this effect yourself with a copy of Flash 8 and some complex mathmatics

The future goal of course is to make something as fast moving as Andre Michelle's constant forays into actionscript - but an actual game :)

Current build for ThreedeeTiles : Monkey
Previous: Lamprey, Mountain Goat (Dead Fork)


None

StaliN98

Reply To Post Reply & Quote

Posted at: 1/28/09 04:03 PM

StaliN98 LIGHT LEVEL 10

Sign-Up: 07/27/07

Posts: 690

I started work on texturing the walls, but can't get the maths right. I have a 128*128 BitmapData, that is what the wall will be textured with. Each column of pixels finds the desired colour of each pixel by retrieving it from the bitmap with getPixel(x, y). The y is fine, just I can't work out how to find x accurately. Anyway, here it is so far. I tested the engine on a huge detailed map before, and it ran quite quickly. I thought it would slow down alot, but there was hardly any frame rate drop.


None

StaliN98

Reply To Post Reply & Quote

Posted at: 1/28/09 04:10 PM

StaliN98 LIGHT LEVEL 10

Sign-Up: 07/27/07

Posts: 690

No, that was a link to the uploader. Whoops.
Here it is.


None

kris008

Reply To Post Reply & Quote

Posted at: 1/28/09 04:21 PM

kris008 DARK LEVEL 10

Sign-Up: 05/11/07

Posts: 587

its awsome...but walking around with that texture makes me feel a bit dizzy..that would give you a headache after 5 mins.


None

zuperxtreme

Reply To Post Reply & Quote

Posted at: 1/28/09 04:33 PM

zuperxtreme NEUTRAL LEVEL 08

Sign-Up: 01/02/05

Posts: 1,652

Dude, I'm with the guy above. Textures aren't really priority right now. Work on collisions first. Then maybe textures, I'd still work on entities first, though.

BBS Signature

None

StaliN98

Reply To Post Reply & Quote

Posted at: 1/28/09 04:51 PM

StaliN98 LIGHT LEVEL 10

Sign-Up: 07/27/07

Posts: 690

I think I'll try and work out a way to do collisions without using hitTests, that just feels like cheating to me. I'll try and work out a way to check if the player has crossed (or will cross) a line


None

Nuttro

Reply To Post Reply & Quote

Posted at: 1/28/09 05:08 PM

Nuttro LIGHT LEVEL 22

Sign-Up: 04/26/07

Posts: 913

Woah, these textures are tripy. Your gonna fix that later on right?


All times are Eastern Standard Time (GMT -5) | Current Time: 12:44 AM

<< Back

This topic is 9 pages long. [ 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 ]

<< < > >>
You need a Grounds Gold Account to post on the NG BBS! If you don't have one, click here to sign up now! It's fast, free, and easy — and opens up tons of great NG features!