Crates.io | hill_vacuum |
lib.rs | hill_vacuum |
version | 0.3.3 |
source | src |
created_at | 2024-06-23 17:45:06.676673 |
updated_at | 2024-07-07 16:21:52.908176 |
description | A bevy-based 2D map editor |
homepage | https://github.com/IvoryDuke/HillVacuum |
repository | https://github.com/IvoryDuke/HillVacuum |
max_upload_size | |
id | 1281330 |
size | 2,275,561 |
HillVacuum is a Doom Builder and TrenchBroom inspired editor that allows the creation of bidimensional maps through the manipulation of convex polygons, placement of items and entities, and texture mapping.
For those who do not mind reading, HV features a built in manual which can be opened through the keyboard key ~
.
For the rest, there's this video.
Brushes are convex polygonal surfaces. They can have an associated texture which can either be drawn filling their area or as a sprite. The sprite can be displaced independently of the brush surface.
Brushes can also be assigned a path that describes how it moves in the bidimensional space and that can be edited with the Path tool.
Finally, brushes have a built-in property, collision
, which determines whether they should represent a clipping surface or not. It can be edited in the properties window.
Things are objects which can be placed around the map. They area characterized by an ID, a width and height, a name, and a texture which represents them.
Things can also be assigned a path that describes how it moves in the bidimensional space and that can be edited with the Path tool.
Things can either be defined in one or many .ini files to be placed in the assets/things/
folder or, if HillVacuum is used as a library, implementing the MapThing
interface for the structs representing an object to be placed in the map and using the hardcoded_things
macro to insert them in the bevy App.
If defined in the .ini files, the things must follow a similar format:
[Name]
width = N
height = M
id = ID
preview = TEX
Where ID is an unique identifier between 0 and 65534, and TEX is the name of the texture to be drawn along with the bounding box.
If a thing defined through the MapThing
interface has the same ID as one loaded from file, the latter will overwrite the former.
Finally, things have two built-in properties, angle
and draw height
. The orientation of the arrow drawn on top of the things will change based on the value of angle
, and draw height
determines its draw order. They can be edited in the properties window.
Things can be reloaded while the application is running through the UI button in the Options menu.
Properties are custom user defined values which can be associated to brushes and things.
Such values can be inserted through the brush_properties
and thing_properties
macros by specifying the pairs (name, default_value)
of the properties.
Properties can be edited per-entity using the properties window.
Currently supported value types are bool
, u8
, u16
, u32
, u64
, u128
, i8
, i16
, i32
, i64
, i128
, f32
, f64
, and String
.
!!! If a saved map contains properties that differ in type and/or name from the ones defined in the aforementioned resources, a warning window will appear on screen when trying to load the .hv file, asking whether you'd like to use the app or map ones.
Textures must be placed in the assets/textures/
folder to be loaded.
The texture editor can be opened at any time to edit the properties of the textures of the selected brushes.
Entity, scale, and rotate tool also feature texture editing capabilities. These capabilities can be either enabled through the dedicated "Target" UI element in the bottom left area, or by pressing Alt + texture editor bind.
Textures can have an associated animation which can either consist of a list of textures to display, each one for a specific time, or an atlas of textures generated by subdividing the textures in subareas. The animations can be applied to the texture as a default or to the texture of the selected brushes only.
When editing a list type animation, it is possible to add a texture by clicking it with the left mouse button.
To edit the animation of a texture that is not the one of the selected brushes, it needs to be pressed with the right mouse button.
Textures can be reloaded while the application is running through the UI button in the Options menu.
Default textures animation can be exported and imported between map files. The file extension of the animations files is .anms.
A prop is a collection of entities which can be painted around the map like the brushes of an image editing tool.
Each prop has a pivot, the point relative to which it is painted onto the map.
Props can be imported and exported between map files. The file extension of the props files is .prps.
The map grid can be skewed and/or rotated to give the map an isometric look. These two parameters can be edited in the settings window.
HV creates three types of files, all of which are relatively simple:
-------------------------------
| Header (4 usize) |
| brushes amount |
| things amount |
| animations amount |
| props amount |
-------------------------------
| Brushes default properties |
-------------------------------
| Things default properties |
-------------------------------
| Animations |
-------------------------------
| Brushes |
-------------------------------
| Things |
-------------------------------
| Props |
-------------------------------
| Grid settings (skew, angle) |
-------------------------------
-------------------------------
| animations amount (usize) |
-------------------------------
| Animations |
-------------------------------
-------------------------------
| props amount (usize) |
-------------------------------
| Props |
-------------------------------
HV can be compiled as a standalone executable simply compiling the source code (Linux distributions may require the installation of extra libraries).
cargo run
Otherwise it can be integrated in your own project as such:
fn main()
{
bevy::prelude::App::new()
.add_plugins(hill_vacuum::HillVacuumPlugin)
.run();
}
Map files can be read through the Exporter struct that will return lists of all the brushes and things, which can then be exported as desired. Assuming the path of the map file was passed as an argument to the exporting executable the code will look something like this:
fn main()
{
let exporter = hill_vacuum::Exporter::new(&std::env::args().collect::<Vec<_>>()[0]);
// Your code.
}
The map being edited can be exported through such an executable through the File->Export command in the editor. The executable can be picked through Options->Exporter.
debug
: enables dynamic linking for faster compile times and some debug lines of the editor;arena_alloc
: enables the usage of an arena allocator for fast allocation times. Requires nightly compiler.The only thing I know for real, there will be bugs.
HV has been thoroughly tested but is still in its early releases, so there might be issues that lead to crashes due to unrecoverable errors. It is strongly recommended to save often.
On Windows, the things and props gallery of the Thing and Paint tools are incorretly drawn. This does not occur on Linux.
In order to close the in-editor windows through the keyboard the F4 key needs to be pressed (similar to pressing Alt+F4 to close OS windows).
First of all https://dictionary.cambridge.org/dictionary/english/vertexes.
Finally, if popular culture has taught us anything is that 'c's are not extreme.
There's a lot of talk around the internet about respecting each other's differences, and rightfully so. So I would appreciate it if people could respect this difference of mine.