Monday, July 10, 2017

VAIO Care filling my hard-drive

A while ago, my computer was running out of hard drive space. Had 500 GB. Found that odd, I was pretty sure I wasn't adding any big files. Even downloads shouldn't have eaten up GB's so quickly.

I used WinDirStat to check files. Found a folder that was bloated with around 30-50 GB. Forgot what it was (wanted to write about this, just forgot). Was one of the folders found in:

C:\Program Files\Sony\VAIO Care

Not the VAIO Care folder itself. But one of the subdirectories. Noticed VAIO Care was doing hidden routine checkups or something and storing some data files or something in this folder. Was racking up huge. Deleted all of them, laptop still okay.

Wanted to stop this routine stuff from VAIO Care, didn't use it anyways. Found that I had to go to Explorer. Right click on "This PC", click "Manage".



I disabled all the VAIO Care scheduled tasks. In the tree browser on the left of the Task Scheduler, I went to:

Computer Management (Local) -> System Tools -> Task Scheduler - > Task Scheduler Library -> Sony Corporation -> VAIO Care

I highlighted all the tasks, and clicked disable in the bottom left. If I remember right, some tasks I had to single click and disable. Anyways, after that, the folder I mentioned earlier stopped filling with report files.



So ya. File bloating. Don't like it. Just happy to figure the source.

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. 

Saturday, May 27, 2017

Pointer problems (check your warnings!)

I was working on a Tic Tac Toe console game in C++ with someone I met online.

(We finished it Thursday. : ) Here's the github repo. My partner tried to incorporate AI, but it was too hard for him. Nonetheless, we both enjoyed working together to make it, even if Tic Tac Toe is a small game.)

Anyways, at one point, when I made a Board object in a Board.h header, I originally wrote it like this:


On building, my Code Blocks compiler gave this warning:


I didn't think much of it (I didn't even read it I think lol.). I gave my Board.h to my partner. He started coding in a gui, but at one point, he got an error like this (which I didn't get interestingly):


He was running on Linux, me on Windows, so at first we were stumped. He thought it was just an OS error, until I looked back at the warning. I googled stuff, found this.

Basically, as shown in the first picture of this post, I returned the address of a local array, which would technically be gone after the function call was over, and the address would be pointing to anywhere, leading to undefined behavior. I fixed it by dynamically allocating the array (allocating to the heap, as they call it) with 'new', so the array would exist even after the function call was over, just as needed.


Overall, that was quite an experience in the Skype chat figuring that out, wanted to share it here. It was two big messages, code-wise:

1. "warning: address of local variable <board_layout> returned"
2. "Segmentation fault [core dumped]"


What was interesting was that I didn't get the same behavior as my partner did (because of the undefined behavior I wrote about). But it's nice that the experience ended well, was able to figure out what was happening. I'm pretty sure they say stuff like this in the books or internet, but I feel like, with most things, you understand it the most through practice and experience: the "hard" way, haha. Anyways, what I learned was: check your warnings! They're warnings for a reason!

BitBlt documentation doesn't mention monochrome to color blitting

I was trying to understand more about BitBlt in theForger's "Transparent Bitmaps" tutorial. What I didn't know was that there's a special conversion process where if you blit a monochrome bitmap to a color bitmap (aka the color bitmap is the hdcDest parameter of BitBlt and the monochrome is the hdcSrc parameter, according to the docs), the monochrome bitmap is mapped to a color bitmap first, like this:

-The white color is mapped to the color bitmap's background color (set from SetBkColor).
-The black color is mapped to the color bitmap's text color (set from SetTextColor).

After that, the 2 images are combined. This was mentioned in this msdn blog post by Raymond Chen. A comment from 'Mike Dimmick' highlights this too. What sucks is that it wasn't mentioned in the BitBlt docs today. That really confused me a lot. Well, anyways, happy to know there's no super magic, just still bitwise ops in the end.

I asked about this in the msdn forums, but I didn't mention about a 'monochrome' bitmap or using SetBkColor or SetTextColor. I didn't know that was relevant til later on. I put my own answer there. I made a diagram too about it, thought it could help anyone in the future.




(The text is hard to see, sorry, I was putting in an image. Opening it in a new tab or downloading it should help to view it easier.)

Also, I was wondering about how the bitwise operations happened in the first place too, with two pixels. Someone at SO helped me with that. Thanks. Basically, in a sense, you can visualize the process by converting the colors to 8 bit hexadecimal and do the bitwise op there. For example, with an AND operation:

RGB(66,244,134) (light green) AND RGB(66, 155, 244) (light blue)

(light green)
66 -> 0x42
244 -> 0xf4
134 -> 0x86
(0x42f486)

(light blue)
66 -> 0x42
155 -> 0x9b
244 -> 0xf4
(0x429bf4)


0x42f486  AND 0x429bf4
0b10000101111010010000110 AND 0b10000101001101111110100
0b10000101001000010000100

0x429084
0x42 -> 66
0x90 -> 144
0x84 -> 132

RESULT -> 0x429084, RGB(66,144,132) (some greenish blue or something)


Tuesday, May 16, 2017

Game Industry Life Project: Writing 39B

One of the writing projects I worked on in my Writing 39B class here at the university was called the RIP Project. "Rhetoric in Practice" Project. Or Rest in Peace lol. That was intense. We were supposed to write a total of 6-8 pages about trying to convince our audience of something. One part was supposed to be the actual content: choosing a genre like a blog or column and writing something in the style of it. The other part was analyzing our own writing choices and how they appealed to our audience. I didn't like the workload. This was a lot. But I still put genuine thought into the game industry topic I wrote about, and I wanted to talk about that more in this post.

The topic I chose was on game industry life. At the time, I was thinking about choosing a Computer Game Science major here at the university, so I wanted to look more into it. I had to tie my project in to the class theme, which was fairy tales at the time, so the project was a little cheesy, but I made it work. As I was researching it though, I realized how harsh it is. Crunch time and short employment seem to be continuous problems in almost every game studio. I mean like, seriously. It sounds really bad, from what I've read. Here's an excerpt from Joshua Rivera's "Inside the Video Game Industry's Culture of Crunch Time":

-------------
“This is people coming in at 9. Working all day. Leaving 10, 11, 12, 1, depending what they were doing. And then coming back the next morning and doing it all over again, six to seven days a week. To my knowledge, five couples got a divorce because of this. Almost the entire creative leadership has now quit, after ship. It was toxic; it was a toxic environment.”
-------------

At first, I'd think this is rare. This is really extreme. But I've seen this same pattern in the other articles I've read, like Andrew McMillen's IGN article on L.A. Noire's 7-year development.

In the end, from doing this project, I've realized that while making games is fun, in the game industry, it can be so busy that it can hurt your health. I don't want to do a Computer Game Science major anymore, just normal Computer Science. I still like making games (I've done a little bit. Nothing AAA of course, but still, I've really enjoyed it), but I don't want to devote my life to it, especially with this lifestyle I'm hearing about. I haven't researched into other computer science fields yet, but I still do love computers and want to have a career with it.

Though I wonder if this lifestyle is common in other industries, and like it's just receiving news in the game industry because the industry is so big. Not sure.

Anyways, I wanted to share my RIP project on this. I did take it seriously, more than just for the grade. Yes, it's a little cheesy. I had to tie it in with fairy tales. But both in the main project and self-analysis, I add in what I've seen from game industry life articles. Of course I haven't had any experience in the industry, but I still think at least mentioning these articles is important.

Dropbox link:
RIP Project

Articles about game industry life:
(the two not mentioned in my bibliography were more about an image and analyzing Polygon's column genre)

Andrew McMillen. "Why Did L.A. Noire Take Seven Years to Make?"

YouTube. "The Realities of Life in Game Development" (Interestingly, I don't think the panel mentions crunch. So maybe crunch is over-hyped, like not in all industries? Or maybe there's something odd here. I don't know.)

Joshua Rivera. "Inside the Video Game Industry's Culture of Crunch Time" 

Jason Schreier. "The Horrible World of Video Game Crunch"

YouTube. "What It's Really Like to Work in the Game Industry"