.com.unity Forums
  The Official e-Store of Shrapnel Games

This Month's Specials

Raging Tiger- Save $9.00
winSPMBT: Main Battle Tank- Save $5.00

   







Go Back   .com.unity Forums > Illwinter Game Design > Dominions 3: The Awakening > Scenarios, Maps and Mods

Reply
 
Thread Tools Display Modes
  #1  
Old March 18th, 2007, 04:59 PM

Kaljamaha Kaljamaha is offline
Private
 
Join Date: Nov 2003
Location: Helsinki, Finland
Posts: 44
Thanks: 0
Thanked 1 Time in 1 Post
Kaljamaha is on a distinguished road
Default Re: tool request (terrain math)

I see the problem is already fixed, but here goes anyway...

I whipped up a small Perl script for this, I thought it would make a fun exercise (I haven't done Perl for some time). It became a lot bigger than I originally thought because I added some functionality to it. I wrote it in windows, so if you want to use it in Unix open it with nano or pico or something to change the line endings.

Just run the thing, it'll tell you what to do. I even tested the thing, so it shouldn't contain too many bugs.


K.
Attached Files
File Type: zip 505341-NoStart.zip (1.1 KB, 248 views)
__________________
Mental health is an extremely serious issue, which, if not detected and treated early on, will drive you mad.
Reply With Quote
  #2  
Old April 15th, 2007, 01:17 PM
Gandalf Parker's Avatar

Gandalf Parker Gandalf Parker is offline
Shrapnel Fanatic
 
Join Date: Oct 2003
Location: Vacaville, CA, USA
Posts: 13,736
Thanks: 341
Thanked 479 Times in 326 Posts
Gandalf Parker is on a distinguished road
Default Re: tool request (terrain math)

I love both the Awk and the Perl versions of this. And reading them I SHOULD be able to figure out my next request but I wasnt able to. (I HATE bitmath)

The problem is that the nostarts are hidden in the terrain bits now. If I generate a map for a 10 player game, then everyone joins, then it tries to generate the game. Only after everyone has joined will it blow up because there is no way to fit that many players on the map.

Can someone whip me out a simple script (yabasic, bash, awk, sed, perl) which will tell me how many nostarts I have. All it has to do is count them so I know how many players to limit the game to.

Gandalf Parker
__________________
-- DISCLAIMER:
This game is NOT suitable for students, interns, apprentices, or anyone else who is expected to pass tests on a regular basis. Do not think about strategies while operating heavy machinery. Before beginning this game make arrangements for someone to check on you daily. If you find that your game has continued for more than 36 hours straight then you should consult a physician immediately (Do NOT show him the game!)
Reply With Quote
  #3  
Old April 15th, 2007, 03:43 PM
DrPraetorious's Avatar

DrPraetorious DrPraetorious is offline
Major General
 
Join Date: Feb 2005
Location: Lake of Hali, Aldebaran, OH
Posts: 2,474
Thanks: 51
Thanked 67 Times in 27 Posts
DrPraetorious is on a distinguished road
Default Re: tool request (terrain math)

Change "mask" to the actual bitmask you want.

Code:

awk '/#terrain/ && (and($3,mask)==mask){print; i++;} END{print i " start locations";}' map.mp



I'm at my folks place so I can't check to see if it works.
__________________
If you read his speech at Rice, all his arguments for going to the moon work equally well as arguments for blowing up the moon, sending cloned dinosaurs into space, or constructing a towering *****-shaped obelisk on Mars. --Randall Munroe
Reply With Quote
  #4  
Old April 15th, 2007, 04:52 PM
Gandalf Parker's Avatar

Gandalf Parker Gandalf Parker is offline
Shrapnel Fanatic
 
Join Date: Oct 2003
Location: Vacaville, CA, USA
Posts: 13,736
Thanks: 341
Thanked 479 Times in 326 Posts
Gandalf Parker is on a distinguished road
Default Re: tool request (terrain math)

It works great. Thanks again.
__________________
-- DISCLAIMER:
This game is NOT suitable for students, interns, apprentices, or anyone else who is expected to pass tests on a regular basis. Do not think about strategies while operating heavy machinery. Before beginning this game make arrangements for someone to check on you daily. If you find that your game has continued for more than 36 hours straight then you should consult a physician immediately (Do NOT show him the game!)
Reply With Quote
  #5  
Old May 1st, 2007, 03:40 PM
Gandalf Parker's Avatar

Gandalf Parker Gandalf Parker is offline
Shrapnel Fanatic
 
Join Date: Oct 2003
Location: Vacaville, CA, USA
Posts: 13,736
Thanks: 341
Thanked 479 Times in 326 Posts
Gandalf Parker is on a distinguished road
Default Re: tool request (terrain math)

OK I thought we had this but so far I found a perl script that doesnt seem to work for me, and an online one that I cant use in lynx.

I want to package up some of the wrapped maps from PH's map generator but I notice that it has no nostarts. Can I get something (basic, awk, sed, whatever) that will nostart any province with fewer than 4 neighbors?
__________________
-- DISCLAIMER:
This game is NOT suitable for students, interns, apprentices, or anyone else who is expected to pass tests on a regular basis. Do not think about strategies while operating heavy machinery. Before beginning this game make arrangements for someone to check on you daily. If you find that your game has continued for more than 36 hours straight then you should consult a physician immediately (Do NOT show him the game!)
Reply With Quote
  #6  
Old May 1st, 2007, 03:48 PM
DrPraetorious's Avatar

DrPraetorious DrPraetorious is offline
Major General
 
Join Date: Feb 2005
Location: Lake of Hali, Aldebaran, OH
Posts: 2,474
Thanks: 51
Thanked 67 Times in 27 Posts
DrPraetorious is on a distinguished road
Default Re: tool request (terrain math)

I have a script that does that at home, I'll attach it when I get back from work.

Do you want to require anything of the four neighbours - like, they all have to be the same land/sea, or don't count wastelands, anything like that?
__________________
If you read his speech at Rice, all his arguments for going to the moon work equally well as arguments for blowing up the moon, sending cloned dinosaurs into space, or constructing a towering *****-shaped obelisk on Mars. --Randall Munroe
Reply With Quote
  #7  
Old May 1st, 2007, 04:28 PM
Gandalf Parker's Avatar

Gandalf Parker Gandalf Parker is offline
Shrapnel Fanatic
 
Join Date: Oct 2003
Location: Vacaville, CA, USA
Posts: 13,736
Thanks: 341
Thanked 479 Times in 326 Posts
Gandalf Parker is on a distinguished road
Default Re: tool request (terrain math)

I would like them to be the same land/sea.
Thanks for asking.

edited: come to think of it. If its not too much bother Id rather nostart anyplace that would get stuck with neighbors of all the same bonuses.
water: 3 or more water neighbors.
land: 4 or more land neighbors. None of them water. And not all the same terrain (in other words refuse a mountain terrain surrounded by mountains or a swamp terrain surrounded by swamps

Id like the water to be 4 or more water and no land neighbors but so far Im having trouble getting PHs mapgen to make oceans
__________________
-- DISCLAIMER:
This game is NOT suitable for students, interns, apprentices, or anyone else who is expected to pass tests on a regular basis. Do not think about strategies while operating heavy machinery. Before beginning this game make arrangements for someone to check on you daily. If you find that your game has continued for more than 36 hours straight then you should consult a physician immediately (Do NOT show him the game!)
Reply With Quote
  #8  
Old May 1st, 2007, 04:54 PM
lch's Avatar

lch lch is offline
General
 
Join Date: Feb 2007
Location: R'lyeh
Posts: 3,861
Thanks: 144
Thanked 403 Times in 176 Posts
lch is on a distinguished road
Default Re: tool request (terrain math)

Quote:
Gandalf Parker said: I want to package up some of the wrapped maps from PH's map generator but I notice that it has no nostarts. Can I get something (basic, awk, sed, whatever) that will nostart any province with fewer than 4 neighbors?
There are dozens of scripts for this...

DireAussie has a web page which does this, Jack has that aswell and with source code available, too. There's a Python script in the Urrapand map which does this, although it would have to be changed a little so that the map file name becomes a parameter instead of being hard-coded. Finally, DrP has a done a perl script for this aswell.
__________________
Come to the Dom3 Wiki and help us to build the biggest Dominions-centered knowledge base on the net.
Visit my personal user page there, too!
Pretender file password recovery
Emergency comic relief
Reply With Quote
  #9  
Old May 1st, 2007, 05:59 PM
Gandalf Parker's Avatar

Gandalf Parker Gandalf Parker is offline
Shrapnel Fanatic
 
Join Date: Oct 2003
Location: Vacaville, CA, USA
Posts: 13,736
Thanks: 341
Thanked 479 Times in 326 Posts
Gandalf Parker is on a distinguished road
Default Re: tool request (terrain math)

Great list.
I think you will see my name in the credits of most of those. But Im hoping for something that will work in linux, text mode, and can be automated as much as possible.

DireAussies doesnt seem to work in lynx (text browser)

Jacks online version is great and does work in lynx (I was surprised). I hadnt realized that he had added starting provinces. But it would need to be done manually I think. I might do it for the great big maps that I plan to offer very few of.

Jacks code seems to be windowsy.

The python code in the urrapand map does actually look to be workable. Thanks for mentioning it.

DrP's code was the first one I tried and didnt seem to get a result. Im sure its a fluke with my system.

I had understood that Ballbarian did one also but I havent found it yet.

So far it looks like Urrapand's python code is my best bet
__________________
-- DISCLAIMER:
This game is NOT suitable for students, interns, apprentices, or anyone else who is expected to pass tests on a regular basis. Do not think about strategies while operating heavy machinery. Before beginning this game make arrangements for someone to check on you daily. If you find that your game has continued for more than 36 hours straight then you should consult a physician immediately (Do NOT show him the game!)
Reply With Quote
Reply

Bookmarks


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT -4. The time now is 12:46 AM.


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