Pages: 1
Posted on 06-06-13, 01:03 am (rev. 1 by  Dirbaio on 06-06-13, 02:16 am)
Super Mario
( ͡° ͜ʖ ͡°)

Karma: 9979
Posts: 3378/4456
Since: 06-08-11
First number is the vtable address (in the IDA Pro database). Second is the name, third is the Class ID, or 0 if none.

============================= Class hierachy: 0x2085260: Base - 0 0x203bce0: Base2 - 0 0x203bd40: Scene - 0 0x203968c: [No name] - 1 0x20c6e64: StageScene - 3 0x216ccd8: [No name] - 13 0x2187470: BootScene - 0 0x2189f38: [No name] - 2 0x218a9b0: [No name] - 14 0x218b530: [No name] - 11 0x218b890: [No name] - 16 0x218bc54: [No name] - 17 0x21a51f0: [No name] - 7 0x21a5248: [No name] - 8 0x21a61ac: WorldmapScene - 9 0x21a9558: StageIntroScene - 12 0x21bf874: MainMenuScene - 4 0x2231df0: MvsLStageIntroScene - 15 0x2232034: MvsLSomethingScene - 5 0x22324cc: MvsLSomething3Scene - 10 0x22326c4: MvsLSomething2Scene - 6 0x20c6c34: Actor - 0 0x203cf30: [No name] - 0 0x2126b90: [No name] - 19 0x2127840: [No name] - 18 0x20c6c8c: StageActor - 0 0x20c4f04: EnemyActor - 0 0x2123dc4: [No name] - 0 0x2125368: Spinning jump board - 254 0x2125484: Unknown - 256 0x21255a0: Unknown - 255 0x2132200: Arrow Sign - 77 0x216cef8: Red Coin - 80 0x216d030: Star Coin - 67 0x216d168: Springboard - 237 0x21f3570: Thwomp - 37 0x21f368c: Giant Thwomp - 38 0x22132e4: Boss Key - 93 0x2294e18: Squiggler - 126 0x22bbe08: Hanging Bouncing ? Block - 250 0x22bbf64: Hanging ? Block - 258 0x22ca0b4: Underwater Bounce Ball - 124 0x2123ee0: [No name] - 0 0x21320d0: End-of-Level Flag - 36 0x216e180: Hammer Bro spawn point - 69 0x2171070: ? Switch - 242 0x217118c: Brick with Red ! switch - 247 0x21712a8: Red ! Switch - 246 0x21713c4: Brick With P-Switch - 245 0x21714e0: P-Switch - 244 0x21715fc: Brick Block with ? Switch - 243 0x21d0dbc: Mega Goomba - 239 0x21d9fdc: Mummy Pokey - 128 0x21de484: Lakithunder - 129 0x21f32f0: Dry Bones - 55 0x21f340c: Giant Dry Bones - 56 0x21f9280: Cheep Cheep - 28 0x21f939c: Cheep-Cheep with coin trail - 30 0x21f94c4: Sea Weed - 301 0x22017a4: Bowser Jr. boss - 113 0x220953c: Whomp - 73 0x220cea4: Snailicorn - 91 0x2213054: Boss Activator - 114 0x2222a9c: Cheep-Chomp - 112 0x2279b24: Hammer Brother - 68 0x2279c40: Boomerang Bro - 89 0x2279d5c: Fire Bro - 88 0x2279eac: Sledge Brother - 70 0x2285864: Giant Cheep Cheep - 29 0x228c004: Blockhopper - 259 0x2291a58: Boo - 41 0x2291b74: Balloon Boo - 42 0x2296964: Shark (No generator) - 74 0x22993e0: Unagi (Eel) - 75 0x22994fc: Mega Unagi (Eel) - 76 0x229d354: Hanging Scuttle Bug - 117 0x229d5dc: Money Bag - 118 0x22c6344: Broozer - 120 0x22dab1c: Toadsworth - 134 0x212415c: [No name] - 0 0x2124048: Self-activating brick/block - 240 0x21245bc: [No name] - 241 0x2124370: [No name] - 31 0x2124484: [No name] - 32 0x21246e8: Unknown - 271 0x2124814: 0 Stick to bottom length activator left - 273 0x2124958: In air vertical scroll stop left - 284 0x2124a78: Horizontal camera offset - 282 0x2124b98: Auto Scroll Start - 276 0x2124cb8: Scroll & Mario stop sideways - 277 0x2124f7c: Fog FG effect - 300 0x212509c: Zoom - 49 0x2125228: Coin / Coin in bubble - 66 0x21256bc: [No name] - 0 0x21257d0: [No name] - 0 0x2125918: Vertical Moving Platform - 161 0x2125a6c: Horizontal Moving Platform - 163 0x2132378: Line Controlled Platform - 182 0x217fa64: Fall-when-touched Platform - 173 0x21ecc68: [No name] - 178 0x22a9414: Moving Wood Platform on touch - 174 0x22276a4: Rising Green Mushroom Platform - 192 0x22a2a54: 3-Platform Automatic Stationary Spinner - 175 0x22a9174: Giant 4 Spinning Platforms - 186 0x22b081c: Mushroom Platform - 189 0x22b094c: Horizontally Moving Mushroom - 195 0x22b0a6c: Purple Tilt Mushroom - 190 0x22b0c1c: Rising/Lowering Mushroom - 191 0x22b0dc4: Expand/Contract Mushroom - 193 0x22b0ee4: Bouncing Mushroom - 194 0x22b4554: Manual Moving Wheel - 183 0x22c03a4: Unused spinning log - 164 0x22c3d34: Scale Platform - 172 0x2125b80: [No name] - 0 0x2125c9c: [No name] - 0 0x2125dec: Vertical Moving Stone Block - 165 0x2125f48: Horizontal Moving Stone Block - 167 0x21261d4: Koopa Troopa - 95 0x2126428: Goomba - 83 0x212653c: Mini Goomba - 85 0x2126650: Paragoomba - 84 0x2126bf4: [No name] - 22 0x2126d18: [No name] - 0 0x2126e40: [No name] - 176 0x21270c8: Smashed pipe sprite - 211 0x21271f0: Invisible coin brick - 268 0x2127324: [No name] - 0 0x212748c: Pipe cannon - 202 0x213c55c: Enemy-in-Pipe Generator - 64 0x216cda4: Red Coin Ring - 151 0x216d298: Warp Entrance - 87 0x216d3c8: Tile creator/destroyer - 206 0x216d4f0: Physics affected coin - 92 0x216d620: Increase chance of drops on Mega-Mario groundpound - 62 0x216d888: [No name] - 0 0x216d774: Roulette Block - 257 0x216d9f4: Rotating Spiked ? duplicate - 251 0x216db08: Rotating Spiked ? duplicate - 253 0x216dc1c: Rotating Spiked ? Block - 252 0x216dd70: Event On/Off Switch Block - 86 0x216ded8: Flying ? Block - 260 0x216e058: Red Flying ? Block - 261 0x216ff78: Midway Point Vertical - 159 0x2170144: [No name] - 121 0x21702c8: Water - 281 0x2170414: Final Castle Create Loop - 286 0x2170568: [No name] - 71 0x21706ac: [No name] - 72 0x217084c: Event Controller - "View Enter" - 20 0x2170960: Event Controller - Multi-Chainer (If X, do Y THROUGH Z) - 142 0x2170a74: Event Controller - "If" (Uses zones) - 141 0x2170b88: Event Controller - Chainer (If X, Do Y) - 140 0x2170c9c: Random output controller (If X, do Y OR Z) - 139 0x2170db0: Input Controller - "Or" (If X OR Y, do Z) - 138 0x2170ec4: Input Controller - "And" (If X AND Y, do Z) - 137 0x217fbb4: See-saw platform - 171 0x217fd20: Warp Zone Pipe Cannon - 269 0x2186384: Unused Bouncing Bricks - 233 0x21864e4: Unknown - 229 0x21cd17c: Bowser boss - 133 0x21cd2c0: [No name] - 78 0x21cd400: Bowser Battle Switch - 265 0x21d5d1c: Petey Piranha - 119 0x21de5bc: [No name] - 97 0x21e136c: Cheep Skipper - 135 0x21e8fec: Monty Tank boss - 43 0x21ec8e4: Moving Stone Block with Spikes - 168 0x21eca28: Vs. Battle Star - 34 0x21ecb48: Vertical Platform Generator - 177 0x21efae4: Pokey - 98 0x21efc38: Jumping Fire Snake Duplicate - 106 0x21f37bc: Rotating Fire Bar - 65 0x21f9124: Random Cheep-Cheep Generator - 60 0x21f962c: Blooper - 145 0x21f9758: [No name] - 146 0x21fb26c: Kab-omb - 149 0x21fc1ac: Swooper - 90 0x2203580: Tube Piranha Plant facing Top - 26 0x2205f04: Wiggler - 111 0x22093b4: Koopa on Fence - 96 0x220b364: Skeeter (Water bug) - 81 0x220b48c: [No name] - 122 0x220e53c: Crow - 148 0x220e664: Crow Generator - 154 0x22131a4: Princess Peach - 115 0x221340c: Boss Battle Key Location - 266 0x221e58c: Bullet Bill - 58 0x221e6c8: Bullet Bill Launcher - 248 0x221e7dc: Banzai Bill cannon - 249 0x221e910: [No name] - 27 0x221ea24: [No name] - 238 0x221eb8c: Rotating Bullet Bill Cannon - 262 0x221edb4: Bob-Omb - 35 0x221f020: Spiny - 123 0x222103c: Giant Bowser/pot/Bowser Jr. - 116 0x2224294: Dorrie - 79 0x2225f5c: Hanging Metal Platform - 169 0x2226094: Falling rock platform - 170 0x22261bc: Fire Ball from lava (Podoboo) - 57 0x2228f24: Jumping Cheep Cheep - 136 0x2275ec4: [No name] - 0 0x22b43f4: Vine - 197 0x227ced4: Chain Chomp / Log - 44 0x227d0c4: Chain Chomp without log - 45 0x227e1b4: Unused Spike bass - 150 0x227e2dc: Spike Bass - 157 0x228046c: Swelling Tube - 204 0x22805bc: [No name] - 203 0x22806e4: [No name] - 205 0x2281634: Soft Cloud Platform - 201 0x228479c: Lakitu Spawner - 59 0x2284944: Lakitu -Unused - 39 0x2289194: Buzzy Beetle - 54 0x22892e4: Spiny Beetle - 147 0x2289434: Amp (Electric Ball) - 110 0x228dc7c: Flame Chomp - 107 0x228de14: [No name] - 108 0x228df34: [No name] - 109 0x2291ca4: Ghost House Pointing Hands - 152 0x2291de4: Invisible Fireball - 153 0x2291f54: Pumpkin - 127 0x2296a94: Shark generator - 61 0x229d484: Falling Scuttle Bug - 63 0x229f528: Piranha Plant - 100 0x229f6a4: Fire Spitting Piranha Plant - 102 0x22a173c: [No name] - 156 0x22a18bc: Snowball Thrower - 155 0x22a2b7c: Tornado - 225 0x22a478c: Giant Pink Floating Log - 227 0x22a48d0: Bubbles From Tube - 53 0x22a4a10: Whirlpool - 226 0x22a8f04: Draw Bridge Platform - 230 0x22a9024: Pendulum Platform - 228 0x22a92b4: Manual Control Platform - 198 0x22a954c: Wall Jump Platform - 209 0x22b1054: Slower purple tilting mushroom - 105 0x22b1848: [No name] - 0 0x22b1968: Moving Sloped Ghost House Goo (16x3) - 207 0x22b471c: Floating Small Barrel - 208 0x22b7ac4: Swelling Ground - 231 0x22b7c04: Bump from below Red Platform - 188 0x22b7d2c: Swinging Pole on Line - 184 0x22bc08c: Tight Rope - 232 0x22bc1e4: Ground Pound Gate - 187 0x22bfd28: [No name] - 0 0x22bff0c: [No name] - 0 0x22c002c: Spinning Red Rectangle Platform - 179 0x22c014c: Spinning Red Triangle Platform - 180 0x22c026c: Spinning Square Platform - 181 0x22c04e0: Flip Fence Side - 47 0x22c05f4: Large Flip Fence Side - 48 0x22c259c: Small Flamethrower - 234 0x22c26e4: Flamethrower - 235 0x22c280c: Spinning Chain with Spike Ball - 130 0x22c4ce4: Rope - 196 0x22c9144: Moving Green Blocks - 214 0x22cae60: [No name] - 0 0x22cad4c: Expandable Block - 82 0x22cd834: Sinking Snow - 200 0x22cd9dc: Falling Snow From Tree - 212 0x22cf234: Arrow - 125 0x22cf404: 1-Way Door - 213 0x22d29a4: Event Activated Door - 263 0x22d2afc: Ghost House Elevator - 215 0x22d2c60: Rotating Carry-Through-Wall Platform - 210 0x22d2da8: Groundpound Ghost House Goo - 199 0x22d4914: Giant Wiggler - 224 0x22d6184: Giant Falling Spike - 223 0x22d7b5c: Small Spiked Ball - 103 0x22d7c84: Giant Spiked Ball - 185 0x22d7da4: Spiked Ball Activator - 104 0x22dad98: [No name] - 0 0x22dac84: Mushroom House Block - 264 0x212f734: PlayerBaseActor - 0 0x21284e8: PlayerActor - 21 0x2123d6c: LastProcess - 325 0x21291d0: [No name] - 267 0x21324a8: [No name] - 236 0x2170098: [No name] - 302 0x218aa44: [No name] - 315 0x21a539c: [No name] - 317 0x21a9040: [No name] - 319 0x21a92b0: [No name] - 320 0x21adc9c: [No name] - 314 0x21bf9a8: [No name] - 305 0x21bfa4c: [No name] - 306 0x21bfad0: [No name] - 307 0x21bfc94: [No name] - 308 0x21bfd40: [No name] - 309 0x21bfdc4: [No name] - 310 0x21bfe40: [No name] - 311 0x21bfea4: [No name] - 312 0x21bff28: [No name] - 313 0x20c6eb4: [No name] - 0 0x2123d10: [No name] - 0 0x2123cc0: [No name] - 316 0x21a5300: [No name] - 0 0x21a52b0: [No name] - 318 0x21a8604: [No name] - 322 0x21a95c0: [No name] - 324 0x21bf91c: [No name] - 0 0x21bf8cc: [No name] - 323 0x20c7b90: [No name] - 0 0x20c940c: [No name] - 303 0x216e310: [No name] - 160 0x21a94e0: [No name] - 321 0x2232f8c: [No name] - 304
Posted on 06-20-13, 11:08 am


Karma: 228
Posts: 3/22
Since: 10-18-12
The base classes might be remains from Super Mario 64 DS, so looking into that game, and dump a similar list might help in naming them.

The 3 methods state machine that is used in execute, draw, etc... might also be more understood by looking into Super Mario 64 DS.
Posted on 06-20-13, 01:12 pm
☭ coffee and cream


Karma: 10398
Posts: 981/2766
Since: 06-26-11
You're right, both games are built off the same base engine.

You'll also notice that they both have the same amount of objects (326). Except unlike NSMB, SM64DS has no dummy objects.
_________________________
Kuribo64 - RH-fucking-cafe - Kafuka

zrghij
Posted on 06-23-13, 08:38 am
Shyguy


Karma: 160
Posts: 65/90
Since: 07-10-12
@Dirbaio
How did you find this structure?
Posted on 06-23-13, 09:21 am
Super Mario
( ͡° ͜ʖ ͡°)

Karma: 9979
Posts: 3442/4456
Since: 06-08-11
NSMB has a table with pointers to the constructors of all the classes that have a class id. I wrote a tool that would parse them and track all the assignments to the vtables. From there you can reconstruct the class hierarchy. 1 vtable = 1 class.

Maybe it will be different for mkds. Good luck with it.
Posted on 06-23-13, 09:44 am (rev. 1 by  Gericom on 06-23-13, 09:46 am)
Shyguy


Karma: 160
Posts: 66/90
Since: 07-10-12
Posted by Dirbaio
NSMB has a table with pointers to the constructors of all the classes that have a class id. I wrote a tool that would parse them and track all the assignments to the vtables. From there you can reconstruct the class hierarchy. 1 vtable = 1 class.

Maybe it will be different for mkds. Good luck with it.

Hmm, I have found some vtables for the differend menus. I will look in the nsmb database how it's stored there.

Edit: Is it profilePointerTable
Posted on 06-23-13, 01:13 pm
Super Mario
( ͡° ͜ʖ ͡°)

Karma: 9979
Posts: 3443/4456
Since: 06-08-11
Yes. But I'm not sure if you'll find something similar in mkds.
Posted on 06-24-13, 07:37 am


Karma: 228
Posts: 5/22
Since: 10-18-12
NSMBDS has vtables for some of the structures as well, such as vector3d and possibly the matrices as well. That means that those structures either are derived from a class/structure with a virtual destructor/member, or have one themselves. The worst part about that is that they take up more space in the ROM.

How I would have done it:

struct Vector3D
{
FIX12 x;
FIX12 y;
FIX12 z;

inline Vector3D(FIX12 x, FIX12 y, FIX12 z) : x(x), y(y), z(z)
{
}
};

How NSMBDS does it:

struct Vector3D
{
FIX12 x;
FIX12 y;
FIX12 z;

inline Vector3D(FIX12 x, FIX12 y, FIX12 z) : x(x), y(y), z(z)
{
}

virtual ~Vector3D ()
{
// Gives this struct or class a vtable
}
};
Posted on 06-24-13, 08:41 am
Super Mario
( ͡° ͜ʖ ͡°)

Karma: 9979
Posts: 3445/4456
Since: 06-08-11
Yeah I knew that. Its pretty funny.

Its making their code quite slower. First, it forces vectors to go on the stack. And second, it is assigning the vtable every time it creates or destructs one...

But on the other hand, it makes it super duper easy to recognize vectors and other structures in the stack. Lolol.

At least their compiler inlines the destructor in functions that use vectors....
Posted on 06-24-13, 04:25 pm
Micro-Goomba


Karma: 572
Posts: 12/19
Since: 06-19-11
As far as I know, the 3 methods state machine is the same in every game that uses this engine (SM64DS, NSMB, NSMBW, Animal Crossing on DS and Wii, maybe more...?)

I haven't checked, but I see no reason why it would change... This is how I decompiled it from NSMBW:

int fBase_c::processOperation(funcPtr onFunc, funcPtr beforeFunc, paramFuncPtr afterFunc) {
  int afParam;
  int result = this->*beforeFunc();

  if (result != 0) {
    result = this->*onFunc();
    if (result == 0)
      afParam = 3;
    else if (result == 1)
      afParam = 2;
    else
      afParam = 1;
  } else {
    afParam = 0;
  }

  this->*afterFunc(afParam);
}


The vector thing is crazy. I guess it does make RE easier though It's no longer virtual in the Wii games, though.
_________________________
Insert generic signature here
Posted on 06-24-13, 10:13 pm


Karma: 228
Posts: 7/22
Since: 10-18-12
Posted by Treeki
As far as I know, the 3 methods state machine is the same in every game that uses this engine (SM64DS, NSMB, NSMBW, Animal Crossing on DS and Wii, maybe more...?)

I haven't checked, but I see no reason why it would change... This is how I decompiled it from NSMBW:

int fBase_c::processOperation(funcPtr onFunc, funcPtr beforeFunc, paramFuncPtr afterFunc) {
  int afParam;
  int result = this->*beforeFunc();

  if (result != 0) {
    result = this->*onFunc();
    if (result == 0)
      afParam = 3;
    else if (result == 1)
      afParam = 2;
    else
      afParam = 1;
  } else {
    afParam = 0;
  }

  this->*afterFunc(afParam);
}


The vector thing is crazy. I guess it does make RE easier though It's no longer virtual in the Wii games, though.

I never found any clue about NSMBWii using the same enigne when I looked into it. Do you have any info about it that can help me? Like any disassembly, and locations for actors and how they are called?

The 3 method state machine doesn't seem to be any useful in NSMBDS.
When I first discovered it for myself, I was interested in actually seeing its potential, but most of the enemies and platforms REAL code were put into another virtual member that weren't part of the original engine's base class.

Kina like this:
class ExtremeNintendoFSMClassOfDoom
{
public:
        virtual int StateExecuteEnter ()
        {
                return 1;
        }

        virtual int StateExecuteUpdate ()
        {
        }
       
        virtual int StateExecuteExit (int result)
        {
                return 0;
        }
};

class BrosEnemy : public ExtremeNintendoFSMClassOfDoom
{
public:
        virtual int StateExecuteUpdate ()
        {
                this->BrosEnemyExecute ();
        }

        virtual int BrosEnemyExecute () = 0;
};

class BrosGoomba : public BrosEnemy
{
public:
        virtual int BrosEnemyExecute ()
        {
                // Do Goomba code here
        }
};

class BrosKoopaTroopa : public BrosEnemy
{
public:
        virtual int BrosEnemyExecute ()
        {
                // Do Koopa Troopa code here
        }
};

class BrosPlatform : public BrosEnemy
{
public:
        virtual int BrosEnemyExecute ()
        {
                // Do platform code here
        }
};

The result just adds more vtable entries. Maybe the player uses the state machine better? Does Mario 64 DS use the state machine better? Just interested
Posted on 06-24-13, 10:30 pm
Micro-Goomba


Karma: 572
Posts: 13/19
Since: 06-19-11
Posted by Powerline
I never found any clue about NSMBWii using the same enigne when I looked into it. Do you have any info about it that can help me? Like any disassembly, and locations for actors and how they are called?
Too much to list, I could probably spend months writing docs about it... I've ripped apart huge parts of the game, I probably know more about its internals than anyone else outside Nintendo EAD :p I'll be releasing tools and header files for compiling custom code for the game later this year.

I haven't looked into much of the code in SM64DS and NSMB; 99% of my work has been with NSMBW. I'm not as familiar with ARM as with PPC, and I just haven't had much reason to look into those (especially with the overlays).

In the Wii game, -everything- happens inside onCreate/onExecute/etc. Here's an example of a custom sprite I wrote, if seeing some actual code helps.


Also, I forgot to mention two more uses of the same engine before- Zelda: Skyward Sword and the MotionPlus demo video player are also based off this thing. Apparently EAD really likes it.
_________________________
Insert generic signature here
Posted on 06-25-13, 10:57 am (rev. 1 by Powerline on 06-25-13, 10:57 am)


Karma: 228
Posts: 8/22
Since: 10-18-12
Posted by Treeki
In the Wii game, -everything- happens inside onCreate/onExecute/etc. Here's an example of a custom sprite I wrote, if seeing some actual code helps.

That is awesome! Gives me a pretty good idea how a platform works. I am a platform freak, and NSMBW is really interesting when it comes to platforms because of the 4 player support and bilinear filter rendering.

So from my work on the NSMBW, I had almost no luck finding anything because of debugging floating point values. I like fixed point better, because you can store and check integers at any value (whereas floating point values converted to integers or float constants for testing fails, as a whole number such as 40 might actually be 39.999999f, which truncated to an integer becomes 39 and not 40). And the very well written and awesome working camera stage wrapping system written in NSMBDS were no longer supported in NSMBW because of floating point.

Two classes in your code:
Physics and StandOnTopCollider
are very interesting to me.
In NSMBDS a (rotating) platform is responsible for moving the player riding it, while the player is responsible for entering and exiting that platform. That system is very neat because it keeps the player from falling off a platform that moves at a high speed, even when standing at the very edge of it. The platform moves the player from its own origin, which is the cause of perfect sync relationship when being rendered to the screen, that only fails one frame during enter and exit of the platform.
Pushing stone blocks that push players sideways are not perfect sync, and makes players visibly appear inside a fast moving stone block (because player moves and collides with the wall, before the wall has moved).

You seem to have a good understanding of how sprites are rendered as well. That is quite interesting!
Posted on 06-25-13, 11:25 am
Micro-Goomba


Karma: 572
Posts: 14/19
Since: 06-19-11
Posted by Powerline
That is awesome! Gives me a pretty good idea how a platform works. I am a platform freak, and NSMBW is really interesting when it comes to platforms because of the 4 player support and bilinear filter rendering.
... bilinear filter rendering? You lost me there

Posted by Powerline
And the very well written and awesome working camera stage wrapping system written in NSMBDS were no longer supported in NSMBW because of floating point.
I don't think this has anything to do with floating point... It still exists in NSMBW :p

Posted by Powerline
Two classes in your code:
Physics and StandOnTopCollider
are very interesting to me.
[...]
You seem to have a good understanding of how sprites are rendered as well. That is quite interesting!
Yep, this stuff is practically identical between DS and Wii as far as I know.

I really need to come up with better names for those classes - I considered renaming the former to SimpleCollider but I haven't changed that in the Newer codebase yet.

Physics is the class used to add a solid box or round object that other actors can collide with, like the rotating blocks, moving platforms (not the ones you can jump through!), and so on. (Fun fact: the giant rotating gears in 1-Castle are composed of something like 10 of these. There's a round solid object for the centre, and each tooth is a rotated rectangle.)

StandOnTopCollider is.. just that. It's a line which is only solid on one side. Quite simple.
_________________________
Insert generic signature here
Posted on 06-25-13, 01:57 pm


Karma: 228
Posts: 9/22
Since: 10-18-12
Posted by Treeki
bilinear filter rendering? You lost me there

Motions between pixels are bilinear interpolated. That's why the texture containing stage tiles have a border of 4 or so pixels so that when a vertex is rendered between pixels on the screen, there won't be any visible gap. The bilinear interpolation makes the synced interactions between sprites look perfect when moving sub pixels. Something that NSMBDS suffer, resulting in anything riding a platform wobble back and fourth. Its a big deal to me. I rather would have NSMBDS use the math from Super Mario World where the Mario sprite moves the same amount of pixels as the platform he is standing on, no matter if the platform is moving slower than one pixel per frame.
The math is correct in NSMBDS and NSMBW, only they render sprites both hoping the 3D graphics will interpolate the resulting pixels. the Nintendo DS's 3D graphics is very bad anyway (such as clipping and flipping textures).

Posted by Treeki
Physics is the class used to add a solid box or round object that other actors can collide with, like the rotating blocks, moving platforms (not the ones you can jump through!), and so on. (Fun fact: the giant rotating gears in 1-Castle are composed of something like 10 of these. There's a round solid object for the centre, and each tooth is a rotated rectangle.)

StandOnTopCollider is.. just that. It's a line which is only solid on one side. Quite simple.

So StandOnTopCollider is typically the (rotating) platform I was talking about above. It has one value being the distance from the platform's left edge to the player, which is transformed using the angle of the platform to put the player there. In NSMBDS it uses (fixed point integer) square root to find the distance. Does it use square root in NDMBDS as well?

Physics is then the type of collision that NSMBDS doesn't have support for. I have zero knowledge of it. It is one very interesting collision detection because it can act as ground and walls and roof, and how the player can detect that, and account for multiple collision creaziness like walking onto one from tile ground, or getting crushed. So they are build of solid boxes and solid circles? So the big grass circle in 1-1 is also a round solid object?


Oh, and the wrapping support in NSMBW, I was thinking about stage wrapping similar to the multiplayer levels. They just hardcoded that wrapping mode to work for the tile screen in NSMBW (because they are all running to the right hand side keeping the scroll value from getting negative). The issue is that floating point requires modulo for wrapping (and extra stuff for wrapping negative values), and a f-modulo operation is an expensive divide.
For integer and floating point values, a simple AND operation (least expensive) will take care of wrapping, no matter if negative or not.
Pages: 1