[WF-General] spawn area

Alistair Riddoch alriddoch at googlemail.com
Sat Jan 2 16:15:48 PST 2010


It looks like all that is required to make "area" compatible with the
"shape" sub property of a terrain mod is to add "type" = "polygon".
Making any other change will break the surface area mods used for
paths, fields and under trees.

The server side code for these surface mods is minimal so far, so the
main issue is client side. I tend to think the terrain mod code is a
bit messy, and nesting "type" and "points" inside "shape" is perhaps
more complex than necessary.

Al

2010/1/2 Erik Hjortsberg <erik.hjortsberg at gmail.com>:
> Hi, here's an example of a terrain mod.
>
>     <map name="terrainmod">
>       <float name="heightoffset">0</float>
>       <map name="shape">
>         <list
> name="points"><list><float>-4.73962</float><float>-18.8356</float></list>
> <list><float>-9.47893</float><float>-10.8557</float></list>
> <list><float>0.0372277</float><float>7.84728</float></list>
> <list><float>3.1825</float><float>3.45996</float></list>
> <list><float>5.86103</float><float>-5.79873</float></list>
> <list><float>1.29012</float><float>-11.3645</float></list>
> </list>
>         <string name="type">polygon</string>
>       </map>
>       <string name="type">levelmod</string>
>     </map>
>
>
> /Erik
>
> Alistair Riddoch skrev:
>
> Agreed the format needs to be common.
>
> Also agreed that the format should be flexible enough to support
> different shape types, though I am disinclined to go much out of my
> way to support formats other than Polygon in much of the code for now.
>
> Do you have Atlas examples to hand for the shape of terrain mods? I am
> frantically busy sorting my move today, and if I can get this coded
> today, I will.
>
> I will spin the release last thing tonight.
>
> 2010/1/2 Erik Hjortsberg <erik.hjortsberg at gmail.com>:
>
>
> 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?
>
>
>
> Yeah, populateEntity will become data driven, the idea being that
> initial inventory will be determined here instead of in the core
> character creation code. Will probably make some progress on this
> tonight too.
>
> Al
>



-- 
Alistair Riddoch
alriddoch at googlemail.com
http://alistairriddoch.org/


More information about the General mailing list