The Daily Click ::. Forums ::. Klik Coding Help ::. Layered Armor and how to get it to not look like total ass
 

Post Reply  Post Oekaki 
 

Posted By Message

Del Duio

Born in a Bowling Alley

Registered
  29/07/2005
Points
  1078

GOTW WINNER CUP 1!GOTW WINNER CUP 2!GOTW WINNER CUP 3!GOTW WINNER CUP 4!Evil klikerHasslevania 2!The OutlawSanta Boot
2nd December, 2007 at 08:56:17 -

Hello!

For my next project I want to have all the armor pieces show up on my hero. Now the first way that I know would work would be to draw exactly ONE HUNDRED THOUSAND frames of animation for each movement for all the different possible types of armor in the game.

However, I'm fresh out of time for drawing ONE HUNDRED THOUSAND frames of animation, so I want to try something that I've never gotten to work right in the past.

I was thinking of having separate active objects for the pieces- Helmet, Shield, Body Armor- and having them "always" stick to the guy at a certain point and overlap him to give him the illusion of being a fully decked out warrior. The big problem I've had in the past is that there's ALWAYS a little bit of lag when he moves around, especially at faster speeds, and said armor pieces seem to drag a bit behind him. Not by much, but really noticable.

I played Wandering Fighter and I guess it uses an overlapping armor system much like what I want, but I'm guessing that for that game it was no problem because the hero moves like molasses so there's no apparent lag.

Question: Has anybody ever done anything like this and been successful? It'd really make my game look a lot better if I could get this to work without that awful lag that even happens during "always" events.

Thanks!

 
--

"Del Duio has received 0 trophies. Click here to see them all."

"To be a true ninja you must first pick the most stealthy of our assorted combat suits. Might I suggest the bright neon orange?"

DXF Games, coming next: Hasslevania 2- This Space for Rent!

Joe.H

Evil Faker

Registered
  19/08/2002
Points
  3305
2nd December, 2007 at 09:16:17 -

Create a mask object the same dimensions as your main character.

All movement is done using this mask object (collisions, jumping, walking etc)

Set the characters position to (0,0) of it, or whatever to make it the same position of it

Do the same for the armor/sword etc, moving it as needed.

Alternatively, always run a fastloop to change the objects' positions

Image Edited by the Author.

 
My signature is never too big!!!

nim



Registered
  17/05/2002
Points
  7233
2nd December, 2007 at 09:25:37 -

Make sure you've got the events in the right order, ie. You need to move the player and THEN attach the armour to the sprite.



 
//

Del Duio

Born in a Bowling Alley

Registered
  29/07/2005
Points
  1078

GOTW WINNER CUP 1!GOTW WINNER CUP 2!GOTW WINNER CUP 3!GOTW WINNER CUP 4!Evil klikerHasslevania 2!The OutlawSanta Boot
2nd December, 2007 at 09:36:07 -

Image

Thanks Nim I do know about that but it sometimes still lagged a bit.

How about always setting the armor pieces to 0,0 of the hero? If I just make the pieces where they would be in the same 32 x 32 box with Rovert like above?

If I could get this to work I think it'd be great.

Image Edited by the Author.

 
--

"Del Duio has received 0 trophies. Click here to see them all."

"To be a true ninja you must first pick the most stealthy of our assorted combat suits. Might I suggest the bright neon orange?"

DXF Games, coming next: Hasslevania 2- This Space for Rent!

Hernan



Registered
  04/03/2003
Points
  707

VIP Member
2nd December, 2007 at 09:54:39 -

If you set the armor to 0,0 of the hero, it will still lag a little. Maybe your missing the point of what Joe said?

So in that example, make a 3rd object (mask). This object does the movement and you set both the hero and the helmet to 0,0 of the 3rd object, so that both the hero and helmet lag at the same time.

 
This space is for rent

Joe.H

Evil Faker

Registered
  19/08/2002
Points
  3305
2nd December, 2007 at 09:59:46 -

Will SOMEBODY read my post?

 
My signature is never too big!!!

AndyUK

Mascot Maniac

Registered
  01/08/2002
Points
  14586

Game of the Week WinnerSecond GOTW AwardHas Donated, Thank You!VIP Member
2nd December, 2007 at 10:52:52 -

I read it!!

Thats how i do stuff usually. But i have an Always event at the very bottom of the events list to set positions to 0,0 of the mask.
Then if they still wont match up perfectly you can always make all the objects move at exactly the same time as the mask in the main movement code.

ie

upon holding left,
move character x - 1, move group.armour's x - 1, move group.detectors' x - 1.

 
.

Knudde (Shab)

Administrator
Crazy?

Registered
  31/01/2003
Points
  5125

Has Donated, Thank You!Clickzine StaffKlikCast StarVIP MemberGhostbuster!Dos Rules!I donated an open source project
2nd December, 2007 at 11:12:32 -

Or, you could use a invisible object to represent the player (I usually use the invisible box as a hit detector), then set the body, armor, sword, etc. to that invisible object. Then all the objects will move the same, as they will be "lagged" relative to the invisible object.

 
Craps, I'm an old man!

Del Duio

Born in a Bowling Alley

Registered
  29/07/2005
Points
  1078

GOTW WINNER CUP 1!GOTW WINNER CUP 2!GOTW WINNER CUP 3!GOTW WINNER CUP 4!Evil klikerHasslevania 2!The OutlawSanta Boot
2nd December, 2007 at 11:25:13 -


Originally Posted by /Joea Claus/
Will SOMEBODY read my post?



Sorry, my mind was slightly injured in a freak time travelling incident.
I can't really talk about it, but I'll try the mask idea.

Weird how the answer is to have everything lag at the same time, but that makes a lotta' sense.

Joe, I shall craft the finest pieces of armor in your likeness!

 
--

"Del Duio has received 0 trophies. Click here to see them all."

"To be a true ninja you must first pick the most stealthy of our assorted combat suits. Might I suggest the bright neon orange?"

DXF Games, coming next: Hasslevania 2- This Space for Rent!

Joe.H

Evil Faker

Registered
  19/08/2002
Points
  3305
2nd December, 2007 at 12:03:22 -

Shab: that's exactly what I said in my first post.

-_-'

 
My signature is never too big!!!

Knudde (Shab)

Administrator
Crazy?

Registered
  31/01/2003
Points
  5125

Has Donated, Thank You!Clickzine StaffKlikCast StarVIP MemberGhostbuster!Dos Rules!I donated an open source project
2nd December, 2007 at 12:25:49 -

Well consider that support for your answer then!

 
Craps, I'm an old man!

Hernan



Registered
  04/03/2003
Points
  707

VIP Member
2nd December, 2007 at 14:02:44 -


Originally Posted by /Joea Claus/
Will SOMEBODY read my post?


If you're also referring to me, did you read MY post?

 
This space is for rent

Joe.H

Evil Faker

Registered
  19/08/2002
Points
  3305
2nd December, 2007 at 14:28:21 -

my post about making a mask object was first

 
My signature is never too big!!!

Hernan



Registered
  04/03/2003
Points
  707

VIP Member
2nd December, 2007 at 14:55:05 -


Originally Posted by /Joea Claus/
my post about making a mask object was first



Yeah, that's exactly what I was explaining. YOUR explanation!

 
This space is for rent

Radix

hot for teacher

Registered
  01/10/2003
Points
  3139

Has Donated, Thank You!VIP MemberGOTW WINNER CUP 1!GOTW WINNER CUP 2!GOTW WINNER CUP 3!GOTW WINNER CUP 4!
3rd December, 2007 at 00:15:55 -

A cheap method is to have all your object parts have the same default movement, in addition to the always relocate event. They'll almost always stick together without lag if you do that. A similar principle can be applied to custom engines.

They way I do it in my games is not to relocate the objects to follow the leader; instead I give them relocation actions in the same event. It's important however that these actions come AFTER the main object. Example:

xinertia of MainObject > 0
--MainObject: set X position to X(MainObject) + (xinertia(MainObject)/4)
--ObjectPart1: set X position to X(MainObject)
--ObjectPart2: set X position to X(MainObject)

The following would be equivalent, but action order is irrelevant (though event order is not):

xinertia of MainObject > 0
--MainObject: set X position to X(MainObject) + (xinertia(MainObject)/4)
--ObjectPart1: set X position to X(ObjectPart1) + (xinertia(MainObject)/4)
--ObjectPart2: set X position to X(ObjectPart2) + (xinertia(MainObject)/4)

That's probably an excessive example, but how you need to do it depends on your engine.

 
n/a
   

Post Reply



 



Advertisement

Worth A Click