So many languages... I felt I could spend a week analysing which to use but ultimately a friend reckoned Python was worth a shot.
The job I need the Python code to do is basically very simple, in theory. I need to be able to load a height_field image but not necessarily modify it, just have it as the background. Then I need to be able to plot points, Nodes, in just the x-z plane (y is up). These need to have default automatic "name idents" with the option to assign your own. Then I need to be able to connect such nodes in pairs, and assign some other variables for each connection. Lastly I need to be able to define triplets and other parameters for those.
The program holds and displays all that data - with possible nice extras like filters and colour coding and so on and ultimately be able to save that data in its own format and also export as pre-defined text strings into a POVRay text file. There's no rendering up to this point, just a few numbers and text strings.
As for the rendering - that's where the second phase comes in and I fire up povray, and run the exported pov file from the Python program.
However, unlike in the Competition, I've been careful to try and keep the render time down. The Nexus took ages on one or two of the renders because of the light beams, which are not needed here. The current textured view of "Bendford" takes about 10 minutes, less if you only want to check layouts using the low detail setting (the yellow and red building versions you can see on the website).
Anyway, it's a challenge, but not enough that I would say "no" to anyone wanting to take it over - in any language!
I'm still on the case, as it were, but progress is slow as I learn Python - or try to. I've cobbled together a quickie App that loads a height field into a scrolling window - mostly by cribbing existing programs. I'm also writing up a better Interface Control Doc for the software dialogue boxes and eventual exported POV text commands which in itself is helping me rationalise the way it works - or should work.
I had a session trying to get ImageMagick included within the Python environment and hit a stumbling block in that there doesn't seem to be a Python/IDLE environment installer, just a windows command line bin installer... any clues here would be helpful! In the meantime I'm looking at it from a Pickle angle but I'm not sure if that will support multiple vector line "rubberbanding" when one moves a single Node connected with several lines... ugh. That may have to be "mandraulic".
It's easy to get distracted from this! In the meantime, I'm using Boa to design the dialogue frames and define the main code structure, after that it looks like plain old text editing in IDLE for the "meat" of the code.
Here's a screen shot of my height field view test program just because, really...
Not forgotten, just delayed...
That's fine, I had a look at ViewingDale in my various researches, very nice tool! The height field part of my project is the simplest bit and being able to view as a plan view is about all I need. I'm not competing with the abilities of VD or Wilbur and the like in height field abilities. All I need is to be able to see the heightfield, much as my screenshot shows it (although more choice of colours schemes would be fun later). That overhead view is basically the backdrop on which to plot the town items so that you don't put a ship in the market square or run a street up a cliff face or something. That means that the "plot screen" for nodes and lines for these things needs to scroll locked with the height field - synchronised.
Creation of the height field itself is outside the scope of the Town Generator and viewing it at angles, while handy, is a low priority since the adjustment of town objects to sit at the correct height at the point of presence is done within "YATG3D" as part of the POVray code. In essence the GUI front end works on a "flat" world - for the foreseeable future!
However, I'm not at a point where I'm committed to using Python, so if wx can do the things I need and I can't get wx in Python, well, maybe a change to a different language is in order... ooooer.
ViewingDale, the main app, isn't 3D and doesn't use height maps thats just a little free thing used to look at them which are spat out from the other free tool instant islands used to make some real basic land masses. You can grab that and use it without having to buy or do anything. It's closed source freeware. I also use height maps to texture up backdrops but I use a different (and unfortunately unreleased) tool for that.
The scroll locked thing you can do by either offsetting the draw list of lines to the same offset for the map and then rendering out a section of it. Or, and more usually, you render the whole screen and put it into a scrollable window which shows only part of it. If I were doing this sort of thing then I would use a 3rd technique which is similar to the second and use windows MFC classes and GDI to draw the bitmap and lines and then copy a section to a displayable screen bit. Tho no hard, theres still a lot to know to do it tho. Id still think you would be better off using perl. Install any V5 32bit version and then install the image magick module by typing:
and then you can write a script where in a line or two load a bitmap and draw stuff on it. It wont be very fast tho. You may find that wx does easy graphics. I know there is a wx opengl thing you can use so presumably that works under Python. I havent ever used it and tho GL is very fast its a bit of a chore loading and saving images with it.Code:ppm install http://www.bribes.org/perl/ppm/Image-Magick.ppd
Unashamed bump! and progress update.
YATG3D has not been forgotten but progress has been made very slowly. An understanding of the Beta version of the GUI interface has been sort of hammered out and a very nice chap is getting to grips with Python to write it. The initial software will still be pretty basic and I think I'll still be out there begging for someone to take it further after that. However, I'm hoping that a usable proof of principle Beta package might generate some interest? Ehem.
It's currently being developed under Linux but will run under windoze - at least so far it does.
On the povray Macro side I haven't done much except refine the fill tool a bit. Building macros is the easy bit.
Observant viewers will notice that I used aspects of the POVray macros to create my New Amsterdam entry in the New york thing. This means I sort of have some other building types available to incorporate using those architectural styles but it's not really much to write home about.
As a reminder, the protowebsite for this idea is still
but if you've been there last time I haven't changed anything on it since
My Python man is not on board for the whole possible ride so if there is someone out there who just lurves to wrestle snakes then please get in contact.
Needless to say again really but a really whizzo street node map generator would really ice the cake! I'm really hoping the dazzling Ravs will get his economic Andyland working!!
More later, I hope!
That is smoking awesome. That is the kind of thing I want to do with my city. wicked wicked wicked.
If I knew anything about the languages, i'd be in there like a dirty shirt. Whenever it's ready for beta i'll be a test dummy for sure. That way I can give you all the possible blunders a user can make LOL.
Once again this looks fantastic.
Last edited by danjr; 03-12-2011 at 04:46 AM.
Glad to hear you are still working on this project, Crayons. I'd forgotten about it but just looking again at your early screenies renewed my enthusiasm for seeing what this baby will be able to do when you've got it more where you want it to be.