View unanswered posts | View active topics It is currently Mon Nov 20, 2017 2:55 am



Reply to topic  [ 3 posts ] 
 How does Cortex Command do its sprite physics? 
Author Message
User avatar

Joined: Sun Dec 25, 2011 7:23 am
Posts: 269
Reply with quote
Post How does Cortex Command do its sprite physics?
In particular, how is it capable of creating semi-realistic 2D physics interactions from nothing but sprites?

A sprite is only composed of a bunch of tiny squares, yet if I draw a sprite circle and place it in the game, it acts as if it were actually round, rolling about and deflecting bullets at angles (given sufficient hardness).

I'm not really asking for any specifics, merely the general concept of how a physics system is capable of "detecting" angles from a bunch of squares.

Just a curious question


Thu Jan 09, 2014 12:59 am
Profile
Data Realms Elite
Data Realms Elite
User avatar

Joined: Wed Sep 05, 2007 4:14 am
Posts: 3966
Location: Canadida
Reply with quote
Post Re: How does Cortex Command do its sprite physics?
I think there are several posts about how reflection works in CC (it has no concept of line/surface detection), and particle physics (something something, sharpness is an inversely proportional to a particle's size).
I don't know if there was a post about MOSprites, though.

What I could scrounge up about MOPixels-on-px physics
Code:
M, mass
-- kg (a standard measure)? oz. (gold's value/weight per px)?
S, sharpness
-- (m/"px/m")/S; "px/m" is defined in Base.rte/Settings.ini, I think.
V, velocity
-- Knowable, but unknown; it probably involves px, or "px/m"
P, momentum/impulse?
I, structural integrity

MSV = P
P-I = P'
P'/M/S = V'
MSV' = P-I

D, distance
--D(n px)=m/"px/m"
-+-- By default, 1px is 5cm, or m/20px
-+-- In practice, this means MOPixels are smaller than 1px when \S > 1\, because S(n) = D(1px)/n
How this translates into MOSprites physics, I don't know, maybe it involves the perennial DepthCheck variable, and things.


Questions:
  1. How much Momentum/Impulse does a MOPixel need to inflict an entry/exit wound on a MOSprite
  2. How does a MOSprite impart an Impulse on MOSprites, and Pixels?
  3. How do Material/Pixel properties affect the characteristics of MOSprites/MoPixels
  4. How are distances calculated in non-rectilinear directions? Would a perfect 45 degree transit through a px be 5*2^(1/2)cm? (This is important to penetration through a thickness of px, and MOSprites) (At the very least, MOPixel-px collisions seem to be surface-blind, and freak out on non-smooth surfaces)


Thu Jan 09, 2014 8:22 am
Profile
User avatar

Joined: Sun Jan 28, 2007 10:32 pm
Posts: 1608
Location: UK
Reply with quote
Post Re: How does Cortex Command do its sprite physics?
ryry1237 wrote:
In particular, how is it capable of creating semi-realistic 2D physics interactions from nothing but sprites?

A sprite is only composed of a bunch of tiny squares, yet if I draw a sprite circle and place it in the game, it acts as if it were actually round, rolling about and deflecting bullets at angles (given sufficient hardness).

I'm not really asking for any specifics, merely the general concept of how a physics system is capable of "detecting" angles from a bunch of squares.

Just a curious question


As far as I can see? The game automatically generates a collision 'mesh' based off where pixels are and aren't, using the AutoGenerate feature of the AtomGroup and DeepGroup chunks. In theory you could probably set and build your own, but I'm not sure whether it expects a full list of every pixel or just a series of coordinates.

I'm sure there's at least one object that has an entirely manually defined AtomGroup, but I forget what.

Long story short; the ball is round because you made it round. Make sense? :grin:


Thu Jan 09, 2014 4:55 pm
Profile YIM
Display posts from previous:  Sort by  
Reply to topic   [ 3 posts ] 

Who is online

Users browsing this forum: No registered users


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 © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.
[ Time : 0.026s | 16 Queries | GZIP : Off ]