A quick generator of M XX YY maps writen for QBASIC.EXE 

Hope you have your old Windows 98 disks handy! :) Or you can just use the
PowerBASIC lite demo with a little bit of modifications.
Just copy everything from inbetween the start and snip lines. Anyone tried
Photoshop or Paintshop Pro filters? I know this is basically a floating
point bitmap stored as a series of values. The current settings generate a
16 KB text file that you can copy and paste into your World parameters.

RANDOMIZE
size = 40
PRINT "M"; STR$(size); STR$(size); " ";
X = RND * 5 + 2.5
DIM Y(size, size)
DIM Z(size, size)
FOR i = 1 TO size
FOR j = 1 TO size
Y(i - 1, j - 1) = X + RND * 5 - RND * 5
NEXT j, i

REM Adds some extreme points.
i = RND * size
j = RND * size
Y(i, j) = 9
i = RND * size
j = RND * size
Y(i, j) = 9
i = RND * size
j = RND * size
Y(i, j) = -1
i = RND * size
j = RND * size
Y(i, j) = -1

REM Copy to buffer. C does this very easily, hehe. Redundant for now...
FOR i = 0 TO size - 1: FOR j = 0 TO size - 1: Z(i, j) = Y(i, j): NEXT j, i

REM Average out nearby points.
FOR i = 2 TO size - 2: FOR j = 2 TO size - 2
Y(i, j) = Z(i - 1, j - 1) + Z(i, j - 1) + Z(i + 1, j - 1) + Z(i - 1, j)
Y(i, j) = Z(i, j) + Z(i + 1, j) + Z(i - 1, j + 1) + Z(i, j + 1)
Y(i, j) = (Z(i, j) + 3 * Z(i, j) + Z(i + 1, j + 1)) / 6 - 6
NEXT j, i

REM Copy to buffer for 2nd smoothing.
FOR i = 0 TO size - 1: FOR j = 0 TO size - 1: Z(i, j) = Y(i, j): NEXT j, i

REM Average out nearby points.
FOR i = 2 TO size - 2: FOR j = 2 TO size - 2
Y(i, j) = Z(i - 1, j - 1) + Z(i, j - 1) + Z(i + 1, j - 1) + Z(i - 1, j)
Y(i, j) = Z(i, j) + Z(i + 1, j) + Z(i - 1, j + 1) + Z(i, j + 1)
Y(i, j) = (Z(i, j) + 3 * Z(i, j) + Z(i + 1, j + 1)) / 6 - 6
NEXT j, i

REM Makes sure the points wrap around perfectly. Left and right edges.
j = size - 1: FOR i = 1 TO size - 2
Z(i, j) = (Z(i, 0) + Z(0, j)) / 2: Z(i, j) = Z(i, 1)
NEXT i

REM Top and bottem edges.
i = size - 1: FOR j = 1 TO size - 2
Z(i, j) = (Z(i, j) + Z(0, j)) / 2: Z(0, j) = Z(i, j)
NEXT j

REM Fixes corners.
Z(0, 0) = (Z(0, 0) + Z(0, size - 1) + Z(size - 1, 0) + Z(size - 1, size -
1)) / 4
Z(0, size - 1) = Z(0, 0): Z(size - 1, 0) = Z(0, 0): Z(size - 1, size - 1) =
Z(0, 0)

REM Show results on screen.
FOR i = 1 TO size: FOR j = 1 TO size: PRINT Z(i - 1, j - 1); : NEXT j, i

REM Save results to file for use in FramSticks as a size-by-size terrain
map.
OPEN "fs_rnd.txt" FOR OUTPUT AS #1
PRINT #1, "M"; STR$(size); STR$(size); " ";
FOR i = 1 TO size: FOR j = 1 TO size: PRINT #1, Z(i - 1, j - 1); : NEXT j, i

Forums: 
Maciej Komosinski's picture

> Hope you have your old Windows 98 disks handy! :) Or you can just use the
> PowerBASIC lite demo with a little bit of modifications.
> Just copy everything from inbetween the start and snip lines. Anyone tried
> Photoshop or Paintshop Pro filters? I know this is basically a floating
> point bitmap stored as a series of values. The current settings generate a
> 16 KB text file that you can copy and paste into your World parameters.

Looks like this might be a nice exercise to do it as a FramScript
macro, and set directly the world map field. See the race.show script,
it also generates a terrain "on demand" based on some parameters like
length, difficulty, and number of tracks.

MacKo

Sorry I haven't checked this in a while - been busy with 5 classes in
college!
Yes, once it has been written in one language, it should be possible and
likely easy to remake it in another since the essence of the algorythm is
just manipulation of a bitmap array.

"Maciej Komosinski"
wrote in message news:dpevpb$8jt$1@cancer.cs.put.poznan.pl...
> > Hope you have your old Windows 98 disks handy! :) Or you can just use
the
> > PowerBASIC lite demo with a little bit of modifications.
> > Just copy everything from inbetween the start and snip lines. Anyone
tried
> > Photoshop or Paintshop Pro filters? I know this is basically a floating
> > point bitmap stored as a series of values. The current settings
generate a
> > 16 KB text file that you can copy and paste into your World parameters.
>
> Looks like this might be a nice exercise to do it as a FramScript
> macro, and set directly the world map field. See the race.show script,
> it also generates a terrain "on demand" based on some parameters like
> length, difficulty, and number of tracks.
>
>
> MacKo

I can make this into a Windows .exe that you can copy and paste the output
from, if anyone is interested. It'll be targeted for XP, but should run on
any version from 98 up.

"Joe Whitehead" wrote in message
news:dd5hjg$f7$1@cancer.cs.put.poznan.pl...
> Hope you have your old Windows 98 disks handy! :) Or you can just use the
> PowerBASIC lite demo with a little bit of modifications.
> Just copy everything from inbetween the start and snip lines. Anyone
tried
> Photoshop or Paintshop Pro filters? I know this is basically a floating
> point bitmap stored as a series of values. The current settings generate
a
> 16 KB text file that you can copy and paste into your World parameters.
>
>
> RANDOMIZE
> size = 40
> PRINT "M"; STR$(size); STR$(size); " ";
> X = RND * 5 + 2.5
> DIM Y(size, size)
> DIM Z(size, size)
> FOR i = 1 TO size
> FOR j = 1 TO size
> Y(i - 1, j - 1) = X + RND * 5 - RND * 5
> NEXT j, i
>
>
> REM Adds some extreme points.
> i = RND * size
> j = RND * size
> Y(i, j) = 9
> i = RND * size
> j = RND * size
> Y(i, j) = 9
> i = RND * size
> j = RND * size
> Y(i, j) = -1
> i = RND * size
> j = RND * size
> Y(i, j) = -1
>
> REM Copy to buffer. C does this very easily, hehe. Redundant for now...
> FOR i = 0 TO size - 1: FOR j = 0 TO size - 1: Z(i, j) = Y(i, j): NEXT j, i
>
> REM Average out nearby points.
> FOR i = 2 TO size - 2: FOR j = 2 TO size - 2
> Y(i, j) = Z(i - 1, j - 1) + Z(i, j - 1) + Z(i + 1, j - 1) + Z(i - 1, j)
> Y(i, j) = Z(i, j) + Z(i + 1, j) + Z(i - 1, j + 1) + Z(i, j + 1)
> Y(i, j) = (Z(i, j) + 3 * Z(i, j) + Z(i + 1, j + 1)) / 6 - 6
> NEXT j, i
>
> REM Copy to buffer for 2nd smoothing.
> FOR i = 0 TO size - 1: FOR j = 0 TO size - 1: Z(i, j) = Y(i, j): NEXT j, i
>
> REM Average out nearby points.
> FOR i = 2 TO size - 2: FOR j = 2 TO size - 2
> Y(i, j) = Z(i - 1, j - 1) + Z(i, j - 1) + Z(i + 1, j - 1) + Z(i - 1, j)
> Y(i, j) = Z(i, j) + Z(i + 1, j) + Z(i - 1, j + 1) + Z(i, j + 1)
> Y(i, j) = (Z(i, j) + 3 * Z(i, j) + Z(i + 1, j + 1)) / 6 - 6
> NEXT j, i
>
> REM Makes sure the points wrap around perfectly. Left and right edges.
> j = size - 1: FOR i = 1 TO size - 2
> Z(i, j) = (Z(i, 0) + Z(0, j)) / 2: Z(i, j) = Z(i, 1)
> NEXT i
>
> REM Top and bottem edges.
> i = size - 1: FOR j = 1 TO size - 2
> Z(i, j) = (Z(i, j) + Z(0, j)) / 2: Z(0, j) = Z(i, j)
> NEXT j
>
> REM Fixes corners.
> Z(0, 0) = (Z(0, 0) + Z(0, size - 1) + Z(size - 1, 0) + Z(size - 1, size -
> 1)) / 4
> Z(0, size - 1) = Z(0, 0): Z(size - 1, 0) = Z(0, 0): Z(size - 1, size - 1)
=
> Z(0, 0)
>
>
> REM Show results on screen.
> FOR i = 1 TO size: FOR j = 1 TO size: PRINT Z(i - 1, j - 1); : NEXT j, i
>
> REM Save results to file for use in FramSticks as a size-by-size terrain
> map.
> OPEN "fs_rnd.txt" FOR OUTPUT AS #1
> PRINT #1, "M"; STR$(size); STR$(size); " ";
> FOR i = 1 TO size: FOR j = 1 TO size: PRINT #1, Z(i - 1, j - 1); : NEXT j,
i
>
>
>
>

LOL So can I but it runs in <2 seconds interpeted. If you want to then go
ahead and post a link. It's totally free code so do what you want with it
except plagorism. Burn effigies of it if you want. :P

If you're looking for commercial applications that support many features in
a neatly compiled installer, then there's plenty online. Just search for
"terrain generators" or "height maps" or just plain "UnRealEd" in
Google/etc. Converting a BMP into a list of values is very easy and usually
supported as an export format in the better programs.

"Michael B." wrote in message
news:dp38g3$pdp$1@cancer.cs.put.poznan.pl...
> I can make this into a Windows .exe that you can copy and paste the output
> from, if anyone is interested. It'll be targeted for XP, but should run
on
> any version from 98 up.
>
> "Joe Whitehead" wrote in message
> news:dd5hjg$f7$1@cancer.cs.put.poznan.pl...
> > Hope you have your old Windows 98 disks handy! :) Or you can just use
the
> > PowerBASIC lite demo with a little bit of modifications.
> > Just copy everything from inbetween the start and snip lines. Anyone
> tried
> > Photoshop or Paintshop Pro filters? I know this is basically a floating
> > point bitmap stored as a series of values. The current settings
generate
> a
> > 16 KB text file that you can copy and paste into your World parameters.
> >
> >
> > RANDOMIZE
> > size = 40
> > PRINT "M"; STR$(size); STR$(size); " ";
> > X = RND * 5 + 2.5
> > DIM Y(size, size)
> > DIM Z(size, size)
> > FOR i = 1 TO size
> > FOR j = 1 TO size
> > Y(i - 1, j - 1) = X + RND * 5 - RND * 5
> > NEXT j, i
> >
> >
> > REM Adds some extreme points.
> > i = RND * size
> > j = RND * size
> > Y(i, j) = 9
> > i = RND * size
> > j = RND * size
> > Y(i, j) = 9
> > i = RND * size
> > j = RND * size
> > Y(i, j) = -1
> > i = RND * size
> > j = RND * size
> > Y(i, j) = -1
> >
> > REM Copy to buffer. C does this very easily, hehe. Redundant for
now...
> > FOR i = 0 TO size - 1: FOR j = 0 TO size - 1: Z(i, j) = Y(i, j): NEXT j,
i
> >
> > REM Average out nearby points.
> > FOR i = 2 TO size - 2: FOR j = 2 TO size - 2
> > Y(i, j) = Z(i - 1, j - 1) + Z(i, j - 1) + Z(i + 1, j - 1) + Z(i - 1, j)
> > Y(i, j) = Z(i, j) + Z(i + 1, j) + Z(i - 1, j + 1) + Z(i, j + 1)
> > Y(i, j) = (Z(i, j) + 3 * Z(i, j) + Z(i + 1, j + 1)) / 6 - 6
> > NEXT j, i
> >
> > REM Copy to buffer for 2nd smoothing.
> > FOR i = 0 TO size - 1: FOR j = 0 TO size - 1: Z(i, j) = Y(i, j): NEXT j,
i
> >
> > REM Average out nearby points.
> > FOR i = 2 TO size - 2: FOR j = 2 TO size - 2
> > Y(i, j) = Z(i - 1, j - 1) + Z(i, j - 1) + Z(i + 1, j - 1) + Z(i - 1, j)
> > Y(i, j) = Z(i, j) + Z(i + 1, j) + Z(i - 1, j + 1) + Z(i, j + 1)
> > Y(i, j) = (Z(i, j) + 3 * Z(i, j) + Z(i + 1, j + 1)) / 6 - 6
> > NEXT j, i
> >
> > REM Makes sure the points wrap around perfectly. Left and right edges.
> > j = size - 1: FOR i = 1 TO size - 2
> > Z(i, j) = (Z(i, 0) + Z(0, j)) / 2: Z(i, j) = Z(i, 1)
> > NEXT i
> >
> > REM Top and bottem edges.
> > i = size - 1: FOR j = 1 TO size - 2
> > Z(i, j) = (Z(i, j) + Z(0, j)) / 2: Z(0, j) = Z(i, j)
> > NEXT j
> >
> > REM Fixes corners.
> > Z(0, 0) = (Z(0, 0) + Z(0, size - 1) + Z(size - 1, 0) + Z(size - 1,
size -
> > 1)) / 4
> > Z(0, size - 1) = Z(0, 0): Z(size - 1, 0) = Z(0, 0): Z(size - 1, size -
1)
> =
> > Z(0, 0)
> >
> >
> > REM Show results on screen.
> > FOR i = 1 TO size: FOR j = 1 TO size: PRINT Z(i - 1, j - 1); : NEXT j, i
> >
> > REM Save results to file for use in FramSticks as a size-by-size terrain
> > map.
> > OPEN "fs_rnd.txt" FOR OUTPUT AS #1
> > PRINT #1, "M"; STR$(size); STR$(size); " ";
> > FOR i = 1 TO size: FOR j = 1 TO size: PRINT #1, Z(i - 1, j - 1); : NEXT
j,
> i
> >
> >
> >
> >
>
>
>