Script objects and paths

Published January 04, 2007
Advertisement
One thing I always thought was neat in the Nebula Device SDK is that you can access any engine object or system from a unix-style path. For example, to get at objects within the graphics subsystem, a simple "/gfx/driver/blah" or "/gfx/texture/blah", etc is fed into the system. When looking at scriptable objects within a system (such as GameDB), I often wonder if a pathed system like this would be useful. To some extent, it reminds me of XPath for XML - especially when you start to consider that GameDB objects can be tagged in many ways.

Accessing a single object with a global id would be a case of referring to "//id=[5]". If you wanted to search for objects with a certain field (eg: name = 'Bob'), you'd go "//name=['Bob']". How about objects not named Bob, would the syntax be formed as "//name!=['Bob']"?. How about for objects of position greater than 100 on the Y axis - "//position/Y>[100]"? Or between Y 100 and Y 500 - "//position/Y>=[100]&&<=[500]"?

This works fine for simple queries, but what if you then needed to combine two queries to look for objects with position Y >= 100 and X >= 50? I wonder how such syntax would work? Perhaps "//position/[ Y>=[100] && X>=[50] ]".

The idea seems to be well suited for a single "attribute is this" query, but gets fugly when more conditional or complex logic is used.

I'm thinking that maybe a sql-like language would be better.
Previous Entry gmBind2
0 likes 1 comments

Comments

Saruman
<3 Nebula
January 04, 2007 08:15 PM
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Advertisement