.com.unity Forums

.com.unity Forums (http://forum.shrapnelgames.com/index.php)
-   Scenarios, Maps and Mods (http://forum.shrapnelgames.com/forumdisplay.php?f=146)
-   -   new map generator (http://forum.shrapnelgames.com/showthread.php?t=30337)

paradoxharbinger March 19th, 2007 12:07 PM

Re: new map generator
 
so you want something like this?

int changebitmask(int mask, int oldmask, int newmask)
{
if( mask & oldmask == oldmask )
{
mask &= ~oldmask;
mask |= newmask;
}
return mask;
}

paradoxharbinger March 29th, 2007 03:37 AM

Re: new map generator
 
1 Attachment(s)
just wanted to give you all a quick update

one of the major hurdles for the next release has been leaped: generating a wrapping mesh, which i've attached a sample of. the image is a mesh tiled with itself in four colors so that the mesh boundaries are visible.

my intent with this new algorithm is to generate a large amount of regions (which will be the dual of this kind of triangulation) and then assign to each region terrain types, rather than using a heightmap.

the generation method is being radically changed to allow for much greater control of what is generated (see a couple of post up). it also means a heinous speed increase.

i'll keep you posted as things move along

Gandalf Parker March 29th, 2007 02:39 PM

Re: new map generator
 
So... within a single map you will get 4 areas with equal chance to develop all of the terrains? Increasing the possibility of 4 areas with a continent, ocean, etc.

Or is this to lead up to flip-flop mapping for the "equal starting positions" crowd?

paradoxharbinger March 29th, 2007 03:45 PM

Re: new map generator
 
perhaps i should not have posted that pic. it was mostly just a demo for setting up wrapping maps in general. the main challenge with the wrapping maps is that you have to make sure that they will tile when you lay them side by side. further, you have to do it in a way that that has no artifacts of wrapping it.

what im trying to do here is create a boatload of small regions and then start assigning terrains to them and thier edges.

paradoxharbinger March 29th, 2007 06:07 PM

Re: new map generator
 
1 Attachment(s)
aight, i put together a crude demo of what i'm going for, check the attachment

lch March 29th, 2007 06:53 PM

Re: new map generator
 
Somehow, those are not Voronoi cells anymore. But I guess I understood what you meant regarding the wrapping maps already, it's the same thing that is used in digital imaging for tiled wallpapers. Very nice.

Gandalf Parker March 29th, 2007 07:25 PM

Re: new map generator
 
Ahhh...
I had on my projects list (my super overloaded projects list) an idea to do a webpage tiling of the maps I randomly generate just to see if one accidentally comes close to being wrappable. That way I could spot one that was at least possible with slight effort.

paradoxharbinger March 29th, 2007 10:42 PM

Re: new map generator
 
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.

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.

BandarLover March 30th, 2007 12:24 AM

Re: new map generator
 
Woa...suddenly had a flash back to high school geometry after reading that. And it still makes no sense now like it did then. http://forum.shrapnelgames.com/images/smilies/wink.gif

llamabeast March 30th, 2007 05:33 AM

Re: new map generator
 
Hey paradox, just to let you know I'm lurking here, and I'm really impressed by what you've got done! The latest demo is really good looking I think. Seems like an excellent system you're using. I'm impressed you managed to get the wraparound working too - it's not obvious after a brief think how you'd do that.

I like how the province borders are defined by the midpoints of the triangles. Cunning. One thing - the coastline goes along the edges of the triangles, which means that all the coastal provinces are half in the sea and half on land. Is that deliberate?


All times are GMT -4. The time now is 12:02 PM.

Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©1999 - 2025, Shrapnel Games, Inc. - All Rights Reserved.