Tuesday, April 2, 2013

Bee Hives!


Hex-Maps, my dreaded enemy!

Just finished working on a hex-map engine for a potential project. So far it can display a tile-based hex-map, allow it to scroll and let mouse select do its magic.

Greatest help ever came from this particular tutorial, which is not only useful for determining the particular tile a mouse is selecting, but also to know which tiles to draw in the window (so you don't draw the whole thing every time, even though a minimum amount of tiles are visible.)


The grid is alive!

That's a small look at it so far, in all its programmer-graphics glory. That green tile with the white boundary is the currently selected tile (by mouse). That test map is 50 by 50 tiles, but only those on (or near) the screen get called to be drawn, and the map can scroll across the screen seamlessly.

Word of Advice:

Always, always, always verify that whatever it is you believe to be a hexagon actually is one. The shapes that Power Point or Paint produce by default (as in: keeping the aspect ration given by default) are not real hexagons: real hexagons have sides which are all the same side, whereas those had different lengths per side.

Trust me, lost quite a bit of time on that one.

Next up: trying to set up so the tiles themselves animate, and maybe some unit work.

Monday, March 11, 2013

On learning XNA

Books, tutorials, oh my!

Last few days since posting I've been looking around for books and tutorials to get started on XNA development. My eventual goal being to create an XNA game that would be (in theory) easy to port to non-Windows platforms using MonoGame (Though it does require a bit of playing around.) At least targeting Linux and OSX is desired, maybe depending on the final game would I consider iOS and Android. (Though Android's not been my favorite thing so far and I have little to no idea on the state of iOS development.)

I've found some nice resources:

  • Learning XNA 4.0
    • This book is so far amazingly written and has nice examples. What I love about it is that you go on building on top of the same code chapter after chapter. I'm still not done with it (one third through so far) but this seems to be a perfect starting point for anyone with programming understanding that wants to dive into XNA.
  • XNA Resources:
    • There's some amazing tutorials here. I did them long ago during a brief period of interest in XNA development and they're great about building something up and taking you along with it.

And not quite XNA related:
  • Coordinates in Hexagon-Based Tile Maps
    • If you're ever getting into Hex-Maps (Think Civilization V and other awesome Turn-Based games), you'll need to know the math behind them. Great language-independent post explaining all you ever wanted to know about coordinates in hex-maps. May come in handy one day.
I'm hoping I'll get started on building some minimum-prototypes soon, and then I guess I'll post a bit more about getting those done.

Thursday, February 28, 2013

Visual Studio Template woes

Headaches abound...

This one took two days of my life.

The current MonoGame version (3.0) includes a Windows installer which adds the necessary templates to either Visual Studio 2010 or 2012, whichever you have installed.

In theory, after your installation, you should find a couple of new templates which let you quickly start your MonoGame project. When it works, it should create a project which is almost identical to a normal XNA 4.0 project.

The problem was that after an insane amount of (re)installs of MonoGame, including older versions (2.5), I was still unable to see the new templates. This led me around to try to use MonoDevelop for Windows, to which I admit my surrender to since I couldn't get that thing working right for MonoGame.

Some deep searching later, I came across a post which mentioned a very particular Visual Studio Bug. It looks for your "My Documents" folder in a certain, particular way.
If at any time you changed your "My Documents" path, like if you renamed your current user, from the original:


Example: C:\Users\<your_user>\Documents\Visual Studio 2010\Templates

It would be unable to locate any custom templates that installed to your new, real "My Documents" folder.

Which is exactly what the MonoGame installer uses.

So for 2 days I was completely unable to understand why this thing refused to work in any way that made sense, and instead it turns out it was VS2010 all along.

Fun times ahead.

(In the end I "fixed" it by making my development using VS2010 in admin mode, which forced it to use the admin "My Documents" and which was not ever renamed. It's not an elegant solution, but for now it gets the job done. Either way, I'm thinking I'm getting my MonoGame dev time on a Linux platform with MonoDevelop instead of in Windows.)

In MonoAural

Long time no see...


Been a while since I attempted to write in here. Things got in the way and in the end I didn't end up setting up that Unity project.

So why am I back? Plenty of reasons: I have one project in my mind and I want to put it out there, at least in playable state, so that I (and other) can judge it on its merits. I also want to get better at programming, and this will at least make me try.

Is Unity back in the spotlight? Not for this one. In this one I want to attempt to use MonoGame, which is an open source project which attempts to implement the XNA spec for a wide variety of platforms. This is nice because Microsoft is going to drop XNA after version 4.0 in Windows 8, where it will mostly be used in conjunction with Visual Studio 2012 to create Market Apps, which is not what I want to do.

So, with MonoGame you take your XNA game and almost perfectly translate it to other platforms without many (in theory) hassles. This lets me use the entire XNA learning resources (books and online) to develop for Windows and more.

I did, however, highlight the previous "in theory" for a reason. I've had a couple of problems so far.

Thursday, April 12, 2012

Introductions

Who am I?

Who are **YOU**!?

*Ahem* OK, OK. Let's see and get this rolling...
This is intended as a journal of a coding journey. In it it will (supposedly) contain my experiences, adventures, misfortunes and other things while trying to get a small game done.

First things first: It will be a small game done in conjunction with (at least) other 3 people. I'm the main coding guy, though there is another who can back me up. This is the first time we actually get together to get shit done, but we've known each other for a while.

We're not professionals, we have little experience... but we make up for it in passion.

Passion and lots of swearing.

This is going to be mainly my recount, not necessarily including my companions. So don't expect to see much in the way of art/sound getting done.

The objective

The Square-Enix Latinamerican Game Contest 2012
This is mainly the reason I was called out of my slumber to code.
It's also as good an incentive as any to get stuff done, have fun, and maybe win some cash on the side.
Who knows? Maybe more than that.

What's next?

Well, first things first: 
  • Deciding what game we're making (Or at least have a vague idea.)
  • Decide which technologies we're going to use
We're already brainstorming some stuff for the first point, and I'm already looking at tech for the second.
Chances are it'll be either Java Applet (have enough Java experience) or Unity3D (have no experience, and a free license) because it'll most certainly be a web browser game (Contest Restrictions.)

I guess next post will be my experiences with Unity and possible good/bad points against a Java Applet.

Only thing left is to go forward.

"Irimi-nage: Entering throw. Face your Uke as you would your Death."