Feed on
Posts
Comments
Page 1 of 612345»...Last »

There are times when you just have to bite the bullet and do some real coding with Xcode.  Here are some tips to make it ‘feel’ more like MSVC (with Visual Assist installed of course) so you can bounce back and forth without snapping and murdering your family again.

Step 1: Get rid of that horrible funky mouse acceleration and fix cut and paste

Setup Synergy so you can use your Windows mouse and keyboard on your Mac.  It’s free.

Just think of your Mac screen like an extra monitor.

Note sure if you’ve heard but the Ctrl-X/Ctrl-C/Ctrl-V shortcuts are freakin’ backwards on the mac.  (Don’t get mad Mac people, I just mean from a long-time Windows user’s point of view!)

To fix this, open the Synergy settings on the server side, which would be Windows, and set up the Mac target to reverse the Ctrl/Alt buttons.  (See pic above)

This makes the fix system wide, much better than just trying to fix Xcode specifically to do it.

Advantages of using Synergy:

  • No switching keyboards/mice!  Switching keyboards can kill productivity.
  • Saves desk space and looks cool
  • You can cut and paste text between the OS’s
  • If you’ve got a linux box, you can also set that  up with Synergy

Disadvantages:

  • Need two machines running all the time for this to work

Alternative methods:

There are free methods to get rid of that nasty acceleration, none of them really work, maybe the $$ ones do.  Some 3rd party mouse drivers will do the job, but you have to OWN that mouse for it to work right.

You can also reverse the Ctrl/Alt (Sorry, Command key, whatever) under keyboard preferences on  the Mac side, but I seem to remember having a problem with doing it that way.

Step 2: Use my MSVC key binding set

Install my MSVC key config. (Works fine with Xcode 3.x)

Download this, unzip it, and place MSVC.pbxkeys in YourUserName/Library/Application Support/Xcode/Key Bindings.

Next, start Xcode and click Xcode->Preferences, select Key Bindings, then choose “MSVC” as your key binding set.  Now Ctrt-Shift-F does project wide find, Ctrl-Shift-H does project wide replace, F5 does build and debug, Ctrl-` (tilde) will swap between source/header and so forth.

It also remaps debugging keys, F10 will step over, F11 will step into, etc.

It’s not perfect though, it doesn’t seem to want to map a key twice, I can’t get F5 to also “Continue” while debugging.  So that became F6.. consider this a good place to start from that you can further customize.

Step 3: Fix Firefox so Home/End works like you would expect.

You’ve gotta websurf from your Mac once in a while, so install Firefox so you don’t have to deal with Safari.

Install Keyfixer, a Firefox 3 plugin so pressing End or Home while editing text will actually do what you expected it to.

While you’re at it, you can fix it so your mouse’s forward and back buttons work properly in Firefox by using the hotkey mapper in Synergy on the server side:

(Map mouse button 4 to Ctrl-L and mouse button 5 to Ctrl-R)

Step 4: Finding a decent SVN client for your Mac

Well, you can’t.  The gold standard is of course TortoiseSVN on Windows – but I can’t find anything close on the Mac yet, at least not for free.  Yeah, I’m cheap like that.

SCPlugin shows a bit of promise because it attempts Finder integration but is currently broken enough to steer clear of.  Maybe later…

RapidSVN is reliable but makes you jump through some hoops if you want merging/diffing.

What works for me currently:

  • Place the SVN checkout on a networked Windows drive so I can use TortoiseSVN.  Xcode will behave fine working directly from it – you can override where projects gets built in Preferences->Building so that part happens on the Mac side.  (Faster, and less worry that permissions will be screwed up when you do your final install)
  • Also enable the SVN support in Xcode, it’s.. uh.. not the greatest but better than nothing.

Step 5: Relax and enjoy your MSVC like coding environment

Well, almost.  You’ll still feel a little empty inside without VisualAssist’s advance code refactoring abilities, but hey.

If you’ve got any more tips to ease the Win->Mac pain please share ‘em.

The IGFM results are in!  Our game Mind Wall didn’t make the cut but it did get an honorable mention in the Best Mobile Game Design category.   I admit it,  I was sort of hoping for a reason to get to GDC this year but alas, it was not to be.

Hit indiegames.com for the full story

iPhone apps dominate

Big congrats to the finalists, wow, it looks like all but one are for iPhone/iTouch devices.  (The single exception is for the DSi)

Complain as you will about the ‘race to the bottom’ pricing and crapware flooding the iPhone,  but wow, it’s also truly a fertile space where people are taking chances and making original and incredible  things.  Reminds me a bit of the crazy C64 days, almost.

LD power

Hat-tip to fellow Ludum Dare alums Dock (Tumbledrop) and Tonic from Secret Exit (Stair Dismount) for making finalist in the technical achievement category.

Everybody has their own favorite development IDE.  Some love Eclipse, others adore Xcode, and a few old school types swear by simple text editors and shell scripts. (Hi Pov!)

While cleaning up the Dink source I’ve been really getting my money’s worth out of Visual C++ with the Visual Assist add-on.

Safely renaming variables

One of the more useful features of Visual Assist is intelligently renaming a variable or function name across a project.

As an example, I could safely rename the horribly named global int variable “mode” to “g_gameMode” .  It’s smart enough to ignore locally defined “mode” variables or the word mode used in other contexts, such as functions or comments.

With its new name it will be safer use Search and Replace to make it GetGlobals->GetMode() later or something if I want to later.

Renaming library functions across multiple projects

Let’s say for some reason you wanted to rename RTFont::Load to RTFont::LoadTrueType but you don’t want to break things in old projects.

Here is a trick to safely rename things across multiple projects:

  • Create a new solution called AllProjects and add each existing project to it
  • Use Visual Assist’s rename or other refactoring tools to modify them all at once
  • Keep the solution around for anytime you need to globally modify things

When you have tools to make normally monotonous chores a breeze, you’re that much more likely to actually do it!

If your IDE can’t do stuff like that it might be time to find one that can.

More Dink stuff.  I’ve been focusing on the more technical parts, especially dmod support.

Please ignore the ugly temporary GUI I’ve got going now.

Day/night mode added! Just kidding, just some palette glitch.

The .dmod format

When Dink was developed, I didn’t give too much thought to how add-ons would work.  Here is what it had:

  • Each dmod gets its own directory name
  • A readme.txt with a lot of info that I don’t think anybody uses, unsure
  • A text dmod.diz file would include the name, a line for copyright, a url, and a description. (starting with Mystery Island?)
  • preview.bmp that nobody uses (Actually, I think this was added by redink/Merlin for the 1.08 release, not me)

So yeah, very basic.

Also missing was a way to package and install them.  The first DMOD’s (Search For Milli Vanilli and Mystery Island) were packaged with .exe based installers that would locate the dink directory (in the ugliest way possible) and create a directory there.

By the way, Search For Milli Vanilli has a 4.6 rating?? Come on!! First DMOD ever, giant heads, awesome music, and eerily predicting the future mean nothing?! (The map.dat is dated 10/15/1997 .. yeah, not even I would be in poor enough taste to do the dmod AFTER what happened)

So I thought everybody would create a windows-centric .exe for each add-on?  Dumb idea, especially back before the era of nice free install makers.  So we ended up with a bunch of zips/rars/lha’s or whatever without a real standard.

Then, an enterprising lad from the Dink community by the name of Merlin created DFArc, a utility to help install and manage dmods.

He invented the “.dmod” file extension.  (I think?)  This is basically the above but compressed as tar.bz2.  (Grr, I only support .zip in my game framework!)

Then, the dink community went through the laborious task of converting existing dmods to .dmod format making everybody’s life easier.

Tar.bz2?!

If I want to make the DMOD experience smooth and take advantage of the currently 301  add-ons (some as big as Dink itself), I need to allow you to download and install the original .dmod files.  No porting, no special iPhone versions.  No repackaging.

First I improved my net code to handle redirects and allow in-game downloading by URL: (there will be an easier way too, but this “manual” download way will remain, useful for testing or just installing any dmod you feel like)

Enter any URL your heart desires. It just better be a .dmod.

I searched in vain for a small and portable tar.bz2 unarchiving class so ended up writing one using the bzip2 library.

Tar is a dead simple format, especially when you can ignore stored file permissions and the like.

I force all files to be lower-case when writing, helps with the case-sensitivity issue.

Single pass un-bzip2'ing and un-tar'ing. Quite zippy.

After it’s finished, it will kick back to the scrollable DMOD management screen:

Basic, but functional. I will add more text and probably icons for the readme and url if applicable.

And finally:

Ta-da! You're now playing a user made add-on from the comfort of the train and/or bathroom!

Incorrect aspect ratio and no midi music yet, but hey, it's playable.

What next?

Well, most of the technical issues are out of the way so it’s time to move on to interface and better audio.  At first I was thinking I wouldn’t need to support midi because I was going to remaster the whole dink audio track, but now I see midi support is a must for dmods.

So do I want to spend $500 to license fmod for iPhone? (I used this for Prey Invasion, so I’m already familiar with it… that would also give .mod/.xm support.  iiiiinteresting.)

Is there anything with similar functionality that is cheaper?  Hurrumph.

Thanks to magicman, Ex-D, and scratcher from the Dink Network’s chat for helping me out.

Note from Seth:

This post is from Justin Martin, the awesome artist behind Dink Smallwood and the new Dink port we’re doing for iPhone! He’ll be using codedojo from time to time as well.

Just check the name near the top to see if it’s Seth or Justin who is posting.

WoWScrnShot_010410_094047_sm

The bitter

After five+ years of adventuring in the land of Azeroth, I discovered yesterday that my beloved WoW toons were hacked… some deleted and all others stripped of everything–all my precious epics sold or sharded and gold stolen. Maguro, my level 80 pally, was left wearing his seasonal xmas garb. The mockery… the nerve… my gearscore went from about 4850 to 70 in a whim in contrast to the many months/years spent in acquiring rare drops. Damn f*** gold farmer hackers. Damn Blizz for not being speedy with replies.

The sweet

The new year also brings good tidings. I’m excited about developing art work/interface graphics for the upcoming  Dink Smallwood port to the iPhone/iPod. I had lived and breathed Dink Smallwood (DS) during it’s year and a half development and look forward to revisiting Dink and working with Seth to make the gui as polished and intuitive as possible. Thanks to all you Dinkers for keeping DS alive and well. Looking forward to some fun duck stomping on my iPod.

Congratulations, you made it to 2010!

Happy new year to you and yours from all of us as RTsoft! (Fine, it’s just me and the family and I didn’t really ask them, but whatever)

Mind Wall blowing minds.. sort of

Christopher Hyde has listed his favorite free games of 2009 and our humble freebie Mind Wall clocks in at #47.

If you’ve got an iPhone/iTouch, I know you’ve already downloaded this way cooler version that has new modes and international rankings.

Latest project

I’m plugging away at the Dink Smallwood port, going to post another ‘developer diary’ soon about that.

First 1 star iTunes text review of Dungeon Scroll for iPhone

Yeah, what’s with that?  An iTunes user review chastised me for not releasing an update and fixing “all the bugs”.  Huh?!  What bugs?

I’ve had a lot of emails and the closest thing to a bug is people not understanding that it automatically saved your game if you quit, or not understanding some aspect of the rules.  (Ok, improving the in-game help text is a legitimate gripe)

If you know of any bugs in Dungeon Scroll for iPhone, please email me about ‘em because if there WAS something wrong, I most definitely would work fast to fix it.  I can’t help it if it’s my most stable V1.0 software release ever.  Hey, I’m as surprised as you.

Can Dink be “done right” on iPhone?

A few weeks ago I seriously looked into the possibility of putting our beloved RTsoft freeware RPG on the iPhone in style.

I basically came to the same conclusion as previous times, it’s just Not Worth It.  I might as well work on something new, I can’t use the GPL version with my gaming framework, etc.

I mean, have you SEEN the original Dink source?  It’s hippopotamus butt.  What was I thinking?   I decided not to do it.

But whatever.   I had some free time while I was waiting on another project and figured I’d give it a test-run to see if I could solve the “millions of 8 bit textures on a GL device with power of 2 limitations” issue without any art retouching.

Plus, there is something delicious about the challenge of refactoring 11 year old code.  I can’t believe I just said that, but there it is.

Step 1: Replacing DirectDraw

dink_screwup

Here is what happens when the background isn't blitted right.. Dink paint!

First I wrote a skimpy software replacement for DirectDraw and dummied out the audio and text stuff.

My DirectDraw software replacement had a bug... but it somehow made a cool sideways ANSI house pic!

My DirectDraw software replacement had a bug... but it somehow made a cool sideways ANSI house pic!

After it was working right,  I put it on  the iPhone and used glTexSubImage2D to put the final “fake” directdraw surface onto a GL texture every frame.

640X480 drawn to a 480X320 screen doesn't work that well.  Plus, slow as hell.

It doesn't fit the screen and it's slow as hell. But hey, it's running on an iPhone.

Got 4 FPS.  Not surprised.  Even updating a tiny GL texture piece seems to be horrible slow, I guess on the iPhone 3G it actually updates the whole surface or something.

Just for fun I tried a technique where you draw a ton of GL_POINTS with color information instead.  Slightly faster for the 640X480 I needed, but for smaller things it’s actually pretty zippy.  I need to remember that if I ever want to do a low-res iPhone game where I need direct screen manipulation.

Step 2: Mixing software and GL surfaces flexibly

So, here comes the next logical step – let’s stop doing everything in software and get with the GL already.  Fine.  But Dink is a memory hog.  Just for the background tile sheets it uses FORTY ONE 400X400 images.  In GL terms, that means 512X512X4X41 bytes, or 41 MB just for some background tiles.  (half that if we go with 16 bit surfaces)

Considering we haven’t even got to the real sprites yet we can see this isn’t going to fly on the iPhone.

Now, we could get funky and write a smart texture atlasing utility and such, but I think there is an easier way.  Plus, I like the idea of using the original media formats, could help with DMOD support later.

The solution?  We’ll keep our fake software DirectDraw around but enable it to create and maintain “shadow GL” textures of themselves when actually blitting to the screen.  We can give hints such as “don’t shadow GL any of the game tiles, just the final background that is built”.

The result? Even after re-enabling text and audio through my Win/iPhone framework I got 2400 FPS on Windows using OpenGL and >50 FPS on the iPhone using GL ES.  I’ve changed my mind, Dink is coming to iPhone!

Real-time scaling to 480X320 looks pretty good.  FPS not bad either!  Temporary GUI, this will improve.

Real-time scaling to 480X320 looks pretty good. FPS not bad either! Temporary GUI, this will improve.

Step 3: Get Justin on board

Justin Martin, the original Dink artist has agreed to partner up and handle spiffing up the GUI – We’d both love to see an eloquent mobile version of Dink available.

Step 4: The real work

But to do this right, I still need to add some very important features.

The challenging ones will be smooth and legal DMOD support on the iPhone and “save/restore anywhere” functionality.

I’ll also take this opportunity to fix/change a few things that have been bugging me about the original Dink, improve the audio, some balance issues, etc.

Special thanks to Dan Walma (redink) and the Dink Network for letting me use the V1.08 version as a base to start from – it includes some improvements and bugfixes over 1.07.  It’s still total ass though.  (Not their fault, .. mine)

Some more iPhone benchmarks and tests with everybody’s favorite difficult to pronounce 3d rendering framework!

Thumb mode and floating point:  Just don’t

iphone_irrlicht_md2_again

Ok, first, I was an idiot before and somehow was still compiling in thumb mode. I know not to do that!

Somehow the setting was removed but I guess the default is ON even with it missing or something.  After adding it by hand it the math-heavy md2 anim rendering test went from 31 fps to 60+ fps.

I think the mistake came from editing the build configuration by clicking on the project settings instead of the “build target” settings, so I’m going to check both from now on to be safe.

Irrlicht and Quake 3 style .bsp demo

Irrlicht's .bsp map demo on iPhone using pvrtc4 textures with collision

Irrlicht's .bsp map demo on iPhone using pvrtc4 textures with mipmaps and player collision enabled

I was expecting Irrlicht to do some kind of wicked optimizations when rendering a .bsp map.  Nope, it does nothing special.  You CAN load it into an octree but if OCTTREE_USE_HARDWARE is defined it renders the whole mesh anyway. (?!!?)   If that flag isn’t defined, it does render less primitives but without using VBO’s so it’s way slower anyway.

This forum thread may be of interest about that.

Collision detection would be a better candidate for a software octree but after playing with createOctTreeTriangleSelector with different settings I never saw even one fps of difference.  Strange, I would have expected it to noticeably help.

(this section was updated Dec 2nd after Tonic pointed out that you can use VBO’s with Octrees…)

Adding iPhone controls

As you can see in the screenshot above I’ve added a basic wolf3d control scheme to get around.

I use my own engine to handle the GUI overlay/handling (it draws after Irrlicht is done)  and just have it controlling Irrlicht’s FPSControlComponent.

I use camera->setTarget() to look up and down, and I fake UP/DOWN/LEFT/RIGHT key movement by sending pDevice->postEventFromUser() messages.  This works ok but bites because it’s not proportional or 360 degree so I’ll need to modify FPSControlComponent or just do my own movement stuff if I want to do it right.

Do using compressed textures help the FPS on the iPhone?

Short answer, a little.

I added CImageLoaderRTTEX to Irrlicht so it could load my own texture format.  It’s sort of a container that houses multiple formats including pvrct4, pvrct2, 4444 rgba, 565 rgb, etc.  It does extra stuff that normal .pvr’s don’t, like remember the original image size before padding or stretching.

I also modified the b3d and .bsp loader to look for textures with my .rttex file extension first.

Some rough numbers with the quake style .bsp map collision disabled:

  • Map test with raw 32 bit textures with mipmap chain: 26 fps
  • Map test with pvrtc4 format textures with mipmap chain: 28 fps

So yeah, tiny difference.

However, keep in mind there are also other good reasons to use pvrtc:

  • Fast loading even when zlib’ed.  Especially compared to decompressing a .jpg
  • Use a hell of a lot less texture memory

On the down side, the visual artifacts can look pretty bad so you still need some raw formats in your toolbox for specific images like GUI.

Do using mipmaps help speed on the iPhone?

I didn’t notice a difference.  Using mipmaps look better though, although I need to adjust the lod bias a bit so it doesn’t pop up so bad…

Tip: The iPhone requires a full mipmap chain to work, so don’t try to get tricky and only include a few of them.

irrlicht_broken_mipmaps

For your enjoyment here is what  happens when your texture processing utility has a bug in its mipmap generation.  (The festive blue, pink, and green colors shouldn’t be there…)

Putting it all together, our own level

I’ve got to say, the king of the 3dsmax exporters for Irrlicht is B3D Pipeline.

I know, you’re thinking “Uh… b3d, that Blitz3d format?  Why not use collada or .x or something?” All I can say is this is the exporter that actually worked right for me when trying to get the lightmaps working.

max_house_scene_render

So here is a low poly house in 3dsmax.  I’ve applied a light source and got it looking how I want.  Then I use max’s render to texture feature to make a single alpha lightmap.

The (old) iPhone has two texture units and this will be the second one, controlling where shadows appear, the same way the .bsp map example works.

After exporting it pops into the game engine fully lightmapped and ready to go with a single line of code.

iphone_irrlicht_shadowmapping

After adding a skybox and a simplified collision mesh it still gets nearly 60 fps, not bad.  Too bad a game needs more than one house.  Hmm, my fov looks a bit extreme.

So being between projects means I get to play around with random technology!

For some upcoming secret projects I’ve setup Flite TTS and Irrlicht as plugins in my iPhone engine to test out.

Flite

It’s a text to speech thingie that lets you make the iPhone talk.   It’s uh… well, I actually don’t really have a problem with it except I’m having a hard time controlling pitch and inflection.  Does anybody know of a better library?  Here’s a sample I made of Flite using the Kal 16kz voice. (Flite 1.3)

First, I’m sorry about the content of the audio.   Second, there is a problem where raising the pitch for the (loosely) female voice causes clipping.  Maybe I shouldn’t be using “Kal” for that.

Irrlicht

This is a solid 3D engine that has been around forever but truly became appetizing after it went with the zlib license.

My tests on the iPhone have been a bit underwhelming, check these screenshots to see the FPS.

A single md2 model.  Disabling frame interpolation gave 45 fps.

Sydney.md2 from irrlicht media. Disabling frame interpolation gave 45 fps.

Skinned dwarf from the irrlicht media.  Bout the same speed as the md2!

Skinned dwarf from the irrlicht media. Bout the same speed as the md2!

Slightly tweaked version of the Irrlicht geomipmapping terrain demo.

Slightly tweaked version of the Irrlicht geomipmapping terrain demo with coldet. REALLY slow to load.

Two skinned squirrels exported with the Panda (.x format) from 3dsmax.  Slow!  One gets about 30 fps.

Two skinned squirrels exported with the Panda (.x format) from 3dsmax. (Akiko made these for Teenage Lawnmower back in the day) Slow! One gets about 30 fps.

Conclusion

So.. yeah, slow.

Is anybody getting better speed than this?  Am I doing something wrong?

If I export say, a squirrel as a solid mesh (no animation) I get 60 fps, so I guess the real bottleneck is in the animation math, not the triangles/texturing.

I have to say though, I really like how Irrlicht is laid out – it’s a great way to steal <ahem, borrow> a ton of easy to plug-in functionality.  It can load nearly everything! (Except animated Collada..)

Random thoughts

I can think of some ways to speed this up, for instance, one way would be to write an irrlicht program that converts skinned mesh anims to a morph/frame based one, then optimize the renderer for the iPhone,  should be way faster than even the .md2 renderer.  (So, mem/filespace exchanged for rendering speed.. could even avoid frame interpolation if you output the anim with enough frames maybe)

On the 3GS you could probably do a skinned mesh shader and just fly, not sure.  But I don’t even have a 3GS yet!  Meh!

Could probably drop the geomipmapping for the terrain and just dynamically create the render list based on terrain sectors in the players view and do a fog thing to hide the edges and see a big performance improvement for iPhone.

I’m happy to announce a major feature was just added to Mind Wall for iPhone (iTunes) to satiate the appetite of the master Mind Wallers – Gauntlet DX!

It’s a special mode where the shapes grow and mutate as you play.

While Gauntlet mode is about lightning fast shape recognition of a limited set, Gauntlet DX mode requires an agile brain that can process totally new shapes on the fly.

What’s new in V1.2:

  • NEW FEATURE: Gauntlet DX Mode – Can you master a constantly evolving shape?  New audio and visual effects, includes its own world-rankings
  • Showing solutions is now configurable
  • Performance improvements on 3GS

Special thanks to the beta test team for giving it a nice work-out.

Page 1 of 612345»...Last »

Older Posts »