Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automapping: Double Width/Height Tile Rules #62

Closed
Bryan-Legend opened this issue Aug 25, 2011 · 6 comments
Closed

Automapping: Double Width/Height Tile Rules #62

Bryan-Legend opened this issue Aug 25, 2011 · 6 comments

Comments

@Bryan-Legend
Copy link

With the current automapping it's not possible to have a rule apply a tile that is "double wide".

So I've got some graphics from http://www.lostgarden.com/2006/07/more-free-game-graphics.html which are awesome.

Some of the tiles though are designed to be tiled two at a time. For instance the wall on this image: http://imageshack.us/photo/my-images/708/internalwalls.png/

There's no way to make a rule to automatically place these double wide tiles because the same rule gets repeated over each tile, so only the left row of tiles in the rule gets applied over and over.

There needs to be a change in the automapper logic that says that if a tile has already been set by this same rule then not to overwrite it. Maybe put it behind a flag.

Example map with rules and tiles.
http://www.mediafire.com/?ejn1vw4c2ycikdc

Feel free to use this example map any way you'd like. You can even include it in the distro if you'd like.

@Bryan-Legend
Copy link
Author

FYI, I'm using this for a silverlight game that's available at http://smote.com Give it a shot.

I'd really like to see this happen so I'll put a bounty on it. I'll paypal $50 to whoever implements the fix and sends me a build before 9/30/2011.

@stefanbeller
Copy link
Contributor

Hello Lone-Coder,

When I understand you right, the problem is this rule http://dl.dropbox.com/u/6520164/tiled/problematic_rule.png

If you are not interested to have it repeated exactly like A-B-A-B-A-B and so on, but in a random fashion,
(example: A-A-B-A-B-B-A-B-B-B-B-A-A-B-A ... just randomly)
this ruleset will apply: http://dl.dropbox.com/u/6520164/tiled/InternalExample.zip
The random placement can be archieved by putting multiple layers for one destination layer.
Changes were only done in ruleSet1.tmx: there is now another rule1_Wall layer which has different tiles
for that given rule in that layer.

If you need to have it exact A-B-A-B (which is indeed a serious cool and needed feature), I'll give it a try on the weekend.

@stefanbeller
Copy link
Contributor

So the solution as of now is this:
Whenever a rule gets applied, it is previously checked if within all touched layers, this rule was not applied to the same (=overlapping) location.

Unfortunately this solution takes a lot of CPU time, so it is switched off by default.
(only needed rules should be switched on then;) This can be done by adding the property "NoOverlayingRules" set to true
to the specific map.

@stefanbeller
Copy link
Contributor

Here is a Windows build for tiled,
which includes a functionality to make double wide rules
in automapping possible:
http://dl.dropbox.com/u/6520164/tiled/tiled-0.7.x_lonecoder-win32-setup.exe
This build is off my current Automapping branch,
(https://github.com/stefanbeller/tiled/commits/AutomappingLoneCoder)

@Bryan-Legend
Copy link
Author

That works perfectly Stefan. Thank you so much! You rock! I've sent over the paypal payment.

Bryan Livingston

@stefanbeller
Copy link
Contributor

@lone-coder:
This feature has been merged into the official tiled version by @bjorn.
Now you can either wait for a regular release or check out the daily builds found here:
http://files.mapeditor.org/daily/

stefanbeller added a commit to stefanbeller/tiled that referenced this issue Nov 1, 2011
* setupRulesMap, which reads in maps properties was rewritten to
  be more stable. It emits warnings in case of unknown properties.
  The capitalisation of the string properties is ignored.

* when not having properties set, you need to have good defaults
  (set in constructor now)

* A new property "NoOverlayingRules" is introduced. This fixes mapeditor#62
  Rules, which still apply, when they are shifted off by one, are
  handled properly now.

  This is achieved by checking if the region, at which the rule should
  applied to, has not been touched by the current rule already.
  This additional check introduces needs a lot of time, so it is turned off
  by default, which also ensures compatibility to lower versions.

Signed-off-by: Stefan Beller <stefanbeller@googlemail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants