jonoxia / rpgbase

Generic Node.js/HTML5 role-playing game client/server
8 stars 6 forks source link

Needed: Random encounter tables #42

Closed jonoxia closed 11 years ago

jonoxia commented 11 years ago

Each domain can have its own random encounter table (though they can also share them).

Table can be keyed (optionally) on land type, day/night, and geographical rectangles.

Data inside the table is a series of d100 threshholds and encounters, maybe something like this: {50: {monster: biteWorm, number: 3}, 80: {monster: biteWorm, number: 5}, 98: {monster: groundSnake, number: 3}, 99: {monster: metalSlime, number: 1} }

where "50" as the key means "a d100 roll of 0-50 produces this encounter".

If keying on geographical rectangles, should be able to assign a zone code for each rectangle, and then key the encounter tables on zone codes. That way one zone can be built up from many rectangles, allowing irregular shapes.

jonoxia commented 11 years ago

Mostly done now, but we need a way to define multiple land tile numbers as a single terrain type for encounter purposes. Also need to allow a callback-based filter -- use this table if this function returns true