Author Topic: Why are entire dungeon floors on one map?  (Read 2877 times)

Zaidyer

  • Newbie
  • *
  • Posts: 14
    • View Profile
Why are entire dungeon floors on one map?
« on: August 09, 2015, 01:34:54 pm »
I notice this is the standard in Solarus quests. The overworld works more like I would expect, as it's broken up into a grid of many maps based on various points of interest.

In A Link to the Past, dungeon screens were equivalent to 512x512 maps, no smaller than that. In case a smaller room was needed, the map would be subdivided, which can be done in Solarus with Separator objects.
This explains how you could occasionally hear sounds coming from nearby rooms, and why enemies and puzzles wouldn't respawn or reset right away sometimes. (Because they're not reloaded when you are just going between separators.)

DementedKirby

  • Jr. Member
  • **
  • Posts: 75
    • View Profile
Re: Why are entire dungeon floors on one map?
« Reply #1 on: August 09, 2015, 02:04:12 pm »
I think it has to do with teleportation. If you want it to be fluid you need the scrolling transition (which is what's used in A Link to the Past). Having the hero simply blink to an adjacent map isn't ascetically pleasing.

Another reason may be because then all dungeon rooms would have to have to same dimensions in order to teleport from one to the other if you're side scrolling. For instance:
    ____
[ ]|      |[ ]
[ ]|___|[ ]

In that scheme you have a large center room equivalent to 4 small rooms. Each block on either side is a small room. If you try to enter the large room from either of the bottom rooms, you'll teleport to where you'd enter from the top rooms (if you're teleportation is scrolling). Likewise, if you enter either of the bottom small rooms from the large room, you'd go to a place on the map not on the map and it'll look like the hero disappeared and you can't move because the hero would've appeared somewhere not defined by tile on the map. So it's easier to just have one large map and separate the rooms by walls and doors, giving the illusion that the rooms are separated.

If you want things to respawn when moving from one room to the next on the same map, you can maybe use sensors within the spaces between the doors coded to respawn whatever you want to be reset as the hero changes rooms.

Hope that answers your question.

Christopho

  • Administrator
  • Hero Member
  • *****
  • Posts: 1173
    • View Profile
Re: Why are entire dungeon floors on one map?
« Reply #2 on: August 09, 2015, 03:01:06 pm »
Exactly. And it is much easier to edit the entire floor on a single map rather than having 20 maps open in the editor.

Separators don't reset enemies, pots, etc but it is possible to use their on_activating()/on_activated() events to automatically save and restore entities. I will soon share an example of that.

The problem DementedKirby mentions about map coordinates can be solved by setting the location property of both maps. If a map is 240 pixels below another, the scrolling will be correct as long as their relative location reflects that.

DementedKirby

  • Jr. Member
  • **
  • Posts: 75
    • View Profile
Re: Why are entire dungeon floors on one map?
« Reply #3 on: August 09, 2015, 03:13:12 pm »
Exactly. And it is much easier to edit the entire floor on a single map rather than having 20 maps open in the editor.

Separators don't reset enemies, pots, etc but it is possible to use their on_activating()/on_activated() events to automatically save and restore entities. I will soon share an example of that.

The problem DementedKirby mentions about map coordinates can be solved by setting the location property of both maps. If a map is 240 pixels below another, the scrolling will be correct as long as their relative location reflects that.

Does that mean that we'll be getting a new tutorial soon discussing separators? Joy!! :D

Zeror

  • Jr. Member
  • **
  • Posts: 88
    • View Profile
Re: Why are entire dungeon floors on one map?
« Reply #4 on: August 09, 2015, 04:53:39 pm »
You can also do a combination of both. Most rooms on one map and some seperate.
With some rooms seperate you can create larger rooms then you would have if you had build that room on one big map. You can create nice mindf*cks with that if you do it right.

Christopho

  • Administrator
  • Hero Member
  • *****
  • Posts: 1173
    • View Profile
Re: Why are entire dungeon floors on one map?
« Reply #5 on: August 10, 2015, 07:13:39 pm »
Exactly. And it is much easier to edit the entire floor on a single map rather than having 20 maps open in the editor.

Separators don't reset enemies, pots, etc but it is possible to use their on_activating()/on_activated() events to automatically save and restore entities. I will soon share an example of that.

The problem DementedKirby mentions about map coordinates can be solved by setting the location property of both maps. If a map is 240 pixels below another, the scrolling will be correct as long as their relative location reflects that.

Does that mean that we'll be getting a new tutorial soon discussing separators? Joy!! :D
I am about to make a live-streaming video of creating a dungeon with this system tonight on https://www.livecoding.tv/christopho/
It will be in French, but I will respond in Engish to questions in English on the chat :)
Sorry to announce this so late, actually I just decided it. But people will be able to watch the video again later in the past broadcasts section.
« Last Edit: August 10, 2015, 07:16:48 pm by Christopho »

Zeror

  • Jr. Member
  • **
  • Posts: 88
    • View Profile
Re: Why are entire dungeon floors on one map?
« Reply #6 on: August 11, 2015, 02:15:09 pm »
Exactly. And it is much easier to edit the entire floor on a single map rather than having 20 maps open in the editor.

Separators don't reset enemies, pots, etc but it is possible to use their on_activating()/on_activated() events to automatically save and restore entities. I will soon share an example of that.

The problem DementedKirby mentions about map coordinates can be solved by setting the location property of both maps. If a map is 240 pixels below another, the scrolling will be correct as long as their relative location reflects that.

Does that mean that we'll be getting a new tutorial soon discussing separators? Joy!! :D
Separators are not that hard to understand. It's basicly an extra edge where your screens stops scrolling. So if you place that edge on a doorway then the screen stops scrolling until the screen reaches the doorway. If the hero walks through the doorway then the screens slides to the other side of the seperator. Think a bit like the Unblock game where one block is your quest window size and the other blocks is/are seperator(s).
It gets hard when you create odd shaped rooms, but it's doable as long the minimal distance between two parallel aligned seperators is the size of 1 quest window size or bigger.
« Last Edit: August 11, 2015, 02:19:33 pm by Zeror »

Christopho

  • Administrator
  • Hero Member
  • *****
  • Posts: 1173
    • View Profile
Re: Why are entire dungeon floors on one map?
« Reply #7 on: August 11, 2015, 02:26:13 pm »
Here is the example I was talking about: http://forum.solarus-games.org/index.php/topic,362.0.html
It restores enemies, destructibles and blocks. I hope it can help!
« Last Edit: August 11, 2015, 02:33:12 pm by Christopho »