Jump to content

Phaysercast V1.0 WIP


Kobaltic
 Share

Recommended Posts

EDIT: Here is the link on github. It isn't perfect and it is a port from another JS raycast engine. The credits can be found in the pages.

https://github.com/kobaltic/PhaserCast

 

So this is Phaysercast. It is a raycast engine done in Phaser. Almost everything is done through Phaser. The little bit that isn't will be in the next update or two. It is a WIP at the moment. I will release the source code shortly. Needs some cleaning.

 

Features:

Renders in Phaser

Walls are sprite images (sprite.key)

Minimap supports sprites

Supports tilemaps in json or csv (csv must be a perfect square)

Movement is handled by Phaser

 

What isn't phaser:

Geometery

Collision

 

Collision is currently handled by using a 0 as walkable, anything else isn't. I am going to add in Phaser collision. I just have one kink left to work out then it should be good to go.

 

To play use the arrow keys or the keys on the screen. Use the 'm' key to toggle the minimap.

http://www.kobaltic.com/raycast/

Link to comment
Share on other sites

Works on mobile? I tested it on safari and chrome it shows a black screen ...

 

I fixed it for chrome, I can't test safari so let me know. It does run really slow on the mobile. Will work on performance.

 

Very nice :) There's no collision in your demo though, right? because I could walk right through the walls. But it looked neat all the same! Ought to get a Wolfenstein level in there :)

 

You tried it during the 1 minute where I had a version up without collision. Collision is back in. I got to get the moving doors first for Wolfenstein.

Link to comment
Share on other sites

Hm, I can't walk through the walls, so there must be some collision detection. 
Also it doesn't seem to catch all keyup events. Sometimes my character keeps spinning in one direction until I press that arrow key again to fire another keyup.

Link to comment
Share on other sites

That's nice, really nice.

 

A suggestion if I may ?

 

Possibility to set a cpu friendly mode.

ie

Instead of calculating each steps, it only calculate steps on a fixed interval, on keyboard or mouse input only for instance.

Dont know if I make my self clear...

 

The end result would aim at an eye of the beholder/dungeon master/Ishar style, here's a video if you've never heard of those

 

No Idea how this type of engine is called, but I guess you can achieve pretty much the same result with a raycaster, at least close enough, and it would be more cpu friendly

Link to comment
Share on other sites

Hm, I can't walk through the walls, so there must be some collision detection. 

Also it doesn't seem to catch all keyup events. Sometimes my character keeps spinning in one direction until I press that arrow key again to fire another keyup.

 

Are you using the arrow keys on screen? There is a slight issue if you click the arrow then move quickly off the Phaser canvas. I need to fix the spacing to correct that issue.

 

That's nice, really nice.

 

A suggestion if I may ?

 

Possibility to set a cpu friendly mode.

ie

Instead of calculating each steps, it only calculate steps on a fixed interval.

Dont know if I make my self clear...

 

The end result would aim at an eye of the beholder/dungeon master/Ishar style, here's a video if you've never heard of those

 

No Idea how this type of engine is called, but I guess you can achieve the same result with a raycaster, at least close enough, and it would be more cpu friendly

 

I grew up on those type of games. I actually did start to make one of those but I wanted a full raycast. They display 13 images on the screen. 3 angles to each side, up, down, left and right then one for the back. They are extremely fast do to the little bit of rendering needed. Although since raycast engines worked on rigs from the '90s I should be able to get it to work at a good speed on a modern day cell phone.

Link to comment
Share on other sites

Are you using the arrow keys on screen? There is a slight issue if you click the arrow then move quickly off the Phaser canvas. I need to fix the spacing to correct that issue.

 

I was using my keyboard. I have no idea how that happened tho.

Can't really reproduce the issue right now.

Link to comment
Share on other sites

This looks really nice. Would be great if it was added to Github so others could contribute (although I don't know if I'm good enough to be able to).

 

Not sure what I would do with it but I quite like the style. With some nice artwork it could make a fun game.

 

I think the old-school rpg maze game would be quite a nice thing to make, I never used to like them because of the instant jumping from location to location but with a semi 3d engine like this you'd be able to create smooth transitions which would look much nicer - and make it easier to keep track of where you are!

Link to comment
Share on other sites

  • 11 months later...

Very nice!

 

Long time ago I wrote raycasting engine for Symbian. Great help for me was very old basic source code by Ken Silverman (the guy who created Build engine for Duke Nukem 3D and other good old games): http://www.advsys.net/ken/klab/labdemo2.bas

In your code you are testing whether player is facing horizontally or vertically before ray is cast. Wolfenstein is testing horizontal and vertical intersections separetely. Ken's source is very small and elegant.

 

By the way - there is also real gem hidden on his site. In this file: http://advsys.net/ken/builgrid.zip you can find one of early versions of Build engine ... grid based. But inside the .zip, there is also basic source for sector engine with non-grid walls!

Link to comment
Share on other sites

  • 3 months later...

Updated first link with the github repository. It is still a work in progress. It still stinks on mobile. I took out the sprites from the minimap as I couldn't get them to disappear when the minimap was turned off (the code is still there just commented out). I was trying to use phaser physics to handle collision by the way of the minimap but I haven't been able to get it to work. The code has little comments. I am not fully supporting this ATM but can answer some questions.

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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