[Finished] [RGSS] First task

Started by Blizzard, March 09, 2011, 03:15:18 am

Previous topic - Next topic

Blizzard

March 09, 2011, 03:15:18 am Last Edit: September 10, 2011, 03:27:37 am by Blizzard
I have added the headers and source files for the RGSS classes in ARC. I have added them under the zer0::RGSS namespace because our final implementations of those classes will be different in the end.
I will have to implement some of the tricky classes (and later you guys), but for now you guys can already sit down and work on the basic classes if you want. The following classes need to be implemented:


  • Color

  • Font

  • Rect

  • RGSSError

  • Table

  • Tone



I have declared that some of those classes already use existing implementations in April & Friends so in those cases you only have to interface the already existing functionality and extend them with RGSS's additional stuff. Refer to the headers of the already existing classes.

Note: Even though Tone has nothing to do with Color, I think that we should use the april::Color class because it's already there.
Check out our game brands:

Daygames
Game Night Games
Chugnar Games

Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

Ryex

what should we do about the _dump and _load methods. I'm thinking that those should be left out of the C++ classes and be implemented on the ruby side.
I no longer keep up with posts in the forum very well. If you have a question or comment, about my work, or in general I welcome PM's. if you make a post in one of my threads and I don't reply with in a day or two feel free to PM me and point it out to me.<br /><br />DropBox, the best free file syncing service there is.<br />

Blizzard

Leave them out for now. We'll decide later. We can always first go with the Ruby implementation and later substitute it with a faster C++ version.
Which of these classes have _dump and _load? Color, Tone and Table have it for sure. I don't think the others do.
Check out our game brands:

Daygames
Game Night Games
Chugnar Games

Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

G_G

Me still confused on how C++ fully works, are we placing this in Color.cpp or Color.h?

Blizzard

Color.h has only the declaration of the methods, Color.cpp has the implementation.
You can take a look at april::Color, you should get the idea.
Check out our game brands:

Daygames
Game Night Games
Chugnar Games

Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

G_G

Am I doing it right?
RGSS/Color.h
Method I am cloning Color.red = value
namespace zer0
{
namespace RGSS
{
class zer0Export Color : public april::Color
{
public:
unsigned char red;
unsigned char green;
unsigned char blue;
unsigned char alpha;

void red operator=(unsigned int value)
};

}
}

Blizzard

March 09, 2011, 04:58:06 pm #6 Last Edit: March 09, 2011, 05:01:05 pm by Blizzard
You won't be able to clone that one. You actually don't even have to. Just make getRed and setRed methods and return and set r from april::Color. We will make the .red and .red= interface later with Ruby.

EDIT: Eh. I just remember that RGSS's Color use float values from -255 to 255. :/ Nvm about the inheritance, just implement the whole class. Same with Tone. BTW, you can use hclamp(value, -255.0f, 255.0f) to limit the value. Remember to include <hltypes/util.h>.
Check out our game brands:

Daygames
Game Night Games
Chugnar Games

Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

G_G

Oh okay so something like this then?
namespace zer0
{
namespace RGSS
{
class zer0Export Color : public april::Color
{
public:
unsigned char red;
unsigned char green;
unsigned char blue;
unsigned char alpha;

void setRed(unsigned int value);
void setRed(unsigned char value);
float getRed();
};

}
}


Then in Color.cpp in the actual methods use the clamp method to keep the values in bound. Ooh I think I'm getting the hang of this >:3

EDIT: Offtopic, but if this is done before I go to college, does anyone mind if I include it in my portfolio? Or hell even if its not done?

Ryex

should we use a 1d or an 3d hlist for the Table class?
I no longer keep up with posts in the forum very well. If you have a question or comment, about my work, or in general I welcome PM's. if you make a post in one of my threads and I don't reply with in a day or two feel free to PM me and point it out to me.<br /><br />DropBox, the best free file syncing service there is.<br />

Blizzard

March 09, 2011, 05:23:12 pm #9 Last Edit: March 09, 2011, 05:24:18 pm by Blizzard
I suggest we make it work with normal arrays. It's the most optimized way.

short*** data;
...
this->data = new short[][][xsize];
*this->data = new short[][ysize];
**this->data = new short[zsize];


I'm not entirely sure about the syntax, but this is the idea.

@G_G: You can include it in your portfolio even while it is in development. You are a developer of this project, you are entitled to credit as much as anybody of us. :)

BTW, setRed(float) is enough.

EDIT: @Ryex: We can also use one 1D array for that and use coordinate translation.
Check out our game brands:

Daygames
Game Night Games
Chugnar Games

Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

G_G

Alright, committed final Color.h. Now from my understanding when I type up Color.cpp we are using the color class from April right? How am I going to do that exactly without conflicts?

Blizzard

March 09, 2011, 05:54:16 pm #11 Last Edit: March 09, 2011, 05:58:52 pm by Blizzard
No, just remove the inheritance. Code the class from scratch. April's Color class does not support negative values and it uses unsigned char (basically a 1-byte int) instead of float.

EDIT: Actually I quickly did the edits. You can continue the implementation.
Check out our game brands:

Daygames
Game Night Games
Chugnar Games

Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

G_G

March 09, 2011, 06:26:50 pm #12 Last Edit: March 09, 2011, 06:32:25 pm by game_guy
Alright, color should be done, thanks to blizzard for fixing some of my code and for adding the set method that I forgot to >.<

EDIT: Working on Tone right now.

EDIT: Do I remove the inheritance of april's color in Tone too?

ForeverZer0

Okay, I finally got the files. SVN is still very buggy, so I may have to wait until tomorrow to commit, but I'll start on Rect. Nice easy one to learn on...
I am done scripting for RMXP. I will likely not offer support for even my own scripts anymore, but feel free to ask on the forum, there are plenty of other talented scripters that can help you.

Ryex

March 09, 2011, 10:31:36 pm #14 Last Edit: March 09, 2011, 10:59:26 pm by Ryex
the Table class is done. I would work on the Font class but atres doesn't make sense to me. unless I'm over thinking it and we just need a general data structure.
I'm also not sure about RGSSError. I'm thinking that it should inherent from an april error class.
I no longer keep up with posts in the forum very well. If you have a question or comment, about my work, or in general I welcome PM's. if you make a post in one of my threads and I don't reply with in a day or two feel free to PM me and point it out to me.<br /><br />DropBox, the best free file syncing service there is.<br />

G_G


Blizzard

Quote from: game_guy on March 09, 2011, 06:26:50 pm
EDIT: Do I remove the inheritance of april's color in Tone too?


Yes.

Quote from: Ryex on March 09, 2011, 10:31:36 pm
the Table class is done. I would work on the Font class but atres doesn't make sense to me. unless I'm over thinking it and we just need a general data structure.
I'm also not sure about RGSSError. I'm thinking that it should inherent from an april error class.


You don't have to understand atres for that. Just make a replica of RGSS's Font class. I don't think it actually provides any functionality except containing data. I will bind those things together later.
As for RGSSError, you have a generic exception class in hltypes.
Check out our game brands:

Daygames
Game Night Games
Chugnar Games

Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

Ryex

March 10, 2011, 02:54:49 am #17 Last Edit: March 10, 2011, 03:57:24 am by Ryex
Quote from: Blizzard on March 10, 2011, 02:45:24 am
You don't have to understand atres for that. Just make a replica of RGSS's Font class. I don't think it actually provides any functionality except containing data. I will bind those things together later.
As for RGSSError, you have a generic exception class in hltypes.


I knew I was over thinking it. now why didn't I notice the exception class?

EDIT: I committed the Font class, I come on here and noticed that you had posed some coding conventions and I havn;t faollows some of them so I'll update my work tomorrow.
I no longer keep up with posts in the forum very well. If you have a question or comment, about my work, or in general I welcome PM's. if you make a post in one of my threads and I don't reply with in a day or two feel free to PM me and point it out to me.<br /><br />DropBox, the best free file syncing service there is.<br />

G_G

Was there a reason the get methods were removed?

Blizzard

March 10, 2011, 05:54:45 pm #19 Last Edit: March 10, 2011, 05:59:29 pm by Blizzard
Yes. If a class has a trivial get and set method, there is no real need for a get and set method. The variable can simply be made public because in Ruby it will be accessed as if it was public. It will make exposing our temporary RGSS classes to Ruby simpler. I realized that while reviewing the code.
Check out our game brands:

Daygames
Game Night Games
Chugnar Games

Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.