Messing around with the map

Hey folks!

It's me again, coming up with some really dumb ideas.
I've been thinking about building a completely new map system. I don't know much about JS canvases, so for now I'm just playing with SVG. But I'm wondering if it would be worth trying to get my head around it enough to integrate this with the current Grid system.

Anyway… what I'm looking at is a simple physics engine. Rooms are light rigid bodies with a constant "friction". Exits are ideal elastic springs with a given natural length and identical mass. The physics algorithm runs in javascript, and only knows about rooms that have been visited. So if rooms are connected in a way that doesn't make a perfect loop (like the "don't do this" examples on the map page), they'll bounce around a little until everything lines up.

Possible problems with this:

  • Making a complex map match up might need a lot of iterations of the algorithm.
    • Means walking along an exit can be slow if the algorithm is forced to run to completion; or could even freeze in some impossible layouts
    • If you allow the algorithm to run continuously, the player could see rooms on the map bouncing around as they adjust
  • Rooms might not always assume the same final layout, depending on the order you visit them in.
  • Couldn't be used as a drop-in replacement for the existing grid system
    • Would work in most cases, but not if a game or library assumes that the same grid dictionaries will be there
  • Guaranteeing that rooms won't overlap is hard
    • Actually, not that hard. But if you use the simplest solution, you can get rooms that 'snag' on each other as they're moving around and then get stuck in ugly layouts.

So… anyone think it's worth playing with?

Log in to post a reply.