April 2008 - Posts

Looks like people is going mad lately, and if you don't think so, check this three examples and think again ;)

Voxelstein 3D

Our all-time classic FPS, having lots of excellent engine remakes, gets an interesting twist with voxel technology.

Although still an alpha, looks great (that is, if you don't expect Crysis-like graphics) and adds a new element to the game: destructible environments.

 

Alternativa3D

What about having a 3D engine made in flash? A impressive one, if you consider it is just software rendering (no 3D acceleration).


POVRay Short Code Contest #5

If you knew POVRay (a Raytracing renderer which uses an object-based scene definition language), what could you do in a 512 scene definition file?

Well, you can check the results (as Quicktime videos) and download the source files. Really impressive!!

 

One problem we've recently found is that the current version of the SDK has limited support for XML encodings other than UTF8. In fact, the encoding attribute in the XML files seems to be just ignored.

We are reading spanish encoded XMLs (ISO-8859-1), and we had some problems with accents and special characters. As not displaying them is clearly not an option, I digged in inside the SDK libraries until I found one function that solved the problem, StringUTF8ToLatin1().

Let's see how it works with a simple example.

This is a simple XML with spanish characters:

<?xml version="1.0" encoding="ISO-8859-1"?>
<messages>
<message>
<text>TEST ENCODING ñÑáéíóúÁÉÍÓÚ</text>
</message>
</messages>

 

We build the datasource as usual:

datasource TestEncoding() => TEXT, USER
  file
    testencoding.xml
  simple xml
    messages
      message {loop=content}
        text

 

And a sample pattern that loads the xml and displays each <message> element properly:

+ test_spanishencoding
  MESSAGES = ()
  try
    RESULTS <= TestEncoding()
      - StringUTF8ToLatin1(RESULTS.TEXT)
  catch ERROR
    - ERROR

 

Simple, but works perfectly :)

Posted by Kartones | with no comments
Filed under:

I've added a new link at the left to a list of the Firefox addons I've actually got installed. Every one has a small description of what it does (to save you extra clicks ;)

I'll keep it updated, and you can leave comments of what ones you would recommend to me too, I'll really appreciate it (I think is the best way to find cool addons).

Posted by Kartones | with no comments
Filed under:

It's been a while but I'm finally starting to "adapt" to living alone and buying all basic house stuff, so here are the photos from the Windows Live Training held at Zurich last month:

Posted by Kartones | with no comments
Filed under: ,

In my last WLA post I talked about normalizing xmls to be able to handle complex structures. We learned how splitting the fields in multiple xmls we could do simple querys and get the wanted data.

But what about after having this data? How can we cross it to obtain some manageable info?

The solution I use is very simple if you know the existence of the MakeHash() function.

This function accepts one or two parameters and (among other things), if you call it with the same list object in both parameters, it will cycle through all the list elements and remove repeated ones. For example, if we have a list called MYLIST with the values 1,1,2,3, MakeHash(MYLIST,MYLIST) will return a list with the values 1,2,3.

In this example, we have two simple functions that retrieve values using simple querys:

GetIDsFromTable1(1) returns 1,2,3

GetIDsFromTable2(1) returns 1,3,4

We can easily build a function that returns both results without repeating values:

function GetIDsFromTables(REGISTERID)
  RESULTS = ""
  IDS = GetIDsFromTable1(REGISTERID)
    for value ID in IDS
      insert last in RESULTS ID
  IDS = GetIDsFromTable2(REGISTERID)
    for value ID in IDS
      insert last in RESULTS ID
  RESULTS = MakeHash(RESULTS,RESULTS)
  return RESULTS

So, calling GetIDsFromTables(1) will return 1,2,3,4  :)

Posted by Kartones | with no comments
Filed under: