Wednesday, July 27, 2011

I'm back!

Well, slightly.

After much putting-off and, now that my shoulder is better, a whole lot of working, I finally got back to the game, and the original game that I'm working on with David, no less.  I didn't actually change a whole lot as of yet, but I've gone back and did some work on my linked sprites.

If you recall, from so very, very, very long ago I devised the system (or rather, I devised my own system) that wold allow me to link sprites together so they would rotate, scale, move and do all of that fancy stuff together.  Well as it would turn out, if I wanted to link in any sort of meaningful way, I'd have issues.

Here's how it works: If one image was to be rotated, it would rotate, then it would call on it's linked images to rotate individually.  Which for figure 1, works just fine and dandy.

HOWEVER, if I had a situation such as figure 2.1 or 2.2, then problems begin to arise.  In figure 2.1, only the first and second image would be rotated, because the third image is attached to the second, but the second doesn't go through it's own linked list, because if it did it would also rotate the first image because the two are linked.  Then there would be infinite rotation and the program would crash.

Same for figure 2.2, if they went through all of the links, each image would keep thinking "oh! I'm linked with him, let's rotate!" when they go to be rotate themselves, resulting in infinite stupidity.


The solution?  Well it kind of makes sense, but it was rather frustrating to implement.

Every time an image calls for a rotation, it passes to the next image it's own personal ID number, and the ID number of the other images that the original is linked too.  These ID numbers become "off limits" and if the second image tries to change any of these images, either the original image or an image that the original image will change in a later update, it is barred from doing so.  Which means a few things: I can be, in a sense, pretty sloppy with how I link images.  I don't have to be certain that images are only linked in a certain fashion, I can link however many I want, in any way I want and it will all be fine and dandy the minute I  try and adjust even one of them.  Not to say that I can just go crazy with linking images as that would probably kill the heck out of my processor, but one image can be linked to many, and they will all function properly.  Any linked image can be tweaked, and all will be effected, and the game won't crash.

Later, I added in one-way linking, which I should have done from the beginning, but one-way linking means one image is considered the base, changes to the base will affect the secondary, but changes to the secondary will not affect the base.  Cool?  Meh. Useful? Um, sure?

The whole exercise?
Hopefully it will be of much use in the future, for the sake of this game, it doesn't change a whole lot, but it enables me to get back on the saddle, so to speak.

I work at the lake tomorrow, but hopefully I'll get some coding in!

Until next time (hopefully not so long as this...)


-Kev

Tuesday, July 5, 2011

Technical difficulties


The following were my emotions in the past weekend/half week since the last (real) update.
Anger


Boredom/ lack of motivation

Panic that summer is moving too quickly
I have no game updates, and no finished Pong remake.  I have discovered that my radian math was working... but working backwards.  I have spent the past three or four days fiddling with the system on and off, trying to reverse my reversal to get radians to work as they should, and properly.  The thing is XNA also seems to do some weird things with radians.  My perfecionsim has been showing these past few days, and I have got nothing done in my effort to reverse my wrongs.

The problem being, is that my wrongs worked.  If you recall, I linked another Dev Blog for a game called The Witness a week or so ago.  I doubt any of you watched the video, but I watched the video and the writer had some excellent points about programming (from a games perspective) such as make a system that works, worrying about optimization is usually premature.  Now in this instance I'm not trying to optimize... but I am trying to fix something that was only technically broken, not really broken.
Yup

So now I must decide.  Do I undo all that I have done and go back to what I had before, a working yet backward system, or forge forward with this bug hunt that has worn me down to the bone?

Tough choice.

I'll let you know what I decide... when I decide it.

-Kev

LATE EDIT:

I went through with it.  As of now, I have un-reversed everything (noticeable) I'll probably be working through the rest of the stuff later.

In "celebration"...


LATE EDIT:

Saturday, July 2, 2011