Maybe a 3D stencyl game instead?

ceosol

  • *
  • Posts: 2279
<a href="http://static.stencyl.com/games/30171-0.swf" target="_blank" class="new_win">http://static.stencyl.com/games/30171-0.swf</a>
******************************
enter/return shoots bullets
right and left arrow strafe you
up and down move your forwards and backwards
Z and X turn you left and right
******************************

Original post:
I started playing around with this a couple of hours ago. It all glitches when the wall goes partially or fully behind you. I'm trying to think of how to use cross-product calculations to stop or partially stop the wall from rendering. Tomorrow is another day :)

« Last Edit: April 12, 2015, 09:18:04 pm by ceosol »

ceosol

  • *
  • Posts: 2279
Updated. Z and X strafe can be used to strafe left and right, respectively. I have it stop rendering when the wall is behind you. I also almost have the left clip plane figured out. Once I have that, I'll just mimic it on the right side. I also centered it more.

I slowed it down so it is easier to maneuver.

ceosol

  • *
  • Posts: 2279
So if you are at zero  in the z-coordinate on the left side of the wall, everything seems to render correctly strafing right and left. If you take a step forward, it jumps. The x coordinate becomes very negative very quickly (hundreds to thousands negative every step). Anybody have ideas on what I might try to compensate?

ceosol

  • *
  • Posts: 2279
There's a minimap to help judge where you are. I noticed a problem with turning. The wall was turning more than the player was. I compensated for that a little.

The left clip plane is fixed a somewhat. I removed the left wall line for when it is behind you. Although, it still jumps wildly in-between 1 and -1 on the Z-axis. I now need to compensate for when the right side of the wall is past mid screen. It moves faster than the left side of the wall and leaves a skewed projection.

I want to build a box on the floor, but I think I should wait until I have the clip plane fixed :)

ceosol

  • *
  • Posts: 2279
I added a ball. :)

Edit: Just put the ball approximately on the minimap. I don't think I'll have full-fledged 3D engine set up, but I might be able to pull off a temple run or something.

« Last Edit: March 21, 2015, 02:06:14 pm by ceosol »

Almakos

  • Posts: 632
this is actually pretty cool! are you using approaches which been present in old games prior to full fledged 3D graphics?
if you want temple run you better get a 3D engine. This approach might work for a racing game though.

Anyway, quite impressive bit of work! =)
Fishing Fantasy Trailer


ceosol

  • *
  • Posts: 2279
I changed it up some. You can now only move right and left. I haven't quite figured out up and down. The game comes at you pretty fast, so refresh and get ready to hit the left arrow.

The goal will be to enter all of the rings of balls (or whatever). I'm close to figuring out ring respawn. It is difficult to say where exactly in the Z coordinates something should appear. I may just have to have separate behaviors for each spawn. I'd rather have it loop, but I might not figure it out in the next couple of months.

MyChairHasALooIn

  • Posts: 310
I drove myself nuts trying to make stencyl do 3D, then went and played with unity for a bit.

Which isn't to say I had no success, but as soon as there's enough objects in the scene to make it look interesting, say goodbye to any pretence of running at a reasonable number of FPS.  I  wish you luck sir.

(I've done fully 3d rotateable wireframe,  textured objects, lighting effects/fog all in stencyl, nothing playable came out of any of it)

ceosol

  • *
  • Posts: 2279
but as soon as there's enough objects in the scene to make it look interesting, say goodbye to any pretence of running at a reasonable number of FPS. 

As you can see, the ring is only rendered when you are 30 away on the z axis (not that you can see the z axis number). When you hit the same z-plane as the ring, it is destroyed. 3D engines make and destroy objects constantly. So if we are using stencyl for 3D, we have to do the same, but manually.

t4u

  • Posts: 418
USE PICTURES WHEN YOU ASK SOMETHING!
If I helped you be sure to mention it in your game.

Tutorials + downloads:
http://t4upl.blogspot.com/

ceosol

  • *
  • Posts: 2279
I just figured out something for ball respawn. The z positioning is calculated off of the 2-dimensional position of the player. So if I want the balls to respawn, I shouldn't change the z-position of the balls, I should change the 2D position of the player. Viola! Balls respawn now. I even gave them a random x component on screen, so they are in different spots.

This is an endless "runner" now.  Still need to work on up and down on the screen.

ceosol

  • *
  • Posts: 2279
I made up something quick to show the game as a possible endless flyer.

Almakos

  • Posts: 632
To be honest, with that rectangular wall it was far more impressive )))
But let's see where you land, good luck! ;)
Fishing Fantasy Trailer


ceosol

  • *
  • Posts: 2279
If someone can figure out how I can write this to find the intersect of the line with the field of vision, I'll go back to the room. :)  I am neither a mathematician nor a computer scientist, so I don't have a clue.

 typedef Point =
{
    var x:Float;
    var y:Float;
}

public static inline function cross(p0:Point, p1:Point) : Float
    {
        return p0.x*p1.y - p0.y*p1.x;
    }

ceosol

  • *
  • Posts: 2279
As per Almakos's request, I have gone back to trying the other 3D version. I still don't know how to do the cross product for figuring out clip plane, but I was able to figure out more walls, floor and ceiling. Here's a screenshot.

« Last Edit: April 06, 2015, 02:38:59 pm by ceosol »