Welcome to my Chronoboy blog. |
posted Jul 27, 2011 9:28 PM by Kevin Veroneau
Web Development in Windows | Web Development in OS X/KDE4 |
posted Jul 27, 2011 3:08 PM by Kevin Veroneau
I found myself coming back to KDE4 for my web development after attempting to use OS X. Nothing can really beat Kate, Konsole, and Plasma.
Under OS X, I attempted to use a program called TextWrangler(available in the Mac App Store), and at first it seemed like it could work, but it didn't like it's layout, session management, and remote files. Kate on the other hand has session management built right in, and has been included in many versions of Kate. Plasma includes a nice Kate session launcher to make it a snap to create and load sessions with minimal effort. So far I haven't found a similar solution for either OS X or Windows without porting Kate over.
Under OS X, the Terminal works very similar to how Konsole works, however the menu bar is much closer, and supports proper keyboard keys, such as Home/End/PgUp/PgDn, it's just a more compatible VT-100 terminal.
Under OS X, managing files to be edited and creating new files is a headache, TextWrangler works a little, but not as simple as how Plasma makes creating and editing files. Plasma has a really nice widget called a Folder View. This widget allows any directory, local or remote to appear on the desktop and fully interacted with. You can create new empty text files, and folders. You can even traverse the nested directories without pressing a button or even opening a new window! This feature alone makes it one the best tools available on KDE4 for development. I can easily find a new file to edit, then drag and drop it directly into kate for editing. No mess, no fuss, no backward buttons to finick with.
This is why I personally prefer KDE4 as my development platform of choice, it just makes all the management tasks feel like childs play.
I will soon create a YouTube video on the differences between a OS X, Windows, and KDE4 development pentagram. Then I'll let you be the judge on what looks better for a developer to use.
|
posted Apr 5, 2011 9:18 AM by Kevin Veroneau
posted Mar 19, 2011 12:04 AM by Kevin Veroneau
In my many year using Linux and other computer operating system kernels, I find Linux's memory management the best. Only a few Linux distributions did I find memory management poor. This was most likely due to either the kernel used, or daemons used.
Applications seem to launch quick under Linux, and the overall memory usage seems lower than other operating system kernels. The way the Linux kernel caches application code, is done really well. I seem to have constant issues with memory under Mac or Windows. Issues of which do not appear under Linux.
I was surprised to see how slow Applications launch under Mac OS X 10.6. After reading many forums, it appears to be related directly to Snow Leopard... However, I am sure if that was the case, Apple would have resolved the issue by Mac OS X 10.6.6.
This is one of the many reasons why I keep retreating back to my Debian Linux desktop from other operating systems. After using OS X for a few weeks, I was quickly trying to find out how to run many of my favorite open source applications on OS X. Mainly because OS X has really awful memory management compared to Linux. For example, I open Firefox on OS X, it can take about 20 seconds on a Dual core 2.66Mhz. After I quit the application and open it at a later time, it again takes about 15-20 seconds to open. However, under Linux, I open it the first time, it may take about 10 seconds. After closing the application and re-opening it later, it takes only 2-5 seconds to open again. This is due to the better application code caching Linux has.
An interesting example on how Linux caching works is when one uses the free command under Linux. When I first began to use Linux, I thought it was horrible at memory management due to how much memory was in use, even after closing applications. Actually, at the time, I thought applications were leaking memory. However, this was not the case. The excessive use of memory was in reality the usage of the cache.
Under Linux, when you close the application, it technically still remains in memory, but the memory is free for other uses. If the user launches the application again, it checks the memory cache, and if it's already there, it uses that in preference. All operating systems have this application code cache, however under Linux it does not delete the application cache unless it really needs to. If I close Firefox now and have plenty of memory free, it will remain in the memory cache for quite awhile. I can open new applications, and if I need Firefox again, I can open it within seconds.
I figure other operating systems have a timed application code cache, whereas it removed the cached application after a specific amount of time. Linux only does this, if another application is requesting more memory.
|
posted Mar 7, 2011 3:58 PM by Kevin Veroneau
I recall using NBD awhile ago for a Linux software RAID I was using with ZFS, and it had wonderfully speedy results. Not until now do I realize how super fast NBD really is compared to Network File System or Server Message Block protocols. The benchmarks are as follows while copying a 105MB file. | NBD | 1.5 seconds
| | SMB | 10.7 seconds
| | NFS | 15.6 seconds
|
The NBD was also encrypted and being decrypted on the client machine. It appears that Linux uses normal disk caching on the client machine when working with remote block devices. This speeds up transfers of previously used remote data. The initial data transfer is still below 5 seconds, making NBD quicker than the alternatives. |
posted Mar 7, 2011 2:48 PM by Kevin Veroneau
I now have Debian Squeeze booting on my MacBook perfectly fine. I was rather easy, thanks to rEFIt. You only need rEFIt to sync the GPT with the MBR, afterwards you no longer really need it. Mostly everything worked right away, needed to manually compile and install the wireless drivers, but I'm quite used to it and it didn't take long. Video acceleration and OpenGL work wonderfully right out of the box, thanks to the Intel chipset. The only hardware issue I have with the MacBook is the limited amount of USB ports. Apple expects users to use Bluetooth HID devices(Keyboard and Mouse). I do not have a Bluetooth keyboard or mouse. Since there is a limit of 2 USB ports, I needed to find a nice solution to make it easy to access my external storage devices without loosing the ability to use my keyboard and mouse. The powered USB hub I bought has a very short power cord and needs to be powered or it will cause problems. I configured my SheevaPlug with the USB hub and a wireless USB Wifi dongle to share my storage devices over the network. This works perfectly since all my devices can access it easily now. Also since OS X does not play nice with LUKs encrypted block devices, OS X can now also access these devices from the SheevaPlug. The SheevaPlug is a standard ARM Cortex A8 embedded device with Debian Lenny installed on it. Actually, it shipped with Ubuntu server, but I put Debian Lenny on there as I prefer it over Ubuntu. The SheevaPlug has one USB port, one Ethernet port, and one SD card slot. I found it much easier and more secure to share my externally USB device over the network using NBD. NBD has faster transfer rates than most network file systems, as it accesses the blocks on the disk directly. Since it accesses the blocks directly, I can export the encrypted block device over the network and let my MacBook decrypt it and store the encryption key. Although this setup is not compatible with OS X, although it might be now. I plan on using an exported NFS share for sharing data with Mac OS X from the encrypted storage unit. Here is a video of my MacBook booting OS X and Debian: Debian and KDE4 booting on my MacBook |
posted Feb 22, 2011 4:03 PM by Kevin Veroneau
I find it strange that a monolithic kernel which Linux possesses is so much more quicker and responsive than a mach BSD kernel which Mac OS X uses. I find myself using Iceweasel via VirtualBox to browse the Internet more than using even a native OS X version of Firefox. What's wrong with this picture? How can a browser using through a Virtual Machine be more responsive than the same browser running on the native Operating System? This makes very little sense to me.
To make things more interesting, here is how I have it set-up. I am using Oracles VirtualBox on a VT-enabled Intel processor. Inside VirtualBox, I have Debian Squeeze running with all updates and Iceweasel. I am not running Iceweasel using Debian Squeeze's X.org server, but am using Mac OS X's X11.app X server. Firstly, don't go and say that it's still Apple's X11.app which is making the apps more responsive than a native Aqua app, as Iceweasel and many other Linux apps are still more responsive when running on a physical computer(one which is considerably slower than the MacBook).
By responsive I mean by the application startup time and the feedback from the application. I attempted to write in my blog on the native Mac OS X firefox browser, but my text cursor constantly skips as I typed, it was not smooth at all. Then on Iceweasel running on Debian through VirtualBox on the same MacBook, I am able to type and the page can actually keep up with my quick typing with no lag whatsoever. How is this possible? I would imagine that the native application would respond more swiftly, but it does not.
I can see more of why Linux is chosen for the server environment over OS X or even Windows. BSD is used somewhat, but if this responsive behavior is really related to a BSD kernel, then I can see why Linux is favored over BSD.
If Apple can make the iPhone more responsive than the Android, then how come Apple cannot make OS X more responsive than Linux, the core of which Android is based? Perhaps is more to do with the extra Dalvik Java Virtual Machine which makes the Android as sluggish at times as it is.
Ironically, I use both a MacBook and an Android phone at the moment. I plan on moving my phone platform back to Symbian OS very soon. If Apple can fix these responsiveness issues and start-up times with their OS, then I may consider a future computer being another MacBook. Until then, my next notebook will definitely be a Linux-based one.
Overall, Mac OS X is very nice to work with, but I still miss the responsiveness of my Linux laptop, although it was much more slower and only single cored, it oddly ran faster than OS X. A great feature of OS X for me is going to be Bootcamp, as I can easily install an Intel-based Linux distro if I so need to. At the moment running Linux via VirtualBox seems to work perfectly, all I need is a RAM upgrade and I'll be all set.
I guess once you try Linux(not Ubuntu) and see how wonderful the system is, it's really difficult to buy into the competitions bullshit. Although, all of this is from a techies point of view. I am a huge power user and tend to no upgrade until I brought the computer to it's knees. For the most part, my last laptop was working perfectly for me. Although the video card was the only piece which I wanted to upgrade. The only way to upgrade a laptops video card is to buy an entirely new laptop. Although there are some newer laptops out there now that support upgrading the video card, mine wasn't one of those.
I will forever remain a LinuxAddict.
|
posted Feb 8, 2011 4:36 PM by Kevin Veroneau
No update for a few days is a good thing right? Well sort of, I have been going through my UNIX knowledge and attempting to use it in Mac OS X. Bad idea... Mac OS X has a UNIX root, but much of the good stuff has unfortunately been removed by Apple. No built-in package manage for managing Open Source packages. I ended up using MacPorts again today to compile many free AV tools, such as libdvdcss and transcode. I got a better version of Mplayer from compiling this way, rather than using the Mplayer OS X 2. I couldn't believe how limited QuickTime is, compared to the mplayer port from MacPorts. QuickTime is missing many codecs, such as FLV and MPeg2.
Basically during the past few days, I have been downloading pre-compiled software for Mac OS X, such as Mplayer, a standalone FLV player called Elmedia Player, and of course the GIMP. So far, I have just compiled these using MacPorts, and they provide a better experience and more features. Let alone the major advantages to compiling the software for my specific CPU. The GIMP is the only application which I have, which is not compiled using a UNIX port.
I am neither a Linux or Mac Addict, but rather a UNIX addict. Maybe more fine grained to an Open Source Software addict. I just can't stop using Open Source software over the commercial alternatives. Most commercial software on both Windows and Mac which cost a huge amount of money, have an Open Source alternative, which I personally find better. A great example is a DVD ripping software, which supports encrypted CSS DVDs. On both Windows and Mac, this type of software can cost as little as $50 and can be much higher than that. Then using a simple UNIX console application, can rip encrypted CSS DVDs with little hassle. Furthermore, since these Open Source alternatives are modularized, the process is more customizable by the user. Also seeing the differences between QuickTime and Mplayer, is another great example.
Since using VirtualBox to run all of my current Debian applications, the migration to Mac is not being as problematic as it could of been
At the moment, my only major issue is the Mac keyboard, even when plugging in a PC keyboard, the Home/End/PgUp/PgDn keys do not work as expected. I tend to use Home/End on the command line and when using nano a lot.
I will be trying my very first OpenGL game on Mac OS X tomorrow, the highly anticipated and currently popular game by Maxis and published by Electronic Arts, Spore. I have been wanting to play this game for many years now, and will have my first chance tomorrow when it arrives via UPS.
X11.app does appear to support 2D acceleration when running remote X clients. I was able to play a Flash video from VirtualBox's Debian, while using my Mac's X11.app Server as the display server. It played without any problems at all, and frankly, I am rather surprised. |
posted Feb 4, 2011 7:23 PM by Kevin Veroneau
My migration from Debian to Mac OS X is turning out rather well. During the first day, I attempted to use MacPorts to access my previous Debian applications on Mac. This was not the best idea, it takes a very long time to compile. It took well over 12 hours just to compile Amarok and all it's dependencies.
After removing MacPorts, I installed MacFUSE and MacFusion to enable access to my SFTP shares. It works wonderfully, although native Apple support would be better. FTP is dead and should be discouraged.
Today, during a walk, I thought of the best idea to fully migrate my PC laptop directly to the Mac. Since I had VirtualBox installed, I decided to copy my old laptop into a Virtual Machine. So far, it is working perfectly. As my laptop used an LVM(Logical Volume Manager) to store the Debian partitions, there was very little effort. Also, since it is Debian, modprobe and udev takes care of the entire driver migration for me during the first boot. All I needed to do, is change a udev rule to make the new Virtual Ethernet card as eth0.
I moved the data over by booting the laptop from a USB key, and booting the same image in VirtualBox on my new Mac. I mounted my existing Debian LVMs under /target, and created the directory targets in VirtualBox in the same place. I used SSH and GNUTar to move the data over the network into VirtualBox. After it was all copied over, I installed and configured GRUB.
The SSH command to use to migrate this data is: ssh root@host tar -cvf - /target | tar -xvf -
Be sure to be in the root of the file system on the target machine, in VirtualBox. What this does, is tar /target to stdout, which is piped through SSH. The local machine then, extracts a tar from stdin to the current directory. I enabled verbose mode to make it easier to monitor, I prefer seeing some output rather than nothing.
Once GRUB is installed and configured, reboot the Virtual Machine, and all should work fine. The only change I really made in VirtualBox was to create a /boot partition, which was not present on my laptop. I was chainloading GRUB from NTLDR, and the kernel and initial ramdisk were stored in a different location for use when booting. This is the only entry I needed to add to /etc/fstab, as everything else is handled by the LVM device mapper.
Rather than using VirtualBox's Framebuffer, I used Mac OS X's X11.app to display my X clients from the VirtualBox image. Running X inside of VirtualBox can take more resources, so why not just use a native, non-virtualized X Server?
To forward X clients to the Mac OS X's X11.app, you first need to edit the preferences for X11.app and enable network connections. Then restart X11.app so this change takes effect, this basically added -tcp to the X11 startup. Once restarted and you have an xterm opened(which X11.app does automatically), you can either allow all connections(if your in a secure environment) or only allow connections from the Virtual Machine(which is more recommended). To enable access from the Virtual Machine, use the xhost command. Take time to read it's man page for further information. Enter in xhost +<hostname>
Some of you readers are probably saying, why not just use SSH? For one, SSH is mainly used to secure a connection, and has SSL overhead. If you use xhost and place your VM in a private network, which only your MacBook can access, what's the point of securing the connection? It's not even going through a single cord or wireless signal.
Once you have xhost setup, log into your VM via the console, and disable KDM/GDM. After you log in, export the DISPLAY environment variable to point to the Mac OS X, X server. It's a simple as typing in: export DISPLAY=<macip>:0
For some reason, due to the way X11.app starts up, every time you relaunch X11.app, the display number is incremented. If you keep X11.app opened all the time, the display number will remain the same.
After the DISPLAY is exported, run your application in the background, for example: iceweasel &
The Linux X application will then appear on your Mac OS X desktop and use the Mac OS X window manager. I would recommend installing a Mac OS X GTK+ theme, so that your applications look the same. KDE has a similar theme as well. To swap themes for GTK2, download the small gtk-theme-switch application.
This is by far the easiest way to run popular Linux applications under Mac OS X with minimal effort. You can use any Linux distro, just disable the X login manager to conserve resources, and export the DISPLAY to run your applications. Concidering MacPorts requires you to have Xcode installed and lots of RAM and Hard Disc space to compile, this method is the quickest and easiest way to run Linux apps directly on your Mac OS X desktop. |
posted Nov 19, 2010 12:38 AM by Kevin Veroneau
What do most RPG engines have in common? A tag system! A tag a simple bit based variable, it can either be on, or it can be off. In many RPG engines and games, it is the driving force of the epic story lines. Did the player do this yet, has he purchased that item, talked to that NPC, etc...
The popularity of tags is due to their very small storage requirement. When computers and game consoles were young, using tags was a no brainer. However, with the very simplicity of tags, comes the simplicity or sometimes complexity of a story. In order to drive a very complex story using tags, you need a lot of them and need to branch them out a lot. Take a look at the console versions of RPG Maker for example, load up the sample game and look at their event systems. It's very confusing to follow the story and even find bugs with this much branching.
In the modern era of computer and console games, we have much more memory to use. Developers are now mixing both a tags system and full fledged variable system for the same purpose. Real variables have the advantage to store more than just two different states, it can store very large numbers. When you have a very complex story, it starts to become essential to use real variables rather than a tag system. Using both together definitely has advantages.
Which brings me to this, I personally use a 2D RPG engine called OHR.R.P.G.CE, to develop my RPG games and stories. This engine has a scripting system for driving story and cutscenes, this was it's main purpose when it was created. Now the scripting engine has completely evolved into something great. Although, when OHR developers use it godly powers, it's not normally for an RPG game, but for a platformer, or another genre. Some of them get creative and code RPG mini-games using it. This is all and good, but it's a complete waste to what power it has to offer for an RPG game.
Let me elaborate, most OHR developers in their RPG games would use a script to add special effects, or add a fancy cutscene into the mix. It's very true that the scripting is great for those, but the same developers which are creating non-RPG games using scripts, are not really applying those same skills to an RPG game. I don't mean by adding a platformer mini-game into their RPG game, that's just stupid use of scripting for an RPG game. If a mini-game appears in an RPG game, the mini game should be Role-playing related, or at least match the theme of the RPG game. I admit seeing many mini-games in RPG games that look completely "tacked" on. There was absolutely no reason for the mini-game at all, but to frustrate the player.
Now on to the good stuff, this is how I utilize the scripting engine in OHR. I will say this many times over, I do believe that I am the only developer in the OHR community which uses these odd methods. I am explaining it here to provide some with ideas, and also the reasons behind my insane way of scripting. Believe me, you haven't seen RPG game scripting quiet like this yet.
Okay, my big rule number 1 when creating an RPG game, separate the game editor from the script and make as much of the scripting reusable as possible. I don't mean reusable in other RPG games, but reusable in the same game. Here is how I do this, read carefully. Inside custom, assign a new-game, load-game, and game-over scripts. Assign a generic map autorun script, which dispatches to other scripts. Assign a after-battle script. When designing the maps, only design the tile and wallmaps. Leave everything else a blank slate. Create the NPCs, but don't place them on the map in static locations, leave your NPC map a blank slate.
Now some of you readers are thinking... "Well this world will be very baron, not even a living creature in sight", well we did create the NPCs, but never placed them. I would recommend creating a template map, which would already have your autorun and after-battle set. Also, set the map music to just -same as previous map-, you'll see why I do this soon.
OHR.R.P.G.CE is very very limited when using the editor to develop your game and world. What we have done above is set the canvas, in which we will extend the engine via scripting. Most developers would use scripting for very simple and trivial things in their RPG game. Doing what we did above, allows us to control every aspect of the game from within a script, while keeping it an RPG game, and still using the editor. Having less scripts to set in the editor makes everything a whole lot easier to manage in the end.
Okay, here is our first scripting example, our map autorun dispatcher. Name it anything you like, and be sure every map has this set as it's autorun, using templates makes this a cinch.
if (run mapsetup == 0) then (exit script) set tag (tag:Savable,true) if (current map == map:Waku Forest 1) then (waku forest 1) if (current map == map:Waku Village) then (waku village) if (current map == map:Waku Stables) then (waku stables) if (current map == map:Waku Forest 2) then (waku forest 2) if (current map == map:Waku Cavern) then (waku cavern)
There we have it, a very simple map autorun dispatcher function. It's very simple to read and pretty straightforward. I'll explain the first two lines: The first line checks a global variable, which is used in a load-game script to make sure that the map autorun runs after the game's load-game script. Depending on your game, this may not be needed. But for my game, the load-game script sets some very crucial variables that tend to break the map autorun if not correctly set. The second line sets a tag which controls the displaying of the "Save" menu option. Controlling this from a tag makes it incredibly easy to manage when the player can and cannot save their game. I also use a custom save-game script, which I will get into more detail later on.
Now that we have a map dispatch function for every map to use and call, lets go into what a map autorun has to do in a game such as how I script it. Reader bewhere, the next section of code may scare some OHR developers, you have been warned!
variable (i) isBlue := 0 isRed := 0 set each step script (@map steps) set on keypress script (@key handler) create ns door (8,9) create ew door (13,13) create ns inside (19,14) if (hour >> 10,and,hour << 21) then (create NPC (2,9,6)) else (npc ns bed (11,6)) north map := 1 south map := -1 east map := -1 west map := 1 for (i,3,10,1) do, begin make animal (i) end blue portal (21,3,1,91) setup blue npc (91) set moon (1,14,14) set timer (0,30,18,@pass cloud) set timer (1,20,18,@pass cloud) map soundtrack (Song:Starry)
This sniplet of code is taken directly from my staging demos first map autorun. Now, if your that curious on how I made the staging area, this is your lucky day!
For the most part, this is very straightforward scripting for most developers, I will point out a few things. Since we do not set a each step or keypress script in the map data, it is set-up here. Your thinking to yourself, what is the point of this, why not just set it in the map editor? The simple answering being, the map editor is static information! Lets say, along the development of your RPG, you wanted to make it so a special event would alter these scripts or disable them completely. Yes, you could have it set in the map, and then use the autorun to disable it or edit it, but if you include it in your map template, every map will have these. Well, okay, then I can just edit the map data for those maps. This is where things begin to get more confusing... Why not just do everything the same way in the editor, thus less menus to pawn through when your trying to debug something. Having everything in the source code is just simpler! You could create a debug tag or variable which can disable these on-demand for specific maps having problems.
This script uses a lot of custom functions, such as the ones to create doors. I like referencing things that use X,Y in the autorun, it makes it much easier to keep track of, and those functions also set special data to the NPC references so that they know how to work.
The next line is an IF line for checking the current game time and taking the correct actions. Some of you might of thought, I used tags to make the NPC vanish at night and populate the bed. No, this is my secret. In my final game, I have autoruns which need to do such things to an entire towns populace, where each NPC may not appear at the same position all the time. This is how I am able to add full NPC schedules to my game to make the game world seem more life-like.
The next four variables are used for when the player walks off the map to move the player to correct place.
The next FOR loop there is for dynamically generating animal NPCs, yet another attempt to make the world more life-like. The make animal function takes care of everything from setting the NPC picture and palette, to randomizing the NPCs place on the map, to even selecting the script that is run when you bump into such an animal.
If you played the staging demo, you will notice a blue gate in the game, these next lines control the gates creation parameters.
The next two lines control the overcast of clouds that pass by in the staging demo.
And last but not least, setting the maps soundtrack. Some of you might be thinking, isn't that suppose to be called "set ambient music"? Well if you want the same effect as setting it in the map editor. If you played my staging demo, you will notice that the ambient music fade in and out very smoothly during specific events, like a battle or playing the interactive item. Wait until you see this in action in the final game, during the development, it's bitter sweet how lovely the music transitions from event to event, it's like no other OHR game you played before.
And there you have it, the first insides of how I code in OHR, and this is not even the half of it. I will have another post soon which will show other things I do, such as textboxes(the most confusing part every really). |
|