Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

3 Dimensional Chat / [LOCKED] Blender 2.49 as a Level Editor

Author
Message
entomophobiac
22
Years of Service
User Offline
Joined: 1st Nov 2002
Location: United States
Posted: 22nd Mar 2010 15:46
OK, so, I've been working on a game prototype for quite some time now and it has come a long really well.

There's a script system for loading assets, gameplay mechanics, physics -- a whole bunch of stuff. But there's a problem: it takes forever to pipe content into the game.

So I've started looking at Blender's Python API for writing such a simple thing as an export script that does all this for me.

In theory, the script will generate GameMonkey script for use in the game itself and save me from all the hassle of having to check positions, rotations, etc. It's also intelligent enough to instantiate objects when they're used multiple times and to call the DirectX exporter for me.

But my question is: has anyone else done this? From looking at it, it seems like one of those "too good to be true" concepts... It scares me.
Kira Vakaan
15
Years of Service
User Offline
Joined: 1st Dec 2008
Location: MI, United States
Posted: 23rd Mar 2010 16:05
Hm, I haven't heard of anyone doing this, but I don't think the Python scripting would be very difficult.

Is this for DBPro? Or another engine?
entomophobiac
22
Years of Service
User Offline
Joined: 1st Nov 2002
Location: United States
Posted: 23rd Mar 2010 17:49
The DGDK at the moment. Python has its quirks, but I've more or less completed a basic version of the script that suits my needs.

It just has to have a reality check.
Quik
16
Years of Service
User Offline
Joined: 3rd Jul 2008
Location: Equestria!
Posted: 24th Mar 2010 22:16
Quote: "but I don't think the Python scripting would be very difficult."


tbh, i think python seems very very easy although it seems kind of powerful


[Q]uik, Quiker than most
Kira Vakaan
15
Years of Service
User Offline
Joined: 1st Dec 2008
Location: MI, United States
Posted: 24th Mar 2010 22:29
@Quik:
Oh I completely agree. I think it's the easiest, best designed language I've worked with, but it in this case, you've also got to learn the inner workings of Blender through the Blender Python API.
entomophobiac
22
Years of Service
User Offline
Joined: 1st Nov 2002
Location: United States
Posted: 24th Mar 2010 22:42
I don't QUITE agree on the "best designed language" viewpoint, but to each his own!

For one thing, I found the "scoping by indentation" thing confusing, even if it enforces some measure of proper coding style.

It was definitely one of the languages that I could jump into the fastest. And Blender's API is quite well-documented.

I'm just hoping that it'll be the same for 2.5, in the end.
Kira Vakaan
15
Years of Service
User Offline
Joined: 1st Dec 2008
Location: MI, United States
Posted: 25th Mar 2010 02:42
Quote: "I'm just hoping that it'll be the same for 2.5, in the end"

Me too. It looks like they're filling out the bpy module quite a bit for 2.5. From what I've looked over, it seems that all of the data is the same, just accessed more efficiently, which is good, but I'm not exactly looking forward to updating all of my scripts.

How's the level exporter coming?
defiler
15
Years of Service
User Offline
Joined: 4th Apr 2009
Location: Canada
Posted: 25th Mar 2010 05:09
are you saying you can make a piece of code to speed up the test built times and possibly the actual build load times!!!


im goin to watch this to see if you figure it out.

Limitless Box studios current project: Lost Contact
entomophobiac
22
Years of Service
User Offline
Joined: 1st Nov 2002
Location: United States
Posted: 25th Mar 2010 09:04
Defiler: not sure what you're after, so I can't really answer that question.

It's going really well, anyway. I've started building the real assets in libraries and will hopefully be able to build a first few test maps by the end of next week to see HOW well.

Right now, the script makes lights in the game out of Blender's lamps, it grabs rigid body properties to make dynamic objects and it uses a few custom properties to determine which file to load, what type of objects you have in the scene, etc. My plan is to make this a little more intuitive -- right now, it's something of a pain.

Also, it grabs the name of all objects and exports them as script names, so that it's possible to (for example) delete specific objects or lights, by name.

Puh.

And it's all just some 100 lines of Python! That's the beautiful bit.
entomophobiac
22
Years of Service
User Offline
Joined: 1st Nov 2002
Location: United States
Posted: 6th Apr 2010 15:40 Edited at: 6th Apr 2010 15:42
In-game shot of current version, still in progress, attached.

Steps to the process:

1. Model, UV and texture a segment in Blender.
2. Export the model in X-format, with textures and maps having identical names to the main file.
3. Use the object in blender, with a couple of Properties set in the game logic panel.
4. Build a level.
5. Run the export script to get a fully engine-compatible version of the level, exporting lights as well as static objects and dynamic objects present in the scene.

Next step:

Allow a simple measure of scripting in Blender, meaning triggers and some very basic game logic (Spawn, unspawn, etc.).

Attachments

Login to view attachments
Kira Vakaan
15
Years of Service
User Offline
Joined: 1st Dec 2008
Location: MI, United States
Posted: 26th Apr 2010 00:00
Hey,

How's this project coming along?

Neco
16
Years of Service
User Offline
Joined: 13th Jul 2008
Location: Waterloo, Wisconsin USA
Posted: 26th Apr 2010 01:24 Edited at: 26th Apr 2010 01:26
I just wanted to comment, on Python. It is a great language for sure and definitely one of the most easiest languages I found to get into. It has a vast amount of books, Internet resources with code, tutorials, etc.. All kinds of neat modules as well.

The only thing I dislike is that it does not have a very easy to understand distribution model, for finished programs.. Sometimes it can be a nightmare to package something, and make sure you have all the proper dependencies either listed, or included, etc..

py2exe can make things a lot easier, especially with wxForms/ wxPython (native look & feel GUI forms, for your target platform) but it still leaves a lot to be desired.

As a game scripting tool, though python has very good potential and many good uses.. From my understanding what you pretty much do with Blender is do your game maps, objects, etc.. But then Python is powerful and diverse enough, that you can write the whole of the game logic itself in just Python.. (blender handles the rendering with its C++ based engine of course).

I really wish we could get a Python binding/plugin for DBPro. That would be awesome.. Lua is too cryptic for me, and Ruby is ostensibly slower and almost "So easy its hard to figure out" that I just couldn't use it if we ever had the option in the future... At least for me that's how Ruby is..

Python would be a great asset for many DarkBASIC programmers, IMHO.

Although I suppose.. with something like DarkDGK, using VisualC++, couldn't you then get access to Python, and subsequent modules (SQlite for example) as well, by embedding it into your application?

That might be a neat idea for me to explore...

entomophobiac
22
Years of Service
User Offline
Joined: 1st Nov 2002
Location: United States
Posted: 26th Apr 2010 13:52
I've done all the functionality I needed, more or less. Working on some parenting links and other stuff right now that is already supported in the game, but not in the exporter just yet.

I'm moving over to another DX wrapper, however, as the GDK is simply too crappy for my tastes. So I'll likely spend the majority of my time learning the ropes in the new system and recreating the current functionality that I have in that system.
Van B
Moderator
22
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 26th Apr 2010 18:08
Why not find a Python forum if you want to discuss it. Locked.


Health, Ammo, and bacon and eggs!

Login to post a reply

Server time is: 2024-11-24 14:51:51
Your offset time is: 2024-11-24 14:51:51