It is currently Sun Nov 19, 2017 1:55 am

All times are UTC - 7 hours





Post new topic Reply to topic  [ 9 posts ] 
Author Message
PostPosted: Fri Nov 03, 2017 2:26 pm 
Offline

Joined: Wed May 19, 2010 6:12 pm
Posts: 2359
Do they have so much RAM that object memories can have huge tables of where every child object is in memory?, or do they allocate as much memory as they need total, and move stuff around in memory to fit?


Top
 Profile  
 
PostPosted: Fri Nov 03, 2017 4:50 pm 
Offline
User avatar

Joined: Thu Mar 31, 2016 11:15 am
Posts: 211
The amount of memory this requires is a minuscule fraction of the amount of total memory available. I don't think modern 2d game programmers worry about such things much. At least, the ones being productive don't.

There are probably dozens of ways to implement multijoint bosses, but the least surprising for me would be a scene graph for each limb and keyframe animation to move everything around. The hitboxes would be rotated with the limbs.

I don't know if that answers your questions though.


Top
 Profile  
 
PostPosted: Fri Nov 03, 2017 8:16 pm 
Offline

Joined: Sun Mar 19, 2006 9:44 pm
Posts: 919
Location: Japan
I'm assuming that even most 2D games now use common game engines that incorporate physics, so this talk is relevant (and interesting!!)

https://www.youtube.com/watch?v=NwPIoVW65pE

It even goes into multi-jointed territory.

_________________
http://www.chrismcovell.com


Top
 Profile  
 
PostPosted: Fri Nov 03, 2017 9:32 pm 
Offline

Joined: Wed May 19, 2010 6:12 pm
Posts: 2359
That was really interesting. It's interesting how I ran into the same glitches while programming an SNES game.


Top
 Profile  
 
PostPosted: Fri Nov 03, 2017 9:57 pm 
Offline
User avatar

Joined: Mon Sep 15, 2014 4:35 pm
Posts: 3108
Location: Nacogdoches, Texas
I really can't even think of a single modern 2D game with multijointed bosses. I thought that multijointed bosses were only ever a thing due to memory/VRAM bandwidth constraints. Admittedly, it often doesn't make a difference visually, particularly if the object is inorganic.


Top
 Profile  
 
PostPosted: Fri Nov 03, 2017 10:20 pm 
Offline

Joined: Wed May 19, 2010 6:12 pm
Posts: 2359
GBA and DS games were full of them


Top
 Profile  
 
PostPosted: Fri Nov 03, 2017 10:52 pm 
Offline
User avatar

Joined: Sun Jan 22, 2012 12:03 pm
Posts: 5822
Location: Canada
I think the most common thing I've seen is "skinning" of a "skeleton".
Wikipedia: Skeletal animation

The skeleton being a tree of "bones", each bone a transformation matrix that's a point and space as well as an orientation and scale. When you move/animate a bone, it moves all of its attached children bones along with it, it makes a tree hierarchy. Ultimately the animation is played back as interpolations between keyframes of various poses of the skeleton.

On top of the bones, you have the "skin". This is a 2D or 3D mesh, wherever every vertex is attached to one or more bones (e.g. a vertex in the forearm might be 90% elbow bone, 10% wrist) and will move along with those bones as they do. Physics systems often let you attach various physics shapes to bones, etc.

If you want to have rigid parts (e.g. metal pieces of a machine), just attach the vertices to a single bone. If you want to work with "sprites", you can use a lot of 4-vertex rectangles. If you want to do it without rotation, just don't rotate the bones, etc. If you don't have/want a modern GPU, meshes, etc. you can even just do sprite tiles attached to bones too. Whatever constraints you want to use to get the look/behaviour you like.

All of this applies equally to 3D and 2D work. I've seen it in both all over the place. I could probably easily come up with 100 2D examples if I looked, but I'm not going to spend time on that. Instead I'll just link a video of one of my favourites: Odin Sphere. All of its characters, bosses and otherwise, are animated this way:
https://www.youtube.com/watch?v=-nj6H5TBmcI

This video seems to have a good explanation of the whole concept:
https://www.youtube.com/watch?v=f3Cr8Yx3GGA


Why is this "modern"? Well, you could have a hierarchy of bones in the past, but the main thing that's tricky on old hardware is just the rotation and scaling of bones. You need a good floating point unit to make that turnkey, though it's certainly possible to implement on old hardware too (especially if you can live without rotation/scaling).


As an alternative to pre-made animation, you can use physics to animate bones as well. E.g. if you had something with a long tail, you could make a physical model of a bunch of connected pieces, and attach the bones to those physics objects rather than the other way around. Either way works, actually sometimes the two approaches are blended, e.g. the "inverse kinematics" technique of using a physics system to determine how a player's legs should be placed to stand on an uneven floor, blended with the animated upper body.


Top
 Profile  
 
PostPosted: Sat Nov 04, 2017 8:22 am 
Offline
User avatar

Joined: Wed Apr 02, 2008 2:09 pm
Posts: 1035
See Spine and Spriter for examples of software designed specifically for this. It's also sometimes called "puppet animation".

Fun image from this blog post:
puppet vs not.
Image

_________________
https://kasumi.itch.io/indivisible


Top
 Profile  
 
PostPosted: Mon Nov 06, 2017 2:09 pm 
Offline

Joined: Wed May 19, 2010 6:12 pm
Posts: 2359
I'm guessing Unity probably uses dynamic memory allocated object memory, because it would need to have trees of objects which can be any size at all.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 9 posts ] 

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 7 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group