Jump to content
  • Advertisement
  • entries
    437
  • comments
    1000
  • views
    336851

Script objects and paths

Sign in to follow this  
evolutional

125 views

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.
Sign in to follow this  


1 Comment


Recommended Comments

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!