Page 1 of 1

Rotatable Features with Featuremap

Posted: 18 Aug 2008, 08:09
by Frostregen
When placing features it looks a bit strange if all face the same direction, so I thought it would be good, if we are able to rotate them (around the upward axis).

Idea:
If a feature is placed on a spot, there cannot be a tree or geovent.
So:
If (red > 0)
green means rotation of feature (0-255)
else
tree/geovent meaning

That would just be the mapping part though.
I have no idea about needed changed in mapconv/mapformat.
The changes required to actually rotate a feature ingame would be rather simple (one glRotate).

Useful?

Re: Rotatable Features with Featuremap

Posted: 19 Aug 2008, 18:07
by Das Bruce
Text file would win much more.

Re: Rotatable Features with Featuremap

Posted: 19 Aug 2008, 21:40
by Frostregen
Sure,
but the idea was to minimize the needed codechanges, and to keep old files compatible ;)

Re: Rotatable Features with Featuremap

Posted: 19 Aug 2008, 22:37
by SinbadEV
I'm still waiting for a new map format that reads everything from a plain-text file... it could be identical to the current map format essentially... and you would still need to make a compressed tile file for it... and it shouldn't be any bigger since text files compress really efficiently.

edit: actually I'm a genius! someone do this.

edit2: oh, and if you populate your features using LUA you could get the effect you are looking for already.

Re: Rotatable Features with Featuremap

Posted: 19 Aug 2008, 22:41
by Forboding Angel
SinbadEV wrote:I'm still waiting for a new map format that reads everything from a plain-text file... it could be identical to the current map format essentially... and you would still need to make a compressed tile file for it... and it shouldn't be any bigger since text files compress really efficiently.

edit: actually I'm a genius! someone do this.

edit2: oh, and if you populate your features using LUA you could get the effect you are looking for already.
*Clears Throat*

Worldbuilder.

/Thread

Re: Rotatable Features with Featuremap

Posted: 20 Aug 2008, 02:51
by Argh
Heh. Yes. Easy.

Re: Rotatable Features with Featuremap

Posted: 21 Aug 2008, 03:23
by Frostregen
Sounds reasonable with LUA.
So I just write an importer myself, based on textfiles, or whatever.

Now I just need a way to get this importer skript attached to the map.
*searching*

Thx so far,
Frostregen

Re: Rotatable Features with Featuremap

Posted: 21 Aug 2008, 13:37
by Kloot
Spring.SetFeatureDirection(id, x, y, z) ;)

Re: Rotatable Features with Featuremap

Posted: 21 Aug 2008, 14:04
by Frostregen
Thx, the lua stuff itself is not the problem.
I'm searching how to integrate it into the map.

There are 2 words which confuse me:
"LuaRules" and "LuaGaia".
Is this something different?

LuaRules seems to be just a "LuaRules" Folder inside the map archive,
filled with lua scripts.
For LuaGaia I have not found any further info, besides the note in the FAQ.

Re: Rotatable Features with Featuremap

Posted: 21 Aug 2008, 14:06
by imbaczek
there's as of yet unreleased WorldBuilder which does pretty much exactly what you want and probably more, I suggest you wait a little while until Argh releases it.

Re: Rotatable Features with Featuremap

Posted: 21 Aug 2008, 14:33
by Frostregen
I read about Worldbuilder, and yes, it looks similar to what I am doing.
But since this is mainly for my personal fun, I will continue anyway ;)
(Maybe it will still be somehow useful in the end)

If someone is interested: My developement log in pictures:
http://saddam.ath.cx/springedit.html

Greetings,
Frostregen

Re: Rotatable Features with Featuremap

Posted: 21 Aug 2008, 15:16
by imbaczek
hey, that's actually really neat!

Re: Rotatable Features with Featuremap

Posted: 21 Aug 2008, 16:33
by Hoi
Hey, what did you just do? make an engine? or a mapmaker? how long did you take? what language did you use?

Re: Rotatable Features with Featuremap

Posted: 21 Aug 2008, 16:38
by SinbadEV
If you are going so far as to make an editor I'd suggest investigating the map format itself and learning how to save (or even load) the spring map format as it includes the ability to place features with rotation it's just that no map converter supported this feature.

Re: Rotatable Features with Featuremap

Posted: 21 Aug 2008, 18:06
by Tobi
Cool stuff ^^

Good chance you already found it, but here is the SMF map format defined and documented.

Features do have a rotation indeed, search for 'MapFeatureStruct'.

Re: Rotatable Features with Featuremap

Posted: 22 Aug 2008, 02:10
by Frostregen
Hoi wrote:Hey, what did you just do? make an engine? or a mapmaker? how long did you take? what language did you use?
1. mapmaker
2. around 2 weeks
3. java (yes, its actually not toooo slow)
SinbadEV wrote:If you are going so far as to make an editor I'd suggest investigating the map format itself and learning how to save (or even load) the spring map format as it includes the ability to place features with rotation it's just that no map converter supported this feature.
Good to know. So no changes to the mapformat needed. :)
Tobi wrote:Cool stuff ^^
Good chance you already found it, but here is the SMF map format defined and documented.
Features do have a rotation indeed, search for 'MapFeatureStruct'.
Thx, I will look at it. Will be better anyway.
Main reason to not directly export to smf was the "tile detection", which I think is complex. (May check it again)

Re: Rotatable Features with Featuremap

Posted: 22 Aug 2008, 02:16
by imbaczek
re tiling: Don't do any, it sucks anyway, most mappers don't use it since it looks really bad. Just save tiles as a grid, maybe with checking for dupes.

Re: Rotatable Features with Featuremap

Posted: 22 Aug 2008, 02:19
by Warlord Zsinj
Wow, very cool!