2012/10/06

example video: Level Design and Text parsing in Unity3D

I made another example video for Grid Framework, this time for the recently introduced text parsing example. Now building new levels is as easy as writing a few lines of plain text and you get perfect clockwork-like precision. This opens up new possibilities for faster development, easier maintenance, easier level editors and support for user-made content. Just take a look at how simle, yet effective it is:


2012/10/05

Version 1.1.7 released

Version 1.1.7 has been approved by the Asset Store team. I fixed a small typo that prevented the menu item for adding the GFGridRenderCamera component from working and I added two more examples,  video tutorials will follow soon. I also redid the screenshots because the Asset Store ate my old ones somehow.
The first example shows you how you can use a plain text file and Grid Framework to build levels outside the editor. If you have a game like breakout that's heavily based around grid-based design it would be tedious to design each level via Drag&Drop in the editor. Another disadvantage is that changing the level would mean switching the scene and it would be harder for players to create their own levels as mods. In my example we design the level as a plain text file where each character corresponds to one predefined prefab. Then we need to set up only one scene and the text parser script will, along with the grid, take the text file, read it and then place blocks accordingly. You can even switch levels on the fly without changing the scene.
The second example continues the grid-based movement example by placing obstacles on the grid. One way to avoid them would be to attach colliders to the obstacles and then have the walker perform a line cast in the direction of its movement and see if the line cast hits anything. However, since this is Grid Framework we can do better than that. In this example I create a matrix that stores whether a tile is forbidden or not and then the walker checks if its next target square is alowed or not. There are no colliders or physics used.

2012/10/02

Cannot log into my account

I've written two new examples, one that takes a plain text file and parses it to create a breakout-style level based on a grid without changing the scene, the other is a continuation of my grid-based movement exmple where I can place obstacles on the grid and the sphere will not step on those squares (without using any physics like collision and raycasts). Sadly I can't update Grid Framework because I can't log into my account via Package Manager. My account still works, I can log into the forums and my Publisher Administration, so the problem must lie within the editor. I've submitted a bug report, but until then I cannot publish updates. If you are interested in one of those two examples please contact me over the Unity forums and I'll send you the examples, provided that you already own Grid Framework. On a related note, it appears that Grid Framework's product page in the Asset Store doesn't have any screenshots. I did submit screenshots, but they don't appear for me, I don't know if other people can't see them either.

2012/09/22

Version 1.1.6 submitted

Important Note: The classes Grid and RectGrid have been renamed to GFGrid and GFRectGrid, you will need to change your source code accordingly.

You might be wondering why I would do such a thing more than one month after releasing the package. Using regular English words is simple and intuitive; however, the danger of name collision with another class called the same is quite large. Let's say a user has already a class called Grid for something in his or her project. When they buy Grid Frmework all of the sudden they will get compilation errors because now there are two classes called Grid. It would be unreasonable to expect users to change their class, especially if that class is already part of a more complex chain of dependencies or inheritance. They could change my code, but then they would have to change it after each single update of Grid Framework. If the class Grid is already defined in some other third party extension it gets even worse.

Adding the GF in front of both classes reduces the chance of name collision. I apologize to all my existing customers for having to change their source code because I didn't think about this in time, but I had to resolve this before it becomes an issue and the sooner I get it sorted out the less customers will have to change their source code. I am very sorry, but this should fix the problem once and for all.


Aside from that the GFRectGrid class contains some minor code cleanup and performance boosts, so it's not all bad news.

2012/09/06

Version 1.1.5 released

As per request the custom rendering range now affects drawing as well, not just rendering. If you are wondering why this wasn't the case before, it was a leftover from before the custom rendering range got implemented. Originally the custom range was only meant for rendering because that would be what the layer sees in the final game, not the drawing, whether they are the same or not. Also, the drawing is only a drawing, the grid keeps working beyond what's visible, being infinite. That's why the drawing had low priority and I worked on other parts instead.

2012/09/05

Version 1.1.4 released

Version 1.1.4 has been approved. It doesn't add anything new for a change, instead it fixes a bug where lines with a width larger than 1 were drawn on top of things they were supposed to be under.

2012/09/02

Hex grid progress so far

Here's a quick status update:

  • Drawing: This works perfectly now, the hexes are drawn properly as described in the post before, and now i have added lines that connect the different layers of the grid.
  • Rendering: Like drawing alsmost finished, except one minor issue. In the rectangular grids you can specify a width for the rendered line and, since the line is drawn in 2D, I had to calculate the directions in which to expand the lines. There were only three possible directions and the lines were sorted by X, Y and Z, so it was enough to calculate each of the three directions only once. With hex grids one set of lines is zig-zagged, so I need to calculate four directions total. I need to find a nice way to separate the the two differently slanted lines. I don't want to calculate the direction for every line as that would be a waste of ressources.
  • Find nearest face & Get face coordinates: done, although only for the default coordinate system.
  • Find nearest box & Get box coordinates: done, just like above


This leaves the following functions:

  • Find nearest vertex & Get vertex coordinates: The challenge here lies in finding a nice coordinate system, and by nice I mean one that's intuitive to understand, easy to implement and easy to maintain
  • Build vertex matrix & read vertex matrix: Getting the vertices is already done, the challenge again lies in finding a good coordinate system.
  • Align & Scale transform: shouldn't pose any problems
  • World to Grid & Grid to World: you guessed it, deciding on a coodinate system
  • Get Vectrosity Points: This will take the same points as used by rendering and drawing, but the array has to be processed first to fit Vectrosity's requirements


So, all in all it looks pretty good. Unfortunately progress has been dragged down by my studies, I'm writing exams soon, so I can't afford to work on Grid Framework full time. The plan is to finish all the needed functionalityl for the first release. After that additional coordinate systems will be added and after that I'll add more drawing shapes like triangular and circular hex grids. That will conclude the hex grid chapter of Grid Framework.