Updates: June 10, 2016

June 10, 2016 at 10:55 am (Art, Java, memory palace, Programming, Rant, Thinking) (, , , , , , , , , , , , )


I’ve been working on a number of different things as well as thinking about my next steps and goals for the year. Here is a point-form list of some of the projects and endeavors I’ve been spending effort on in the past couple weeks:

  • I set up a home Linux server. I wanted a local, private Git repository as well as a machine to host some automated processes and apps. Things have been working out very well on this front. It’s been a great learning experience on top of it as well as I haven’t really used Linux in a decade or more. I installed a desktop version of Ubuntu, but I’ve been sticking to using the terminal as much as possible to expand my sphere of knowledge.
  • I’ve been working on my coding skills and algorithm knowledge. I always have some sort of coding project on the go, but recently I’ve been so focused on my front-end skills that I’ve let my core skills droop a bit. To get back up to par, I’ve been solving a lot of coding problems in Java as well as figuring out some algorithms that I haven’t touched in a while. I decided to start basic with heaps and heapsort, then moved on to KMP string matching, and now I am working on suffix tries/trees. I’m going at a slow pace with this though so I can not only code solutions, but also store them in my mind palace.

   Preparing an algorithm for long-term mind palace storage pretty much consists of tearing the algorithm down to its basic elements in your mind and trying to make a story out of it. For example, I’ve decided to store the KMP string matching algorithm in a kitchen in one of my mind-rooms, so I compared the process to making spaghetti. Comparing noodles of different length was the basis of the story. I also had to work in the generation of the prefix table for the search pattern. For this, I’ve been toying around with adding some sort of “sauce” to the story to indicate the comparisons of the prefix to suffix for each length of the pattern noodle.

   I think that I’m finally starting to outgrow the hub room I’ve been using for my computer science mind palace. It was a good index for classes of algorithms so I could always see what tools were at my disposal, but it’s getting too cluttered now.

  • I’ve also been doing a lot of general-purpose reading. I visited the library not long ago and “accidentally” walked away with between 10-15 books. Some of these were painting-related so I could learn some new techniques and composition skills, but I also picked up some interesting biology books. One of these is a book on viruses (the non-computer version). I’ve been learning a lot about how they operate as well as how they’re being used/manipulated today. Bacteriophages are being produced to one day replace antibiotics, and I find the whole thing fascinating (phages are a type of virus that goes after bacteria instead of humans).
  • In addition to practicing my coding/problem solving skills, I’ve also been working on learning and using some new technologies; at least new to me. I’ve been fiddling with the Play framework, which is a web platform. I wasn’t really impressed with it at the start as you have to use a self-hosted web app just to create a project structure, but beyond that it seems really nifty. My next area of interest within this framework is the Ebean integration, which allows for a fun way to connect objects to databases without having to write scripts and stored procedures. There are also some features to allow syncing a database to ElasticSearch automatically, which will be fun.
  • The Android platform is another area I am learning about lately. I’ve set up my development environment and I’ve been learning about the SDK for creating apps. It seems like there are a lot of different approaches to building Android apps, especially as the SDK has been evolving. It has made things a little awkward to get started (as there are many references on the internet to doing things the “old” ways), but I think I’m past that hurdle now. My only real problem now is that I haven’t been spending enough time on this project.

Permalink Leave a Comment

Progress Update: May 24, 2016

May 24, 2016 at 6:39 pm (Computer Science, Java, Programming, python, Rant) (, , , , , , , )


I know I’ve recently posted about a few of my upcoming goals, but since then I’ve fiddled with a number of things since then and have some updates on my progress.

  • Python Learning. Thanks to a suggestion on the Halihax Slack channel, I picked up a pretty decent IDE for my Python projects (PyCharm). Unfortunately, I learned the hard way that Windows is not the ideal platform for using Python. I wanted to work with a packaged called “sklearn” that I saw during a Google I/O session on machine learning, but it depends on SciPy; a package for scientific calculations. Unfortunately SciPy has some dependencies that do not install cleanly on Windows (LaPack and BLAS are a couple examples). I was really looking forward to toying with the code snippet from the presentation, and I’m sure there are plenty of equivalent libraries I could try out, but the fiddling process wore on me.
  • Android Learning. I’ve been learning about making apps on the Android platform. There was a fair amount of setup and configuration for getting the IDE to work as well as setting up the right emulators to run code on. The annoyances were further compounded by the fact that I don’t want anything installed on my C drive. I use a smaller SSD drive for my C, and then put everything else on another drive; it allows my OS to run lightning fast and lets me get going faster. This guide ended up being really useful in moving the hefty emulators and other odds & ends to my storage drive: http://www.littlecpu.com/android-studio-c-drive.

  I’m in a pretty good “hacking” state right now on this front after some effort. I’m learning about the UI-data model binding within Android page components as well as other architecture aspects. The architecture is fairly straightforward (activities, services, etc) but there seem to be a lot of conventions and gotchas.

  • Java Experiments. I’m also back experimenting with Java as well. I’ve been using Derby (JavaDB) as an embedded database, and it’s pretty simple so far. I had toyed with MapDB a bit, but I’d like something a bit better supported so I can use Hibernate with it to avoid having to do my own schemas. I’ve also been using ElasticSearch in parallel. It’s kind of it’s own document-based database, but without the reliability – it’s usually used in conjunction with a real database and you just sync the data in batches so that Elastic can index the data to make it searchable. These components are all pretty straightforward, but I want to build a decent non-trivial demo project. I was also considering using Akka for the concurrency management to control the batch operations to ES.

Permalink Leave a Comment

Updates: May 2016

May 15, 2016 at 7:03 pm (Computer Science, Java, memory palace, Programming, Rant, Thinking) (, , , , , , , )


It’s been a while since I’ve posted about my recent endeavors outside of painting (this is by design). There’s been a fair amount of things keeping me busy and stressed. That being said, I’ve started putting together and working on my goals for the next several months. A large part of this will be getting my full-stack technical skills back up to a competitive level. I’m going to be focusing mostly on my Java skills as well as commonly-used libraries, since it’s been a while.

As part of this, I spent a bit of time building a small app to back up my development files. Mostly because I needed a good, automated process and didn’t want to go shopping for an app. I needed something that can backup different sets of files at different times, so I could selectively backup specific projects and images, but also my full dev repository. It seems to be working according to my tests, but I’ll be trying it out soon to find out.

I also plan on picking up Python. I think I will use Python 3, although I want to be knowledgeable of the differences from 2 to 3 as well so I can read/port existing code. It shouldn’t take long to pick it up, but I have to learn the specific syntax and rules such as scoping, etc. Some sort of project would help, so I’ll be trying to think of more home automation tasks I could fulfill with Python apps.

Lastly (for this post), I plan on giving my memory palace an upgrade. I need some more rooms, and I need to finish storing algorithms in it. I’m missing tree and graph algorithms (which are pretty important), and I wouldn’t mind adding some more details for implementation as well. This should ensure that I don’t have to review algorithms, data structures, and design patterns when I need to use them; I’ll have them permanently stored.

Permalink Leave a Comment

Zombie Mansion with shaders and post-processing

January 22, 2015 at 9:03 am (Game Development, Graphics, Java, Processing) (, , )


Update: Full project description here

I finally got around to retrofitting my older projects with the new hotness. I am now rendering the scenes with shader programs, which gives me a lot of nice options for how the scenes look. I can do lots of fancy stuff with them including doing neat things to the screen after the scene has been drawn. Here’s a quick example of one of the things I’ve already tried. It’s a ripple effect I applied to the screen; it looked awful, but I was getting 60 frames per second with it (which is good).

jan17_2015_screen effect gone wrong1

Permalink Leave a Comment

Project: DarkWolf2D (2D Dungeon Crawler)

January 10, 2015 at 4:30 pm (Game Development, Games, Graphics, Java, Processing, Programming, Rant, Uncategorized, Video games) (, , , , , , , , )


Over the holidays, I had some time to upgrade the core code for my game engine. I’ve upgraded the version of Processing that I use as well, which means I can use shaders for rendering along with some of the nicer JSON loading features. While I have a “version 2” of my engine working though, I haven’t yet retro-fitted it into my Zombie Mansion yet. This is coming in the future, but for “proof” that my code works, I’ve been putting together a small game based on a design I had in a dream. It’s the “basic” version of the idea, which means no multiplayer and no nice graphics.

The idea is for a dungeon crawler action game that takes ideas from the MOBA genre. I know how it sounds, but it’s actually a very basic idea and it’s already half built. It’s a player-vs-environment game right now where the player begins at level 1 for each dungeon and has to level up as they progress to bosses. The theme for it is an alternate history WW2 where the characters are different classes such as “US Medic”, “Russian Sniper”, or “French Resistance Fighter”. Each class has a basic attack and a list of abilities they can level up and use. I’m keeping the XP system as simple as I can (although I’ve never built one before), and I’m not using any items for the game right now.

For rendering, it’s a 2D game with no character animations; just a static side-shot image. This should keep the dev cycle pretty low for now. I also have a feature backlog that I’m considering making public, but for now I’ll only do that if I have anyone comment that they actually care to look at it. It’s a list of all the features that I plan on implementing (some are basic things like “add audio to the game”, and it functions as my “todo” list. As I build in features, I mark them as “Complete” and they shuffle to the bottom of the list for storage.

Edit: Added a screenshot. It’s very basic and you can’t really see anything worthwhile. Just showing that I can at least render the player in a level. I’ll make a video later.

First screenshot of DarkWolf2D

First screenshot of DarkWolf2D

 

Permalink Leave a Comment

Aftermath of Zombie Mansion Alpha 1 Build

July 18, 2014 at 12:40 pm (Game Development, Games, Graphics, Java, JavaScript, Processing, Programming, Video games) (, , , , , , )


So at this point in time I’ve had multiple people play through my game demo. The results were actually better than I thought. I think only one person wasn’t able to run it (still not entire sure why, but that’s future Jake’s problem now). There were a couple major issues, but those were found and fixed as well. One of the bugs was that I didn’t include the assets for the 3D objects, so when the players entered the room with columns, the game crashed. There was also some scripting errors driven by not having necessary images wrapped up in the resources archive. Logging definitely helped out there.

The last major issue is unsolved, but lies with some code I threw together for the level selection screen. I think some of the click events aren’t going through, or it’s not loading the levels properly. I think this may have something to do with that particular tester running the game through a zip file though. I was shocked to find out that it worked period though.

I got some pretty decent feedback from one tester in particular though. He gave not only bug reports, etc, but opinions on controls, aesthetics, and game flow as well. Most of those things were explained away as “placeholder” stuff, but still; it was useful information to know what a tester/player is thinking when they see that stuff. When I show most people my game, I need comments like “looks neat and retro” or “I like the camera spin feature”, but not enough people pay attention to tiny details.

Anyway, that’s the update. I haven’t had free time to cut a second build or to work on new levels or anything.

Permalink 2 Comments

Ant + Processing = Grief

July 4, 2014 at 8:20 am (Computer Science, Game Development, Java, Processing, Programming) (, , , , , , , , )


This will be a humorous post coming right after the article about how great automation is. After I finished writing my Ant scripts for automating my Java project, I ran into a wall; Ant can’t update a Processing library while the Processing Development Environment is running. For some reason, Eclipse is able to deploy JAR files and have them overwrite the existing library while the PDE is running though!

So now I have to figure out a way to make this work, or else I have to ignore all of the automation I put in. I may still use Ant to back up my code projects to an external hard drive, but that’s about it right now.

And then there was sadness.

Permalink Leave a Comment

Automation 4 U

June 28, 2014 at 2:29 pm (Computer Science, Game Development, Games, Graphics, Java, JavaScript, Processing, Programming, Rant, Teaching) (, , , , , , , )


So, this will be nothing new for some of you. This isn’t even something new to me; I have a day job where I’m a professional software engineer and we do this at my job all the time. I’m talking about automation and automated processes. This could be anything in your project development process where you have the computer automatically do something for you. An example could be a script that backs up your files to a different drive that you can just run when you want. It could be as complex as a build step that automatically deploys your binaries or runs unit tests.

My disclaimer: A lot of this is technical stuff and directed towards programmers, but even if you’re a graph artist, you can still benefit from this. Everybody that uses computers for projects will need to back up their files for instance.

I’ve only recently realized just how important this all is for regular, personal projects. I’ve always known that it saves time, but my initial mindset was that I’d rather get my project up and running and THEN waste time implementing the time-saving stuff after I get it together. I’ve been reading this book I bought from Amazon that talks about indie gaming from a business, “get your act together” perspective. The book can be found here. I’m still reading it, and some may or may not agree that it’s a good book, but it provides some good ideas for how to take your hobby projects to the next level and keep your process renewable. This means saving time and money on mundane processes, etc.

I am still in the process of automating many aspects of my project, but it really crept up on me just how much time I was wasting on manual things. Here are some of the processes I perform just for my Zombie Mansion project:

  • Backing up files from two areas on my system to my external hard drive
  • Deploying JAR files from my Eclipse solution to my Processing solution to use in my game
  • Removing alpha channels from sprite sets (I built a tool to do this, but it’s still manual)
  • Putting together standalone builds of the game software
  • Packing and compressing image resources for game builds
  • Merging animation sequences together for access by the game engine

These are just things I thought of off the top of my head this morning. Some of them will be easier to do than others, and some of them are specific to my project. All of them eat up time though and are tedious things. Here are a few tips and ideas for how I plan on solving some of these issues though. Please read through just in the off chance that it inspires something or gives you an idea or two.

Deploying JAR files to another solution

For this, I intend on using ANT with Eclipse. This is pretty much a standard for serious Java projects, but it’s taken me a long time to start to improve my processes (usually I want to work on the fun stuff or the stuff that has a visual out-come). Visual Studio has its own build steps and things you can run. Alternatively, you could write a script/BAT file that will grab the files from your output directory and deploy them. This doesn’t require a full set-up of a 3rd party tool and it should be quick to do. It just might break and won’t be as robust.

Backing up project files

This is something I’m already part way through implementing. I’ve written most of a BAT script that will grab the project files from specific directories and dump them in one area so I can back them up (it will optionally zip them as well). To make it a bit easier, I’ve started using virtual drives, but this isn’t necessary. If you’re interested in what virtual drives are or how to set them up easily, email me or post a comment. I can give you some resources or just write an article. Here is a snippet of what I have so far (I’ve been taking bits and pieces from the interwebs, so most of it is borrowed code anyway).

I wanted to dump the files into a folder that would be timestamped so I wouldn’t have to worry about overwriting anything. This is one way of how you’d accomplish it using a BAT script in Windows:

set hour=%time:~0,2%
if "%hour:~0,1%" == " " set hour=0%hour:~1,1%
set min=%time:~3,2%
if "%min:~0,1%" == " " set min=0%min:~1,1%
set secs=%time:~6,2%
if "%secs:~0,1%" == " " set secs=0%secs:~1,1%
set year=%date:~-4%
set month=%date:~3,2%
if "%month:~0,1%" == " " set month=0%month:~1,1%
set day=%date:~0,2%
if "%day:~0,1%" == " " set day=0%day:~1,1%
set datetimef=%day%-%month%-%year%_%hour%-%min%
echo %datetimef%
xcopy "C:\Test\A" "C:\Test\B\Backup\%datetimef%" /E /I

This will copy everything in your source directory (the first argument) and store them in a custom folder with a timestamp. You can use multiple source directories as well if you have things spread out like I do by just putting in an extra line. The last two arguments are switches to tell XCOPY to use the full source directory (and children) and to assume I mean the destination should be a folder.

Removing alpha channels from image resources

This one will be a bit more complicated. I have a tool I wrote to do this, but I want to streamline this. Now, I wrote up a full project plan with a product backlog, but then I realized even that was too ambitious. I plan on taking some items from the list, but I also plan on it being a purely script-based tool. It will run on the command prompt and will use my engine’s scripting engine for customization (as opposed to using config files). At this point in time, it’s cheaper for me to use scripts than config files since I don’t have a streamlined approach to reading them yet. ANYWAY, I will be writing this as a project in my game engine solution and it’ll have a unit test project to go with it. I’m still working out what tests I will need for it since it works with images, but it’ll be centered on testing the RGB values of generated images before and after the script runs. It’ll also test image sizes for when I add the feature to compile multiple animation sequences together.

Anyway! To summarize this; automation is good. It saves a HUGE amount of money (time is money). If you ever have dreamed of selling a game, you NEED to get in the habit of doing this. The more you do it, the easier it will become and the more effective you will be with your time. Be as lazy as possible with your projects; that’s why we’re programmers! (Although you don’t need to be a programmer to benefit from this).

 

 

Permalink Leave a Comment

Zombie Mansion: Alpha Build 1!

June 23, 2014 at 2:54 pm (Computer Science, Game Development, Games, Java, JavaScript, Processing, Programming, Rant) (, , , , , , , )


So I’ve finally gotten a build of the game working! I can’t post it yet for a variety of reasons, but I’ve sent the build out to some people to try it. It’s mostly to verify that the game works as expected and is stable. It just features the level I showed in the previous videos and a couple of extra smaller areas.

Last Saturday night I had a few panic moments when the builds weren’t working as expected. I had an issue where the resource unpacker code I wrote wasn’t actually unpacking the images from the compressed assembly; it turns out it was still trying to load them from the local directory. The issue has since been fixed thanks to all of the logging architecture I recently put in. There’s still several areas that could use more logging, but there’s enough now to sort out common issues.

Another bug that logging helped uncover was with the asset manager system. I have code that manages any images and ensures you only load one copy into memory. This helps to keep a cap on the memory usage of the software as a whole. However, there was an issue where I had slashes in the reference indices that were going the wrong way! This is a pretty common issue with programming to be honest. Devs frequently write code for their own system and then find out that nothing works on other computers or operating systems. Thankfully, the logging system helped uncover the fact that it was double loading certain resources.

Now if I could just muster the effort to change the spelling mistake I made with naming the logging variables…

Permalink Leave a Comment

Log4J 4 You

June 9, 2014 at 8:42 am (Computer Science, Java, Processing, Programming, Teaching) (, , , , , , )


Last weekend I added logging to my game engine since I finally got fed up with print logging to console. I’ve waited this long because while it was on my To-Do list, it kept getting pushed back because it isn’t as interesting of a task as rendering a new HUD for example. It is definitely worth investing in though! If you don’t have logging in your game, I suggest you do it now!

In this post, I will talk about setting up Log4J to use in either Java or Processing programs. Furthermore, I will show you how to set up loggers programmatically. Typically you will see guides that reference config files or XML for setting up loggers. I chose to do it programmatically because I wanted to set it up early in my engine code, have it trickle down into all of the other layers, and not have to change the configurations very often. Perhaps this isn’t a good enough reason to do what I did, but at least for my situation I didn’t mind using it.

Before I get into how to do it this way, I will warn you of one of the major drawbacks of doing this: you can’t change the default logging levels without recompiling your code. This is actually a big deal for many projects, but for some not so much. One of the advantages of doing it programmatically however, especially with Processing sketches, is that once you set up a Log4J library you can copy and paste code and it will just work. No configuration files required.

Enough talk! Lets see some how-to!

 

Add Library (For Processing sketches only)

If you are setting up Log4J for use in Processing sketches, you first need to create a Library. There are many guides on how to do this, so I will just give an overview. After you download a log4j JAR file, navigate to your “libraries” folder (I forget where the default spot is at the moment; I keep mine in the same folder as my sketches). Create a new folder named “Log4J” or if you’d like, put in the version numbers. NOTE: The folder MUST have the same name as the JAR file. Within that folder, create a folder named “library” and dump that JAR file in there. After you restart the Processing IDE, you will see a new entry when you go to import a library.

EDIT: I’ve been informed that you can actually just drop the JAR into the sketch folder! That’s very handy. It makes it even easier to integrate Log4J. The only downside to doing this is that if you work with many sketches, you have to remember to drop the JAR into each folder instead of just referencing your library. Thanks to Nacho Cossio for pointing this out.

Use Log4J

Now it’s time to use it! Here is some code that will set up a logger.

String masterPattern = “[%c{1}], %d{HH:mm:ss}, %-5p, {%C}, %m%n”;
fa = new FileAppender();
fa.setName(“Master”);
fa.setFile(sketchPath(“./Logs/” + “Master.log”));
fa.setLayout(new PatternLayout(masterPattern));
fa.setThreshold(Level.DEBUG);
fa.setAppend(false);
fa.activateOptions();
Logger.getRootLogger().addAppender(fa);

This will give you a logger that will dump out everything to file. The “masterPattern” variable holds the format that each log message will have. This specific line of gibberish tells the logger that I want it to look like this:

[categoryName], time(hour:minute:seconds), Priority (if any), {Class name where message was logged from}, message

The category name in my example will be “Master”. I’ve also put commas in there so that I can optionally open the logs in Excel and have it put each value in its own column. This is very handy as you could then use searching and sorting features with zero effort.

Note that in the last line of code, I add the appender to the root logger. Do this only if you want all log messages to go to one file. In my game engine, I’ve set up multiple loggers for different categories to go to different files, and then I use a master logger to consolidate them to one file.

Log Messages

Logger logger = Logger.getLogger("Master");
logger.debug("Log my message");

This will get the logger (which you only need to do once if you store it in a variable) and output a debug message.

There you have it; easy logging for Processing sketches or Java programs. There are likely better and more in-depth tutorials for using Log4J, however I just wanted to give an introduction to get it to pay off quickly without having to browse to nine different sites like I did.

 

Permalink 2 Comments

Next page »