Pages: 1
Posted on 03-17-15, 12:03 pm (rev. 2 by  Hiccup on 03-18-15, 05:47 pm)
Birdo


Karma: 2754
Posts: 1292/2091
Since: 06-26-11
I have some questions about Classes.

1. Are they the same as the actors in SM64DS, NSMBW, NSMB2 and NSMBU/NSLU?

2. Why do some Classes in the Class Heriarchy not have Class IDs?

3: Are Classes and Class IDs the same thing? Is it only the stage actors/stage - enemy actors that have/are Class IDs?

4: Is it possible to load items in the Class Hierachy that do not have actor numbers into a level? Or are they not the sort of class that can be spawned into a level, like Goombas?
Posted on 07-18-15, 03:12 pm


Karma: 228
Posts: 19/22
Since: 10-18-12
Posted by Hiccup
I have some questions about Classes.

1. Are they the same as the actors in SM64DS, NSMBW, NSMB2 and NSMBU/NSLU?

2. Why do some Classes in the Class Heriarchy not have Class IDs?

3: Are Classes and Class IDs the same thing? Is it only the stage actors/stage - enemy actors that have/are Class IDs?

4: Is it possible to load items in the Class Hierachy that do not have actor numbers into a level? Or are they not the sort of class that can be spawned into a level, like Goombas?


Let me see if I can answer some of your questions.

First off, when talking about classes and the class hierarchy, they are NOT really related to Mario, but really related to the programming language that Mario was coded in.
In this case, the engine NSMBDS was made in was coded in the C++ programming laguage, so we are talking about C++ classes here:
https://en.wikipedia.org/wiki/C%2B%2B_classes

"A class is a user defined type or data structure declared with keyword class..."

I keep telling myself that a C++ class can be Mario, or a barn, or the universe itself. What that means is, there is no enforcement what a C++ class must be or can do. The thing that makes an enemy an enemy is the way the programmer structured/designed the class, to do enemy behaviours. In order to make Mario really work in a smart way (and yes, some of the Mario code is really smart), a specific C++ class was designed to deal with all different game interactions needed by the game, and this class is the base class of the actors. All other actors derive from this base class, so that they can all share and talk to each other.

1. Actors in SM64DS, NSMBW, NSMB2 and NSMBU/NSLU are all coded as C++ classes, so that their AI and individual data storage can be managed in an Object-Oriented way. But in order for actors to interact with each other (Mario and a platform lift for example), they all share many similar attributes, inherited from a common base class.

2. Simply because classes are not restricted to actors. A class can be anything the programmer wants it to be. Sometimes there are classes inside other classes, like an actor having an animation class to deal with animations for the actor. But that animation class is no way related to an actor, as if you would create one where you usually create an actor, the game would crash.

3. I don't really know the terms here. To me, NSMBDS uses two types of actors, one global actor called "scene" can only be alive one at a time. The other actors can all be alive at the same time, doing different things from being an enemy, or a scroll stop, or some event.

4. It is all possible. If you create a dummy C++ class with the correct header of an actor, then create a spawn structure that holds its building function and priority numbers of execution and drawing, and add the structure location to the spawn list, that class can be spawned into the game, to do anything you ever wanted. But C++ classes are only helpful for programming when you have access to the same dev tools and the source code of the game, because it uses name mangling:
https://en.wikipedia.org/wiki/Name_mangling

Without the right tools and knowlegde, and alot of manual work, it would just be too much work. I don't even know how some of those "crazy" Newer Team people were able to get their custom programmed actors into the Wii game
Posted on 07-18-15, 05:28 pm
Birdo


Karma: 2754
Posts: 1426/2091
Since: 06-26-11
Thanks. This is really helpful.
Pages: 1