![]() |
Re: new map generator
1 Attachment(s)
Quote:
Quote:
There is quite some information about it on Wikipedia, and they got lots of links regarding Voronoi diagrams and Delaunay triangulation, too. |
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. |
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. |
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.
|
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. http://forum.shrapnelgames.com/images/smilies/wink.gif
|
Re: new map generator
hmmm... never thought about it like that.
|
Re: new map generator
1 Attachment(s)
just wanted to post a little demo of the river algorithm im working on
|
Re: new map generator
Firstly, great work, paradoxharbinger http://forum.shrapnelgames.com/images/smilies/laugh.gif. Unfortunately, I'm having a few problems with scripting. For example, my script: script.spt file contains<font class="small">Code:</font><hr /><pre>pcount: 100</pre><hr />and results in<font class="small">Code:</font><hr /><pre>script: ./script.spt ... success
pcount: 1000 ... success</pre><hr /> 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: <font class="small">Code:</font><hr /><pre>pcount: 10 filename: test2</pre><hr />results in: <font class="small">Code:</font><hr /><pre>script: ./script.spt ... success pcount: 10 filename: test22 ... failed</pre><hr /> The pcount isn't increased, and the filename is, and it fails. Changing the pcount to a higher value dousn't help. Just <font class="small">Code:</font><hr /><pre>filename: test2</pre><hr />results in: <font class="small">Code:</font><hr /><pre>script: ./script.spt ... success filename: test22 ... success</pre><hr /> 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 http://forum.shrapnelgames.com/image...ies/tongue.gif), 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 laughhttp://forum.shrapnelgames.com/images/smilies/eek.gif, but I can't figure it outhttp://forum.shrapnelgames.com/image...s/confused.gif edit : And one last thing - I'm using Dominions 2... please don't drop support for it... pretty please? |
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. |
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 |
All times are GMT -4. The time now is 12:07 PM. |
Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©1999 - 2025, Shrapnel Games, Inc. - All Rights Reserved.