doggan / diablogl

A re-implementation of Diablo 1 for the web.
MIT License
23 stars 0 forks source link

how to run game with diabdat.mpq? #8

Open mewmew opened 7 years ago

mewmew commented 7 years ago

Hi Shyam,

It's a really cool project that you've been playing with. Path finding and TMX loading seems to be working well.

I got it up running using the OpenGameArt assets that you had included with the v0.2 release, and that worked great!

diablogl screenshot

How do you get it running locally using assets from diabdat.mpq?

We've been playing around with similar ideas of using TMX as a basic for the Diablo 1 maps, and have a proof of concept at https://github.com/sanctuary/spark

The approach we've taken to handle assets is to extract them locally and convert them into suitable file formats. The user is still required to own a legal copy of DIABDAT.MPQ, but other than that, the game engine isn't even aware of any of the ancient file formats. All the file format conversion is handled by a preprocess stage (i.e. https://github.com/sanctuary/spark/blob/master/_scripts_/opensourceami/main.go).

I'd be interested to hear what your plans are for DiabloGL going forward, and if you'd be interested in collaborating in one way or another :) If you want to use a TMX for the first dungeon level, have a look at https://github.com/sanctuary/spark/blob/master/tiled/cathedral/cathedral_00000000.tmx

It is the first level of the Cathedral, using seed 0x00000000.

Hope to hear back from you!

Cheers /u & i

doggan commented 7 years ago

Robin -

To run DiabloGL with the the mpq, please see instructions for v0.1 (https://github.com/doggan/diablogl/releases/tag/v0.1.0). The mpq-server project serves assets from the mpq to the DiabloGL client. In this version, you can walk around part of town and attack an enemy. This version doesn't use TMX.

v0.2 of DiabloGL (the version you tried, and latest master) is a re-write and had a more ambitious goal to do something similar to what you did with spark, but for the web. Eventually, the plan was to make a moddable 'engine' built on Phaser, with one of the mods being vanilla D1. This version uses TMX for the level formats, but due to time constraints, it doesn't incorporate the D1 assets/mpq the same as v0.1 yet.

Awesome work with sanctuary/spark. I will check it out more later.

Btw, are you able to dynamically generating dungeons right now, or is the cathedral TMX static? edit: Ah, nevermind. I think I see what you're doing now.

mewmew commented 7 years ago

Robin -

To run DiabloGL with the the mpq, please see instructions for v0.1 (https://github.com/doggan/diablogl/releases/tag/v0.1.0). The mpq-server project serves assets from the mpq to the DiabloGL client. In this version, you can walk around part of town and attack an enemy. This version doesn't use TMX.

I wanted to try out the v0.1 release, but did not manage to build its dependencies.

Running npm install mpq-server gives me the following output. (Note, I have little to no experience with NPM dependency management, so not sure if there is an easy fix?)

[100%] Linking CXX shared library libstorm.so
make[3]: Leaving directory '/home/u/Desktop/doggan_v0.1/diablogl-0.1.0/node_modules/mech-mpq/src/StormLib'
[100%] Built target storm
make[2]: Leaving directory '/home/u/Desktop/doggan_v0.1/diablogl-0.1.0/node_modules/mech-mpq/src/StormLib'
make[1]: Leaving directory '/home/u/Desktop/doggan_v0.1/diablogl-0.1.0/node_modules/mech-mpq/src/StormLib'
node-gyp configure build
make[1]: Entering directory '/home/u/Desktop/doggan_v0.1/diablogl-0.1.0/node_modules/mech-mpq/build'
  CXX(target) Release/obj.target/mech_mpq/src/mpqtools.o
In file included from ../src/mpqtools.cc:3:0:
../src/mpqtarchive.h:6:10: fatal error: Stormlib/src/StormLib.h: No such file or directory
 #include "Stormlib/src/StormLib.h"
          ^~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[1]: *** [mech_mpq.target.mk:96: Release/obj.target/mech_mpq/src/mpqtools.o] Error 1
make[1]: Leaving directory '/home/u/Desktop/doggan_v0.1/diablogl-0.1.0/node_modules/mech-mpq/build'
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:285:23)
gyp ERR! stack     at emitTwo (events.js:106:13)
gyp ERR! stack     at ChildProcess.emit (events.js:194:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12)
gyp ERR! System Linux 4.11.3-1-ARCH
gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "build"
gyp ERR! cwd /home/u/Desktop/doggan_v0.1/diablogl-0.1.0/node_modules/mech-mpq
gyp ERR! node -v v7.10.0
gyp ERR! node-gyp -v v3.6.0
gyp ERR! not ok 
make: *** [Makefile:6: all] Error 1
diablogl@0.1.0 /home/u/Desktop/doggan_v0.1/diablogl-0.1.0
├── commander@2.9.0  extraneous
└── express@4.15.3  extraneous

npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! mech-mpq@0.1.1 install: `make`
npm ERR! Exit status 2
npm ERR! 
npm ERR! Failed at the mech-mpq@0.1.1 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/u/.npm/_logs/2017-06-04T20_16_38_600Z-debug.log

v0.2 of DiabloGL (the version you tried, and latest master) is a re-write and had a more ambitious goal to do something similar to what you did with spark, but for the web. Eventually, the plan was to make a moddable 'engine' built on Phaser, with one of the mods being vanilla D1. This version uses TMX for the level formats, but due to time constraints, it doesn't incorporate the D1 assets/mpq the same as v0.1 yet.

It is a really sweet project, and I like your direction with v0.2! I know a friend of mine loves the idea of running a an isometric game engine running on the web. I mentioned your project to him today :)

Awesome work with sanctuary/spark. I will check it out more later.

Haha, you may be our first alpha tester? :P The project is definitely in its infancy, so let me know when you decide to take it out for a spin. I know of at least one issue (the relative paths of the assets extracted using opensourceami refer to tristram rather than spark, since our last Game Dev hackathon). The fix is trivial, just wanted to give you a heads up.

Btw, are you able to dynamically generating dungeons right now, or is the cathedral TMX static? edit: Ah, nevermind. I think I see what you're doing now.

Hehe, we are indeed not generating the dungeons dynamically just yet. Tracking the FLARE issue for it thought :)

https://github.com/clintbellanger/flare-engine/issues/1484

Cheers /u & i

doggan commented 7 years ago

I wanted to try out the v0.1 release, but did not manage to build its dependencies. Running npm install mpq-server gives me the following output. ...

It looks like an issue with the MPQ package. This is a 'native' node module, since it wraps the C++ StormLib library. It looks like you're running node v7.10.0, but I've only updated the MPQ library to run up to node 4.x. The node ecosystem changes very quickly, particularly with the C++ API, so this makes native modules prone to breakage.

Can you try installing node 4.x and see if that fixes it? You can use NVM to install and manage multiple versions of node on your system.

mewmew commented 7 years ago

I switched to node 4.x and got a similar error:

[100%] Linking CXX shared library libstorm.so
make[3]: Leaving directory '/home/u/Desktop/doggan_v0.1/diablogl-0.1.0/node_modules/mpq-server/node_modules/mech-mpq/src/StormLib'
[100%] Built target storm
make[2]: Leaving directory '/home/u/Desktop/doggan_v0.1/diablogl-0.1.0/node_modules/mpq-server/node_modules/mech-mpq/src/StormLib'
make[1]: Leaving directory '/home/u/Desktop/doggan_v0.1/diablogl-0.1.0/node_modules/mpq-server/node_modules/mech-mpq/src/StormLib'
node-gyp configure build
make[1]: Entering directory '/home/u/Desktop/doggan_v0.1/diablogl-0.1.0/node_modules/mpq-server/node_modules/mech-mpq/build'
  CXX(target) Release/obj.target/mech_mpq/src/mpqtools.o
In file included from ../src/mpqtools.cc:3:0:
../src/mpqtarchive.h:6:10: fatal error: Stormlib/src/StormLib.h: No such file or directory
 #include "Stormlib/src/StormLib.h"
          ^~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[1]: *** [mech_mpq.target.mk:92: Release/obj.target/mech_mpq/src/mpqtools.o] Error 1
make[1]: Leaving directory '/home/u/Desktop/doggan_v0.1/diablogl-0.1.0/node_modules/mpq-server/node_modules/mech-mpq/build'
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/home/u/.nvm/versions/node/v4.0.0/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:270:23)
gyp ERR! stack     at emitTwo (events.js:87:13)
gyp ERR! stack     at ChildProcess.emit (events.js:172:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
gyp ERR! System Linux 4.11.3-1-ARCH
gyp ERR! command "/home/u/.nvm/versions/node/v4.0.0/bin/node" "/home/u/.nvm/versions/node/v4.0.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "build"
gyp ERR! cwd /home/u/Desktop/doggan_v0.1/diablogl-0.1.0/node_modules/mpq-server/node_modules/mech-mpq
gyp ERR! node -v v4.0.0
gyp ERR! node-gyp -v v3.0.1
gyp ERR! not ok 
make: *** [Makefile:6: all] Error 1
npm ERR! Linux 4.11.3-1-ARCH
npm ERR! argv "/home/u/.nvm/versions/node/v4.0.0/bin/node" "/home/u/.nvm/versions/node/v4.0.0/bin/npm" "install" "mpq-server"
npm ERR! node v4.0.0
npm ERR! npm  v2.14.2
npm ERR! code ELIFECYCLE

npm ERR! mech-mpq@0.1.1 install: `make`
npm ERR! Exit status 2
npm ERR! 
npm ERR! Failed at the mech-mpq@0.1.1 install script 'make'.
npm ERR! This is most likely a problem with the mech-mpq package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     make
npm ERR! You can get their info via:
npm ERR!     npm owner ls mech-mpq
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /home/u/Desktop/doggan_v0.1/diablogl-0.1.0/npm-debug.log
doggan commented 7 years ago

Please try one more time staying with node 4.x.

I just bumped the version of mpq-server from 0.0.5 -> 0.0.6 and published to npm. The previous version was linking to an old version of mech-mpq.