Skip to main content

Posts

Studying Metal Slug's Engine

There's a Debug Menu in many titles from the Metal Slug series. Today I played around with that debug menu in Metal Slug X, especially I turned on 'body rect' and 'attack rect', which revealed how the game works. Now not only did I have tons of hours of fun, I also studied a lot from this amazing game! Of course the following are only my observations, or my best guess on how they have been implemented the game. Although I think my interpretation should work, but it's definitely not the only way, and it's quite possible that the developers have achieved the same effect with another (maybe better) method. First Impression At the first glance, the debug drawing is far cleaner than I had expected, it seems that it's not tiled based physics at all. But note the thin shadowed area below the line, which may imply that it's still using tiled based calculation somehow. Edges The ground is described as line segments, from the way the ...

Notes

surface pro stylus calibration http://www.reddit.com/r/Surface/comments/18cd96/improved_pen_accuracy_with_a_100_point/ http://www.reddit.com/r/Surface/comments/1cy8hn/this_pen_calibration_is_so_far_the_best_solution/ Search for 'UserLinearityData' in HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet and remove 'devicekind=pen'   merge tool: meld   linux虚拟机的硬盘大小不够,扩容以后又调整了分区,于是grub就不能进入了。启动说unknown filesystem然后进入grub rescue。 根据 http://askubuntu.com/questions/142300/fixing-grub-error-error-unknown-filesystem 在grub rescue输入 set prefix=(hd0,5)/boot/grub insmod linux linux (hd0,5)/boot/vmlinuz-3.11.0-15-generic initrd (hd0,5)/boot/initrd.img-3.11.0-15-generic boot 然后grub这步正常了,但是会卡到initramfs/busybox,说找不到init 于是在linux命令后面加上root=/dev/sda5就可以正常进入系统 进入系统以后赶紧用grub-install和update-initramfs再修正一下。

Converting synced C/C++ into asynced JavaScript

Emscripten is a C/C++ -> LLVM -> JavaScript compiler. It's useful and interesting, but one of its biggest limitations is about the sync/async model: JavaScript is single-threaded event-driven languages, therefore you cannot do a sleep() in the hope of receiving and processing extra events. Demo First of all, please enjoy this demo , on which I really spent some time. tl;dr Motivation: to make `sleep` and other similar functions actually work in our Runtime, without lots of labor work porting the C/C++ code I actually made it worked  `sync->async` is doable and I think it's not too hard - there are already implementations for JS I think this is a feature that cannot be supported by merely an external library Does it fit emscripten? Or is it possible to write a plugin for emscripten? Demo explained(?) The demo is basically a stop-time animation: //draw something //wait for some while //draw something else //wait... You can verify this ...

杂记 2013.10.23

png优化工具:pngnq(有损)和 pngcrush(无损) ubuntu gnome 13.10的input source里找不到输入法:手动修改dconf键值 org.gnome.desktop.input-sources.sources ,在数组里添加 ('ibus','sunpinyin') 和 ('ibus', 'anthy') 。 但是mozc似乎不行,原因不明。观望。 mozc在dconf里要打('ibus', 'mozc-jp')

Ubuntu 下 mount windows 共享目录

一般来说遇到标题所述问题我马上会想到smbfs,不过好久不用,最近发现smbfs已经没有了,取而代之的是cifs,于是命令大约是 sudo mount -t cifs //hostname//folder /localfolder -o user=username 不过总是报 Input/ouput error google了一阵,有的说加上 sec=ntlm 有的说加 iocharset=utf8 ,不过都没用。其中加了后者还会出 Can not access a needed shared library 的错误。根据 http://wiki.openwrt.org/doc/howto/cifs.client    和 https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1067681 , 安装了linux-image-extra-***的包以后才可以,但是mount还是不行。(我的linux是在虚拟器,装的最小内核linux-virtual) 于是尝试了一下smbclient,也是报错: tree connect failed: NT_STATUS_INSUFF_SERVER_RESOURCES 根据 http://klebom.net/melazy/tricks/ 查到是IRPStackSize过小的问题, 我在windows也确实查到了事件: Log Name: System Source: srv Date: 2013-10-20 14:08:29 Event ID: 2011 Task Category: None Level: Error Keywords: Classic User: N/A Computer: *** Description: The server's configuration parameter "irpstacksize" is too small for the server to use a local device. Please increase the value of this parameter. ...

Install Ubuntu 13.10 via Grub Legacy

I need to install Ubuntu 13.10 into an old Linux machine. The BIOS has been locked such that I cannot boot from CD or USB drives. The machine has grub 0.97 and a pretty old CentOS installed on it, which I've got the root access, so I decided to try to load the ubuntu iso file with it. Based on https://help.ubuntu.com/community/Installation/FromLinux I tried to enter the grub commands there, but then it failed with error like this: stdin: error 0 /init: line 7: can't open /dev/sr0: No medium found After spending hours in searching and trying, I found this url: http://askubuntu.com/questions/47076/usb-boot-problems which solved the problem for me. The full commands I used are: root (hd1,0) kernel /casper/vmlinuz.efi boot=casper live-media-path=/casper/ ignore_uuid initrd /casper/initrd.lz This link http://manpages.ubuntu.com/manpages/karmic/man7/casper.7.html describes the parameters for casper

Screen Color Calibration

configure softwares gimp: edit->preferences->color management->try to use system monitor profile firefox: about:config ->  gfx.color_management.mode -> 1   test pages http://www.gballard.net/photoshop/srgb_wide_gamut.html http://photographylife.com/is-your-browser-color-managed I bought a spyder 4 express and would like to try dispcalGUI on my surface pro, so I have to install Argyll CMS's driver, which is not signed. For windows 8, one option to disable driver signature enforcement is through "advanced startup settings", which lists a few options after a restart, and you can press f7 or 7 to disable it. However for my surface pro, it refused to recognize my keyboard, no matter it is a bluebooth keyboard, a usb wireless keyboard or a normal usb keyboard. I guess a touch/type cover might work, but I don't have one. Another option is to enable test mode (bcdedit -set testsigning on), before which you should also disabl...