Opened 12 years ago

Closed 9 years ago

Last modified 9 years ago

#1163 closed enhancement (fixed)

[PATCH][ATLAS] Object placement constraints

Reported by: historic_bruno Owned by: trompetin17
Priority: Nice to Have Milestone: Alpha 18
Component: Atlas editor Keywords:
Cc: Patch:

Description

I think this would be a good addition to Atlas, to prevent problems like #656, where entities can be placed on the very fringe of the map circle, but because of pathfinder passability they get stuck. Of course it should still be possible to place objects anywhere on the map for unusual circumstances, but as an option, we can add placement constraints. For instance boats shouldn't be built on land, most buildings shouldn't be built in water. I think this can all be done by adding some logic to the create object handler to make it check pathfinding classes, similar to what building restrictions and unit spawning already do in-game. Though that wouldn't work for gaia objects like trees unless we assign them some default passability, maybe there's a better way to handle it.

As a visual indicator, we can apply some shading to the entity preview if it's hovering an invalid location, like we do for building previews.

Attachments (9)

1163.diff (6.6 KB ) - added by trompetin17 9 years ago.
Captura de pantalla 2015-01-04 a las 8.55.40 p.m..png (1.2 MB ) - added by trompetin17 9 years ago.
1163.2.diff (6.5 KB ) - added by trompetin17 9 years ago.
1163.3.diff (6.5 KB ) - added by trompetin17 9 years ago.
1163.4.diff (3.0 KB ) - added by trompetin17 9 years ago.
1163.5.diff (2.9 KB ) - added by trompetin17 9 years ago.
1163.6.diff (4.7 KB ) - added by trompetin17 9 years ago.
1163.7.diff (5.4 KB ) - added by trompetin17 9 years ago.
1163.8.diff (4.5 KB ) - added by trompetin17 9 years ago.

Download all attachments as: .zip

Change History (26)

by trompetin17, 9 years ago

Attachment: 1163.diff added

comment:1 by trompetin17, 9 years ago

Keywords: review patch added; simple removed
Milestone: BacklogAlpha 18
Owner: set to trompetin17
Status: newassigned
Summary: [ATLAS] Object placement constraints[PATCH][ATLAS] Object placement constraints

comment:2 by trompetin17, 9 years ago

Atlas now use Constraint Component for every object if it already has one.

Tested with:

  • Place a object outside map
  • Place a object above other
  • Copy and Paste feature
  • Move an exists entity
  • Move a group of object
  • Add an actor

comment:3 by trompetin17, 9 years ago

evidence

comment:4 by Niek, 9 years ago

Does this also occur when placing actors? I often let actors overlap to make them look better.

in reply to:  4 comment:5 by trompetin17, 9 years ago

niektb actually actor doesn´t have constraint component, Im not sure how is going to affect pathfinder and collision if i will add constraint component to actors. Replying to niektb:

Does this also occur when placing actors? I often let actors overlap to make them look better.

comment:6 by Niek, 9 years ago

You shouldn't add. Your patch shouldn't affect actors.

in reply to:  6 comment:7 by trompetin17, 9 years ago

ok them :), everything works like i said in my test, you can overlap only objects without constraint component(that's mean actors) Replying to niektb:

You shouldn't add. Your patch shouldn't affect actors.

by trompetin17, 9 years ago

Attachment: 1163.2.diff added

by trompetin17, 9 years ago

Attachment: 1163.3.diff added

comment:8 by Itms, 9 years ago

Keywords: review removed

The patch works fine but the user will need a way to force placing of entities anywhere, regardless of obstruction. Using a hotkey like Shift would be intuitive, I don't know if it is already used for anything else though.

comment:9 by Lionkanzen, 9 years ago

May be control+F or P.

by trompetin17, 9 years ago

Attachment: 1163.4.diff added

in reply to:  8 comment:10 by trompetin17, 9 years ago

over IRC talked a little more about it. Now this patch is only a visual helper for map makers.

Replying to Itms:

The patch works fine but the user will need a way to force placing of entities anywhere, regardless of obstruction. Using a hotkey like Shift would be intuitive, I don't know if it is already used for anything else though.

by trompetin17, 9 years ago

Attachment: 1163.5.diff added

by trompetin17, 9 years ago

Attachment: 1163.6.diff added

comment:11 by trompetin17, 9 years ago

this is my video about how I implementd

http://youtu.be/Z3ynovnPwhs

by trompetin17, 9 years ago

Attachment: 1163.7.diff added

by trompetin17, 9 years ago

Attachment: 1163.8.diff added

comment:12 by fabio, 9 years ago

No idea if it could be useful, but what about having a sign of overlapped objects even after they are placed? So one can notice possible issues even after having placed them. Maybe having them red-colored even after placed.

comment:13 by mimo, 9 years ago

May-be not permanently, but having a hotkey or a button which (when pressed) would display such issues would be fine.

comment:14 by Niek, 9 years ago

Indeed not permanent. (I said through IRC that it should only be in preview) That would f.e. turn all walls into red.

I personally think that it is fine as it is right now (in trompetin's latest patch) and doesn't need any additions.

comment:15 by historic_bruno, 9 years ago

Sounds like a separate feature request to me, perhaps a tool to find invalid placed objects on the map (even long after it's designed) and highlight them, or select or delete them.

Last edited 9 years ago by historic_bruno (previous) (diff)

comment:16 by Itms, 9 years ago

Resolution: fixed
Status: assignedclosed

In 16149:

Notify map makers when they are placing obstructed entities (overlapping other ones or placed outside the borders of the map). Patch by trompetin17

Fix #1163, refs #2829.

in reply to:  15 comment:17 by Itms, 9 years ago

Keywords: patch removed

Thanks for the patch! :)

Replying to historic_bruno:

Sounds like a separate feature request to me, perhaps a tool to find invalid placed objects on the map (even long after it's designed) and highlight them, or select or delete them.

See #2829.

Note: See TracTickets for help on using tickets.