August 23, 2017, 02:26:38 AMLatest Member: sparky222b

Author Topic: HTML5 Canvas Experiments (loosely TH related)  (Read 1994 times)

0 Members and 1 Guest are viewing this topic.

ChrisP

  • Registered member
  • *
  • Posts: 7
    • View Profile
HTML5 Canvas Experiments (loosely TH related)
« on: February 01, 2015, 06:18:47 PM »
This may or may not be of interest to anybody, but I've recently started experimenting in earnest with HTML5 Canvas - in particular finding out what kind of performance you can get with games (before you make the leap to something like WebGL (although that does have limited support)).

It's loosely TH related as I've been using some TH content and may continue to add basic TH functionality, although I have no intention at this point of recreating the game (even aside from the potential for litigation from EA) - anyway you can find the experiment so far here if you're interested.

The code is quite rough and ready as I've been trying a lot of different things to see the effect on performance. There is limited things to do right now, I'm really only looking at the engine at this point. People make their own movement decisions around the 'map', although you can influence one particular person by clicking on the map.

I've been getting a good 60fps with 4000 humans wondering about so I'm quite impressed with the canvas so far!
« Last Edit: February 01, 2015, 06:21:30 PM by ChrisP »

ChrisP

  • Registered member
  • *
  • Posts: 7
    • View Profile
Re: HTML5 Canvas Experiments (loosely TH related)
« Reply #1 on: February 05, 2015, 02:49:50 PM »
Just a small update: added some basic UI elements (using the DOM rather than drawing in the canvas).

I've also included some very rough new features, for example each patient has a name, and is displayed in the UI when you hover over them. The hover over code was only a quick 5min addition and needs massive improvements, it's still a bit fidgety.

I'm working on some basic action handlers for the actors (to make animations and actions easier to manage), creating a basic map (probably be based on the first TH level) and some basic AI.
Please do provide any thoughts and feedback  :)
« Last Edit: February 05, 2015, 06:03:15 PM by ChrisP »

Lego3

  • Project Owner
  • *****
  • Posts: 398
    • View Profile
Re: HTML5 Canvas Experiments (loosely TH related)
« Reply #2 on: February 07, 2015, 10:43:43 AM »
Interesting indeed. :-) When you say AI, what do you mean by that? AI for patient behaviour or AI for a "competitor"?
For the end of the world spell, press Control, Alt, Delete.

ChrisP

  • Registered member
  • *
  • Posts: 7
    • View Profile
Re: HTML5 Canvas Experiments (loosely TH related)
« Reply #3 on: February 08, 2015, 01:40:52 PM »
Interesting indeed. :-) When you say AI, what do you mean by that? AI for patient behaviour or AI for a "competitor"?

Well I was thinking about basic patient behaviour - I assume you mean 'competitor' as in competing hospitals? I believe that's still something absent from CorsixTH?

Lego3

  • Project Owner
  • *****
  • Posts: 398
    • View Profile
Re: HTML5 Canvas Experiments (loosely TH related)
« Reply #4 on: February 10, 2015, 05:39:34 PM »
Yes, it is on our todo list.
For the end of the world spell, press Control, Alt, Delete.

ChrisP

  • Registered member
  • *
  • Posts: 7
    • View Profile
Re: HTML5 Canvas Experiments (loosely TH related)
« Reply #5 on: February 16, 2015, 04:38:45 PM »
Another update  :Dwww.chrispreston.net/gameengine/ I'm sure you can now tell which direction this might be going :p

I still need to create an onClick handler for the destruction of the rats (currently just uses a crude mouseover), and my mouse over still needs a bit of a re-work. Next on the list (aside from the aforementioned) is loading a basic level, drawing walls and different floor tiles.

Edit: UPDATE!!

This new version now supports level loading and very nearly wall drawing (the walls are running locally, but need some optimisation before I'm going to upload). I have removed (temporarily of course) rat destruction.

This version can be found at  www.chrispreston.net/gameengine2/

« Last Edit: February 18, 2015, 12:52:17 AM by ChrisP »

godboko

  • Registered member
  • *
  • Posts: 17
    • View Profile
Re: HTML5 Canvas Experiments (loosely TH related)
« Reply #6 on: June 13, 2016, 09:48:31 PM »
Sorry for the old bump, but this is pretty cool to me.
- Godboko

MarkL

  • Community Manager
  • ****
  • Posts: 359
    • View Profile
Re: HTML5 Canvas Experiments (loosely TH related)
« Reply #7 on: June 15, 2016, 11:30:32 AM »
No updates from Chris in over a year!

Are you still working on this Chris as I think it has great possibilities and could become an online multiplayer version?