Jerenaux / phaserquest

Reproduction of Mozilla's BrowserQuest using Phaser, socket.io and Node.js
http://www.dynetisgames.com/2017/03/18/phaser-quest/
MIT License
371 stars 127 forks source link

Hey man, Do you have the files for editing maps #8

Closed Langerz82 closed 5 years ago

Langerz82 commented 7 years ago

Hello,

As you may well know I'm the author of the RPG Mod Branch. I was wondering do you have the file exports for map editing? I was hoping to polish it a bit and eventually import some of my own maps into the game. Kind regards, Josh L.

Jerenaux commented 7 years ago

Hi,

I just added to the repository the Tiled file used to edit the map. It is mostly the same one as the original file used by Browser Quest, with a few small modifications.

Note that before using it in the game, I first use a script to "flatten" the file and remove a lot of unnecessary layers, because layers are bad for performance in Phaser. If you are interested let me know and I can commit that script as well.

alexbartsch commented 7 years ago

Hej Jerenaux, I'm interested in the "flatten" script. I just tried to update the map in Tiled, but exporting it as json makes the hero walk behind the gras. So I think, I need to flatten it, like you did it.

Thanks a lot!

Jerenaux commented 7 years ago

I have updated the script, it may be a bit messy, let me know if it's unclear or doesn't work! (I have updated the Readme with some instructions)

ghost commented 7 years ago

Nice to see you here @Langerz82 How's your version of TTA going -.-

Langerz82 commented 7 years ago

@Tach-Yon hey, its monolithic hence its slow especially in combat with more than 1 monster. I got a few more things done like server-sided path finding, dynamic map loading and a couple of other things which is why I decided to create the RPG Mod with PhaserQuest. If you want my Maearth source you can have it. I'm no longer working on it really. I've started work on a Fallout 3 Multiplayer and eventually porting that to Fallout 4. All the best with your new project.

ghost commented 7 years ago

@Langerz82 Why would you put pathfinding server-sided. It is redundant. Have the client do the pathfinding and have the server verify that.

https://github.com/Tach-Yon/Kaetram

Enjoy something that's properly written.

brandonhanks commented 6 years ago

Hi @Jerenaux phaserquest_map.tmx refers to mobset.png which is not in the repo. Can you add it? Thanks!

ghost commented 6 years ago

@brandonhanks You can get it from one of the original BQ repositories.

brandonhanks commented 6 years ago

Is it this one? https://github.com/mozilla/BrowserQuest/blob/master/tools/maps/tmx/mobset.png

ghost commented 6 years ago

@brandonhanks Yep, that ought to do it.

lulalala commented 4 years ago

May I ask how I can call formatMap()? I created a js file and run node format.js on it.

var f = require('./js/server/format.js')
f.format()

It would err:

Formatting ...
phaserquest/js/server/format.js:62
                    var tileProperties = map.tilesets[0].tileproperties[layer.data[j]-1];
                                                                       ^

TypeError: Cannot read property '-1' of undefined
    at phaserquest/js/server/format.js:62:72
    at FSReqCallback.readFileAfterClose [as oncomplete] (internal/fs/read_file_context.js:63:3)

Update

The reason for this is because Tiled 1.3 changed the json output. We can fix this by following https://github.com/bjorn/tiled/issues/2058#issuecomment-458975579

Jerenaux commented 4 years ago

Thanks for pointing this out! Since you identified the cause of the issue, do you see how to fix it? I unfortunately don't have the time to fix it myself. :/