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 yatayata

hi -

was wondering if anyone has used node.js instead of the php server for just serving up whatever is needed for weltmeister?

there seem to be some threads here to do with using socket.io and node for multiplayer games, impsock etc, but i just need the much more basic case where i can dump apache/php.

if nothing is done already, is there a spec on what weltmeister needs, or is it a case of decoding the lovely php inside api/*.php , like:

$globs = is_array($_GET['glob']) ? $_GET['glob'] : array($_GET['glob']);

thanks!

/dc

1 decade ago by yatayata

turned out to be a temporary entity file. seems like the editor hoovers up everything in the directory, whereas the runtime only does as requested by the game.

1 decade ago by dominic

Conner Petzold ported Weltmeister's backend to node. It's on Github: https://github.com/cpetzold/node-impact

Btw: this line
$globs = is_array($_GET['glob']) ? $_GET['glob'] : array($_GET['glob']);

makes sure that $globs is an array, as you can modify your lib/weltmeister/config.js to load entities from several directories:
'entityFiles': ['lib/game/entities/*.js', 'lib/some/other/dir/*.js'],

1 decade ago by explor3r

I had the same issue and did try out node-impact but ended up having issues (PHP errors continued to crop up in Chrome Developer Tools debugging..) I am not sure if this is a version-incompatibility issue (I am using Impact-1.21).

I did find another github project that rebuilt Weltmeister as a Node service.
https://github.com/namuol/node-impact-weltmeister

This one worked for me for simple examples though I am yet to dive into more complex usage.

1 decade ago by drhayes

Heh. That would've been helpful to find before I started building it, too: https://github.com/drhayes/impact-dev-server

I wanted something that was as simple as http-server but I could use it globally across my system; no drop-ins to existing node apps.

1 decade ago by Jaha

Yea I just extended node-impact to work using an express app that just loads the game assets from the "public directory" so you can access your game/wm at http://localhost:PORT/game1/ or http://localhost:PORT/game2/wm. Hopefully ill get a chance to post to github soon.

8 years ago by Bum

I've produced a full nodejs impact solution here:
http://impactjs.com/forums/code/f-l-a-r-e-development-suite-for-impact

Note, you need to buy an impact license to launch the game as the {/lib/impact} files are not provided
Page 1 of 1
« first « previous next › last »