- Joined
- Aug 7, 2013
- Messages
- 1,338
Hi,
In most RPGs I can think of, they do not place the game in a single map but rather separate maps/cells which are reached by using doors/warps.
My understanding is that a warp is a relation from a Door/Warp to a point. That is, a door/warp at point A moves things at to point B.
My dilemma is, are warps a relation between types (unique warps) or between tokens (instances of a warp type).
E.g., suppose I have a building called "Ferry" that acts as a warp between two islands, and suppose I have three islands which I need to link by using "Ferry."
Type approach
1. I make a custom object/building for each possible pairing of Ferries.
2. This gives me 6 objects to make: AB, AC, BA, BC, CA, CB
(where A, B, C are islands, and XY is a warp from X to Y).
Token approach
1. I make a single custom object called "Ferry."
2. I place six of these (two per island).
3. I then have to create variables for each instance of "Ferry" and map it to the appropriate other instance of "Ferry."
The former approach gives my code portability and modularity, since warp is a property that holds between two custom objects, but it comes at a cost of having a lot of custom objects--if I have N warps I'll need at least 2N unique buildings (assuming symmetry holds).
The latter approach only requires a single warp building (if I were lazy I could use "Ferry" for every possible warp), but it's ugly in that it has to be hardcoded by picking out unit variables.
So, what is the best approach to solving this?
I have been using a Type to Token approach but I have misgivings now...
In most RPGs I can think of, they do not place the game in a single map but rather separate maps/cells which are reached by using doors/warps.
My understanding is that a warp is a relation from a Door/Warp to a point. That is, a door/warp at point A moves things at to point B.
My dilemma is, are warps a relation between types (unique warps) or between tokens (instances of a warp type).
E.g., suppose I have a building called "Ferry" that acts as a warp between two islands, and suppose I have three islands which I need to link by using "Ferry."
Type approach
1. I make a custom object/building for each possible pairing of Ferries.
2. This gives me 6 objects to make: AB, AC, BA, BC, CA, CB
(where A, B, C are islands, and XY is a warp from X to Y).
Token approach
1. I make a single custom object called "Ferry."
2. I place six of these (two per island).
3. I then have to create variables for each instance of "Ferry" and map it to the appropriate other instance of "Ferry."
The former approach gives my code portability and modularity, since warp is a property that holds between two custom objects, but it comes at a cost of having a lot of custom objects--if I have N warps I'll need at least 2N unique buildings (assuming symmetry holds).
The latter approach only requires a single warp building (if I were lazy I could use "Ferry" for every possible warp), but it's ugly in that it has to be hardcoded by picking out unit variables.
So, what is the best approach to solving this?
I have been using a Type to Token approach but I have misgivings now...