aliens

Author Topic: UnitSprite Studio  (Read 2758 times)

Offline Leflair

  • Colonel
  • ****
  • Posts: 133
    • View Profile
Re: UnitSprite Studio
« Reply #15 on: April 12, 2021, 01:36:43 pm »
I´ve figured out how to use the shift animation tool now, not entirely intuitive so here is a little tutorial:
By default ALL frames are selected, haven´t found a better way but if you just click "go" and then ctrl+Z to undo, you can now select to move only inside one frame.
By default the body part you´ve selected is what you´ll move. Haven´t found a way to move all parts of a body yet.
You set the direction you want to shift with LEFT CLICK, opposite of the GUIDE LINE
The guide line is by default up in the left corner, this prevents adjustments in half the directions so use RIGHT click to move the guideline anywhere (a red cross hair shows up to show its location).
[Suggestion: To make this tool more intuitive, having the guideline show up centred in each frame by default would help, with a check-box to hide it]

The LEFT CLICK and pixel movement is then RELATIVE to the red cross hair guideline.
Example: Right click on the SHIFT ANIMATION frame you´ve picked. This sets the red GUIDE LINE.
Now LEFT CLICK one pixel ABOVE the red cross hairs and click GO. The body part will move DOWN 1 pixel. If its the first time, ALL of the selected frames will move if you click GO! (i.e the same as if you clicked GO FOR ALL FRAMES, the second go button).  CTRL+Z to undo and now do it again to just move 1 frame at a time.
Left click diagonally UP to the RIGHT, and the body part will move diagonally DOWN-LEFT.
Basically it works like a joystick in an aircraft (inverted input). [Suggestion: An option to have it not inverted could also help.]

There´s probably more commands here that I´ve not figured out yet, but this tool is fantastic for adjusting misaligned arms and such in movement cycles or finding over-flowing pixels that stick out and show up in other frames.
« Last Edit: April 12, 2021, 01:40:11 pm by Leflair »

Offline Buscher

  • Captain
  • ***
  • Posts: 74
    • View Profile
Re: UnitSprite Studio
« Reply #16 on: April 24, 2021, 09:15:48 pm »
Would it be possible to do a debugging session? I am trying to get your studio to run in Linux. The handobmaker starts with wine-6.6 (Staging) + dotnet45 but I haven't got this to run yet.

The most important part in the log seems to be
Code: [Select]
wine: Call from 7BC2BF20 to unimplemented function MSVCR100_CLR0400.dll._initterm_e, aborting
which is printed till the stack overflows.

If you want I can open an issue on your github or perhaps we can talk in discord?

Offline bohemond

  • Sergeant
  • **
  • Posts: 20
    • View Profile
Re: UnitSprite Studio
« Reply #17 on: April 25, 2021, 02:33:01 am »
New version released (on github):
Drawing routine 10 - Muton
Support for GIF
Minor bugfixes

@Leflair,@gaffer:
The selections are a little clunky, but I'm pretty sure cut/copy/paste works, as well as moving the selected pixels around.
To move the selected pixels, you must hold ctrl and drag with the left mouse button.
The shortcut to deselect and drop the pixels back in is CTRL-D.

If you're having problems, it's most likely because the pixels you want to move are on a different layer.

@Yankes:
I'm not familliar with this feature, can you provide a sample spritesheet and a proposal of how to support it in the application?

@Leflair, ad Shift animation
That tool is very unintuitive, as you wrote. Even I have problems getting it right on the first try.
I've been trying to write an explanation of how it works, but I can't do it.
Simply put; It translates the pixels from coordinates marked with the white crosshair to the coordinates marked with the red crosshair.
You can shift a single frame with just right-click and then left-click in the frame you want to move, I don't think any tricks with undo are needed.

@efrenespartano:
I'm not sure I understand what you need. I've never done any unit sprite recoloring myself.
I came up with something like this:
You would select which layers and frames you want to change, then create a list of operations to do on the pixels. For example 'Change color' or 'Change brightness' and then apply the operations.
I've added a draft of how the UI could look.

Offline greenscarf

  • Sergeant
  • **
  • Posts: 26
  • hello world
    • View Profile
    • reddit page
Re: UnitSprite Studio
« Reply #18 on: April 25, 2021, 04:14:18 am »
a great tool, reduced my worktime tenfolds :D
it's a but hard to use digitizer tablet with it tho. drawing lines are not easy, it gets dtuck midwhere and I have resorted to stabbing pens like as if i was drawing a pointillism painting. but anyway it's a novel work and I love it. please keep going on great work.

Offline Yankes

  • Commander
  • *****
  • Posts: 2521
    • View Profile
Re: UnitSprite Studio
« Reply #19 on: April 25, 2021, 11:57:06 am »
@Yankes:
I'm not familliar with this feature, can you provide a sample spritesheet and a proposal of how to support it in the application?
OXCE feature is simply you write script that get offset to "body part" in spiritsheet and restoration offset of given part.
Result of script that add more rotation to every part:
https://www.youtube.com/watch?v=q0-RwIvLUxw
Here constant animation of 2x2 unit (please ignore different script that recolor unit after hit)
https://www.youtube.com/watch?v=71n4gmk0Zbc

In both this examples there was used standard spiritsheet but script is not limited to it.

Some example of working script hooks that alter animations:
https://openxcom.org/forum/index.php/topic,5245.msg78242.html#msg78242
https://openxcom.org/forum/index.php/topic,6303.msg96798.html#msg96798


Offline efrenespartano

  • Commander
  • *****
  • Posts: 675
  • I know a lot about the law and other lawyerings.
    • View Profile
Re: UnitSprite Studio
« Reply #20 on: April 26, 2021, 04:32:07 am »

@efrenespartano:
I'm not sure I understand what you need. I've never done any unit sprite recoloring myself.
I came up with something like this:
You would select which layers and frames you want to change, then create a list of operations to do on the pixels. For example 'Change color' or 'Change brightness' and then apply the operations.
I've added a draft of how the UI could look.

Basically this is what I had in mind! Thanks a bunch, looking forward to see it implemented

Offline Leflair

  • Colonel
  • ****
  • Posts: 133
    • View Profile
Re: UnitSprite Studio
« Reply #21 on: April 26, 2021, 03:15:09 pm »
Thanks for the explanations!

Request: Probably already planning to add this, but I got a Snakeman based movement type unit.

I´ve bumped into one strange possible error that I need to investigate a little more, but I´ve noticed a ingame-animation gap on a movement type 0 unit (Between leg and torso in 1-2 frames), where in the UnitSprite Studio movement loop it shows no error. First thought was that the game was reading some other older version of the spritesheet, but it looks to be the correct sheet its reading. So the second idea is that the Unitsprite Studios animation position for the legs doesn´t match the ingame one.

Possibly in the left side-ways animation walking direction loop, 1 pixel too low. I´ll do some more testing.

e: Note, this would be on the older non-muton and possible bug fixes version.
« Last Edit: April 26, 2021, 03:16:41 pm by Leflair »

Offline bohemond

  • Sergeant
  • **
  • Posts: 20
    • View Profile
Re: UnitSprite Studio
« Reply #22 on: April 29, 2021, 09:36:31 pm »
@greenscarf: I finally realized what you meant; It's not about the tablet, it's about sloppily programmed paint tool. It does not interpolate the line and just draws a pixel where the cursor currently is.
I'll add an interpolating pen in the next release, which I think is what you need.

@Leflair: I checked some unit sprites I have, but I can't see the error in any animation.

Offline bohemond

  • Sergeant
  • **
  • Posts: 20
    • View Profile
Re: UnitSprite Studio
« Reply #23 on: May 01, 2021, 12:16:34 am »
New version released (on github):
Drawing routine 6 - Snakeman
Pixel operations tool (Can be used to recolor)
Paint tool interpolates
Help shortcuts contains more shortcuts
Single frame 'Drawing routine'

Pixel operations tool:
You can use the tool to recolor the sprite.
I've tried to make it as simple as possible, but I fear that I have failed as usual.
The basic use is such: You setup the steps that will be applied to the sprite and you select which frames should be affected. Then you click RUN.
The operations run from top to bottom in sequence. You can use this to your advantage, recoloring in the correct order.

Notes:
You can use Alt-Click (with paint tool) in the main window to get the group color into the operation dialogue.
Be aware that the 'Death' frames are usually handled completely differently from the rest of the sprite. So when you are recoloring, the layers don't apply to it. You can get a nasty surprise if you're not careful, that's why I made the Death frame checkbox yellow, so that it's easier to remember that there might be some problem.
It always recolors all directions and the whole animation. I did not really see a use-case for there to be more options, but if there is a need to recolor just some direction, it can be implemented.
Double clicking the Step list will let you edit the operation.

If anyone can think of other operations on pixels they'd like to use, don't hesitate to request them.

Single frame drawing routine:
This can be used to load a normal sprite. This is highly experimental. It can be used to edit FloorObs. I made this especially to be able to use the recoloring tool on the corpse sprite. It does not work with images of other sizes. Expect crashes when using this.

Offline efrenespartano

  • Commander
  • *****
  • Posts: 675
  • I know a lot about the law and other lawyerings.
    • View Profile
Re: UnitSprite Studio
« Reply #24 on: May 02, 2021, 06:10:38 pm »
Awesomeeeeeee!

I was waiting for this, thank you so much! Your tools make my life easier. :D

Offline Nord

  • Commander
  • *****
  • Posts: 1330
  • The Gate will open... someday.
    • View Profile
Re: UnitSprite Studio
« Reply #25 on: October 22, 2021, 10:36:21 am »
It is a great tool, must-have for any modder!
Thank you,bohemond.
Do you still working on this, or this version is final?

Offline bohemond

  • Sergeant
  • **
  • Posts: 20
    • View Profile
Re: UnitSprite Studio
« Reply #26 on: October 26, 2021, 12:09:25 am »
Definitely not the final version yet, but I haven't been working on it for quite a while.
I still have to add a bunch of Drawing routines, support for TFTD, custom frames, and maybe a few other things.

Offline Nord

  • Commander
  • *****
  • Posts: 1330
  • The Gate will open... someday.
    • View Profile
Re: UnitSprite Studio
« Reply #27 on: October 26, 2021, 02:20:16 pm »
Then it will be even greater!
Good.
Indeed, this tool allows to fix multiple bugs in unit spritesheets and create new sheets with double or even triple speed.