« Blog

COBERTOS BLOG

My last full song for a while

My last full song for a while, if not ever. Making music just doesn’t have the drive it used to for me (though playing music on the other hand…).

I may end up posting some older WIP stuff but nothing new.

The art is from Reinforcement’s game Quackventure. I liked the monster art design (I thought it was really cute) so I ended up rendering it in Blender into a song cover.

Read More »

Another 4am Blender night...

This is a product of another 4am night playing around working with Blender’s Cycles renderer for some art for a song.

My friend ended up giving me some models from his game “Quackventure” for the album art (the song is called Mini Boss, these are a Mini Boss from his game). I retextured everything, made a scene for the little spiders, and had fun posing the little eyes and sculpting the rocks and the webs. The rendering above is just a quick progress picture as the final render is currently rendering in the background.

I’ll post the final one in the morning when it’s done and the song sometime soon.

Read More »

Just another old song

Just another song that had been sitting around for a while. I finally got to finishing it up, balancing everything out, etc. Came out well but there are a few things that I’m a bit unhappy with (formulaic structure mostly).

Hope you like it! Download is free on SoundCloud.

Read More »

How to climb stairs as a Rigidbody (in Unity3D)

So you want to add some stairs to your game? Great! Adding stairs in level design adds more vertical variety to your levels. Or perhaps your game is based on stairs (Stair Climbing Simulator 2018?).

In this tutorial I'll show you how to implement stair climbing from scratch in Unity3D if you're using a Rigidbody as your player. Before we get to coding, you should consider your (much easier / less work) alternatives:

  1. Use a CharacterController. It already has some support for this, but can't have physics applied willy nilly, nor is it as customizable as a Rigidbody with multiple colliders.
  1. Use a CapsuleCollider with your Rigidbody. If you get the player going fast enough they can just ram right over the stairs.
  1. Use ramps or stairs with invisible ramps over the steps. They work just as well and even provide a smooth transition surface. Doesn't work for cases of dynamic/physics content or player generated content.
Read More »

Extracting a .unitypackage without Unity3D

It looks like all the libraries that currently exist to extract .unitypackage files are broken/don't exist anymore (or at least the ones on Unity Answers). So I made a new one in Python.

Download unitypackage_extractor on GitHub

It's also on pypi in case anyone might want to use it in some sort of automated workflow.

While Unity packages are just a .tar.gz, they have a special file structure that doesn't make them usable after extracting right away. Every file and it's data is broken up over multiple files and stored in specific folders. This script just rebuilds the original heirarchy from those files.

Read More »

ConEmu and cmder fix for saving current working directory

ConEmu and tools built on it like cmder are awesome for Windows development. I can't see myself ever going back to conhost.exe with its lack of color, unicode-support, buffered-scrolling, tabs, configuration, sane hotkeys... ConEmu does come with a set of annoyances though.

The biggest ConEmu annoyance for me is it not properly persisting the current working directory in Git Bash. Long story short you need to add this snippet to your .bashrc.

#ConEmu Integration
if [[ -n "${ConEmuPID}" ]]; then
  #For WSL and cygwin/msys connector (which ConEmu will use for Git bash). It
  #sends an operating system command (OSC) to cygwin/msys connector to update the
  #cwd on PS1 print (the \$PWD in the below string, \w will not work).
  #https://conemu.github.io/en/ShellWorkDir.html#connector-ps1
  #https://github.com/Maximus5/ConEmu/issues/1752
  PS1="\[\e]9;9;\"\$PWD\"\007\e]9;12\007\]$PS1"
fi

ConEmu by default does not know when Git Bash changes its working directory. This breaks features like tab cloning (hotkey WinS), %CD% in tasks, and workspace persistence. To notify ConEmu of changes, you have to send an operating system command (OSC) using special control characters. The ConEmu documentation does describe how to set this up but I still found it buggy. After extensive testing, I found that only paths that contain the ~ character break it and submitted a bug for it. Using the above snippet I created implements the OSC described in the documentation and also fixes the bug.

Read More »

Is WebAssembly faster than vanilla Javascript?

I keep seeing GitHub issues of people just like me trying to figure out what WebAssembly (Wasm) and previously asm.js mean for performance-related javascript (in my case, games). WebAssembly should introduce less abstraction between you and the hardware and so your code should in general run faster, right? In reality this question is harder to answer because WebAssembly runs in a Javascript VM-like environment and was not made directly motivated for performance. I'll be putting aside the misinformation and anecdotes to hopefully find out if and how applying Wasm might make your projects more performant.

A bit of background on Wasm

Wasm was originally created for so much more than just performance. Wasm is about providing a proper compile target for native code to get into the browser. In the earlier stages of the development cycle, Wasm was actually asm.js, a unofficial JavaScript standard that only supports strict subset of JavaScript to allow native code to compile and run in a JavaScript VM. Wasm is also about providing an environment where multiple sources of code can run safely at a low level where things like memory management and control flow structures (jumping and loops) matter. Already Wasm is doing a ton of things that previously were infeasible or a real pain to do in the browser. (Sourcing a lot of this from this blog post by Adrian Colyer. It's good to keep this in mind while we ask performance only questions.

Wasm loads much quicker than Javascript code in pretty much all cases I've seen that is not really a topic that's up for debate so I'll skip over load performance and focus on runtime performance.

After quite a bit of searching and review, I found a few people who have done research into Wasm's runtime performance specifically by using benchmarks:

Read More »

A Simpler Blender Development Environment

After accidentally running Blender from a native console, I realized a much easier way to setup Blender for iterating over features/bug development. My old Blender Python module reloader was becoming too unreliable in my codebase so it was a welcome discovery.

To easily reload Blender for development:

  1. Set up the Blender UI to your liking to test your add-on. Mine happens to be the scripting interface but instead of the notepad on the left, I have the User Preferences view with the add-on tab open.
  1. Save this as your startup file for Blender
  1. Run ./blender.exe from cmd, bash, or Git bash to capture error output in the console without having to toggle it manually every startup.
Read More »

Subway Minimap WIP

Chemistory minimap for subway including character marker. Subway lines are loaded via SVGLoader to allow for greater customization and color/animation in the future. Next update should have some more level design/character movement changes.

Read More »

Bobskater - A Python obfuscation Library

Recently I had the need to obfuscate/minify some Python files before I distributed them. Coming from the Javascript world of ES6 where transpilers and processors are plentiful, I figured there would be a mature, well maintained library similar to UglifyJS in the Python ecosystem. It turns out that this isn't the case.

I decided to code and package my own, called bobskater. It turned out to be surprisingly easy with Python's ast library, the invaluable documentation at GreenTreeSnakes, and a little library called astunparse. Being completely AST based, it won't die on weird syntax or require special formatting. All obfuscation decisions are based on AST node type. There are a few limitations as of now but they're all documented in the repository.

There do exist a lot of libraries/techniques out there (free and pay) that perport to do this, with mixed results:

  • Compile to .pyc using compile(). Even at the highest optimization you can still extract the original code, variable names, and docstrings with uncompyle6 in literally just one command.
  • Encrypt your modules and hook the import functionality to decrypt them when loading them at runtime. Too simple to reverse in my opinion.
Read More »
Older posts Newer posts