Zephyris' Procedural Buildings Tool

Discuss, get help with, or post new graphics for TTDPatch and OpenTTD, using the NewGRF system, here. Graphics for plain TTD also acceptable here.

Moderator: Graphics Moderators

blitzkrieg
Engineer
Engineer
Posts: 105
Joined: 30 Jun 2006 04:22

Re: Zephyris' Procedural Buildings Tool

Post by blitzkrieg »

Zephyris wrote:Just so you call know I am still fiddling with the generator trying to get the results as good as possible... It is, unfortunately, a classic 80%/20% thing; 20% effort to get 80% finished, 80% effort to get the last 20% sorted! Hopefully I can get it finished at some point though :)

I've also done some stuff on a procedural tree generator... Any thoughts? It makes growth stages dead easy to generate, it would also make creating season variations (if OpenTTD ever supports that, hint hint) of the trees very simple.
images.jpg
images.jpg (6.61 KiB) Viewed 2409 times
:bow: :bow: :bow: :bow: :bow: :bow: :bow:
ZxBiohazardZx
Tycoon
Tycoon
Posts: 1534
Joined: 14 Mar 2006 12:46
Location: Netherlands

Re: Zephyris' Procedural Buildings Tool

Post by ZxBiohazardZx »

reminds me A LOT of this

http://www.youtube.com/watch?v=-d2-PtK4F6Y

Pixel City - Procedurally Generated City

even the outcomes are damn similar
User avatar
Zephyris
Tycoon
Tycoon
Posts: 2897
Joined: 16 May 2007 16:59

Re: Zephyris' Procedural Buildings Tool

Post by Zephyris »

And here is "version 1" of the building generator tool. To use it download and install ImageJ and open the text file "ImageJMacro_DrawBuildingCombined3.txt". To run it press Ctrl+R or select run macro from the drop down menu. This will run the macro and (by default) produce 4 sets of sprites along with a tab delimited text file with the sprite x/y offsets, width/height and rotation/construction stage. It's not the most user friendly thing, you will have to set up an output path string in the code (use "//" rather than "/" to define folder levels) and to generate buildings other than the boring default house you have to modify the generateBuildingDefinitions() function. If you copy/paste the content of either of the two extra files I have attached ("ImageJMacro_Accessory_BuildingGen_StepBackSkyscraperDefinition2.txt" and " ImageJMacro_Accessory_BuildingGen_TerraceDefinition2.txt") to replace the content of the generateBuildingDefinitions() function you will get some slightly more interesting outputs...
Attachments
ImageJMacro_DrawBuildingCombined3.txt
(30.12 KiB) Downloaded 168 times
ImageJMacro_Accessory_BuildingGen_StepBackSkyscraperDefinition2.txt
(3.25 KiB) Downloaded 110 times
ImageJMacro_Accessory_BuildingGen_TerraceDefinition2.txt
(1.87 KiB) Downloaded 102 times
User avatar
Zephyris
Tycoon
Tycoon
Posts: 2897
Joined: 16 May 2007 16:59

Re: Zephyris' Procedural Buildings Tool

Post by Zephyris »

... and the contents of the building generator function for a detatched house.
Attachments
ImageJMacro_Accessory_BuildingGen_HouseDefinition.txt
(1.97 KiB) Downloaded 121 times
Yexo
Tycoon
Tycoon
Posts: 3663
Joined: 20 Dec 2007 12:49

Re: Zephyris' Procedural Buildings Tool

Post by Yexo »

Amazing work Zephyris!

Little bash script and nml file to create a house grf to view those houses in game :)

Install ImageJ, install NML, extract the zip file and run the script "run". It'll create macrobuildings.grf containing a few houses. These houses will be available in all climates in all town zones to ease testing. You can change the amount and height (in number of stories) of houses the script generates in the run script (line 19+20).

I've slightly altered Zephyris ImageJ script so it accepts a few parameters when started via the commandline, so avoid running the macro manually every time you want to generate new houses.
Attachments
macrobuildings.zip
(8.17 KiB) Downloaded 104 times
User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9432
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: Zephyris' Procedural Buildings Tool

Post by planetmaker »

The run script uses some syntax which does not work in my bash. I modified it slightly so that it works here, too. Version attached. And I have to say: amazing results :-) ... 10 minutes of playing and the screenshot shows what is already there. I know there are some clipping issues and others as well. But without actually doing *anything*, it's quite neat ;-)
Attachments
modified_build_script.zip
(18.68 KiB) Downloaded 83 times
Unnamed, 2050-04-01.png
Unnamed, 2050-04-01.png (81.57 KiB) Viewed 2068 times
User avatar
Zephyris
Tycoon
Tycoon
Posts: 2897
Joined: 16 May 2007 16:59

Re: Zephyris' Procedural Buildings Tool

Post by Zephyris »

Lookin' good :) I should really get round to actually trying to make a town set using this...
User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9432
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: Zephyris' Procedural Buildings Tool

Post by planetmaker »

what needs adding IMHO is for each house a ground tile which has a black area covering the base of the house. It's probably not much work, but would greatly add to a good overall impression of such houses.
User avatar
Zephyris
Tycoon
Tycoon
Posts: 2897
Joined: 16 May 2007 16:59

Re: Zephyris' Procedural Buildings Tool

Post by Zephyris »

Mmm, I meant to write a basic garden generator too, then totally ran out of time! Maybe some day...
User avatar
kamnet
Moderator
Moderator
Posts: 8705
Joined: 28 Sep 2009 17:15
Location: Eastern KY
Contact:

Re: Zephyris' Procedural Buildings Tool

Post by kamnet »

planetmaker wrote:The run script uses some syntax which does not work in my bash. I modified it slightly so that it works here, too. Version attached. And I have to say: amazing results :-) ... 10 minutes of playing and the screenshot shows what is already there. I know there are some clipping issues and others as well. But without actually doing *anything*, it's quite neat ;-)
Are the circled items part of the clipping issues, or just mis-drawn sprites?
Attachments
screenshot.png
screenshot.png (180.03 KiB) Viewed 1947 times
User avatar
Zephyris
Tycoon
Tycoon
Posts: 2897
Joined: 16 May 2007 16:59

Re: Zephyris' Procedural Buildings Tool

Post by Zephyris »

Clipping during missdrawing... The peaks of those buildings are falling off the top of the rectangular area available for drawing.
Yexo
Tycoon
Tycoon
Posts: 3663
Joined: 20 Dec 2007 12:49

Re: Zephyris' Procedural Buildings Tool

Post by Yexo »

That is only a small problem with the script generating the grf, not a problem with the graphics themselfs. Houses with this size are supported by the game. It's just that the bounding box (as defined in the grf) is too small.
User avatar
kamnet
Moderator
Moderator
Posts: 8705
Joined: 28 Sep 2009 17:15
Location: Eastern KY
Contact:

Re: Zephyris' Procedural Buildings Tool

Post by kamnet »

Good to know! Just wanted to make sure Zephyris wasn't falling asleep drawing them and started doodling sideways ;-)
Post Reply

Return to “Graphics Development”

Who is online

Users browsing this forum: Google [Bot] and 21 guests