Impact

This forum is read only and just serves as an archive. If you have any questions, please post them on github.com/phoboslab/impact

1 decade ago by MikeMc

I am evaluating different frames and am really impress with Impact, but would like to have a few questions answered before I would be willing to drop a bill on it.

I am looking at developing a game that will spawn hundreds or even thousands of entities on a single environment. How well does impact scale with a high number of entities interacting with each other, how many total entities can impact handle on a common machine?

Also I have searched for information regarding persistant mmo worlds using impact, has anyone tried this or had success with it?

The long term goal would be having a persistant world populated with entities that have AI that interact with other AI entities.

Thanks for your time.
-Mike

1 decade ago by MikeMc

This is in the wrong forum. sorry - please move it :)

1 decade ago by dominic

The bottleneck is the drawing performance. How many entities can be drawn at the same time depends very much on the browser you're using.

Compare X-Type with WebGL vs. X-Type with Canvas2D. IE9 (the only browser without WebGL support) does a pretty good job with the Canvas2D version. Canvas2D is a bit slower in other browsers, but they have WebGL, which is way faster than IE9's canvas still.

To be clear: the WebGL support in X-Type is achieved with the WebGL-2D lib - it's not part of Impact.

I'd say on a typical machine you should be able to draw about 300 entities with an acceptable frame rate in any browser without WebGL. Collision detection and everything else scales well with high numbers of entities.


Impact doesn't have any networking build in, but nothing is stopping you from using WebSockets and any server side technology you want either.

Be aware though, that an MMO is the most complicated thing you could try to build - regardless of the tools you're using. I suggest you start smaller :)

1 decade ago by Graphikos

I had similar needs for my project and quickly found that having too many entities is a performance nightmare. Like Dominic said the bottleneck is drawing which is more of a limitation of HTML5 rather than with the Impact engine.

With some creative coding I've switched from using a lot of entities to doing more direct interactions with the canvas context. Doing this I'm able to achieve upwards to 3,000 draws with little drop in performance. This is using the hardware acceleration with Chrome... so once again it all depends on browser and hardware. I expect performance to keep improving in every browser and devices.

Here is a benchmark I found interesting when I first started playing with Impact:
http://www.phoboslab.org/crap/notjsgamebench/

=D

1 decade ago by fugufish

@Graphikos awesome! what type of creative coding specifically ? Could you open source it to ImpactJS-ers?

1 decade ago by Graphikos

Maybe it's not so much creative as it is just optimizing the hell out of the code. I was happy to shave 1-2ms off the draw time because every bit counts. There are a lot of tips out there for drawing to canvas. Some I haven't had a chance to really benchmark. Things such as using globalAlpha vs rgba() to apply alpha, drawRect vs fillRect vs drawImage, caching to off-screen canvases, using doubles vs whole numbers for positioning.. etc etc.

Overall though I'm still struggling with performance a bit but, like I said, I hope over time the browsers will solve some of it. The performance of 2D canvas has seen tremendous improvement even over the last 6 months.

=D
Page 1 of 1
« first « previous next › last »