Kobaltic Posted August 30, 2014 Share Posted August 30, 2014 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 PhaserWalls are sprite images (sprite.key)Minimap supports spritesSupports tilemaps in json or csv (csv must be a perfect square)Movement is handled by Phaser What isn't phaser:GeometeryCollision 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/ jdnichollsc and Tom Atom 2 Link to comment Share on other sites More sharing options...
sfcal99 Posted August 30, 2014 Share Posted August 30, 2014 Works on mobile? I tested it on safari and chrome it shows a black screen ... Link to comment Share on other sites More sharing options...
rich Posted August 30, 2014 Share Posted August 30, 2014 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 Link to comment Share on other sites More sharing options...
Kobaltic Posted August 30, 2014 Author Share Posted August 30, 2014 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 More sharing options...
Sebi Posted August 30, 2014 Share Posted August 30, 2014 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 More sharing options...
JUL Posted August 30, 2014 Share Posted August 30, 2014 That's nice, really nice. A suggestion if I may ? Possibility to set a cpu friendly mode.ieInstead 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 More sharing options...
Kobaltic Posted August 30, 2014 Author Share Posted August 30, 2014 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.ieInstead 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 More sharing options...
Sebi Posted August 30, 2014 Share Posted August 30, 2014 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 More sharing options...
Binary Moon Posted August 30, 2014 Share Posted August 30, 2014 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 More sharing options...
Kobaltic Posted August 30, 2014 Author Share Posted August 30, 2014 It is going to GitHub. I just want to clean the code up a little first. Tilde and Binary Moon 2 Link to comment Share on other sites More sharing options...
oddskill Posted August 30, 2014 Share Posted August 30, 2014 Thank you Kobaltic.Nice code,Goes straight into my lib folder,for the case that i needto do raycasting some day. Link to comment Share on other sites More sharing options...
Kobaltic Posted August 30, 2014 Author Share Posted August 30, 2014 Thank you Kobaltic.Nice code,Goes straight into my lib folder,for the case that i needto do raycasting some day. Thanks but you might want to get the one I post on Github soon, as it will be cleaner. Link to comment Share on other sites More sharing options...
oddskill Posted August 30, 2014 Share Posted August 30, 2014 yeah i plan to do that, i wil download it there when its up,tyvm Link to comment Share on other sites More sharing options...
gaelbeltran Posted August 15, 2015 Share Posted August 15, 2015 Hello, just wondering if you ever published the code on github @Kobaltic Link to comment Share on other sites More sharing options...
Tom Atom Posted August 16, 2015 Share Posted August 16, 2015 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.basIn 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! gaelbeltran 1 Link to comment Share on other sites More sharing options...
Kobaltic Posted November 28, 2015 Author Share Posted November 28, 2015 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. gaelbeltran 1 Link to comment Share on other sites More sharing options...
Recommended Posts