A day of RF2 development

Discuss the development of Reality Factory 2
Post Reply
User avatar
AndyCR
Posts: 1449
Joined: Wed Jul 06, 2005 5:08 pm
Location: Colorado, USA
Contact:

A day of RF2 development

Post by AndyCR »

Just a log of tonight's RF2 development.


I normally begin by grabbing a terminal and doing a 'cvs update' to be sure I have the latest version of the RF2 sourcebase. This isn't nearly as much of an issue now, with only one developer, but it's a good habit to get into for later on, and it might be if I were to get on my laptop and hack away at RF2 for awhile, then come back to my desktop to work on it and realize half-way through that I'm working on the revision 1.13 version of a 1.14 file. Of course, CVS could help with that too; even after the fact, I just have to do a 'cvs update' and it will attempt to merge two versions of the source and warn me of any conflicts if I forgot to update until into working (like today). Nice.

After CVS assures me my code is up-to-date, I switch over to KDevelop. My goal for tonight is to work on the slider code a bit.

I realized that the checkbox I implimented last night wasn't displaying on the audio page. I then realize what happened: I forgot to add it to the page after loading it. Good grief. Solved. On to the sliders.

Sliders are something (along with most of the menu system) I never tried in RF1, so the only indications that I am doing correctly are I get expected results from the code I write, and that the fields load correctly from the menu ini. This may sound like a rather silly way to do it, but it really works.

I have a rough idea how the sliders will work. The menu event reciever already recieves mouse release signals (for the buttons and checkboxes), so I simply need to impliment a mouse button down signal. It works in this way:

(In the slider code:)

Is the mouse over my slider widget?
(Yes)
Ask the receiver if the mouse button has been pushed down.
(Yes)
Every frame, set the slider widget's X coordinate to that of the mouse cursor, unless the mouse cursor passes out of the slider's range, in which case stop until the cursor comes back into range. Check every frame whether the event receiver has received a mouse release signal, and if so, stop moving the slider widget and calculate the new percentage.

Is the mouse over my background widget?
(Yes)
Ask the receiver if the mouse button has been pushed down.
(Yes)
Set the slider widget's X coordinate to that of the mouse cursor.

I begin by modifying the mouse release method's name, which was ReceiveMouseClick, to the more accurate ReceiveMouseRelease, and change all the appropriate references to it in the code. I also fix a spelling mistake which occurred in the code about 17 times ('reciever' instead of 'receiver').

Next, I implement a temporary MenuElementLoader::InitializeSlider method. I fire up RF2, only to find that the audio page does not show a slider graphic of any kind anywhere. I begin to worry, when I realize I again forgot the Load(Element name here) method call. I'm getting good at that! One line added, a build, and life is good. Confident that I have a slider on the audio page, I begin working on the MenuSlider class itself.

I had no idea how sliders worked, and the manual offered little help. It seemed an awful lot of information crammed into such a small space! Where did it define the coordinates for the background?? Then I noticed a little definition called 'Images'. Sigh. THAT might make it a little easier. I begin work on the MenuSlider::Initialize method, committing the source to CVS when I am done.

I implieent the LoadSlider method, which loads a slider from a file. A rebuild, some error fixes, and another rebuild, rinse and repeat once, and I'm in business with the sound volume slider loading into the audio page just fine, albeit it ignores mouse events. I do another CVS commit.

Time for a break. Since I'm to a point where it's pretty much either collect items or face the final boss in Metroid Prime, my usual break venue is not an option. I decide to have a cup of milk and a few cookies while browsing some forums.

Back to KDevelop. Time for some mouse response.

I begin by adding a MenuReceiver::ReceiveMouseDown method. I implement basic slider movement using the mouse, not taking into account the limits of the slider. There is an odd bug where it won't go back to a lesser value, but I will wait until tomorrow to solve it. For now, I will do a cvs commit and call it a night.


My motto for RF2 is "Respecting the past while not forsaking the innovations of the future." I hope this has provided some information on how RF2's development is progressing. :D
User avatar
SithMaster
Posts: 306
Joined: Mon Jul 04, 2005 11:45 pm

Post by SithMaster »

Sounds good but i have a few questions.

firstly what kind of cookies?

secondly did you gather items or fight the boss?

thirdly sounds complicated what docs are you using to program? a book, ebook, or a forum/online tut?
The brightest light casts the darkest shadow.
Burn the heretic. Kill the mutant. Purge the unclean.
User avatar
AndyCR
Posts: 1449
Joined: Wed Jul 06, 2005 5:08 pm
Location: Colorado, USA
Contact:

Post by AndyCR »

1. ginger snaps, though i prefer sugar cookies.

2. i didnt do either, i browsed some forums and had cookies and milk.

3. the standard issue rf1 docs.
Post Reply