Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 2 3 [4] 5 6 ... 18

Author Topic: World Viewer - Supports Mods + Graphical Map! (8/12)  (Read 66414 times)

Mason11987

  • Bay Watcher
    • View Profile
Re: World Viewer - Supports Mods + Graphical Map!
« Reply #45 on: July 12, 2010, 01:09:49 pm »

It seems that when you parse a new world when you previously parsed a world, some of the old data remains intact (for example, if you re-parse the old world, some content is doubled). This appears to be on the people and the races tabs only, though.

People: Found (obvious) problem, should be fixed.
Races: I don't see the same bug, and I couldn't recreate it.  Let me know if it's still happening.

To be blunt - I haven't really done any cleaning up to allow safe re-parsing.  To be safe (until I can look into it) just restart the program when parsing again or parsing a new world.

V 1.7.1
Map view should work for an arbitrarily large xml file.

Screenshot in OP/dffd shows a 400MB one I was able to explore in the map.
« Last Edit: July 12, 2010, 01:13:29 pm by Mason11987 »
Logged

Knight Otu

  • Bay Watcher
  • ☺4[
    • View Profile
Re: World Viewer - Supports Mods + Graphical Map!
« Reply #46 on: July 12, 2010, 01:34:11 pm »

Races: I don't see the same bug, and I couldn't recreate it.  Let me know if it's still happening.
Sorry, I should have been more specific there - On the races tab, the number of civilizations (to the right of the selection of races) of a given race is doubles (tripled...) when you reparse the world, whether dead or not.

To be blunt - I haven't really done any cleaning up to allow safe re-parsing.  To be safe (until I can look into it) just restart the program when parsing again or parsing a new world.
i wouldn't have done so normally, but in the case where I noticed this happening, I had first parsed the world without the XML information, and then with it, for a bit of a test of the XML parsing.
Logged
Direforged Original
Random Raw Scripts - Randomly generated Beasts , Vermin, Hags, Vampires, and Civilizations
Castle Otu

cephalo

  • Bay Watcher
    • View Profile
Re: World Viewer - Supports Mods + Graphical Map!
« Reply #47 on: July 12, 2010, 01:53:40 pm »

Ok I got a new error with my XML: 'Couldn't pull necessary sections of XML file' This was after the warning about the large xml file.

EDIT: it looks like it partially worked, many site rectangles are on the map window, but there is no actual map in the window, perhaps it didn't get far enough to actually load the bitmap.
« Last Edit: July 12, 2010, 02:01:42 pm by cephalo »
Logged
PerfectWorldDF World creator utility for Dwarf Fortress.

My latest forts:
Praisegems - Snarlingtool - Walledwar

Mason11987

  • Bay Watcher
    • View Profile
Re: World Viewer - Supports Mods + Graphical Map!
« Reply #48 on: July 12, 2010, 02:06:03 pm »

Races: I don't see the same bug, and I couldn't recreate it.  Let me know if it's still happening.
Sorry, I should have been more specific there - On the races tab, the number of civilizations (to the right of the selection of races) of a given race is doubles (tripled...) when you reparse the world, whether dead or not.

To be blunt - I haven't really done any cleaning up to allow safe re-parsing.  To be safe (until I can look into it) just restart the program when parsing again or parsing a new world.
i wouldn't have done so normally, but in the case where I noticed this happening, I had first parsed the world without the XML information, and then with it, for a bit of a test of the XML parsing.

no problem, found it.  Fixed it.  Thanks.

Understandable.  If I only do the same things every run I'll only catch the same bugs :).

Ok I got a new error with my XML: 'Couldn't pull necessary sections of XML file' This was after the warning about the large xml file.

I knew putting in useful error messages would help me!  Your xml was apparantly quite a bit bigger then my test one.  We're getting close though, I think my next release should fix this.

In the meantime, take a look at this:



I wanted some visual way to group sites belonging to the same civ together on the map, this is an ugly (but effective) way of doing that.  Any good ideas on how to do this in a less ugly way?  (I tried going behind the symbols, but I can't make it work).

Star Weaver

  • Bay Watcher
    • View Profile
Re: World Viewer - Supports Mods + Graphical Map!
« Reply #49 on: July 12, 2010, 02:22:02 pm »

Try drawing a circle around each site, and then offset the line start and end by that amount? That might require (simple) vector math and a normalizaiton (sqrt!) tho, to offset it in the right direction.

You could also probably find some algorythm online somewhere to remove interior edges in a 2d polygon, which would let you just draw a bordery line.

Looks awesome tho. Has the map view been tested with a square or other non-default tileset?
Logged

Mason11987

  • Bay Watcher
    • View Profile
Re: World Viewer - Supports Mods + Graphical Map!
« Reply #50 on: July 12, 2010, 02:26:09 pm »

Try drawing a circle around each site, and then offset the line start and end by that amount? That might require (simple) vector math and a normalizaiton (sqrt!) tho, to offset it in the right direction.

You could also probably find some algorythm online somewhere to remove interior edges in a 2d polygon, which would let you just draw a bordery line.

Looks awesome tho. Has the map view been tested with a square or other non-default tileset?

Not a bad idea, I'll give that a shot.

It hasn't, I didn't even think of that possibility.  That might be a problem.

cephalo

  • Bay Watcher
    • View Profile
Re: World Viewer - Supports Mods + Graphical Map!
« Reply #51 on: July 12, 2010, 02:34:33 pm »

I think the lines look fine, trying to draw a polygon around them might actually complicate the view as it's possible for empires to overlap in crazy ways. Maybe you could draw one line to the nearest same-civ site.

Looks awesome tho. Has the map view been tested with a square or other non-default tileset?

It hasn't, I didn't even think of that possibility.  That might be a problem.

People use alot of different character sets, and that's what gets exported. So you have to know the map size in some way versus the bitmap size, and divide by that in each direction to get the character width/height. Also keep in mind that it's possible to have non-square maps.
« Last Edit: July 12, 2010, 02:41:20 pm by cephalo »
Logged
PerfectWorldDF World creator utility for Dwarf Fortress.

My latest forts:
Praisegems - Snarlingtool - Walledwar

Star Weaver

  • Bay Watcher
    • View Profile
Re: World Viewer - Supports Mods + Graphical Map!
« Reply #52 on: July 12, 2010, 02:47:33 pm »

Hey, I just did some combination testing, and if my math is right, every possible dimension of the map is uniquely discernable to be a given tile size at given map size. This is CSV-style output, and can be read as:

If the map image is A pixels wide/tall, it is made of B tiles which are each C pixels wide/tall.

Just figure width and height seperately, for non-square maps :)

Spoiler (click to show/hide)

Logged

cephalo

  • Bay Watcher
    • View Profile
Re: World Viewer - Supports Mods + Graphical Map!
« Reply #53 on: July 12, 2010, 02:49:48 pm »

Maybe you could draw one line to the nearest same-civ site.

Actually this would not work, I think the rule would have to be: One line to the nearest same-civ site that isn't already connected to me. Otherwise a two way connection could disconnect an empire.  :D
Logged
PerfectWorldDF World creator utility for Dwarf Fortress.

My latest forts:
Praisegems - Snarlingtool - Walledwar

Star Weaver

  • Bay Watcher
    • View Profile
Re: World Viewer - Supports Mods + Graphical Map!
« Reply #54 on: July 12, 2010, 02:57:48 pm »

Hey, I just did some combination testing, and if my math is right, every possible dimension of the map is uniquely discernable to be a given tile size at given map size. This is CSV-style output, and can be read as:

If the map image is A pixels wide/tall, it is made of B tiles which are each C pixels wide/tall.

Just figure width and height seperately, for non-square maps :)

Spoiler (click to show/hide)

Edit: To be clear, this is for tileset with dimensions ranging from 5 to 32 pixels, and it will not detect or misdetect other sizes. At some point there will have to be conflicts ... I think? Maybe power-of-two-plus-one is magical enough that it wouldn't. I don't think i've ever seen anything outside this range, though.
Logged

Mason11987

  • Bay Watcher
    • View Profile
Re: World Viewer - Supports Mods + Graphical Map!
« Reply #55 on: July 12, 2010, 03:01:05 pm »

Yeah, I realized that it shouldn't be hard to find the tilesize givein map coord size and map size, so I'm not too worried about it, I just haven't implemented it yet (the default set isn't square though (it's 8x12px)

anyways, here's my improvement on the lines



I took starweaver's idea of not hitting the site directly, made the lines brighter (just random not dark colors), and had every site just connect to one site (the central site is unremarkable, it's just the first in the worldsites file.  Feel free to offer improvements suggestions on this.  I'll release something in the next hour or so that is functioning (even with your larger xml cephalo)

JoRo

  • Bay Watcher
    • View Profile
Re: World Viewer - Supports Mods + Graphical Map!
« Reply #56 on: July 12, 2010, 03:14:44 pm »

I convert my world maps to .png as a matter of course, and the viewer only wants bitmaps.  It's not a too big a hassle to just export the image again, but .png support would be handy.
Logged
You have been struck down.
The giant cave spider spits out your head.

Mason11987

  • Bay Watcher
    • View Profile
Re: World Viewer - Supports Mods + Graphical Map!
« Reply #57 on: July 12, 2010, 03:31:48 pm »

I convert my world maps to .png as a matter of course, and the viewer only wants bitmaps.  It's not a too big a hassle to just export the image again, but .png support would be handy.

I did a quick check and it seems like that isn't a simple addition, so I'll add it to the list.

V 1.8
Works with even larger xml files.  Should be fine for almost anything now
added cave hiding and civ connecting to the map
added the ability to click the "Location:" coordinates on the "site" tab and have the map center on the location on the map.  Now you can, for example... sort sites by population, click the largest site, and immediately see where it's located, so you can visit it in adventure mode quickly.

Star Weaver

  • Bay Watcher
    • View Profile
Re: World Viewer - Supports Mods + Graphical Map!
« Reply #58 on: July 12, 2010, 03:51:41 pm »

That's cool. Starting from their initial city (that is the first one listed, right?) is neat 'cause it gives you a clue how they moved in worldgen.
Logged

Mason11987

  • Bay Watcher
    • View Profile
Re: World Viewer - Supports Mods + Graphical Map!
« Reply #59 on: July 12, 2010, 03:56:21 pm »

That's cool. Starting from their initial city (that is the first one listed, right?) is neat 'cause it gives you a clue how they moved in worldgen.

It makes sense it would be the first one, but then there aren't any unoccupied sites.  I assume when people leave them they dissapear from that file at least.  Then again I don't know that much about worldgen, so I couldn't be sure.

I've since set it up to have the "center" be the largest site in the civ, but if we find out the first one is always the "initial" one, then I'll leave it as it was.
Pages: 1 2 3 [4] 5 6 ... 18