Menu
 
FAQFAQ
SearchSearch

MemberlistMemberlist

UsergroupsUsergroups
RegisterRegister
ProfileProfile
Log in to check your private messages
Log in to check your private messages
Log inLog in
 
 

Community
 

Cartographer Filters
Goto page 1, 2  Next
 
Post new topic   Reply to topic    Winbolo.net Forum Index -> Maps
View previous topic :: View next topic  
Author Message
Alain



Joined: 05 Oct 2004
Posts: 455

PostPosted: Mon Dec 26, 2005 6:46 pm    Post subject: Cartographer Filters Reply with quote

* From DAllen's idea in the "Cartographer" thread *

Cartographer is a very good tool for map creators, even if it needs some more functions to be complete (see here to read the discussion about it). I can say to you that Ianbanks wants to continue his work on it : he just need our encouragements, to find some time, and to see that we use it Wink

The object of this thread is that Cartographer allows us to create and use Filters written in LUA.

I give here some scripts I made.
  1. Create a "Filters" directory in the same directory than "Cartographer.exe".
  2. Copy all the content of each script in a new Notepad file. I recommend you to name the file like the 1st line of the script (without the"-- "). Don't forget the ".lua" extension when saving.
  3. Open Cartographer. Open Filters menu and you will see the new filters.

*EDIT 2006-07-31 : You can download my complete collection of filters, ready to use, on my "Alain's WinBolo Micro-Site" here Wink


A simple script to understand the terrains codes :
Code:
-- Tool - Terrains Codes.lua
-- Cartographer Filter
-- By Alain

for i = 0, 16 do
   line(i+5, i, i+10, i, i)
end


The center of the square made by this 2nd filter is the absolute symmetry center of the map. Draw in a quad and then use the 4 other symmetry filters to complete the other quads.
Code:
-- Tool - Symmetry 0 Center Point.lua
-- Cartographer Filter
-- By Alain

line(127, 127, 128, 128, 4)
line(127, 128, 128, 127, 0)


Code:
-- Tool - Symmetry 1 West-East.lua
-- Cartographer Filter
-- By Alain

for y = 0, 255 do
   for x = 0, 127 do
      setpoint(255-x, y, getpoint(x, y))
   end
end


Code:
-- Tool - Symmetry 2 East-West.lua
-- Cartographer Filter
-- By Alain

for y = 0, 255 do
   for x = 0, 127 do
      setpoint(x, y, getpoint(255-x, y))
   end
end


Code:
-- Tool - Symmetry 3 North-South.lua
-- Cartographer Filter
-- By Alain

for y = 0, 127 do
   for x = 0, 255 do
      setpoint(x, 255-y, getpoint(x, y))
   end
end


Code:
-- Tool - Symmetry 4 South-North.lua
-- Cartographer Filter
-- By Alain

for y = 0, 127 do
   for x = 0, 255 do
      setpoint(x, y, getpoint(x, 255-y))
   end
end


Some other examples of filters (some of them already posted by others and modified) :
Code:
-- Tool - Border Limits.lua
-- Cartographer Filter
-- By Alain

tile_type = OCEAN

for i = 0, 9 do
   line(i, 0, i, 255, tile_type)
   line(0, i, 255, i, tile_type)
   line(255-i, 0, 255-i, 255, tile_type)
   line(255, 255-i, 0, 255-i, tile_type)
end


Code:
-- Background - Random Diagonals.lua
-- Cartographer Filter
-- By Alain

for n = 1, 10000 do
    x = math.random() * 225 + 10
    y = math.random() * 225 + 10
    line(x, y, x + 10, y + 10, math.random() * 10)
end


Code:
-- Background - Explosion.lua
-- Cartographer Filter
-- By Alain

for x = 0, 1000 do
   line(127, 127, math.random(10, 245), math.random(10, 245), math.random(0, 9))
end


Tell me if you want that I send you all these files "ready to use".

Then... if you make some interesting filters, please post them here Very Happy[/url][/b]


Last edited by Alain on Mon Jul 31, 2006 11:07 am; edited 2 times in total
Back to top
View user's profile Send private message
Nova



Joined: 04 Jul 2003
Posts: 1774

PostPosted: Mon Dec 26, 2005 7:05 pm    Post subject: Reply with quote

Neat, but it'd be nice if we had a description of what each filter did.
Back to top
View user's profile Send private message AIM Address
Alain



Joined: 05 Oct 2004
Posts: 455

PostPosted: Mon Dec 26, 2005 7:14 pm    Post subject: Reply with quote

The titles / file names says it, Nova...
Back to top
View user's profile Send private message
Nova



Joined: 04 Jul 2003
Posts: 1774

PostPosted: Mon Dec 26, 2005 7:17 pm    Post subject: Reply with quote

I suppose it does, I just didn't understand at first.
Back to top
View user's profile Send private message AIM Address
Alain



Joined: 05 Oct 2004
Posts: 455

PostPosted: Mon Dec 26, 2005 7:23 pm    Post subject: Reply with quote

I send you the files Nova, I think that you will like the tools. Wink
Back to top
View user's profile Send private message
Nova



Joined: 04 Jul 2003
Posts: 1774

PostPosted: Mon Dec 26, 2005 7:28 pm    Post subject: Reply with quote

Very nice, Alain. Thank you.

edit: You could upload the files somewhere like www.uploadit.org that way everyone could do the same.
Back to top
View user's profile Send private message AIM Address
#2



Joined: 12 Feb 2006
Posts: 192

PostPosted: Sun Apr 23, 2006 3:42 pm    Post subject: Re: Cartographer Filters Reply with quote

Alain wrote:


  1. Create a "Filters" directory in the same directory than "Cartographer.exe".
  2. Copy all the content of each script in a new Notepad file. I recommend you to name the file like the 1st line of the script (without the"-- "). Don't forget the ".lua" extension when saving.
  3. Open Cartographer. Open Filters menu and you will see the new filters.



a bit of more detales?
it dident work for me.
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger
Alain



Joined: 05 Oct 2004
Posts: 455

PostPosted: Mon Apr 24, 2006 6:51 am    Post subject: Reply with quote

#2 : I will send you a ZIP file of a directory "Filters" containing all these precedent filters. Just unzip it in the same folder then "Cartographer.exe". Open Cartographer and you will see the new filters in the menu "Filters". Good luck ! Wink
Back to top
View user's profile Send private message
#2



Joined: 12 Feb 2006
Posts: 192

PostPosted: Mon Apr 24, 2006 7:01 am    Post subject: Reply with quote

thanks!

but please can you send it to metric810@hotmail.com ?
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger
Alain



Joined: 05 Oct 2004
Posts: 455

PostPosted: Sat May 13, 2006 3:21 am    Post subject: Reply with quote

New filter !

To try it, open a new map, draw some lines, empty or filled circles, squares... and run the filter : all the terrains surrounded by sea will grow !

For the ones who wants more details :
This filter records in a table the terrain values of all the squares of the map. But not the squares included in the minefield : 10 tiles from each border. The filter don't do anything in this zone = security. Then, if a recorded square is not deep water, it tests all the 8 squares around it. If and only if one of this 8 is deep water (sea), the square analysed becomes the same terrain than the center recorded square. The "recording / analyse / drawing" runs by west to east square, line by line, and from north to south. You can use it any time you want on the map.

Code:
-- Tool - Morphing Grow All.lua
-- Cartographer Filter
-- By Alain

terrain = {}

for y = 11, 244 do
   for x = 11, 244 do
      terrain[y * 234 + x] = getpoint(x, y)
   end
end

for y = 11, 244 do
   for x = 11, 244 do
      ter = terrain[y * 234 + x]
      if ter ~= 16 then
         if getpoint(x - 1, y - 1) == 16 then setpoint(x - 1, y - 1, ter) end
         if getpoint(x - 1, y) == 16 then setpoint(x - 1, y, ter) end
         if getpoint(x - 1, y + 1) == 16 then setpoint(x - 1, y + 1, ter) end
         if getpoint(x, y - 1) == 16 then setpoint(x, y - 1, ter) end
         if getpoint(x, y + 1) == 16 then setpoint(x, y + 1, ter) end
         if getpoint(x + 1, y - 1) == 16 then setpoint(x + 1, y - 1, ter) end
         if getpoint(x + 1, y) == 16 then setpoint(x + 1, y, ter) end
         if getpoint(x + 1, y + 1) == 16 then setpoint(x + 1, y + 1, ter) end
       end
   end
end
Back to top
View user's profile Send private message
Alain



Joined: 05 Oct 2004
Posts: 455

PostPosted: Sat May 13, 2006 3:40 am    Post subject: Reply with quote

New filter to make random background or "hexagonal maze" : each terrain shape is in contact with 6 other terrain shapes. Then you can modify and keep any part you want, make it symmetric or not and build maps from that...

Code:
-- Background - Hexa Maze.lua
-- Cartographer Filter
-- By Alain

for y = 12, 240, 6 do
   for x = 15, 239, 4 do
      ter = math.random(1, 10)
      if ter == 10 then ter = 16 end
      line(x, y, x+1, y, ter)
      line(x-1, y+1, x+2, y+1, ter)
      line(x-1, y+2, x+2, y+2, ter)
      line(x, y+3, x+1, y+3, ter)
   end
end

for y = 15, 237, 6 do
   for x = 13, 241, 4 do
      ter = math.random(1, 10)
      if ter == 10 then ter = 16 end
      line(x, y, x+1, y, ter)
      line(x-1, y+1, x+2, y+1, ter)
      line(x-1, y+2, x+2, y+2, ter)
      line(x, y+3, x+1, y+3, ter)
   end
end


Note : I post these filters to give some examples of what we can do with Cartographer. You can use them like they are, but you can modify them with your own values and add your own scripts to do specific drawings...

If some of you write some interesting scripts, post them here please Very Happy
Back to top
View user's profile Send private message
Alain



Joined: 05 Oct 2004
Posts: 455

PostPosted: Mon Jun 05, 2006 4:47 am    Post subject: Reply with quote

New filter that I'm using to create zet_Land : Tool - Copy With Rotation From North-West Quad. It is very quicker and simpler than using BoloReich !!!

Code:
-- Tool - Copy With Rotation From North-West Quad.lua
-- Cartographer Filter
-- By Alain

for y = 0, 127 do
   for x = 0, 127 do
      setpoint(255 - y, x, getpoint(x, y))
      setpoint(255 - x, 255 - y, getpoint(x, y))
      setpoint(y, 255 - x, getpoint(x, y))
   end
end


And to have the limits of the North-West quad :

Code:
-- Tool - North-West Quad Limits.lua
-- Cartographer Filter
-- By Alain

line(128, 0, 128, 128, 4)
line(0, 128, 128, 128, 4)


Draw IN this quad and to copy it in other quads with a 90° rotation, use the "Copy With Rotation From North-West Quad" tool. Cool
Back to top
View user's profile Send private message
Alain



Joined: 05 Oct 2004
Posts: 455

PostPosted: Fri Jul 14, 2006 6:21 pm    Post subject: Reply with quote

Just ask me if any1 want a ".rar" file of all the filters I posted here Smile

Last edited by Alain on Thu Jul 20, 2006 6:39 pm; edited 1 time in total
Back to top
View user's profile Send private message
Alain



Joined: 05 Oct 2004
Posts: 455

PostPosted: Thu Jul 20, 2006 6:33 pm    Post subject: Reply with quote

4 new filters of diagonal symmetry (from every corner !). These filters ignore the diagonal axis which is already symmetric to itself. You can draw only a quad between 2 diagonal axis and a complete border, including diagonal axis, and copy/symmetry it to all the map with 2 mouse-clics only !

Code:
-- Tool - Symmetry 5 Diagonal SW-NE.lua
-- Cartographer Filter
-- By Alain

for y = 1, 255 do
   for x = 0, y-1 do
      setpoint(y, x, getpoint(x, y))
   end
end


Code:
-- Tool - Symmetry 6 Diagonal NE-SW.lua
-- Cartographer Filter
-- By Alain

for y = 0, 254 do
   for x = y+1, 255 do
      setpoint(y, x, getpoint(x, y))
   end
end


Code:
-- Tool - Symmetry 7 Diagonal NW-SE.lua
-- Cartographer Filter
-- By Alain

for y = 0, 254 do
   for x = 0, 254-y do
      setpoint(255-y, 255-x, getpoint(x, y))
   end
end


Code:
-- Tool - Symmetry 8 Diagonal SE-NW.lua
-- Cartographer Filter
-- By Alain

for y = 1, 255 do
   for x = 256-y, 255 do
      setpoint(255-y, 255-x, getpoint(x, y))
   end
end


Bonus one : build perfect random stars with this one (or custom stars if you change the random values to your own : branch_nb, dim_int, dim_ext. Don’t change anything else !). It’s better to start using it on a new map. It automatically draws a “quad” of star and copy/symmetry it on the other quads to make it perfectly symmetric around the 127,127 point. (I can’t fix it perfectly symmetric by mathematic drawing only… Limits of LUA code ???) The random is not so “random”, then if a star is not nice, use the “UNDO” button and use the filter again… Then you can cumulate some stars and fill the spaces made into the branchs with diferent terrains types and symmetry : nice maps in view ! Try it now !!!

Code:
-- Shape - Random Star.lua
-- Cartographer Filter
-- By Alain

branch_nb = math.random(2, 8) * 2
dim_max = 25
dim_int = math.random(1, dim_max)
dim_ext = math.random(dim_int, dim_max * 2)

for a = 0, branch_nb / 4 do

   x1 = 127 - math.sin(math.pi * 2 / branch_nb * a) * dim_ext
   y1 = 127 - math.cos(math.pi * 2 / branch_nb * a) * dim_ext
   x2 = 127 - math.sin(math.pi * 2 / branch_nb * (a + 0.5)) * dim_int
   y2 = 127 - math.cos(math.pi * 2 / branch_nb * (a + 0.5)) * dim_int
   x3 = 127 - math.sin(math.pi * 2 / branch_nb * (a + 1)) * dim_ext
   y3 = 127 - math.cos(math.pi * 2 / branch_nb * (a + 1)) * dim_ext

   line(x1, y1, x2, y2, 4)
   line(x2, y2, x3, y3, 4)

end

for y = 0, 255 do
   for x = 0, 126 do
      setpoint(254-x, y, getpoint(x, y))
   end
end

for y = 0, 126 do
   for x = 0, 255 do
      setpoint(x, 254-y, getpoint(x, y))
   end
end


Smile Just ask me by email to get all my filters in a ".rar" file in return Smile
Back to top
View user's profile Send private message
Nova



Joined: 04 Jul 2003
Posts: 1774

PostPosted: Thu Jul 20, 2006 8:19 pm    Post subject: Reply with quote

Alain, you're awesome. That helps so much.

By the way, if you hang on the Cntrl+F key after you've selected "random star," you get some interesting results. Especially if you change the terrain each time.
Back to top
View user's profile Send private message AIM Address
Display posts from previous:   
Post new topic   Reply to topic    Winbolo.net Forum Index -> Maps All times are GMT - 5 Hours
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
 
 
 
Winbolo.net Copyright ©2003 John Morrison