View unanswered posts | View active topics It is currently Mon Oct 22, 2018 9:06 am

 Page 1 of 1 [ 3 posts ]
 Print view Previous topic | Next topic
How does Cortex Command do its sprite physics?
Author Message

Joined: Sun Dec 25, 2011 7:23 am
Posts: 269
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
Data Realms Elite

Joined: Wed Sep 05, 2007 4:14 am
Posts: 3966
Location: Canadida
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

Joined: Sun Jan 28, 2007 10:32 pm
Posts: 1608
Location: UK
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?

Thu Jan 09, 2014 4:55 pm
Display posts from previous:  Sort by
 Page 1 of 1 [ 3 posts ]

#### Who is online

Users browsing this forum: Google [Bot]

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

Search for:
 Jump to:  Select a forum ------------------ Cortex Command    Dev Log    Wiki    Game Discussion    Game and Licensing Support    Mod Making       Lua Scripting       Requests    Mod Releases       Older Mods    Scene Releases       Scene Making Planetoid Pioneers    Game Discussion    Pioneer Program Lounge Data Realms Off-Topic    Off Topic Chat       Gaming       Forum Games    Site Support & Feedback
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.
[ Time : 0.018s | 18 Queries | GZIP : Off ]