liquidwar-user
[Top][All Lists]
Advanced

[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: Tue, 11 Nov 2003 19:57:59 +0100
User-agent: Mutt/1.3.28i

On Mon, Nov 10, 2003 at 08:31:24AM +0100, Christian Mauduit wrote:
> > that was my idea too.. I figure a system("lwmapgen"); or something like
> > that would be fine...
[me saying system("lwmapgen") is not the road to follow]

Well, in fact, linking your code with Liquid War caused too much
trouble. I got segfaults because sometimes the % operator was called
with 0 as its right member (mostly when generating small maps with
numerous columns and great paddings) and basically it's not yet stable
enough to be included this way.

So I choose the "run it as a separate executable" option and it works
fine. I also edited your main.c to solve your "black maps" problem, look
at the comments in it it's pretty self explanatory I thinlk.

Everything's commited in CVS on Savannah.

> BITMAP *generate_random_map();
> 
> Basically this would encapsulate code like:
> --------8<--------------------------------------
> map.map = create_bitmap(map.width, map.height);
> clear_to_color(map.map, 255);
> rect(map.map, 0, 0, map.width-1, map.height-1, 0);
> (*map.method)();
> --------8<--------------------------------------
> in your current code in main.c.
Forget about all this.

The only thing is that command line options should stay consistent
enough so that LW does not have to be too clever to invent them.

Alternatively, having all the parameters chosen randomly but the size
(you already do it for the method) might not be a bad idea. 

This way LW would call "liquidwar-mapgen --width 400 --height 300"
and not bother about any option, getting a totally random result.

Note that this could be convenient for real human users too.
 
Have a nice day,

Christian.

-- 
Christian Mauduit <address@hidden>     __/\__ ___
                                        \~/ ~/(`_ \   ___
http://www.ufoot.org/                   /_o _\   \ \_/ _ \_
http://www.ufoot.org/gnupg.pub            \/      \___/ \__)




reply via email to

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