Suggestion: Sprite flipping at runtime

Started by GarageGothic, Wed 06/04/2005 17:40:24

Previous topic - Next topic

GarageGothic

Would it be possible to implement horisontal/vertical sprite flipping at runtime, writing it to a temporary sprite slot? I could really use this feature.

DoorKnobHandle

Hmm... Not really needed in Adventure Games ( However you can always have two sprites with flipped content and change the object/character view in runtime... That will result in the same effect ).

If you include flipping in runtime, then include rotating by any given degree just like in ms paint as well!

Pumaman


Orieac

Quote from: Pumaman on Wed 06/04/2005 19:38:51
Would anyone else find this useful?

And why not for objects (i know we can use views)?

Ubel

Hmm... It would be much easier than making a new view for rotating. That kind of code could be useful (for me anyway).

DoorKnobHandle

Wait... I was kinda joking with that rotating function, because how are you going to rotate a - let's say - 25x25 sized sprite WITHOUT using anti-aliasing? That's not gonna work, there's just no logical way... Programs like MS Paint or Adobe Photoshop use anti-aliasing when they rotate...

Of course, rotating by degress like 45°, 90°, 135° and so on would be fine, I guess...

strazer


DCillusion

Yeah, I could really use it.........

P.S. BEWARE CJ!! I would be using it for Twiddle-ware puzzles

Pumaman

QuoteAnd why not for objects (i know we can use views)?

Well, the likely implementation would be of the form:
static DynamicSprite.CreateAsCopyOfExistingSprite(int slot)
and
DynamicSprite.Rotate

which would mean you could then use the sprite as an object graphic if you wanted.

Quote from: [ ... ] on Wed 06/04/2005 20:19:51
How are you going to rotate a - let's say - 25x25 sized sprite WITHOUT using anti-aliasing? That's not gonna work, there's just no logical way

It's perfectly possible, it just tends to look rubbish.


Radiant

I would find rotation useful. Flipping, well, I don't see why not but the easy workaround already exists.

GarageGothic

Thanks for your response. The thing is that view flipping is currently, as far as I know, horizontal only. Or have I missed something?

I'd like to use the effect for reflective floors, parsing the current character view, loop, frame directly to a semi transparent follow-character, but flipping it in the process. Rotation would be nice too, but as CJ says, it tends to look rubbish.

Scummbuddy

i really dont see why this needs to be done at runtime. isnt this very simple to set up within the editor, and play out during the game. essentially, im asking what are the benefits of this over what you can do now? you can do everything mentioned already. im not trying to be mean, im just curious.
- Oh great, I'm stuck in colonial times, tentacles are taking over the world, and now the toilets backing up.
- No, I mean it's really STUCK. Like adventure-game stuck.
-Hoagie from DOTT

MrColossal

#13
Quote from: [ ... ] on Wed 06/04/2005 20:19:51
Wait... I was kinda joking with that rotating function, because how are you going to rotate a - let's say - 25x25 sized sprite WITHOUT using anti-aliasing? That's not gonna work, there's just no logical way... Programs like MS Paint or Adobe Photoshop use anti-aliasing when they rotate...

Of course, rotating by degress like 45°, 90°, 135° and so on would be fine, I guess...

Photoshop doesn't necessarily use antialiasing, here are 3 sprites over various sizes only rotated and no editing:







MsPaint doesn't let you free rotate and it sure as heck does not have antialiasing.

Do you know how many old school games use sprite transformation and rotation? I use it all the time in my animations for my game and to be able to freely transform something in AGS would be pretty neat.
"This must be a good time to live in, since Eric bothers to stay here at all"-CJ also: ACHTUNG FRANZ!

Pumaman

Quote from: strazer on Fri 08/04/2005 02:47:37
I've trackered all this under one entry together with earlier CJ-approved suggestions by Gilbot V7000a: http://www.adventuregamestudio.co.uk/tracker.php?action=detail&id=519

Thanks, good idea :)

Quotei really dont see why this needs to be done at runtime. isnt this very simple to set up within the editor, and play out during the game. essentially, I'm asking what are the benefits of this over what you can do now? you can do everything mentioned already. I'm not trying to be mean, I'm just curious.

The main benefit would be being able to flip/rotate any sprite at runtime, rather than having to import all the possible rotations/flippages of each sprite into the editor. For most purposes, you can just import a flipped sprite into the editor easily enough, but for some situations, especially where rotation is involved, importing every possible rotation is impractical.

DoorKnobHandle

MrColossal: Allright, I don't know what in the world put this thought about anti-aliasing and free-rotating in paint in my head... sorry about that...

And, yeah I'd sure love such a function! (Very useful for non-adventure games as well! )

GarageGothic

Quote from: Scummbuddy on Fri 08/04/2005 17:22:19
i really dont see why this needs to be done at runtime. isnt this very simple to set up within the editor, and play out during the game. essentially, I'm asking what are the benefits of this over what you can do now? you can do everything mentioned already. I'm not trying to be mean, I'm just curious.

First of all, vertical flipping would be a VERY welcome addition (or should that be horizontal? I always get confused about this in Photoshop. What I mean is turning the sprite upside down - which I suppose would be around a horizontal axis). Secondly, I assume the engine already DOES this at runtime whenever you're using flipped sprites(?), except you can only select it when assigning sprites to views. If so, the mechanics are already in there and just needs a command to control them.

Free any-degree rotation would be even cooler, but seems a lot more work.

Anarcho

This is slightly off topic, but does anybody know if there is a way with Paint Shop Pro to rotate without anti-aliasing?  I use Paint Shop Pro 5, and the most annoying thing is that when you rotate an image, it anti-aliases the hell out of it.  It means that to do simple arm movements you have to draw the whole hand instead rotating like Eric shows.

But it's different with Photoshop?  I have access to Photoshop, just wanted to finish my game before learning a new program.  Maybe i'll upgrade...


Kweepa

Yeah, with Photoshop you can choose bicubic, bilinear, or nearest neighbour interpolation when rotating and scaling (through a Preference).
Unfortunately, Photoshop Elements (2.0) doesn't give you the option, except during Image Resize, and just goes with bicubic interpolation. That's the only feature I've missed so far with Elements.

On a similar note to the request, I'd like to be able to flip an entire loop.
I can see it happening in several ways...
(a) in the view editor, create a loop that references another loop, but flips it.
(b) when playing an animation, opt to flip the loop.


For a slight overhaul of the animation system, it might be better to break down a character's animation into ACTIONS rather than VIEWS. So, you have an idle action, a fidget action, a walk action, a run action, a talk action, a pick up low action, a use high action, etc. Some actions are looped and some return to idle when finished (this is defined for each action). Each action has the four (or eight) directions and no other "loops" can be added to the action.

I suppose this can all be scripted given the current system, although it could get rather complicated for non-blocking actions returning to idle.
Still waiting for Purity of the Surf II

Skyhawk

i'm using reflective floors/water already, but it's a waste of precious sprite slotsÃ,  ;)
so a additional flip function in the view editor would be very welcome  ;D

SMF spam blocked by CleanTalk