Here we are once again. I did manage to complete the sound assignment. Working with FMOD was an enormous pain. Doing something in Ogre is bad enough. Having to learn and implement FMOD on top of that was a nightmare.
The hardest part of the assignment was getting the sounds to load in. Once that was accomplished, which was really just to change a boolean to false, the rest of the assignment either involved using commands built into FMOD to implement the features necessary for the question or coming up with a custom work-around. These usually amounted to a sort of jerry-rigging of code, but in the end they worked nonetheless.
I expected the Doppler Effect to be the hardest thing to implement, but once I figured out how to pass values to the sound channel so it would move with the Ogre Scene Node it was really straight forward. The hardest feature ending up being able to play only a user specified portion of each available sound. For that I used a combination of channel->setPosition and loop points.
Now all I have to do is make it presentable for Wednesday.
Game Engine Take 2: The Revenge
Monday 3 December 2012
Monday 26 November 2012
Now or Never
Well...this is it. I spent all week on a 5000 word final paper for my fourth year class, but it's finally done (pretty much). Everything else is now out of the way and I'm left with one hard question to do before the exam. I have 1 week. I'm very worried. I'm STILL not sure whether I'm going to attempt the FMOD question, which after looking at it today seems like an unbelieveable pain in the ass, or if I'm going to dive hardcore into the AI question and just hope for good results.
My only strategy going into this is to ask somebody tomorrow during GDW if the FMOD question is perhaps, as I'd previously heard, "easy" and I'm just not seing something. If it isn't then I honestly don't know if I'm going to be able to pull off the AI question. Here goes nothing.
My only strategy going into this is to ask somebody tomorrow during GDW if the FMOD question is perhaps, as I'd previously heard, "easy" and I'm just not seing something. If it isn't then I honestly don't know if I'm going to be able to pull off the AI question. Here goes nothing.
Monday 19 November 2012
A short, brutal road ahead.
I haven’t made much of any progress this week in terms of programming. Most of my MIGS week off was spent preparing my business assignment and doing some preliminary work for the final paper of my critical game theory class, in which I’ll have to write an adventure game and then do a critical analysis of it. It’s meant to substitute the capstone project which I won’t be in until next year, and I’m still not sure if I traded up or down. At least I’m writing, I guess.
I did however do some thinking about what I’m going to do in terms of the last hard question I need in order to write the final exam. I’m leaning more and more towards looking for some assistance and trying to get the audio question done, which again, I’ve heard is simpler than AI. It's not that I think the AI would be extremely difficult, but I know that it will be time consuming, and I find myself extremely lacking in that department, despite my efforts.
Everything is culminating, and I'm rapidly losing faith that things will turn out positively.
Monday 12 November 2012
One question left
This week I worked through the rest of the camera question which it turns out I was not nearly as done as I had previously thought. I ended up completely re-working the cinematic camera so that it kept the moving object in frame while it travelled around a wall that I set up in my pre-determined path. Most of the work was just playing with values in order to get it looking right, so I set up a text box to display the cameras x, y and z values in order to track where it was moving. After that I spent entirely too much time working on the frustum, but was able to finish just before my demo time.
Regardless, it's finished and now I can focus on the one hard question I need to do in order to write the exam. I'm going to be trying the leveled-up AI question, which should be fairly easy to do once I get going. The hardest part, I feel, will be figuring out the basics of AI and how to get started implementing it. After that I feel it will just be a matter of adapting the process to whichever behaviour I'm working on.
My back-up plan if the AL question falls through is to do the sound question, which I've heard is "easy", but what others' criteria of "easy" is could be anything. I've worked with fmod before, I think, so I may take a look at it.
Regardless, it's finished and now I can focus on the one hard question I need to do in order to write the exam. I'm going to be trying the leveled-up AI question, which should be fairly easy to do once I get going. The hardest part, I feel, will be figuring out the basics of AI and how to get started implementing it. After that I feel it will just be a matter of adapting the process to whichever behaviour I'm working on.
My back-up plan if the AL question falls through is to do the sound question, which I've heard is "easy", but what others' criteria of "easy" is could be anything. I've worked with fmod before, I think, so I may take a look at it.
Monday 5 November 2012
A change of Plan
This week I re-examined my time frame and realised that it would be difficult to learn to program an entirely new concept such as morphing, so I looked at all the available questions again and found that number 7 was a fairly simple camera assignment. I am happy to say that after only a few hours of work I am about 95% done that question and should be ready to present well before Friday.
My main problem going into the question was that it required an object to be going moving on its own so that one of the cameras could always be focused on it. I'd never done that before, so working out some of the logic behind it took probably the longest chunk of time.
My other problem came about when I tried to implement the maya camera as the fifth camera and ended up with an un-handled exception problem. I'd had problems with the maya cam before, so I sort of half expected it to happen, but unfortunately didn't know how I was going to fix it. After looking through other assignments I'd done that had a working maya cam, I realised that in my haste I had included the attach camera code but had neglected to create a separate camera for that particular one. Basically I had 5 attach camera commands and 4 available cameras. Once I fixed that it worked perfectly, and now all I really have left is to draw each camera's position and frustum.
My main problem going into the question was that it required an object to be going moving on its own so that one of the cameras could always be focused on it. I'd never done that before, so working out some of the logic behind it took probably the longest chunk of time.
My other problem came about when I tried to implement the maya camera as the fifth camera and ended up with an un-handled exception problem. I'd had problems with the maya cam before, so I sort of half expected it to happen, but unfortunately didn't know how I was going to fix it. After looking through other assignments I'd done that had a working maya cam, I realised that in my haste I had included the attach camera code but had neglected to create a separate camera for that particular one. Basically I had 5 attach camera commands and 4 available cameras. Once I fixed that it worked perfectly, and now all I really have left is to draw each camera's position and frustum.
Monday 29 October 2012
A Brief Reprieve, and Moving Forward
I took a little, I feel, well deserved break after the last few weeks I've had slogging through my engine work to relax a tiny bit and catch up on other far less anguishing school work. After that I planned out my next couple of weeks so that hopefully I can meet the medium question deadline as well as have enough time to take a crack at a hard question in time for the exam.
For the medium question I'll be attempting morphing, wherein the user will be able to select two objects through a simple graphical user interface and have them morph together into one object. I assume this involves approximating a third object based on the vertices of the selected two, but after working with the engine I know that my initial assumptions are usually wrong. So, we'll see how that turns out.
From there I'll be trying to do the leveled-up AI medium question for my hard experience points. It simply involves doing more behaviours than the medium question would call for. I figure that once I get a handle on the general way of making one behaviour I should be able to suss out enough to turn the question in for 15 points. With that, I'll have just enough to do the exam, so right now I'm content with this plan.
For the medium question I'll be attempting morphing, wherein the user will be able to select two objects through a simple graphical user interface and have them morph together into one object. I assume this involves approximating a third object based on the vertices of the selected two, but after working with the engine I know that my initial assumptions are usually wrong. So, we'll see how that turns out.
From there I'll be trying to do the leveled-up AI medium question for my hard experience points. It simply involves doing more behaviours than the medium question would call for. I figure that once I get a handle on the general way of making one behaviour I should be able to suss out enough to turn the question in for 15 points. With that, I'll have just enough to do the exam, so right now I'm content with this plan.
Monday 22 October 2012
An Astronomical Step Forward
This week I managed to get the entirety of medium question 1, the solar system with clickable planets and moons that displayed information about them, completed. It took four days of non-stop work, but I managed to pull it off, and subsequently earned enough XP to write the midterm in the next hour. However, the experience was not easy. Even “medium” is a stretch.
I initially encountered a problem when trying to load the texture onto my sun. I’ve run into this problem for practically every single assignment I’ve attempted, so I wasn’t surprised. Frustration set in when I realised that I’d done everything that in previous instances had solved my issue. After an hour or so of looking through past assignments, googling, and swearing at my computer, I realised that I’d been working out of the folder for Easy Question 1, not Medium Question 1.
After that, I was able to get all of my planets loaded in and textured appropriately. To calculate the distance of each planet to the sun I went off of the Parenting example. In that example Earth is five units away from the Sun, so I looked up how far away the Earth is from the sun and divided by five. I then looked up all of the other planets’ distances and divided them by that resultant to determine how many units away each planet was from the Sun.
Rotations were also a huge problem. The provided equation wasn’t working for me, so I ended up devising my own math for the planets’ orbital and rotation periods. I divided the degrees of a full circle (360) by the frames per second that the engine was running at (60). Then I divided that number by a ratio of the planet’s orbital or rotation period by the degrees of a circle. Finally, I divided that number by a variable called “choke”, which when increased would slow own the simulation in order to make it easier to click on some of the celestial bodies with shorter orbital periods. In the end, this equation worked for the orbits and rotations of every celestial body and the rest was a matter of copy and paste.
mPlanetOrbit = ((360/60)/(Orbital Period/360))/choke
mPlanetSpin = ((360/60)/(Rotation Period/360))/choke
What this does is tell Ogre how many degrees to rotate each object per frame, and provided me with a system that was accurate to reality.
Selecting the objects were done via the Ray Picking example and differentiating objects was done via a simple string compare function based on each node’s name. After I’d figured out that all I had to do was fill in information pertaining to each celestial body and the ordeal was over.
Two successful weeks in a row. Scary stuff.
Subscribe to:
Posts (Atom)