Problem - Objects just instantly appear in the game world. Looks naff.
Suggestion - Have a simple build animation play when something is built.
Implementation -
1. Make a big, square shaped, animation. Blue electrical plasma movements (like in the game "Subnautica"), rocky brown boulders and dirt flying around, grey granite boulders and grey dirt flying around, that kind of thing. Could have several animations, assigned to objects by theme.
2. Apply a transparency image mask to a newly created object. Black = Object invisible (0%), White = Object visible (100%), Greys inbetween = Transparency level. Match the shape of the object. The object instantly is in the game world and instantly functioning - as per the current game implementation. However, the black part of the image mask makes the object completely invisible.
3. Play the animation over the object. Animation transparency is the inverse of the object transparency.
4a. Two choices here: Either, make the object go wholly from 0% visible to 100% visible over the duration of the animation. The animation becomes progressively invisible, while the object becomes progressively more visible.
OR
4b. A more fancy way would be to make any area that the animation draws over becomes visible - having the animation sweep over the whole object through its duration. (The game "Subnautica" demonstrates this. Notably, in 3D, but this is entirely implementable in 2D).
Animation duration would vary according to building size/importance. Fraction of a second for belts, perhaps several seconds for launch pad.
Suggestion - Simple Build Animation Overlay
Moderator: ickputzdirwech
- eradicator
- Smart Inserter
- Posts: 5206
- Joined: Tue Jul 12, 2016 9:03 am
- Contact:
Re: Suggestion - Simple Build Animation Overlay
From an eye-candy perspective it'd be nice to have some sort of animation for large machines (i.e. not belts/inserters). But i'm sceptical wheather it's possible to generate a generic animation on the fly. I guess one could use the non-transparent bits of the building as a mask for the building animation so it's not too large, but it's still a bit wonky. Things are further complicated by the construction overlay of the thing you're holding in the cursor, which at the time of building overshadows the actual structure (not an issue for bots).
Do you have a link to what it looks in subnautica? Edit: searched for random bits on yt and i guess you mean the effect in this video @ 26:23? That looks more like a highly erratic paint job than a construction animation. Things aren't constructed from random floating bits outwards. :)
From an in-lore perspective you're not really building stuff on site. It's already premade and you just carry it over to where you want it and put it on the ground.
Do you have a link to what it looks in subnautica? Edit: searched for random bits on yt and i guess you mean the effect in this video @ 26:23? That looks more like a highly erratic paint job than a construction animation. Things aren't constructed from random floating bits outwards. :)
From an in-lore perspective you're not really building stuff on site. It's already premade and you just carry it over to where you want it and put it on the ground.
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
Re: Suggestion - Simple Build Animation Overlay
Given the building is compressed, and expanded on-site, perhaps animate the building expanding?
Re: Suggestion - Simple Build Animation Overlay
"...perhaps animate the building expanding?" - That sounds like a good solution.
- bobingabout
- Smart Inserter
- Posts: 7352
- Joined: Fri May 09, 2014 1:01 pm
- Contact:
Re: Suggestion - Simple Build Animation Overlay
this kind of reminds me of the old command and conquer stuff, like the MCV deploying and growing in size, or just things like the war factory coming up from underground and expanding.
- eradicator
- Smart Inserter
- Posts: 5206
- Joined: Tue Jul 12, 2016 9:03 am
- Contact:
Re: Suggestion - Simple Build Animation Overlay
Expansion from center doesn't work because you can't derive the center of a building from the sprite. Think of a tall building with a small footprint (i.e. a gas vent). I'd go for a linear blend in. Here's a crude example:
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
Re: Suggestion - Simple Build Animation Overlay
Actually, it should work, most (but not all) of the tall entities have a selection/collision box centred around the base area.
Power poles, for example, have a collision box that's centred around their base area, so scaling the entity image from icon-size to entity size around the centre of entity should look about correct.
"Flat" entities (most of the crafting machines) likely have the centre sufficiently close to the visual centre of the image that just varying the scale of the graphic should look okay-ish.
Ideally, the visual centre of the entity and the centre of the collision box should coincide, but that's an artefact of the graphical design; arguably all buildings should extend somewhat above the top of the tiles that they sit upon.
Power poles, for example, have a collision box that's centred around their base area, so scaling the entity image from icon-size to entity size around the centre of entity should look about correct.
"Flat" entities (most of the crafting machines) likely have the centre sufficiently close to the visual centre of the image that just varying the scale of the graphic should look okay-ish.
Ideally, the visual centre of the entity and the centre of the collision box should coincide, but that's an artefact of the graphical design; arguably all buildings should extend somewhat above the top of the tiles that they sit upon.