Author Topic: Work in progress: HTML5 canvas-based 2.5D landscape engine  (Read 6873 times)

Offline andrewjbaker

  • Level 17
  • *
  • Posts: 154
  • Reputation: +2/-0
    • View Profile
    • Fleeting Fantasy
Re: Work in progress: HTML5 canvas-based 2.5D landscape engine
« Reply #50 on: June 15, 2011, 07:20:30 PM »
Work on Fleeting Fantasy and Steppe (the HTML5 canvas 2.5D landscape renderer) continues apace.

With Harkins' adoption of Steppe for Oaqn, you can rest assured that Steppe ain't gonna' fizzle out anytime soon.

Chris described FF as my 'insane game'... well things are getting even more insane now:

Steppe is being ported to PHP!

WTF? Let me explain...

HTML5 encourages the notion of a plug-in free Web and with Steppe I'm taking that to the extreme. What if someone's using a browser that doesn't support HTML5 canvas? Or their hardware isn't particularly powerful? Have no fear, images can be rendered server-side using the PHP version! :)

The port is a proof-of-concept at the moment and it'll shortly be entering a testing phase. Just like the JS version of Steppe (https://github.com/andrewjbaker/Steppe) it'll be made available on GitHub and free for all to use.

Watch this space. ;)
Currently working on an HTML5 canvas 2.5D landscape renderer and a PBBG that uses it (http://fleetingfantasy.com/). The development blog's at http://fleetingfantasy.wordpress.com/.
What are BBGameZone members working on? See the game list.
irc.freenode.net, #bbg

Offline Harkins

  • Level 28
  • **
  • Posts: 424
  • Reputation: +11/-2
  • Coder, blogger, entrepreneur.
    • View Profile
    • Push CX - Blog
Re: Work in progress: HTML5 canvas-based 2.5D landscape engine
« Reply #51 on: June 15, 2011, 08:32:07 PM »
If someone is using a browser that doesn't support canvas you tell them to step up. PHP, man, ew...

Visit #bbg on irc.freenode.net to talk browser games anytime.

Offline andrewjbaker

  • Level 17
  • *
  • Posts: 154
  • Reputation: +2/-0
    • View Profile
    • Fleeting Fantasy
Re: Work in progress: HTML5 canvas-based 2.5D landscape engine
« Reply #52 on: June 15, 2011, 08:39:26 PM »
LOL. There's a little more to it than just PHP... but let's get the proof-of-concept out of the way first, eh? ;)

Plus, given my employer, I'm kinda' obliged to keep the PHP end up, LMAO.
Currently working on an HTML5 canvas 2.5D landscape renderer and a PBBG that uses it (http://fleetingfantasy.com/). The development blog's at http://fleetingfantasy.wordpress.com/.
What are BBGameZone members working on? See the game list.
irc.freenode.net, #bbg

Offline Chris

  • Game Owner
  • Level 35
  • *
  • Posts: 2,217
  • Reputation: +28/-1
    • View Profile
Re: Work in progress: HTML5 canvas-based 2.5D landscape engine
« Reply #53 on: June 16, 2011, 03:38:34 AM »
Plus, given my employer, I'm kinda' obliged to keep the PHP end up, LMAO.
So there really is justice in this world :D

Offline andrewjbaker

  • Level 17
  • *
  • Posts: 154
  • Reputation: +2/-0
    • View Profile
    • Fleeting Fantasy
Re: Work in progress: HTML5 canvas-based 2.5D landscape engine
« Reply #54 on: June 20, 2011, 03:43:43 PM »
I'm almost in a position to release the PHP port of Steppe. I have successfully replicated all of Steppe's functionality server-side.

Here's a sexy screenshot:


Erm, before you ask... no, the PHP version isn't fast. But there are plans to create a PHP extension (written in C++) which should greatly increase rendering speed. The initial port is a proof-of-concept and I think it's fair to say that the concept has been proved. ;)
Currently working on an HTML5 canvas 2.5D landscape renderer and a PBBG that uses it (http://fleetingfantasy.com/). The development blog's at http://fleetingfantasy.wordpress.com/.
What are BBGameZone members working on? See the game list.
irc.freenode.net, #bbg

Offline andrewjbaker

  • Level 17
  • *
  • Posts: 154
  • Reputation: +2/-0
    • View Profile
    • Fleeting Fantasy
Re: Work in progress: HTML5 canvas-based 2.5D landscape engine
« Reply #55 on: June 21, 2011, 07:45:15 PM »
As promised, the PHP port of Steppe has been pushed to GitHub! Grab it at https://github.com/andrewjbaker/Steppe.
Currently working on an HTML5 canvas 2.5D landscape renderer and a PBBG that uses it (http://fleetingfantasy.com/). The development blog's at http://fleetingfantasy.wordpress.com/.
What are BBGameZone members working on? See the game list.
irc.freenode.net, #bbg

Offline andrewjbaker

  • Level 17
  • *
  • Posts: 154
  • Reputation: +2/-0
    • View Profile
    • Fleeting Fantasy
Re: Work in progress: HTML5 canvas-based 2.5D landscape engine
« Reply #56 on: July 11, 2011, 07:50:11 PM »
Steppe, and by extension Fleeting Fantasy, has got sprites! Near-correctly rendered sprites too, I hasten to add.

Check out this screenshot:


Got an HTML5-capable browser? Then go one better, check out the updated FF demo!

Expect the GitHub repo for Steppe to be updated in the next couple of days. Following that, expect sprites to be added to the server-side PHP renderer.

Remember, it's there if ya' wanna' make use of it. And I'm on-hand if you have any questions. ;)
Currently working on an HTML5 canvas 2.5D landscape renderer and a PBBG that uses it (http://fleetingfantasy.com/). The development blog's at http://fleetingfantasy.wordpress.com/.
What are BBGameZone members working on? See the game list.
irc.freenode.net, #bbg

Offline StudioFortress

  • Level 3
  • *
  • Posts: 6
  • Reputation: +1/-0
    • View Profile
Re: Work in progress: HTML5 canvas-based 2.5D landscape engine
« Reply #57 on: August 05, 2011, 01:50:56 PM »
Very nice. You might want to split the work up so it is run across multiple functions, using a setTimeout with 0. When the page first shows the whole page freezes for quite a while, and this will solve that. It'll also prevent any "do you want to stop this script?" dialogues popping up.

Offline andrewjbaker

  • Level 17
  • *
  • Posts: 154
  • Reputation: +2/-0
    • View Profile
    • Fleeting Fantasy
Re: Work in progress: HTML5 canvas-based 2.5D landscape engine
« Reply #58 on: August 06, 2011, 04:03:48 PM »
Ah, yeah... it does that. The JS compositor (used to composite the heightmap and textures together to form the texturemap) is quite slow. Unfortunately, it's all encapsulated in Steppe.

But, for Fleeting Fantasy I plan on having already pre-composited the texturemaps server-side so it won't be an issue eventually.

I'm glad you liked it dude.

Today, I've been adding shadows to the 2D sprites to give them a feeling of 'volume'...


Hopefully the live demo will be updated tomorrow.
Currently working on an HTML5 canvas 2.5D landscape renderer and a PBBG that uses it (http://fleetingfantasy.com/). The development blog's at http://fleetingfantasy.wordpress.com/.
What are BBGameZone members working on? See the game list.
irc.freenode.net, #bbg

Offline StudioFortress

  • Level 3
  • *
  • Posts: 6
  • Reputation: +1/-0
    • View Profile
Re: Work in progress: HTML5 canvas-based 2.5D landscape engine
« Reply #59 on: August 08, 2011, 02:55:57 AM »
I also had a quick look at some of your rendering code. One thing I noticed is that you work with a lot of your colours as objects containing separate red, green, blue components; if you pack them into a 32-bit int instead you should receive a speed-boost. You can pack them in, and get them out, using bit-shifts and ORs, which is much cheaper then object creation + getting and setting properties. You will also be able to perform faster pixel manipulation techniques, such as faster alpha calculations, by taking advantage of bit-masks and bit-twidling.

For the highest quality setting, you could also take advantage of the pixel manipulation methods on the canvas. They allow you to get the pixel data out (which you'd only need to do once), set the new pixel values (instead of drawing a small rectangle), and then just put the data straight into the canvas. For the highest quality setting, it means drawing a 1x1 rectangle + setting the colour + string concatonation (for the rgb string) is replaced with just a single array write (and the ImageData object might use a typed array, which is even faster). It might also be faster for the medium quality level too, where you draw 2x2 rectangles.

Given that those optimizations would be multiplied across tonnes of iterations, the speed up could be quite significant.

Offline andrewjbaker

  • Level 17
  • *
  • Posts: 154
  • Reputation: +2/-0
    • View Profile
    • Fleeting Fantasy
Re: Work in progress: HTML5 canvas-based 2.5D landscape engine
« Reply #60 on: August 09, 2011, 06:18:26 AM »
Ha, excellent. I'll defo explore these ideas. ;)
Currently working on an HTML5 canvas 2.5D landscape renderer and a PBBG that uses it (http://fleetingfantasy.com/). The development blog's at http://fleetingfantasy.wordpress.com/.
What are BBGameZone members working on? See the game list.
irc.freenode.net, #bbg

Offline StudioFortress

  • Level 3
  • *
  • Posts: 6
  • Reputation: +1/-0
    • View Profile
Re: Work in progress: HTML5 canvas-based 2.5D landscape engine
« Reply #61 on: August 09, 2011, 12:44:10 PM »
You might find some of those optimizations, individually, double or even quadruple performance. Although what you are doing is expensive, IMHO there really isn't any reason why the highest quality version couldn't be gotten down to rendering within 500ms.

Offline andrewjbaker

  • Level 17
  • *
  • Posts: 154
  • Reputation: +2/-0
    • View Profile
    • Fleeting Fantasy
Re: Work in progress: HTML5 canvas-based 2.5D landscape engine
« Reply #62 on: September 02, 2011, 07:52:42 PM »
Steppe, Fleeting Fantasy's renderer, now has a real-time Mars demo that implements a lot of the suggestions kindly proffered by StudioFortress. Many thanks guys.

Check it out: Mars Demo
Currently working on an HTML5 canvas 2.5D landscape renderer and a PBBG that uses it (http://fleetingfantasy.com/). The development blog's at http://fleetingfantasy.wordpress.com/.
What are BBGameZone members working on? See the game list.
irc.freenode.net, #bbg

Offline Mufasa

  • Game Owner
  • Level 18
  • *
  • Posts: 189
  • Reputation: +3/-0
  • Maniac Developer
    • View Profile
Re: Work in progress: HTML5 canvas-based 2.5D landscape engine
« Reply #63 on: September 02, 2011, 07:54:23 PM »
Steppe, Fleeting Fantasy's renderer, now has a real-time Mars demo that implements a lot of the suggestions kindly proffered by StudioFortress. Many thanks guys.

Check it out: Mars Demo

it doesn't fully capture my keystrokes. In firefox I have it set to start searching when I type a key on the page, so I've got it entering a million W's lol

Offline andrewjbaker

  • Level 17
  • *
  • Posts: 154
  • Reputation: +2/-0
    • View Profile
    • Fleeting Fantasy
Re: Work in progress: HTML5 canvas-based 2.5D landscape engine
« Reply #64 on: September 02, 2011, 08:44:01 PM »
Ha, ha... OK. Let's hope you're the exception. ;) Thx for looking Mufasa.
Currently working on an HTML5 canvas 2.5D landscape renderer and a PBBG that uses it (http://fleetingfantasy.com/). The development blog's at http://fleetingfantasy.wordpress.com/.
What are BBGameZone members working on? See the game list.
irc.freenode.net, #bbg

Offline Marek

  • Level 18
  • *
  • Posts: 177
  • Reputation: +7/-0
  • XHTML, CSS, JS, PHP and MySQL are my pantheon.
    • View Profile
Re: Work in progress: HTML5 canvas-based 2.5D landscape engine
« Reply #65 on: September 03, 2011, 02:17:17 PM »
Nice, runs very smoothly

Offline andrewjbaker

  • Level 17
  • *
  • Posts: 154
  • Reputation: +2/-0
    • View Profile
    • Fleeting Fantasy
Re: Work in progress: HTML5 canvas-based 2.5D landscape engine
« Reply #66 on: September 09, 2011, 05:31:19 AM »
Coloured fog now added to Steppe. http://steppe.fleetingfantasy.com/
Currently working on an HTML5 canvas 2.5D landscape renderer and a PBBG that uses it (http://fleetingfantasy.com/). The development blog's at http://fleetingfantasy.wordpress.com/.
What are BBGameZone members working on? See the game list.
irc.freenode.net, #bbg

 


SimplePortal 2.3.3 © 2008-2010, SimplePortal