[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [liquidwar-user] random map generator

From: Christian Mauduit
Subject: Re: [liquidwar-user] random map generator
Date: Mon, 10 Nov 2003 08:31:24 +0100
User-agent: Mutt/1.3.28i


On Sun, Nov 09, 2003 at 09:08:34PM -0500, Redick David A wrote:
> On Sat, Nov 08, 2003 at 11:19:49AM +0100, Christian Mauduit wrote:
> > Hi,
> > 
> > > Currently its "pre-alpha" but it can create playable maps.
> > > All be it, rather boring ones.  Just random rectangles =]
> currently it can 9 different types of maps and is getting close
> to "beta" quality.
> > Now to be honest I'd really like to include your map generator *in* the
> > game so that people can click on "random map" and get one. 
> >  
> > My idea would be to stick a button right in the middle of the "map menu"
> > that reads "Generate a random map" on it and another "Random map
> > options" button that would lead the player to another menu where one can
> > tune your generator.
> that was my idea too.. I figure a system("lwmapgen"); or something like
> that would be fine...
Well, it's not really my intention to use system("lwmapgen") and then
read the map in a temporary file. This is really a performance killer
and could be buggy if creating the temp file is a problem (some users
might be playing on a read-only file system on a CD-Rom, under a crappy
OS that does not have nice temporary file support...)

So my plan - coding has already started in fact, should be done from a
technical point of view by tomorrow, and will then need polishing, ie
translating the button and so on - is to have an interface to call your
functions in the same way your "main.c" does. I had a look on your code
and the design looked rather clean to me, so what I'd need is to call
the map generator, then not save the map but instead put it in the right
place for LW to work correctly, and that's it.

About tweaking the options of the map generator, I think in the first
place I'll only offer a "generate random map" button and that's it. This
button will itself choose a random map type and then generate it. The
point is that if someone wants "one special kind of random map" he's
better with running lwmapgen directly, it will always be more powerfull
and fexible that any ugly, clumsy and outdated UI I will design 8-) 
> > > Compile it and play with it.  Let me know what you think.
> > I haven't tried all the options yet, will try to find some time to
> > really test all of them.
> tomorrow I'll hack out a webpage and put example maps up.
> it will be
That's a good idea, I'll update the link on too.

> > BTW, you might be interested by a direct CVS access to LW source code on
> > Savannah. Contact me if you're insterested.
> I don't think I need it right now...
> If you need me to clean up the interface, just yell.
As far as I can tell, it's OK. If I was *really* lazy I would ask you to
have some function that would return a random map *without any*
parameter. That's to say a function that would pick up a method
randomly, and all the parameters for this method randomly, and return
the BITMAP as a "BITMAP *". Here would be a typical prototype for this

BITMAP *generate_random_map();

Basically this would encapsulate code like:
--------8<-------------------------------------- = create_bitmap(map.width, map.height);
clear_to_color(, 255);
rect(, 0, 0, map.width-1, map.height-1, 0);
in your current code in main.c.

Note that this function must *not* be in main.c for I cannot link your
main.c to the main LW executable.

But don't worry, I can code this myself, only if this function is in my
code, whenever your add a new method/parameter, I'll need to update my
code, wether if it's in your code I'll be able to keep on using
generate_random_map() without ever changing anything in the main

> Also the map format changing for 5.6.0, right?
> So do I need to change my output? 
Nope, your output is good, do not change it. The change in maps is only
about associating textures to maps. As long as you don't have a "texture
generator" that generates a texture which represents your map in a nicer
way than the builtin LW engine, you are not concerned 8-)

Have a nice day,


Christian Mauduit <address@hidden>     __/\__ ___
                                        \~/ ~/(`_ \   ___                   /_o _\   \ \_/ _ \_            \/      \___/ \__)

reply via email to

[Prev in Thread] Current Thread [Next in Thread]