|
|
|
|
|
March 30th, 2007, 08:02 AM
|
|
General
|
|
Join Date: Feb 2007
Location: R'lyeh
Posts: 3,861
Thanks: 144
Thanked 403 Times in 176 Posts
|
|
Re: new map generator
Quote:
paradoxharbinger said:
hmmm... maybe i am doing the voronoi calculation wrong. the tringulation is delaunay, other triangles were removed from around the edges, so the borders do not appear so, but they are. i thought that to get the voronoi tesselation you drew a line from the center of a triangle to its neighbor's center. working from memory here, so would not be suprised if that isnt quite right.
|
That's right, the question is whether you used the incircles or circumcircles for that. I just judged by my eyesight and most cells look quite fine, but you can spot that some are a little bit off, some are even so far off that it can't come from rounding errors / computer precision. (see Attachment)
Quote:
paradoxharbinger said:
edit: so hard to find good computational geom stuff on the internets, bu i think i figured the difference out, should be from the centers of the triangle's circumcircles. i think the triangle centers will suit my purpose fine though.
|
Yep. The vertices of the Voronoi cells are the centers of the circumcircles from the triangles of the Delaunay triangulation: you get the Voronoi cells if you draw in the perpendicular bisectors of the sides of the triangle towards their collective intersection point. This point could even be outside of the triangle surface, if it is obtuse angled. In the same way, the vertices from the Delaunay triangulation are the intersection points of the perpendicular bisectors from the Voronoi cells.
There is quite some information about it on Wikipedia, and they got lots of links regarding Voronoi diagrams and Delaunay triangulation, too.
|
March 30th, 2007, 02:04 PM
|
|
Sergeant
|
|
Join Date: May 2004
Posts: 338
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Re: new map generator
@ich
oh there are plenty of links to applets and half assed descriptions of how to do it, but go looking for a detailed description and all i've ever gotten is cryptic source code, if that
i dont like the very short edges that you get with voronoi, so im sticking to the segments between the triangle centers
@llamabeast
those regions are not necessarily provinces, they are meant to be the building blocks of the provinces. im thinking that province edges could be either the gray or red lines, depending on the terrain that has been placed. but im pretty sure that im sticking to rivers on the triangle edges, using the others would make it too chaotic. and yes, getting the delaunay triangulation to wrap was rough.
|
March 30th, 2007, 09:43 PM
|
|
General
|
|
Join Date: Feb 2007
Location: R'lyeh
Posts: 3,861
Thanks: 144
Thanked 403 Times in 176 Posts
|
|
Re: new map generator
Oh, you don't want the cells to be the finished provinces, okay, you're free to do that. Otherwise I'd assume that you get strange effects because I'd assume that the game interprets the provinces as being voronoi cells, so that mouse-clicks on the map can be efficiently calculated to the province they're meant for, by only saving and using one point per province instead of a whole polygon.
I still guess there's quite alot of good software around, but either you'll have to program the stuff yourself or use some library which does tons of other algorithmic geometry stuff aswell (like CGAL), yeah.
|
March 30th, 2007, 10:26 PM
|
|
Sergeant
|
|
Join Date: May 2004
Posts: 338
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Re: new map generator
actually i think the game just gets the closest point. otherwise youd have to calculate the voronoi every time the map is loaded and store all the vertexes in addition to the province centers.
|
March 31st, 2007, 09:50 AM
|
|
General
|
|
Join Date: Feb 2007
Location: R'lyeh
Posts: 3,861
Thanks: 144
Thanked 403 Times in 176 Posts
|
|
Re: new map generator
Yes, of course it only has to calculate the closest white points of the map, that's what I meant regarding that it does not have to save and use the whole polygons. But it can only do this because that is exactly the defining attribute of voronoi cells.
|
March 31st, 2007, 03:45 PM
|
|
Sergeant
|
|
Join Date: May 2004
Posts: 338
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Re: new map generator
hmmm... never thought about it like that.
|
April 5th, 2007, 09:53 PM
|
|
Sergeant
|
|
Join Date: May 2004
Posts: 338
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Re: new map generator
just wanted to post a little demo of the river algorithm im working on
|
April 16th, 2007, 09:15 AM
|
Private
|
|
Join Date: Jul 2004
Location: Ipswich, UK
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Re: new map generator
Firstly, great work, paradoxharbinger . Unfortunately, I'm having a few problems with scripting. For example, my script: script.spt file contains Code:
pcount: 100
and results in Code:
script: ./script.spt ... success
pcount: 1000 ... success
That's a bit quirky, but it seems to work when you realise it adds about a factor of 10 to you pcount. However, I can't get some other stuff to work at all:
Code:
pcount: 10
filename: test2
results in:
Code:
script: ./script.spt ... success
pcount: 10
filename: test22 ... failed
The pcount isn't increased, and the filename is, and it fails. Changing the pcount to a higher value dousn't help. Just
Code:
filename: test2
results in:
Code:
script: ./script.spt ... success
filename: test22 ... success
Anyway, I'm a bit confused - seems as if if I put two variables in, it gets screwed. It's a little screwy with one, too. I've tried other scripting variables, with the same result. I tried switching to Unix style line breaks to see if that would fix it (I was clutching at straws here ), but same again. I may try downloading again, see if that fixes it.
Oh, my verion numbers are off too. In the title bar MapGen claims it's v 0.52.03082007, and in the program it claims it's 0.51.03082007.
If I'm doing something unbelievable stupid, feel free to point and laugh , but I can't figure it out
edit : And one last thing - I'm using Dominions 2... please don't drop support for it... pretty please?
|
April 16th, 2007, 12:15 PM
|
|
Sergeant
|
|
Join Date: May 2004
Posts: 338
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Re: new map generator
odd... could you attach a zip with all of the output please?
the version number may just be that i forgot to change an output line, that's no biggy. you're using th most recent right?
as far as dom2 goes, we'll see. it is probably just a mater of leaving out the dom3 terrain types, but i havent gotter quite as far as adding in the dom3 types yet.
@ all
sorry for the lack of updates, finals week is rolling around, so i've been bogged down with school related work.
|
April 16th, 2007, 02:09 PM
|
|
Sergeant
|
|
Join Date: May 2004
Posts: 338
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Re: new map generator
one thing ive spotted is that you dont have semi-colons ( after your command, that might throw it off. the scripting isnt very robust as far as error checking goes, so it's best to follw the rules to the letter, so commands look like this:
command: arg1 arg2 arg3;
colon after the command, arguments seperated by spaces, and a semicolon at the end of the argument list
edit: just checked, leaving off the semi-colon at the end will result in duplicating the last character, and if you have a command after one that does not have a semi=colon i can only imagine all of thew odd things that could happen. moral of the story is stick to the rules
|
Thread Tools |
|
Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is On
|
|
|
|
|