The Parts and Whole: Overview: Difference between revisions

From The DarkMod Wiki
Jump to navigationJump to search
Geep (talk | contribs)
mNo edit summary
Geep (talk | contribs)
 
(17 intermediate revisions by the same user not shown)
Line 1: Line 1:
''By Geep 2022''
''By Geep 2022''


"The Parts and Whole" series explores map objects being brought together into higher-level assemblies... their creation, navigation, manipulation, and benefits. Dark Radiant provides a number of techniques to control the visibility, selectability, and association of multiple objects. Some also can improve game performance. Here's a quick overview. Follow individual links [WIP] for lots more.
''This is a work in progress. To give feedback or suggestions, see the forum thread [https://forums.thedarkmod.com/index.php?/topic/21256-the-parts-and-whole-discussion/ The Parts and Whole: Discussion]''


==Techniques that affect DR Only==
As a broad theme, "The Parts and Whole" explores map objects being brought together into higher-level assemblies... their creation, navigation, manipulation, and benefits. Dark Radiant provides a number of techniques to control the visibility, selectability, and association of multiple objects. Some also can improve game performance. Here's a quick overview. Follow individual links for lots more.
 
==Techniques that Affect DR Only==
To speed up complex editing, DR provides 6 techniques to form collections of associated objects, to benefit:
To speed up complex editing, DR provides 6 techniques to form collections of associated objects, to benefit:


Line 19: Line 21:
! Pros & Cons
! Pros & Cons
|-
|-
|Hide/Show
|[[The_Parts_and_Whole:_DR_Hide/Show|Hide/Show]]
|Toggle visibility of selected or deselected objects.
|Toggle visibility of selected or deselected objects.
|Pros: Quick & easy. Important as adjunct to "Group" and "Selection Set".
|Pros: Quick & easy. Important as adjunct to "Group" and "Selection Set".
|-
|-
|Region
|[[The_Parts_and_Whole:_DR_Region|Region]]
|Define a box & temporarily hide everything that doesn’t touch it.
|Define a box & temporarily hide everything that doesn’t touch it.
|Pros: Easy to use. Several way to define box.<br />
|Pros: Easy to use. Several way to define box.<br />
Also: Can generate auto-sealed map file of region for testing, but with caveats.
Also: Can generate auto-sealed map file of region for testing, but with caveats.
|-
|-
|Layer
|[[The_Parts_and_Whole:_DR_Layers|Layer]]
|Assign each object to one or more named layers, based on any criteria. Then toggle layer visibility.
|Assign each object to one or more named layers, based on any criteria. Then toggle layer visibility.
|Pros: Highly customizable. Quick layer select.<br />
|Pros: Highly customizable. Quick layer select.<br />
Cons: Requires active organization and management.
Cons: Requires active organization and management.
|-
|-
|Filter
|[[The_Parts_and_Whole:_DR_Filters|Filter]]
|Toggle visibility based on class name or other attributes (i.e., spawnargs)
|Toggle visibility based on class name or other attributes (i.e., spawnargs).
|Pros: Good selection of built-in filters. Quick to use & needs no management. Custom filters possible.<br />
|Pros: Good selection of built-in filters. Quick to use & needs no management. Custom filters possible.<br />
Cons: Custom filters require programming.
Cons: Custom filters require programming.
|-
|-
|Group
|[[The_Parts_and_Whole:_DR_Groups|Group]]
|Cluster objects together to select, move, or copy as group.
|Cluster objects together to select, move, or copy as group.
|Pros: Quick, easy, scales well to large number of Groups and of objects within.<br />
|Pros: Quick, easy, scales well to large number of Groups and of objects within.<br />
Line 44: Line 46:
Also: Stack-like (LIFO) manipulation method to love/hate.
Also: Stack-like (LIFO) manipulation method to love/hate.
|-
|-
|Selection Set
|[[The_Parts_and_Whole:_DR_Selection_Sets|Selection Set]]
|Clusters objects together temporarily, with naming.
|Cluster objects together temporarily, with naming.
|Pros: Consider for one-time complex editing tasks.<br />
|Pros: Consider for one-time complex editing tasks.<br />
Cons: Lacks the persistence and fine-grained control of Groups and Layers.
Cons: Lacks the persistence and fine-grained control of Groups and Layers.
Line 67: Line 69:
! Persistent (Kept Across DR Sessions)
! Persistent (Kept Across DR Sessions)
|-
|-
|Hide/Show|| || ||X||1||  
|[[The_Parts_and_Whole:_DR_Hide/Show|Hide/Show]]|| || ||X||1||  
|-
|-
|Region||X|| ||Non-collection||1||  
|[[The_Parts_and_Whole:_DR_Region|Region]]||X||Export filename only||Hides non-collection||1||  
|-
|-
|Layer|| ||X||X||Dozens||X
|[[The_Parts_and_Whole:_DR_Layers|Layer]]|| ||X||X||Dozens||X
|-
|-
|Filter||X||X||X||Dozens||X
|[[The_Parts_and_Whole:_DR_Filters|Filter]]||X||X (criteria)||X||Dozens||X
|-
|-
|Group|| || || ||No limit||X
|[[The_Parts_and_Whole:_DR_Groups|Group]]|| || || ||No limit||X
|-
|-
|Selection Set|| ||X|| ||Dozens||  
|[[The_Parts_and_Whole:_DR_Selection_Sets|Selection Set]]|| ||X|| ||Dozens||  
|}
|}
==Cloning Objects - The Basics==
As you know, one or more selected objects are duplicated in DR simply by hitting the Space bar. They appear atop their source objects (or slightly displaced, if the "Offset cloned objects by 1 grid unit to the right and downwards" button is so toggled). Name conflicts are automatically resolved. You then drag the clones to where you need them.
Space bar is effectively a shortcut for Copy/Paste. Furthermore, you can use Copy in one DR instance and Paste in another; the duplicates will arrive at the source's map coordinates. Then you drag.
You could Copy from DR, Paste into a text editor, and save to disk. Then later reverse the process. Prefabs, next, formalizes that process, and spares you the post-paste dragging.
==Prefabs==
A Prefab is a set of map objects stored as a disk file, for re-use. The set is typically of moderate size and diverse but with a unifying theme, e.g.:
* a house
* a corridor with wall modules
* a few AI characters and their paths, with some adjoining furniture and knick-knacks.
A Prefab file has much the same syntax and content as a Map file, but is meant for DR alone; it cannot be DMAP’d.


==Special Case: Prefabs==
Upon import into DR, a Prefab is converted to its constituent objects. During this, two checkboxes provide automatic options for the objects: to re-position them around the current map insertion point, and to place them in a Group. Once inside DR, there is no longer a prefab per se.
[PLANNED][Also update of existing Prefab article]


==Techniques that Affect Both DR and TDM==
Stock Prefabs are an important asset distribution method for TDM. Or you can make your own custom ones. It is one way to promulgate duplicates throughout your current FM, or be part of a private asset archive for all your FMs. Or shared. Prefabs may be helpful while crafting new modular architectures.
[PLANNED][Coverage to include:


* Entities with Primitives
{| class="wikitable"
|-
! Technique
! Purpose
! Pros & Cons
|-
|[[The_Parts_and_Whole:_Prefab_Import|Import Prefab (or RMB Insert Prefab)]]
|Inspect available prefabs (either stock TDM ones, or custom), and place in your project
|Pros: Can preview prefabs. On import, can control insertion and/or auto-group as desired.<br />
Cons: Only map objects are contained in a prefab; other assets may be needed. If importing duplicates, each instance adds to map filesize and (typically) entity count.
|-
|[[The_Parts_and_Whole:_Prefab_Export|Export Selected as Prefab]]
|Make a custom prefab, to re-use in current or future FMs, or share with others.
|Pros: Creates custom asset for import, e.g., duplicates in your FM<br />
Cons: If planning to share, some extra steps recommended.
|}
 
==Maps==
[Planned: Export Map, Export Selection as Map, Import Map, Merge Map]
==Models==
TBD
 
==Other Techniques that Affect Both DR and TDM==
[PLANNED coverage, except as linked]:
 
* Conversion from/to Worldspawn
* [[The_Parts_and_Whole:_Entity_with_Primitives|Entity with Primitives]]
* Multiple Instances Combined with SEED
* Multiple Instances Combined with SEED
* Combining Models
* Combining Models
* Func Groups
* [[The_Parts_and_Whole:_Func_Group|Func Group]]
* Inlining
* [[Inlining]]
]
]
{{Editing}}
{{Models}}
[[Category:Prefabs]]

Latest revision as of 22:07, 26 April 2022

By Geep 2022

This is a work in progress. To give feedback or suggestions, see the forum thread The Parts and Whole: Discussion

As a broad theme, "The Parts and Whole" explores map objects being brought together into higher-level assemblies... their creation, navigation, manipulation, and benefits. Dark Radiant provides a number of techniques to control the visibility, selectability, and association of multiple objects. Some also can improve game performance. Here's a quick overview. Follow individual links for lots more.

Techniques that Affect DR Only

To speed up complex editing, DR provides 6 techniques to form collections of associated objects, to benefit:

  • Ease of selection and subsequent manipulation
  • Control of visibility, hiding items that obscure what you really want to see and manipulate.

These techniques do not affect your project's .map file or performance. Those that are persistent across DR sessions store their information in the map/<FM>.darkradiant file.

In a Nutshell

Technique Purpose Pros & Cons
Hide/Show Toggle visibility of selected or deselected objects. Pros: Quick & easy. Important as adjunct to "Group" and "Selection Set".
Region Define a box & temporarily hide everything that doesn’t touch it. Pros: Easy to use. Several way to define box.

Also: Can generate auto-sealed map file of region for testing, but with caveats.

Layer Assign each object to one or more named layers, based on any criteria. Then toggle layer visibility. Pros: Highly customizable. Quick layer select.

Cons: Requires active organization and management.

Filter Toggle visibility based on class name or other attributes (i.e., spawnargs). Pros: Good selection of built-in filters. Quick to use & needs no management. Custom filters possible.

Cons: Custom filters require programming.

Group Cluster objects together to select, move, or copy as group. Pros: Quick, easy, scales well to large number of Groups and of objects within.

Cons: Groups are unnamed.
Also: Stack-like (LIFO) manipulation method to love/hate.

Selection Set Cluster objects together temporarily, with naming. Pros: Consider for one-time complex editing tasks.

Cons: Lacks the persistence and fine-grained control of Groups and Layers.

Additional "Cons"

  • For all techniques that hide items: you might forget the hiding is in effect when it comes time to copy things, so you fail to copy the totality of what’s needed.
  • In the next table’s "Max # of Collections" Column: "Dozens" – typically just a few dozen - refers to practical limitations on suitability of the dropdown menu or scrollable list used to view and manipulate the list.

Characteristics

Technique Collect Items without Touching Them Collection Named Hide Collection Directly Max # of Collections Persistent (Kept Across DR Sessions)
Hide/Show X 1
Region X Export filename only Hides non-collection 1
Layer X X Dozens X
Filter X X (criteria) X Dozens X
Group No limit X
Selection Set X Dozens

Cloning Objects - The Basics

As you know, one or more selected objects are duplicated in DR simply by hitting the Space bar. They appear atop their source objects (or slightly displaced, if the "Offset cloned objects by 1 grid unit to the right and downwards" button is so toggled). Name conflicts are automatically resolved. You then drag the clones to where you need them.

Space bar is effectively a shortcut for Copy/Paste. Furthermore, you can use Copy in one DR instance and Paste in another; the duplicates will arrive at the source's map coordinates. Then you drag.

You could Copy from DR, Paste into a text editor, and save to disk. Then later reverse the process. Prefabs, next, formalizes that process, and spares you the post-paste dragging.

Prefabs

A Prefab is a set of map objects stored as a disk file, for re-use. The set is typically of moderate size and diverse but with a unifying theme, e.g.:

  • a house
  • a corridor with wall modules
  • a few AI characters and their paths, with some adjoining furniture and knick-knacks.

A Prefab file has much the same syntax and content as a Map file, but is meant for DR alone; it cannot be DMAP’d.

Upon import into DR, a Prefab is converted to its constituent objects. During this, two checkboxes provide automatic options for the objects: to re-position them around the current map insertion point, and to place them in a Group. Once inside DR, there is no longer a prefab per se.

Stock Prefabs are an important asset distribution method for TDM. Or you can make your own custom ones. It is one way to promulgate duplicates throughout your current FM, or be part of a private asset archive for all your FMs. Or shared. Prefabs may be helpful while crafting new modular architectures.

Technique Purpose Pros & Cons
Import Prefab (or RMB Insert Prefab) Inspect available prefabs (either stock TDM ones, or custom), and place in your project Pros: Can preview prefabs. On import, can control insertion and/or auto-group as desired.

Cons: Only map objects are contained in a prefab; other assets may be needed. If importing duplicates, each instance adds to map filesize and (typically) entity count.

Export Selected as Prefab Make a custom prefab, to re-use in current or future FMs, or share with others. Pros: Creates custom asset for import, e.g., duplicates in your FM

Cons: If planning to share, some extra steps recommended.

Maps

[Planned: Export Map, Export Selection as Map, Import Map, Merge Map]

Models

TBD

Other Techniques that Affect Both DR and TDM

[PLANNED coverage, except as linked]:

]