Asset Tracking

[QUOTE=lkruel;4096]Well, games are a tad different because we have a database that is actually running in game and knows what asset to spawn where, how much health they have, how fast they move, so on and so forth. Then I have the asset DB which the script populates, and the web frontend connects the 2.

We use perforce which works pretty well for us, I have a python interface to it which lets me talk to it from Maya. And it’s integrated to the game editor by default (Unreal). Technically you could have perforce be tied to the webfrontend by we use the web mainly as a readOnly interface, not editting.[/QUOTE]

Thanks Luiz for some tips we currently are still using SVN here so might have to look into just editing that been trying to get perforce here but SVN is free so its up to management pretty much.

Just wondering how long did it take to write your interface into perforce?

We use perforce at our studio as well, with the P4 python API it took about half a day and <300 lines of code to implement in Maya. Including fancy things like up-to-date checks when opening a file and such.

Thanks for the reply Nathan. Sounds like I need to push for perforce here after we get the smtp problems worked out. :D:

Yeah, we just use the p4 python api too, and we have a p4Utils file that wraps around it with functions we use the most, and handle stuff like logging in.

why an asp over python?

I couldn’t find a python webserver that I liked to be honest. If you know of any I’m more than willing to give it a shot. ASP gave me a simple designer interface and robust control objects, like gridviews and details list, for free ( that and we have a couple of ex-Microsoft guys in house that are really good at it that help me out from time to time).

Do you know of a good python web platform that I can take a look at?

Django is probably the most popular Python web framework. I haven’t used it personally but I’ve heard good things about it.

There’s a few more mentioned on the Python.org Web Frameworks page.

I tried Django out, I liked it a lot, but it wasn’t as quick to get results out as ASP was. It has some pretty awesome features if you’re doing a community site, or a blog, but ASP looked easier at the time. I might look at it again since I’m looking closely into flex for the UI, so I could have python be on the backend which would be schweeet

we’re using django right now for one of our internal sites. I havent noticed any slowness to it, at least on the db side. Im using apache for serving and lighttpd for the static stuff, images, JS, etc. Cant seem to slow it down :slight_smile:

I see what you mean though about the controls. However if you are going to use flex or use pure JS, there are several frameworks with awesome UI stuff, i really like ExtJS, but it doesnt play nice with mootools.

Its nice having the web framework in python as it can tie into just about every part of the pipeline natively.

Can you provide an example on how you’re using a website to tie into your pipeline?

I might move over just for consolidation issues, so I don’t have to write code over and over again in 2 different languages, but right now all I’m doing is writing to DBs with python and then reading from DBs with ASP. There isn’t too much I would need from python that I can’t get from ASP, and being able to attach visual studio to a site for debugging is nice.

Are you using mootools to add some fancy UI interaction? Have you tried Jquery out, I heard it’s pretty good.

I’m slowly convincing management that we need more webApps and hopefully I’ll be able to do some more fancy work. I really want to create a reporting system that generates PDFs and Emails on a weekly basis.

Thanks for the info!

On a side note I just made the crawling scripts work in distributed mode this week, really basic stuff, one script goes through the assets and determines what’s out of date and dumps the results into a db, and then multiple clients read from the DB and do the appropriate work. Seems to work pretty well and makes the crawling like 800% faster now =)

right now we haven’t got it hooked into too much our pipe yet. But we have some plans for some cool stuff in terms of viewing asset data and possibly tying into maya. There a bunch of things you can do with this. Im sure ASP isnt going to prevent you from doing this, but you could write libs once and use them on the web app too.

For example we have a permissions tool for internal stuff and we use this to handle django users/perms too. So someone else wrote that whole system for the pipeline, but i can use it for django too without missing a beat. And it allows people to set perms from one location.

Not too exciting, but it will be. With the html5 and the new stuff from safari/chrome and ff, you can pull of some slick stuff.

Im using mootools because its lightweight and really easy to use. I looked at jQuery but decided to give mootools a shot. Im not disappointed. The only thing mootools is missing is time. jquery has some good UI stuff but thats because its been around for a while longer. ExtJS’s UI i think is the best looking and flexible, thats what Shotgun is using.

Hey Maxx, I’m taking a closer look at Django and I was wondering how would you solve an issue that I have.

Right now we have 2 different existing dbs, one with game data that’s generated by the designers and one that’s auto filled by the asset crawling scripts. I would love to be able to leverage Django models to work with the data. But I’m not sure if you can specify a different db for a different model.

I read that you can do an unmanaged model in 1.0, which will help, but is there a way to customize an object to the SQL level like

character.id, character.name = “SELECT id, name from table”

Any help would be appreciated,

Luiz

i havent had to use multiple DBs yet, but ive heard of some way to do it. Push comes to shove, you can always get down to raw SQL. There is a thread about multpile DB support here.

Let me know if you have any luck with that, i’m interested to see what others in our field are doing with django.

I kinda got a shoehorned version of it working, by writing a custom Manager, it breaks some stuff, like the admin page and a lot of functions, but it works if you just call the functions specified.

I’m going to look at sqlAlchemy today because it seems to have some functionality that might make it more QuerySet like.

I’ll also take a look at the first link you sent and try something out with that. The trick is that whenever I read multiple db support it seems like they mean to have multiple db servers running with the same data, which is not my case.

That part of feeding in your connection into the QuerySet might be the best way to go.

The way I’m looking at it is, I’ll probably have to deal with 3 or 4 dbs, one of those being the django db, so if some objects are unmanaged and hacky but do what I need them to do, and then have some objects that are django like it should be good enough, at least better than what I currently have which is monolithic asp pages with gobs of SQL in them.

Thanks for the pointers!

I tried SQL Alchemy with turbo gears, but ditched it for django. Not that it was bad, but django had everything i needed so it was more of getting away from turbo gears.

I see what you’re saying about it breaking stuff. I’ll have to put more thought into how you would get that to work, i’ll probably be getting into that soon enough here :slight_smile:

Tried SQLAlchemy last night with the objects and it’s AWESOME. Highly recommend it. You can specify a db per app, and possibly per object. So I have an app setup for the design stuff and one for assets, and I’ll set up extra ones for django functionality like polls, announcements etc. I took a look at Pylons and Turbo Gears (which are mergin) but Django seems cleaner. All you need to do with the sqlAlchemy is make a custom manager per class that calls the sqlAlchemy query, pretty straight forward

You can set up SQLAlchemy to do different DBs per object. You just need to bind them to different engines.

SQLAlchemy is indeed awesome. I haven’t delved too deeply, but what I’ve done has been really useful and fun.

Do you know how to do proper foreignKeys in sqlAlchemy? I couldn’t get it to work with postgres, so I just made a method that gets the other object with the specified key, which might be faster since loading every foreign key down the chain in one shot.

What little I know of foreign keys in SQLAlchemy I learned on their site (here, here).

Thanks Adam,

Update:

Got the objects working with Django, I’m manually doing the foreign Key lookups because I want to control what information I bring online and when, otherwise we’ll sit forever trying to load up a mission, all the npcs, all their meshes, all their materials, all their textures, so on and so forth.

Got a first sample page up and running, looks much better than the ASP, also got ExtJS running, trying to wrap around JSON but for now I can manually create the tables I need.

Also found out about a project called Pinax which has a lot of Django Modules for social networking like websites. They have stuff like announcements, user to user messaging, forums, wiki, twitter clone all built in, so I might look into leveraging some of their apps in the django side of things. I’m specifically looking at the Comments and Announcements apps.