Saturday, June 24, 2017

Personal Reflection, College Freshman: Routine

Around the end of my freshman year here at college, I asked my roommate if he wanted to make a website with me. I was interested in doing a personal reflection, where we'd each share our thoughts about how we changed. I planned to let him make the website. He came up with the theme "Routine": how are day-to-day things have changed over time. He thought of an interesting title, "Life Lessons from 102C" (that was the dorm we stayed in). Unfortunately, as of now, we never got to making the website. Guess he forgot. If he remembers and wants to work on it, hopefully he'll send me a message about it in the future.

Nonetheless, I did end up writing my entry about what I wanted to put on the website, and I wanted to share it here on my blog, before I forget about it altogether. Here it is. We planned to talk about different aspects of routine, such as expectations and change of location. I sectioned up my entry based on those.

Here's some links to 2 things I mentioned in my entry. Wasn't sure how to link it in, will just put it here for now.

Screen Reminder
-A little Python 3.X program I wrote that pops up a Tkinter window every 15-25 minutes to remind me to look away from the computer at something ~20 feet away for at least 20 seconds. Based it off of the "20-20-20" rule I read here
-In other words, the program reminds me to take breaks. I don't follow the rule dogmatically, just the idea of reminding for breaks has helped me a lot.
-Also, had a text file keep track of how many times it popped up the window. So far, 1966 times! (6/24/17)

-Dropbox link here. Added a little "readme.txt" just to get minor details in.

Air Bomber
-Game project I worked on at VGDC game dev. club here at UCI. itch.io link here.


Also, link to prompt and last draft I made. Did put legitimate time and thought in to this, so wanted to acknowledge my own work haha.
Prompt: Dropbox link
Last Draft: Dropbox link

===========

Intro:
It’s my first year here at UCI, and in college in general, and I wanted to write a bit about how I feel like I’ve changed over this year, how my routine changed mainly. With the change in pace in high school and being away from family, I feel like I’ve gotten more time to think about my life, and I guess I’ve gotten the time to want to write this as well. I’d say it’d be mainly a life marker for me to look back to in the future, writing down tips and details, but hey, if anyone reads this (and thanks for reading too), I hope you get something out of it as well.

Expectations and Results:
Coming out of high school felt quite like a bit of a release for me. Looking back at it, I felt like it was way too intense, too much work. The math and English homework was a lot, and maybe I was just getting tired of classwork in general. The teachers were nice, but the workload wasn’t.
One month after high school, I’d be starting Freshman Edge here at UCI, which was pretty much taking summer classes. Psych 7A wasn’t a pretty good class for me (I’m not someone for memorizing a bunch of facts), and UNI STU 83 was a sort of “adjusting to UCI” introduction class. Nonetheless though, it was pretty much the first time I got to live sort of on my own, with a roommate in a double room. Away from parents and most everyone I knew. It felt really nice to me, like I’d get a chance to put a “fresh start” on my life.  I mean, to be more realistic, my parents were still paying my tuition, but still, it was as close to what I call a “fresh start” as I could think of.

When Fall Quarter started, I was feeling pretty excited. Starting with Freshman Edge, I felt like I had more free time than I did than high school, and I wanted to do so much. But I’ve noticed over time I have my limits, and I’d rather do less classes so I could focus on my programming hobby more. I mean, doing computer science classes, I was learning programming there, but I wanted as much free time to do my own thing for my own enjoyment.

My original plan back in the beginning was, “I’m going to start with 3 classes, then I’m going to do 4 every single quarter until the end, and I’ll consider 3 classes as sort of like a backup, when I need a break.” But that definitely didn’t happen. Fall quarter, did 3 classes. After Winter quarter, 4. First time trying out 4 classes, and I felt that was intense. This last spring quarter coming to an end, I started to try to do 4 classes, but dropped out of a GE (General Education) class because of the workload, so I could focus more on my other three: Writing 39C, ICS 33, and Math 3A.

I’d look back at it right now, and can say in one point, these classes were heavy. Writing 39C is a lot of writing, a little less than high school, but still a lot (my instructor was nice, and the mass incarceration topic was interesting, it was just that the curriculum required us to write these large Historical Conversations Project (HCP) and Advocacy Project (AP) papers). And ICS 33 had weekly quizzes and large programming assignments, that was heavy already. Math 3A was a good workload, though, with a weekly assignment. So ya, maybe for one, I was just taking pretty intense classes this time.

But I look at it in another way, and I’m now thinking to myself that I’d probably won’t be able to handle 4 classes every quarter continuously anymore. I’d burn out. Even if I was able to handle it, I’d won’t feel as free to do my hobbies in my free time. I’d be tired out studying. Interestingly, I came out of high school with enough college credits to be considered sophomore status on entering UCI. And if I were to do a lot of classes, I probably would be graduating in 3 years. But I’d rather spend an extra year to not burn myself out so that I can pursue my own interests. I admit, that’d raise my tuition a lot, to be at the university for the next year (then again, I wonder why tuition is so high here). I’d feel bad for having increasing financial strain on my family, but I think being able to pursue my interests more would be better for me in the long run, and I think I’ll be able to land a better job with the skills to pay off the tuition more with my parents. Anyways, that was my first expectation: was thinking about taking so many classes, but I would rather take less now so I can pursue my hobbies more.

Location:
Switching topics, when it came to locations and routine here at UCI, I first thought I’d always want to stay in the same place and work continuously. There were a few “quiet places” here at UCI I could go to study and work on hobby stuff, like the Ayala Science Library, but over time I realized I wanted to be more flexible with myself than that.

Now that I think about it more, I don’t think my change in location routine was much by choice. I was developing some knee pain this quarter. It may have been by carrying my laptop all over with me back then or just (more likely) that I wasn’t exercising that much. Anyways, with the knee pain, I started to stay in my dorm room more, and I now biked around campus. And so when class would finish, I’d bike back to my dorm if I wanted to continue to work on my laptop.

As I’m writing this in my dorm, I’d say I’d look over my routine moving and around and say going to the same place just to study was a bit too much. It was more convenient for me to stay in my dorm room and use my computer here. Plus carrying my laptop all over the place became cumbersome. With that though, being in my room with a bed next to me all the time, I sort of feel more often to stay sedentary (sitting on the computer is a lot already), and I know it’s bad for me to do that all the time.  I try to do in-place jumping and pushups once every while to keep myself healthy. I can’t run because of my knee, but I wish I could do it again. I miss it a lot. Maybe over the summer, I’ll get a chance again. Quiet hours at night has always been an issue here at my dorm, unfortunately, but still, overall it became more convenient to keep my laptop in my room so I didn’t have to lug it everywhere I went.

With regards to using my laptop a lot, ya, even that too, with a programming hobby, I’ve felt like over time that I need to take more breaks. I wrote a “Screen Reminder” program in Python that pops up a tkinter window saying “Screen Eye Reminder” every 15 – 25 minutes (I randomize it every run). I made it mainly to remind myself to look away from the computer every once so often. It makes my eyes feel better, --seriously--. I do it all the time now. I used to always wear Gunnar Gaming classes when I used the computer, but now with just taking breaks, I don’t use them anymore, and I don’t have to worry about dirt on glasses (I use the glasses only when playing video games now, which I do rarely now too.). Anyways, besides that, I feel like the program helps me to take a break/walk outside more often. It feels great to do that, relaxes my eyes and clears my head too.

Lastly, with being in my room a lot, I can say my roommate is away most of the time too, even on weekdays. It actually used to be the other way around back in Fall and Winter Quarter if I remember right, with me outdoors and him indoors. He usually goes back home every weekend too. I guess in one sense, routine-wise, I feel more comfortable working in an emptier environment. Easier to concentrate. (I’d say it the same to anyone, not just my roommate. Just in general, the less noise, the more comfortable I feel.).

Nonetheless, I admit it can get pretty lonely here too. It’s a hard balance, in my opinion. For one, I’d like to be alone so I can concentrate and feel at ease. But on the other hand, being by yourself all the time can take its toll. I guess, I’d just like it if It was always quiet around my room so I can work on stuff, but it’d be nice maybe outdoors, when I’m more free at mind, to get ideas running with someone once in a while.

How I feel Like I’ve Changed:
For a start, looking at the expectations and results I wrote about earlier, I feel like a big thing I’ve learned about in my first year is to take my time with things. I’d rather do less school-wise so I can focus on my hobbies, and with anything in general, I’ve found it more comfortable to take more breaks. I’ve gotten to try a lot of programming in my spare time, and I’ve realized not to overload myself. Living in a dorm, I’ve gotten more time to think on my own, which I really appreciate. All the breathing room and stuff. And with taking more breaks, as I mentioned before I found myself going outdoors more. It cleared my head and relaxed my eyes. Just made me relaxed in general. I wasn’t like super happy, I just felt calmed.

Being in the Video Game Development Club here at UCI was quite a game changer too, pun intended. I participated back in Winter 2017. I had a game idea called Air Bomber. It ended up being a 2D downwards side scroller where you drop bombs below on enemies before continuing downwards. I ended up in a 3 person team. When I originally pitched the idea online, no one signed up, and I was about to choose another group during a club meeting until two other people show up. So ya, then we worked on Air Bomber on Unity. We finished the game in one quarter, like I’d planned. That was a seriously big experience before. I’ve had a little bit of experience with game development before, but this time I dedicated as much time as I could to make sure it was finished. Looking back at it, I’m proud of it. It’s not a super AAA game, but I learned a lot of programming from it. But I wished I could’ve made the scope lower. One person in the group was new, but I wanted to increase the scope to push myself and the artist in the group (he had experience too). But I realized that it feels better in the long run to get everyone’s ideas in, not leave anyone out. That probably means the game’s not going to be as good, but it feels better for everyone in the end (and you still learn stuff too). I’d say if you’re ever in a situation where you’ve got a team and some of your team members are genuinely interested but new to the experience, lower the project expectations and encourage group ideas more. And if it really is that low scoped, have a personal self project to push yourself during the time.

One of the most major things I feel like changed my life a lot is limiting my digital entertainment. I’ve decided to cut off my social media virtually entirely, and I’m trying to minimize what I watch on YouTube as much as possible. I feel like in the past, I sort of got hooked onto these things. Not obsessed, that’d be too dramatic. I just feel like I’ve done so much time on Facebook and YouTube, I wasn’t liking it anymore, and I wanted to do other things with my life, like pursuing programming, hobbies in general. Besides, I hardly ever posted on Facebook, just used it for homework and looking at the news feed. The messaging was fun, but I missed talking in person more. Even as rare as that is, an in-person talk felt more genuine than online chatting. Video games and movies, I didn’t feel too obsessed with them, I really enjoyed them. Overall, they’re just technology, they don’t force me to use it, it was up to me to limit it. And by doing it, ya, I don’t feel as excited anymore, but I feel amazingly clear-headed because of this, just as much as taking my time.

Final Thoughts
So that’s my first year at UCI, routine-wise. Getting some free time, pursuing my hobbies, taking my time. I see that I’ve changed a lot, and I plan to keep these habits in my life. I’m pursuing a general computer science major. Just looking for a stable job now. I still want to do game dev in my spare time. I still dream of making a cool 3D game, with a nice team. Social-wise, well, I haven’t really connected with anyone this year. Though I’m not really talkative I’ve realized. I really enjoy these hobbies dearly, just personal projects in general. I hope to find someone one day I could really pursue them with, and bounce ideas off each other. Maybe someone I know already would be interested, not sure. Or maybe someone in the future. Anyways, ya, that’s where I am, looking forward. Keeping it slow, pursuing what I love, hoping to find others to team up with in the future. It’s not the happiest life, but it’s one I’m happy to live.

So to sign off, here are some tips I felt like I’ve gained for myself. Hope it helps anyone reading this:

-Don’t overload yourself. Take breaks. Stay healthy.

-Don’t overload yourself with media and online messaging. Appreciate less, and think more for yourself. Yes, you can always be connected with others, but you should make time alone to think about your life  as well.

-Pursue your hobbies. Find what you love. Make some cool stuff, not just watch, listen, or copy it. I’d say the best hobbies are those that allow you to pursue your own ideas.

-Even with hobbies, don’t do them alone always. Find others to work on team hobbies too.

-Be yourself. I’d even argue that being yourself is more important than having friends, but that’s a huge extreme I admit. Not sure about that, would have to look back at this in the future.

-Ask for help if you need to, and give help in return. I haven’t asked too much in the forums with programming for example, but people were nice to respond, and I’d like to give back too one day (when I can actually answer haha).


-Take your time. Life’s too short to rush to do everything. 

Thursday, June 22, 2017

PlaySound() and SND_FILENAME

Two big things I found out today about PlaySound() when you use it with the SND_FILENAME flag:
1. It only accepts .wav files.
2. The bitrate can't be too high. (file size can be in MB's, as I've tried, but bitrate is still big limiter)

The documentation does say the sound specified "must fit into available physical memory", but I thought that meant file size. It actually meant bit rate. I tried a "Chicken Sound.wav" (wanted to try something funny when I was trying this function for the first time). 67 KB, should've been no problem, but I was really confused/frustrated when I was only getting default beeps. 67 KB sounded really small, at least to me.

I tried a bear sound from WavSource.com, "bear_growl_y.wav". (It was listed as "Bear growl 12KB" here.) 48.9KB. And it worked. Even more confused.

I thought about it, checked the bit rate, and guessed how the huge difference in bitrate was causing the bear growl wav to play but not the chicken sound wav.

bear_growl_y.wav -> 88 kbps || Chicken Sound.wav -> 705kbps 


I exported a new wav of the chicken sound in Audacity in lower bitrate, and it worked. Found the details at superuser. I set the Project Rate in the bottom left corner to 8000 HZ, and exported to "WAV (Microsoft) signed 16-bit PCM".

Again, quite confusing what they meant by "available physical memory". Wish they could've noted that part in. Anyways, happy it's working now.

Sunday, June 4, 2017

GL_STENCIL_BITS returns 0

About two months ago, I found that glGetIntegerV(GL_STENCIL_BITS) was returning 0. I asked about it in the OpenGL forums. I got a lot of help, that was really nice. The post goes 2 pages. I found at the time that even with all the ideas, I was still getting 0, so I called it a driver bug. Guess it goes to say that there can be rare cases where it's really a hardware bug and you can't really do anything about it.

I wanted to end it at that. Now, however, I'm getting 8 again. I found a minimal.c here for Windows. Here's a dropbox link to the edited version I had to make to get it to work on VS 2015. (If you're doing VS 2015, don't forget to right click Project -> Properties -> Configuration Properties -> Linker -> SubSystem to Windows (/SUBSYSTEM:WINDOWS). Got me for a bit.)

I now know after a while that it's for Windows only because it's Windows API based. When I first found this while trying to work with the forums, it looked pretty daunting, but I found by changing some DC calls if I remember right and some strings that it worked again. Pretty neat, considering the code was written in 1997. That's the cool thing about Windows API, I see.

I don't have the original file for some reason, but back then, I found a display() function, guessed it was the exact same as  GLFW's "while (!glfwWindowShouldClose(window)) {}" loop, and added this code snippet in to attempt to get stencil bits (lines 19 to 23).


Back then, when I opened the file, it returned 0. That's why I concluded it was a driver bug in the forums. But now when I run it again, it returns 8! No clue why, but that's great! But I'm now confused again. Maybe it could be a GLEW or GLFW bug now to conclude from? Or maybe I read it wrong for some odd reason back then?Anyways, ya, quite a surprise to get this when I'm writing this blog. 

Anyways, ya, overall, wanted to put this entry in here about how in rare cases, weird results can actually be a hardware bug (or now, I'm seeing, maybe a library bug, surprisingly). I haven't reported it to Intel, I would've now, but with the proper 8 result, I'm not sure what to write now haha. I'll let it be for now. If it happens with another function, and trying it in a minimal.c like this doesn't work, then I'll definitely write it in.

Also, it was pretty cool to find that I was trying Windows API for the first time too. Really, that was awesome, getting working results out of a program written that long ago.