Menu

LEX File Exchange EA Support Files
SC4 Wikipedia Network Addon Mod
Dependencies Chat

Author Topic: Using Blender (open source modeling program) for content creation.  (Read 17839 times)

0 Members and 1 Guest are viewing this topic.

Offline eggman121

  • NAM Team
  • Forums Parliamentarian
  • *
  • Posts: 1578
  • Reputation: 27
  • CL:
    Mr. Smth
Hello everyone.

I am looking at ways to preserve the artistic talent of users and I believe that using free and open source programs such as Blender and other helper tools like FreeCAD (An open source CAD program) will help preserve the content creation capabilities for many years to come.

This is a general discussion and any valid input is welcome  :)

So my first question to anyone who knows, Is there a way too morph of extrude a texture onto a plain in Blender?

I have successfully been able to make some curves in FreeCAD and export them via dae collada and export them into blender.

But I have no clue of how to apply textures for starters and morph the textures along the curve.



So This is just the tip of the iceberg. If we could find a way too make a rollout for rendering textures from Blender onto a BAT than we could avoid the ever changing dynamic of 3ds max. This also means that users using different OS like Linux and Mac OS can make content to varying degrees as well.



So. This is an open discussion. Valid points and views are welcome.

-eggman121

Offline matias93

  • Forums Governor
  • *
  • Posts: 302
  • Reputation: 0
Re: Using Blender (open source modeling program) for content creation.
« Reply #1 on: December 29, 2016, 08:11:58 PM »
Well, I have no experience on 3D modelling outside of Sketchup, which is also proprietary software (and where extruding is very easy), but I guess that if we want to know more about blender, we should recur to the Cities Skilines modding community, where that application is more widely used.

"Lets be scientists and as such, remember always that the purpose of politics is not freedom, nor authority, nor is any principle of abstract character,
but it is to meet the social needs of man and the development of the society"

— Valentín Letelier, 1895

Offline tigerbuilder

  • Forums Citizen
  • *
  • Posts: 49
  • Reputation: 0
Re: Using Blender (open source modeling program) for content creation.
« Reply #2 on: January 21, 2017, 12:10:54 PM »
I'm using blender to make low poly models for automata. It's a powerful program. I can use it because all I need is the S3D table data which I import using the reader to bring my model to the SC4 world. The texture UV data is transferred also during this import. I map it in Blender very easily. Research (YouTube) "Blender UV unwrapping". It's not so hard when you get it.

Of course we could model in Blender, but I'm afraid BAT and BAT4MAX is all we get to actually get our models into the game. Sure, if someone was to make a plugin that could do it, but that's unlikely. Surely Blender can make the 20 shots needed, but it won't be in SC4 format like BAT does. Converting those into a model file? That is something above my pay grade.

I find that using gmax/3dsmax is just easier to get to where you're going making something.

Offline mgb204

  • NAM Team
  • Forums Guru
  • *
  • Posts: 2314
  • Reputation: 23
  • CL:
    Solved!!
Re: Using Blender (open source modeling program) for content creation.
« Reply #3 on: January 21, 2017, 06:53:05 PM »
I did briefly look at using Blender once. To be totally frank, I hated the interface and just found it totally alien. But that's more a reflection of having learned to use gMax. Rather than learn it all again, it made far more sense for me to move up to 3DS Max for my batting. Of course, that's not really helpful, I'm sure others will feel quite differently too...

The real problem with 3DS max is that everyone has gone along with Autodesk's will, being forced into a SaaS type of arrangement. Mostly because everyone uses a student licence, which always has an expiry date on it. As that software moves towards the cloud, along with other changes, compatibility with BAT4MAX is becoming a serious problem. So much so, I don't think you can use BAT4MAX with the current releases at all. Having no-one with the abilities of SimFox means it's been left without updates since his departure.

Whilst it would be nice to see someone update the scripts to work with newer editions of 3DS Max, that's a stop-gap solution at best. It's clear from the progression of that software that the problem will only come up again later on.

So what we need is an absolutely stable platform, in the sense that we can continue using an older edition for the purposes of compatibility. As such, Blender is probably the best candidate for this, being open source we're free to even fork the code especially for the SC4 community if so desired.

What we really need more than anything else is a plugin/script that can render an object created in Blender into the 20 views used by SC4 Models. There shouldn't be any technical barrier to doing this, it simply requires someone with the knowledge to do it and the will to make it happen.

It's probably useful to explain how BAT4MAX works a little. Whilst all the bells and whistles of the script are handy, they aren't really essential. Everything except the initial rendering process can be handled by SC4BAT/gMax, much like it is now.

  • LODs can be exported from Blender in 3DS format, allowing import into gMax to create the SC4Model file.
  • Although less convenient, LODs can be manually created in Blender.
  • Assuming we can render the necessary images (as BMPs), converting them to FSH and compilling them into SC4Models can be done the same way it is now. FSHWrite and DatCMD, both of which can be ran from a command prompt as part of a BAT script, could be adapted easily for use with Blender. Again, it might not be as intuitive, but it's very possible.

The real issue is finding someone with knowledge of the inner workings of Blender. Someone who could write a script/plugin that would enable the application to render the images in the format required. Ideally that would include some default lighting rigs and scenes, suitable for making bats. It was suggested (over on ST I think), that we could maybe look for a third party who would be able to handle this on our behalf. That may mean paying someone outside of the community as a one off commission. Assuming no one with the knowledge is around to handle it for us. But, I think it would be possible to hire a non-professional, for what is a reasonably small amount of work, without it costing huge sums of money. That may mean crowd sourcing the cost of this one-time service to achieve, but I think that's possibly the best solution here. Since having done this once, we'd have a stable and free platform for BATs for the future of SC4.

Offline matias93

  • Forums Governor
  • *
  • Posts: 302
  • Reputation: 0
Re: Using Blender (open source modeling program) for content creation.
« Reply #4 on: January 21, 2017, 08:20:46 PM »
You made that sound even easy!


In any case, it seems that Blender is fairly transparent on its scripting, and uses --what else-- Python to automate things.


As I said previously, I guess someone on the C:S community, where Blender is more widely used, could be of help to learn what is needed to automate on the modeling side, and the exporting side would be the only part requiring full, novel work.


Considering also the abundance of scripts for Blender, and its general open source nature, it wouldn't be strange to find something useful to fork, or someone available to give a hand (or even to take charge of the project). And, as you said, this would only require to be done once, so is a no-strings-attached situation for any developer that could help.

"Lets be scientists and as such, remember always that the purpose of politics is not freedom, nor authority, nor is any principle of abstract character,
but it is to meet the social needs of man and the development of the society"

— Valentín Letelier, 1895

Offline Handyman

  • Forums Citizen
  • *
  • Posts: 44
  • Reputation: 1
  • We are all astronauts living on the same spaceship
Re: Using Blender (open source modeling program) for content creation.
« Reply #5 on: January 28, 2017, 10:26:11 AM »
Considering also the abundance of scripts for Blender, and its general open source nature, it wouldn't be strange to find something useful to fork,

I installed Blender and spent some time poking around, I know nothing about using it, but I noticed there is a very long list of import / export scripts. are none of those, or a combination, useful?

Offline mgb204

  • NAM Team
  • Forums Guru
  • *
  • Posts: 2314
  • Reputation: 23
  • CL:
    Solved!!
Re: Using Blender (open source modeling program) for content creation.
« Reply #6 on: January 28, 2017, 01:00:18 PM »
I installed Blender and spent some time poking around, I know nothing about using it, but I noticed there is a very long list of import / export scripts. are none of those, or a combination, useful?

I wouldn't have thought so, simply because modelling in SC4 is unique (compared to modern 3D games). We actually apply 2D models to a 3D LOD, but each Rotation/Zoom combination has it's own static texture. With the exception of certain 3D objects, most items can only display correctly based on the isometric viewpoint of SC4. Even if scripts exist for other 2.5D isometric games, it's doubtful they will conform to the standards used in SC4. I'll try to do some digging, but alas I fear such a task is beyond me. I poked around the 3DS Max scripts and I just don't know enough about the modelling side of things to make any progress on them, even if the logic is mostly understandable.

However, a brief search on Google does show that similar things have been attempted, more here. So there may be third party plugins we can make use of.

What I'm not sure of is whether all Isometric games require the same formatting. But maybe there is something to start looking into. I'll try to see if I can make something out of this.

Offline Handyman

  • Forums Citizen
  • *
  • Posts: 44
  • Reputation: 1
  • We are all astronauts living on the same spaceship
Re: Using Blender (open source modeling program) for content creation.
« Reply #7 on: January 28, 2017, 06:45:48 PM »
I checked out your links, and while I don't understand all the processes, it seems there are similar concepts at play. Hopefully we can find some helpful information.

Offline mgb204

  • NAM Team
  • Forums Guru
  • *
  • Posts: 2314
  • Reputation: 23
  • CL:
    Solved!!
Re: Using Blender (open source modeling program) for content creation.
« Reply #8 on: January 28, 2017, 08:08:40 PM »
I dug in a bit further and as previously mentioned, I don't see any technical barrier to making Blender do what we want.

That said, I got the impression that the linked information (and everything else I came across) was aimed at sprite-based modelling. Where you model each individual 2D tile, which isn't what we're after at all.

The key barriers here are working out the following:

  • Where to place the "cameras" so that the render appears correctly.
  • The specific angle of that camera in relation to SC4s isometric view.
  • There will no doubt be a need to set up the lighting too. I should state, at least in the first instance, it's unlikely we'd have DarkNite renders with this method. Of course that's just a specialised lighting rig for 3DS Max. But the renders from Blender will not necessarily be identical to what we have now.

Once we know this information, it should be possible to render the images we need I think. But bear in mind, that's 20 camera angles that need switching between for a complete render. If we can get a successful render, then we can look at scripts to automate the process and automatically setup the scene for end users.

And here once again we hit a bit of a roadblock, because I've not got the slightest clue what any of those settings might be. I'll dig around through 3DS Max and see if the BAT4Max scripts shed any light on this. Likewise, somewhere in the forum archives, SimFox (or ALN / ChrisAdams) may have documented these settings. It could also be somewhere in the SC4BAT scripts too. But these will need to precise, it's not going to work well to just use trial and error here.

Offline Handyman

  • Forums Citizen
  • *
  • Posts: 44
  • Reputation: 1
  • We are all astronauts living on the same spaceship
Re: Using Blender (open source modeling program) for content creation.
« Reply #9 on: January 29, 2017, 07:56:19 AM »
I dug in a bit further and as previously mentioned, I don't see any technical barrier to making Blender do what we want.

That said, I got the impression that the linked information (and everything else I came across) was aimed at sprite-based modelling. Where you model each individual 2D tile, which isn't what we're after at all.

The key barriers here are working out the following:

  • Where to place the "cameras" so that the render appears correctly.
  • The specific angle of that camera in relation to SC4s isometric view.
  • There will no doubt be a need to set up the lighting too. I should state, at least in the first instance, it's unlikely we'd have DarkNite renders with this method. Of course that's just a specialised lighting rig for 3DS Max. But the renders from Blender will not necessarily be identical to what we have now.

Once we know this information, it should be possible to render the images we need I think. But bear in mind, that's 20 camera angles that need switching between for a complete render. If we can get a successful render, then we can look at scripts to automate the process and automatically setup the scene for end users.

And here once again we hit a bit of a roadblock, because I've not got the slightest clue what any of those settings might be. I'll dig around through 3DS Max and see if the BAT4Max scripts shed any light on this. Likewise, somewhere in the forum archives, SimFox (or ALN / ChrisAdams) may have documented these settings. It could also be somewhere in the SC4BAT scripts too. But these will need to precise, it's not going to work well to just use trial and error here.

This looks like a positive step mgb204. You know a lot more about this stuff than I do, so I am encouraged by your response.

When I was scanning through a tutorial, I remember seeing a section that described working with single tiles or a group of tiles. ( don't know if this is what you are referring to above ).
I also spent some time with the program and tried to familiarize myself with some of the tools (so many tools &mmm). I was able to add and move cameras, add and move lighting, I was able to import a S3D file and manipulate it. Don't know if any of this helps, just kinda spit balling.
I'd be happy to peruse some of the scripts if you like, just point me in the right direction.

Offline APSMS

  • San Diegan
  • -Local Moderator (Active)-
  • Forums Parliamentarian
  • *
  • Posts: 1044
  • Reputation: 5
  • "Omnia dicta fortiora si dicta Latina"
Re: Using Blender (open source modeling program) for content creation.
« Reply #10 on: January 29, 2017, 01:48:22 PM »
Just for clarity, I was under the impression that SC4 uses a trimetric projection. Previous 3d SimCity titles used isometric perspectives.

This is what causes the foreshortening and weird perspective angles when trying to properly model standard shapes in all perspectives.
Experience is something you don't get until just after you need it.

My Mayor Diary San Diego: A Reinterpretation

Offline vortext

  • Administrator
  • Forums Guru
  • *
  • Posts: 3361
  • Reputation: 23
  • CL:
    Street Smarts
Re: Using Blender (open source modeling program) for content creation.
« Reply #11 on: January 29, 2017, 02:03:44 PM »
hm, iirc simcity actually uses it's own unique axonometric projection, which is not proper isometric nor trimetric. Like, there're slight differences in projection for each zoom level, and some weirdness in the height scale.

That said, I've been following this discussion with great interest as some time ago I came across a set of modular medieval buildings for blender. Thus far I've only imported them into Max successfully (1, 2) but that's about it. And given I've picked up an interest in programming lately I may start to tackle this case from the opposite end, i.e. fool around in Python a bit, look up library for fsh compression. .  &Thk/(

Also, there's an awesome tree generator plugin for Blender. .  ::)   Ah well, lets not get ahead of one self. .  :D

time flies like a bird
fruit flies like a banana

Offline mgb204

  • NAM Team
  • Forums Guru
  • *
  • Posts: 2314
  • Reputation: 23
  • CL:
    Solved!!
Re: Using Blender (open source modeling program) for content creation.
« Reply #12 on: January 29, 2017, 02:17:36 PM »
And given I've picked up an interest in programming lately I may start to tackle this case from the opposite end, i.e. fool around in Python a bit, look up library for fsh compression. .  &Thk/(

Feel free to do so, but as it stands right now, that's really unnecessary. The tools from BAT4Max can be used for that, in fact those tools are just command-line based versions of the FSH tools we are using already, they aren't specifically for BAT4Max, the scripts used by BAT4 Max merely sends them the commands to run. When I made the Diagonal addons for Cal's Canals, I couldn't get the scripts to work properly with Max9. So I had to manually take the exported textures and create my own scripts to pack them. So I know for a fact, if we can get Blender to render the images correctly, that side of things is a trivial matter. The hardest part, randomly (or programmatically) assigning the IDs for the BATs. That said, this is handled by SC4BAT when it exports the LODs. So the scripts can just take the ID from there for importing the new textures. Again, the tools to read/write DBPF data already exist for this.

However, Python knowledge would come in handy for scripting in respect of the rendering process. Since having figured out the 20 angles needed for a successful render, a script to automate that would be a high priority. But, having worked with BAT textures myself, I know even when you have the z5 camera setup correctly, the scaling is not as simple as you might think for the other zoom levels. I.e. z4 textures are not exactly half the size of z5, the texture size might be, but the part that renders is not. This is really the key to unlocking this, getting the settings for rendering. Armed with that, the remaining parts are relatively easy to make functional. At that stage, we could look at incorporating useful features like Auto-LOD creation, different lighting setups and all the other bells and whistles that we can utilise with tools like BAT4Max. Those would require more knowledge and effort to include. But a basic functional script that renders the textures should be the first priority obviously.

Offline vortext

  • Administrator
  • Forums Guru
  • *
  • Posts: 3361
  • Reputation: 23
  • CL:
    Street Smarts
Re: Using Blender (open source modeling program) for content creation.
« Reply #13 on: January 29, 2017, 02:26:26 PM »
Ah I see, so basically what's needed at first is a script for Blender to take the camera render and send the output to FSH tool? 

time flies like a bird
fruit flies like a banana

Offline art128

  • ~\.Failed Haibane./~
  • Administrator
  • Forums Legend
  • *
  • Posts: 8218
  • Reputation: 18
  • 一人ぼっち
  • CL: Chocolarte
Re: Using Blender (open source modeling program) for content creation.
« Reply #14 on: January 29, 2017, 05:07:31 PM »
What would be interesting too is a script for blender to replace sc4bat completely. That way we could create BATs under Linux, from modeling to LODs, without having to use wine or a vm.

That aside, this is a very interesting thread which I will be following closely.
I'll take a quiet life... A handshake of carbon monoxide.

Offline Handyman

  • Forums Citizen
  • *
  • Posts: 44
  • Reputation: 1
  • We are all astronauts living on the same spaceship
Re: Using Blender (open source modeling program) for content creation.
« Reply #15 on: January 29, 2017, 06:52:56 PM »
That way we could create BATs under Linux, from modeling to LODs, without having to use wine or a vm.

I like that idea too. :thumbsup:

Offline mgb204

  • NAM Team
  • Forums Guru
  • *
  • Posts: 2314
  • Reputation: 23
  • CL:
    Solved!!
Re: Using Blender (open source modeling program) for content creation.
« Reply #16 on: January 29, 2017, 11:51:00 PM »
Ah I see, so basically what's needed at first is a script for Blender to take the camera render and send the output to FSH tool?

Pretty much. The script is for keeping things simple. Setting up twenty different camera angles and hitting render would otherwise be tedious. Assuming that outputs BMPs like 3DS max does, everything else from there would work much as it does now.

Offline eggman121

  • NAM Team
  • Forums Parliamentarian
  • *
  • Posts: 1578
  • Reputation: 27
  • CL:
    Mr. Smth
Re: Using Blender (open source modeling program) for content creation.
« Reply #17 on: January 30, 2017, 12:16:23 AM »
If I may add we could try to export the current camera angles from gmax or max and import them into blender.

I have some scripts that allow the export from gmax to blender so If we can get the camera angle rig out and import it into blender that may be immensely helpful.

Just my two cents. I like where this discussion is going.

-eggman121

Offline rivit

  • NAM Team
  • Forums Councilmember
  • *
  • Posts: 104
  • Reputation: 11
    • The van Tilburg Archives
Re: Using Blender (open source modeling program) for content creation.
« Reply #18 on: January 30, 2017, 12:36:44 AM »
The entire process is in the Gmax\Gamepacks\BAT\scenes and scripts folders

This is quite readable (if a little convoluted) and someone (programmer/scripter type) knowledgeable in Blender and gmax could reasonably assess whether its doable.

 Some time back I extracted all of the basic info on the projection and wrote this article to explain it (mostly to myself)

  http://users.tpg.com.au/rivit/rvt-simcity-articles2.htm 

 and I've recently used this to allow Bender to project planar tiles so we can edit rails or roads encased in Bats.

Offline Handyman

  • Forums Citizen
  • *
  • Posts: 44
  • Reputation: 1
  • We are all astronauts living on the same spaceship
Re: Using Blender (open source modeling program) for content creation.
« Reply #19 on: February 01, 2017, 07:57:58 PM »
I have been checking out the BAT scripts rivit mentioned, and the python scripts in Blender, there seems to be similar functions in both cases. If the BAT scripts can output the necessary co-ordinates for the cameras I don't see any reason why I, or someone can't get these into a python script to set up Blender, and export content in a usable format.

Also followed your link rivit, I thought it was well written, just a completely new concept for me. I had to go over it a couple times.