Categories
Week 2

Trying to walk when you can’t crawl!

This week, I actually got to implementing the Movie castmembers in ScummVM. The idea behind this was to use the MovieCastMember as a wrapper around a Movie member. This Movie class variable will handle the updating of frame number, execution of Scripts, handling events, etc. just like how a the main movie handles it. The tricky part was that it does not have a window. The main movie has a dedicated window where it can render its Sprites. The Movie castmember needs to be rendered in a box inside this main window. For this purpose when the main window updates (renders the next frame in the main movie) it also asks the MovieCastMember for its updated sprites using a function called getSubChannels(). So, the idea was simple, before returning these sprites, we ask the Movie castmember to “step”, update its own state.

But, this simple idea lead to me facing many difficulties. First of all, I had to include a check at each place the _window member was accessed in all functions in classes Movie and Score. The class Window also tracks the the Lingo State, which was now inaccessible for our MovieCastMember. So, the Window class needed refactoring.  I separated all Lingo State keeping functionality into a separate class LingoStateKeeper and migrated all the relevant functions  from Window. I added a member _stateKeeper to Window and Score. There was also a question of whether MovieCastMembers can switch movies using the go to movie ... command. I created a movie as a test in the original Director to check this. @sev asked me to add it to the director-tests repository.

This task is still incomplete. I’m able to see externally linked movies in ScummVM’s Director but they are stuck. They still do not allow execution of their own scripts.

What was thought to be a two day job, ate my entire week. I didn’t have my Director basics down. I hadn’t read the Manuals that were given to me a weeks ago.  I made obvious logical mistakes, I got stuck at multiple points… to the point that @sev has asked me to take a step away from this task.  I was working on processing Lingo script events the last. He will continue from here. He asked me to focus on my main task of  saving Director Movies. Hopefully, I’ll learn enough to come back to this task and be able to finish it.

I’m worried at this pace, whether I’ll be able to complete my project or rather make a meaningful contribution to ScummVM in a reasonable time period. I wanted to work yesterday (Sunday) but I thought it’d best to take the day off and read the Interactivity Manual (even though its a bit late now) and start working today (Monday) with a fresh mind.

This week I’ll focus on studying ProjectorRays to start writing director files. Study the different chunk types in a .dir file.

So… the first two weeks for me have been much less than perfect. I’m too focused on the greener side of the river forgetting there is deep water in between, gotta pass through that first or I’ll drown… But I’m optimistic. Even though I couldn’t keep the promise of having a good week from last week, I hope to have a comeback week starting today.

Categories
Week 1

Struggles of a newborn!

Okay, Week 1 over! Hussshh! Not how I imagined it would go.

I started the week by “trying” to work on my unfinished QTVR task. I made very minor improvements, but they were not my main goal. Basically, the QTVR decoder in ScummVM uses a two step approach to projecting a cylindrical panorama in ScummVM. First Step: Cylindrical projection correction, Second Step: Perspective projection correction. I tried to implement a warp mode 1 in it by skipping step 2. But apparently that’s not the correct solution. This introduces a wobble to the image when tilting up and down. I tried working on it, but couldn’t do it. @sev suggested I abandon it because I have to focus on my main task of saving Director files.

This week I worked on familiarizing myself with the Director 5. I started reading the Director 2 Interactivity Manual. My main task for this week was to understand how Director Movies can be embedded into other Director Movies as cast members. Currently this functionality is missing from ScummVM Director. We cannot load external Movies into the current movie. It was my task to implement this functionality. This is used extensively in startrek, a game we’re hoping to support in ScummVM, which has a main (Director) movie that loads other (Director) movies which store different things (e.g. the floor plans of different rooms on the USS Enterprise NCC-1701-D spacecraft). But so far I’ve been struggling to carry out the task.

To get acquainted with Director and to understand what the task is, @sev asked me to create a simple movie in Director 5. I had to embed an external movie into that just like startrek does using a lingo script. Although, making the movie was simple enough, I failed to see the point behind the exercise. Instead of embedding an external movie, I instead imported all the cast members of my external movie into my current movie and basically mimicked the external movie in my current movie (to not do so was the entire point). After a helping hand from @sev, I was able to make the movie. I will be using this movie as a unit test to check whether the movie cast member loader (which I will start implementing starting next week) works or not.

@sev wanted me to do another thing which was to create a loader for Score that works for all of these cast members: scores, filmloops (very similar to scores but very little or no external control using scripts) and movies (which have their own score and casts and scripts unlike filmloops).  But my progress was slow, I am getting stuck often; which lead @sev to tell me that I should immediately ask for help if I feel stuck. I have very little time to make this happen and I can’t afford to spend much time on just getting the basics done. Other students are well on their way to complete their respective tasks.

So to expedite this process @sev and I had a video call where he explained how the Director works, how its components work, how it is implemented currently in ScummVM, how are they loaded, how all of this is tied to my main task of saving movies in ScummVM, and what is it exactly that I need to do. This helped a lot. I now have a clear picture of what needs to be done. From next week I’ll start by implementing a common loader for Score, filmloop and movies in ScummVM’s Director.

I hope I’ll have better news and a better blog next week!

Categories
Week 0

A wonderful, exhilarating but frustrating start!

Hello!

I’m Malhar. I got selected to work on a Macromedia Director task (large variant) for GSoC ’25. I’m a computer engineering student, currently (at the time of writing this) in the third year (Junior if you will) of my Bachelors degree. My GSoC Proposal should give you a detailed rundown of what I’ll be doing for my project. I think that should be enough for a formal introduction.

Okay… so let’s start from the beginning…

Ever since I got into programming and found out about GSoC, I’ve always wanted to be a part of it. This year I was determined to at least send a proposal. The entire idea behind open source sounds… awesome. A bunch of people who are so passionate about a project that they are willing to spend time on it without any other incentive but their own love for it. That is very admirable. Maybe it’s the prestige of getting selected for GSoC (at least in my university) that drew me to it. But I’d like to believe that I was also passionate about working on ScummVM.

I started contributing pretty late; after the list of organizations was declared. I joined the ScummVM discord server on 10th March. Starting contributing was as easy as introducing yourselves. @sev (sorry, too used to discord tagging convention at this point) took notice, helped me compile the project and assigned me a task. And that was it! I started contributing. I struggled a bit in the beginning, but the project is pretty well written. It was much easier to understand than some of the other open source projects. I mostly worked on the QTVR decoder in ScummVM. It was messy but fun. Seeing my first PR being merged felt amazing.

@sev suggested that I should work on saving director files which is currently missing from the director engine for GSoC so that’s what I chose. I started working on the proposal pretty late as well. I wanted to complete the QTVR PR before I focused on the proposal. I continued working on QTVR even after submitting the proposal up until my exams started.

The entire goal of the project (apart from some minor improvements to Director engine) is to redo the file loading logic of the current Director engine so that they will be read in a way that preserves the on-disk structure, which will make saving .dir files much easier. Thank you @djsrv for such a great reference ProjectorRays. Although, it hasn’t been much time since I started looking into this, but I feel confident.

I was pretty thrilled to have been selected for GSoC, when the news came on 8th May. A lot of people congratulated me. One of our professors – who is a pretty vigorous advocate of Open Source software and faculty advisor for the Open Source club at our university (CoFSUG) – personally called and congratulated me. I felt validated! My parents who don’t know the first thing about programming or open source were relieved that their son got an “internship” and a pretty good one at that. I tried correcting them on the “internship” but to no avail. Every single one of my classmates is doing an internship at some big shot multinational corporation where it will be harder for them to enjoy the work they do. For me though, its going be so much fun.

My exams lasted till 15th and I promised that I will start working from that very day. But alas! Something kept coming in between. Being part of our college’s annual magazine, I had a lot of responsibility for the last two weeks. Something or other kept me from continuing. A couple of times I resurfaced to work but couldn’t do much. Made @sev worry about whether I was stuck at my task. I felt pretty guilty about going back on my promise.

But it’s 31st March, 2:15 AM here in India. No more excuses. The next 12 weeks, I’m going to drop everything else, and make sure that I do a good job, something I’ll be proud of. Let’s make this an outstandingly successful GSoC project…

Oh! One last thing. I like to read and I like to write (secretary of Magazine Club ;)). I’m a fast typewrite as well (100wpm). Don’t ask me how much time I took writing this, though… but expect long blogs on this page in the future. 🙂