First person engine

Discussion and feedback on Construct 2

Post » Mon Dec 15, 2014 6:43 am

Hello,
I created first person engine based on DOOMs vector calculation - example in picture. I want to find someone who made it too to exchange experiences. I have implemented optimization to not render hidden objects, collisions and "billboard" objects (allways face to player) representating enemy player (they have own direction vector with 8 different textures).

I am disappointed because of C2 speed. But maybe someone discover better (faster) solution.

I wanted to upload Node-Webkit example but DEMO not allow it and export to HTML fail because of minification. C2 v190 is broken and even when I have installed java 8, minification failed. Older C2 versions have no problems. So only picture is attached.

PM me if you want.

Thx.
You do not have the required permissions to view the files attached to this post.
B
4
S
1
Posts: 56
Reputation: 462

Post » Mon Dec 15, 2014 6:56 am

Well, I don't know the first thing about this, but I'm interested in how you did it. Is this all event based? Or are you using the q3D plugin?

updated-q3d-v-2-0-plugins_t106677
Don't lose your work. Backup your game with Dropbox.
B
44
S
10
G
10
Posts: 1,106
Reputation: 9,202

Post » Mon Dec 15, 2014 7:01 am

Event based + Math
B
4
S
1
Posts: 56
Reputation: 462

Post » Mon Dec 15, 2014 8:06 pm

You can look here for a few implementations:
pseudo-3d_t69895?&hilit=raycast

I have a computer that doesn't like html5 so the performance wasn't nice enough to pursue further.

I've also made an attempt at 3d that leverages c2's renderer more using a plugin, but the z-sorting proves to be very complex.
suggestion-simple-3d-objects_t92497
B
94
S
33
G
114
Posts: 5,360
Reputation: 73,781

Post » Mon Dec 15, 2014 8:31 pm

hes using raycasting, basically shooting rays for each vertical bar, saving the distance to each bar, using that to scale the bar vertically, and using the position along the face of the tile to choose what to use as the texture for that bar.
B
79
S
13
G
8
Posts: 1,977
Reputation: 9,947

Post » Mon Dec 15, 2014 9:23 pm

Wow, these event based engines are murder on the cpu... for R0J0hound's event based example (raycast4.capx), I get 10fps and 90% cpu on an i5 3570k. :shock:
Don't lose your work. Backup your game with Dropbox.
B
44
S
10
G
10
Posts: 1,106
Reputation: 9,202

Post » Mon Dec 15, 2014 9:44 pm

Considering Doom and Wolfenstein 3D ran decent on computers with 1/100th the computing power of today's pc's I'd say some major bottlenecks are being encountered.
B
94
S
33
G
114
Posts: 5,360
Reputation: 73,781

Post » Mon Dec 15, 2014 9:56 pm

Doom uses BSP's , and im not sure about how you implemented raycasting, but wolfenstein/effecient raycasters use a hashing scheme that can very quickly determine collisions in a uniform grid.
B
79
S
13
G
8
Posts: 1,977
Reputation: 9,947

Post » Mon Dec 15, 2014 11:09 pm

BSP's would need to be generated first but even then the drawing performance isn't there on my pc with html5. Also agreed a uniform grid would be faster, but it is also is less interesting.
B
94
S
33
G
114
Posts: 5,360
Reputation: 73,781

Post » Tue Dec 16, 2014 6:13 am

Thanks R0J0hound for link to Wolfenstein engine. If you will just draw walls, you can save some fps if all will be grid based (same height / width all time) with 90° angles. I use almost same like raycasting4 example but not use Array and have billboard polygons representation enemies.
B
4
S
1
Posts: 56
Reputation: 462

Next

Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 7 guests