[PLUGIN] Roguelike plugin - C2 rot.js interface

Post your work in progress addons and get feedback

Post » Sat Oct 25, 2014 7:13 pm

For all Roguelike fans, here is an early work in progress version C2 interface to an excellent rot.js javascript roguelike library.

"Generate map" action generates the map data and stores it in the plugin internal dictionary (the plugin is based on the Dictionary plugin): the key represents map coordinates and is of the format "x,y" (e.g. "12,34"); the value is a text character - "." for floors/passable tiles and "#" for walls/solids.

Image

Image

Image



Plugin can compute a discrete (map cell based) FOV (Field of vision) from a given map coordinate:

Image



Plugin can compute a discrete (map cell based) path (Dijkstra algorithm) from a given map coordinate to a given map coordinate:

Image


Configurable room width & height and corridor length:

Image

Image

Image



Loop through all rooms and access room edges and center (useful for a map object placement):

Image


Added door hooks. You can get X & Y coords foor each room's door...

Image

Image
You do not have the required permissions to view the files attached to this post.
Last edited by Lunarovich on Sat Nov 01, 2014 2:53 pm, edited 11 times in total.
B
6
S
2
Posts: 64
Reputation: 576

Post » Sat Oct 25, 2014 7:18 pm

That is really neat. Thanks for sharing! :D
ImageImageImageImage
B
62
S
19
G
51
Posts: 633
Reputation: 30,826

Post » Sat Oct 25, 2014 7:21 pm

Glad you like it :) Please test it if you can and send comments and eventual feature requests: rot.js is a feature packed library. I'll implement those features not covered by C2 first.
B
6
S
2
Posts: 64
Reputation: 576

Post » Sun Oct 26, 2014 2:04 am

Thanks for the effort, I hope I can get to try it soon. Roguelikes are my favourite.
B
24
S
9
G
4
Posts: 1,646
Reputation: 6,596

Post » Sun Oct 26, 2014 8:08 am

You're welcome :)

The plugin is functional / usable. I still have to add OnMapGenerated, OnPathComputed and OnFOVComputed triggers. Also, there are some neat options for customization of map generation: max/min room size, max/min corridor length, etc. Hope to add all of these in a few days...

Afterwards, it's testing, testing and testing :) And finally making great Roguelikes in C2!
B
6
S
2
Posts: 64
Reputation: 576

Post » Sun Oct 26, 2014 11:10 am

This looks great! Thanks! :)
ImageImageImageImage
B
157
S
64
G
41
Posts: 2,592
Reputation: 34,644

Post » Sun Oct 26, 2014 5:00 pm

:) You're welcome! Currently adding configurable rooms and corridors...
B
6
S
2
Posts: 64
Reputation: 576

Post » Sun Oct 26, 2014 6:03 pm

Thanks for such a great plugin!

will the plugin allow to set doors, locked doors and the keys for this doors in a reachable area? that would be really cool!
Last edited by fldr on Sun Oct 26, 2014 7:04 pm, edited 1 time in total.
B
38
S
11
G
5
Posts: 485
Reputation: 5,340

Post » Sun Oct 26, 2014 6:26 pm

Was about to ask same thing :)

One more question, Could you put some noticed on that ""." for floors and "#" for walls" somewhere inside a plugin? or even make it as a separate expression "room", "floor" etc, so it's always easy to access and remember this values.

Besides that I was playing with it for a half a day now, and it gives great results! Once again, Well done! :)
ImageImageImageImage
B
157
S
64
G
41
Posts: 2,592
Reputation: 34,644

Post » Sun Oct 26, 2014 7:23 pm

@fldr, you are welcome! As for the doors, the plugin will actually let you get an array of rooms and corridors, and door coordinates for rooms (junctions of rooms and corridors). Afterwards, it will be on the user to decide what he/she wants to do with the door locations.

@shinkan, I've just added a notice to the "Generate map action". Thanks for the suggestion. Thanks for the congrats :) Although credits for constructing the C2 plugin (no pun intended :)) go to me, the javascript logic behind the plugin is made available by the rot.js javascript library author...

P.S. I've just added the improved version 0.5.0 of the plugin...
B
6
S
2
Posts: 64
Reputation: 576

Next

Return to Work in Progress Addons

Who is online

Users browsing this forum: No registered users and 2 guests