[WF-General] spawn area

Erik Hjortsberg erik.hjortsberg at gmail.com
Sat Jan 2 08:35:31 PST 2010


I can agree that not all different kind of shapes fits all kind of 
purposes, but I still think that we would benefit from having both a 
common code and a common atlas representation of shapes.
While the code can be common for parsing the shapes, different kind of 
properties might have different kinds of shapes available. The changes 
made to Mercator with the addition of atlas parsing of shapes was made 
with such a harmonization in mind.
If the way shapes are defined for the terrain mods, there's a "shape" 
attribute which in turn has a "type" attribute describing the type of 
shape, and then different other attributes defining the shape, dependent 
on the type.
For spawn areas I would actually think that circles and rectangles would 
be more suited than polygons, since the math for generating an evenly 
spread random point within the shape probably would be simpler.
I did the code for the terrain mods; if you want I can take a stab at 
implementing this for the spawn points too.

Another question regarding the spawn points: I see that there is proof 
of concept code in SpawnEntity::populateEntity
Is the idea to let this be data driven, or to let it be implemented in a 
script hook?

/Erik

Alistair Riddoch skrev:
> 2010/1/2 Erik Hjortsberg <erik.hjortsberg at gmail.com>:
>   
>> Hi, the new spawn point feature looks really nice, but I would like to have
>> seen the area definition code harmonized with the way areas/space is defined
>> in the terrain mod property. Overall I think it would be good if area
>> defining properties were harmonized, so that all kind of areas (terrain
>> areas, terrain mods, spawn points etc.) used the same code, allowing for the
>> area to be defined as any one of the available wfmath shapes (as is the case
>> with terrain mod currently).
>>
>>     
>
> Ooops. The reason this has come out this way is that I thought this
> was the way all areas are defined. As I didn't write the terrain mod
> code, it had slipped my mind that it works differently. I kinda think
> that having mutltiple different ways of handling area shapes is overly
> complex and unnecessary. Most shapes can be defined in terms of
> polygonal areas, and the use of other wfmath shapes such as squares,
> circles etc. just serves to make the implementation harder and more
> code.
>
> In summary I think the only area shape we should support is
> WFMath::Polygon<2>, and these areas should be defined the way they
> work on the spawn areas. I think this should be generally compatible
> with what terrain mods requires, but obviously your input is vital.
>
> Al
>   
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.worldforge.org/pipermail/general/attachments/20100102/d4e78a0f/attachment.html>


More information about the General mailing list