Quick Gr1d F# Tips

Just made the following quick post on the Gr1d Forum of using F#with the game, in particular setting the CLSCompliant attribute and signing/strong-naming the assembly


Just a quick tip for anyone else thinking of using F# with Gr1d.

It’s not obvious where to stick the CLSCompliant Attribute and Google wasn’t a great help.  I eventually found this post which shows that you need to explicitly create and ‘assmeblyInfo.fs’ file and add the attribute there. Also, signing/strong-naming isn’t built into the properties window of the project like it is in C#.  As described in this post, you need to add a command to the ‘Other Flags’ textbox on the ‘Build’ Properties window pointing to your keyfile (which you can create from the C# properties window and just reuse with a full path), e.g.

--keyfile:"C:DevGr1dlibkey.snk"

Other than that, I’ve found the F# Survival Guide to be an excellent resource. I’m still learning the language myself, so please feel free to reply with any more tips 😀

    Taking over the Gr1d

    Ok, so it seems that I have a short attention span and am easily distracted by the next ‘shiny thing’.  The current ‘shiny thing’ with my attention is Gr1d – an RPG for Programmers.  I’m really, really enjoying it.

    The concept is that you code some Agents based on a chosen predefined class and these Agents run around the Gr1d claiming nodes.  The more nodes you claim, the more experience you earn and you level up allowing you to use more class skills and deploy more Agent bots at the same time.  You will encounter other Agents on your travels which you can either attack or flee from, depending on how you’ve coded them.

    So far I’m a lowly Agent with extremely simple logic, basically crawling around the Gr1d collecting nodes and fleeing as fast as possible from any danger – it’s great fun!

    The software is still a little buggy with the Ticks (a timer concept) regularly getting stuck and some people’s poor code bringing the system down, but with each revision the creator ‘root’ improves all of these things.

    I’m also hoping to use this little game to learn F#.  So far I have coded my really stupid Agents in F# but have hit a hurdle in that the servers do not have F# installed, yet.  We shall see what happens when I pit my C# and F# Agents against each other 🙂

    Give Gr1d a go, it’s great fun and an awesome tool for learning programming or .Net if you’re new to these concepts – there’s nothing quite like a game for making learning fun!

    WebGL

    Just discovered WebGL today by accident and I think I’ve found my next project!

    I studied OpenGL at University, but since then I’ve forgotten all of my C++ knowledge and have not touched it since.  Now, WebGL has rekindled that passion and I’m even willing to get over my irrational dislike of Javascript in order to do some graphical coding in the browser – yay!

    To begin with, I shall be taking a look at Giles Thomas’ Learning WebGL blog and going through the tutorials.  I’m not sure I’ll be able to post any working examples here on WordPress, but maybe some code snippets.  If there’s any other resources I should look into then please comment below.