Freedom Reborn

Freedom Force Forums => Mods => Topic started by: GogglesPizanno on March 29, 2009, 11:19:11 PM

Title: Map Creation Utility-ish
Post by: GogglesPizanno on March 29, 2009, 11:19:11 PM
So I had me a wacky idea a couple of weeks ago while playing a rogue game. People always complain about the robot factory map getting stale and needing new layouts. So I got to thinking how difficult could it be to try building maps lego style out of simple square pieces. After toying around with nifskope and dat files and other less than satisfying (i.e. breaking the game) methods, I went simple. Basically I am working on a collection of blocks, these blocks are just objects that get copied into the art assets of the game and corresponding template entries. Then (and this was the wacky part) you can use a web based map editor to create your map, export the level layout and then import into FFEdit. Instant interior map (more or less)... Its still early on and suffers from the "blocky looking" syndrome. That and I only have rock walls completed, but these screen shots give a basic idea of how it turns out.

Spoiler
The Web based grid editor:

(http://gpwarehouse.freedomforceforever.com/web_interface.jpg)

The Imported Map (from layout file):

(http://gpwarehouse.freedomforceforever.com/map_over.jpg)
Title: Re: Map Creation Utility-ish
Post by: catwhowalksbyhimself on March 30, 2009, 12:19:28 AM
Intriguing idea!  Very useful for people wanting interior maps.
Title: Re: Map Creation Utility-ish
Post by: detourne_me on March 30, 2009, 12:31:09 AM
Wow!  sweet ideas!
Have you looked at ow_tiobe's textured tiles?  they may be useful to you as well.
I know they were part of the mod goodies on his site.
Title: Re: Map Creation Utility-ish
Post by: stumpy on March 30, 2009, 01:59:12 AM
Holy Dungeons And Dragons, Batman!

With a collection of "geometry" blocks (maybe with some triangular pieces and quarter rounds (http://home.graffiti.net/stumpyanker:graffiti.net/images/MapBlocks.gif) to smooth things out) and different textures, people creating missions will be able to create a custom map to order in, well, short order. It may never be quite get to the level of a custom meshed map, but this is a godsend for people wanting to do underground adventures, freeroam mods with junctions that lead inside of buildings, new bases, etc.

This is excellent, GP! That looks really good. :thumbup:

BTW, I wonder if maybe making the blocks a little taller would allow for Giants and fliers to be on the map without looking like they are "over" it?
Title: Re: Map Creation Utility-ish
Post by: GogglesPizanno on March 30, 2009, 02:17:19 AM
Quote from: stumpy on March 30, 2009, 01:59:12 AM
BTW, I wonder if maybe making the blocks a little taller would allow for Giants and fliers to be on the map without looking like they are "over" it?
Yeah, I was flip flopping on that. There reaches a point where the height starts giving the impression of being really cramped so I was trying to balance asthetic vs. realistic. Its still not quite there...
Title: Re: Map Creation Utility-ish
Post by: cmdrkoenig67 on March 30, 2009, 03:08:23 AM
Whoo-Hooooo!  Go Goggles!
Title: Re: Map Creation Utility-ish
Post by: GogglesPizanno on March 30, 2009, 03:29:58 AM
One stumbling block that I have worked around but cant seem to find an answer to is rotation values in the level layout file. In FFedit, it uses degrees. The game engine uses radians. If you use python to get/set the rotation tuple for an object, it returns values in radians (i.e. 90 degrees = 1.57xxxxx). However it appears that the level layout values it needs are in some kind of who knows what values that I can't correspond to anything.

What does this mean?
It means that instead of having 5 blocks and being able to "spin" those that have the same number of facing sides to create all possible combinations, I have to use 15 blocks with no rotation on any of them. Its easy enough to do this in nifskope, but it would be nice if it was more automatic. So if anyone can decipher what the numeric rotation values are in a level layout file, you win a no-prize from me.
Title: Re: Map Creation Utility-ish
Post by: stumpy on March 30, 2009, 03:52:28 AM
The rotations are expressed as quaternions, which I haven't seen since grad school. They weren't what I expected either, since the angles are more intuitive, but quaternions aren't all that complicated. This Wikipedia article (http://en.wikipedia.org/wiki/Quaternions_and_spatial_rotation) will tell you all you need to really know about converting an angle into a quaternion set (the example (http://en.wikipedia.org/wiki/Quaternions_and_spatial_rotation#Example) is the most useful part). Use the level.txt quaternions in comparison with the angles in FFEdit as examples to check your work and it's pretty smooth sailing.
Title: Re: Map Creation Utility-ish
Post by: Gremlin on March 30, 2009, 04:37:57 AM
This is awesome. Is there any way to adjust the height? Maybe just by units of blocks? You could default to one or two rows, and any maps that needed to be higher you could adjust when you generate the layout. That way you're only as high as the specific map needs
Title: Re: Map Creation Utility-ish
Post by: Volsung on March 30, 2009, 08:18:04 AM
shpadoinkle!
Title: Re: Map Creation Utility-ish
Post by: bearded on March 30, 2009, 08:58:27 AM
is there a way to go totally rogue and make random maps?
by the way, i was playing around with a similiar technique (totally based on your technique), and for some reason all the characters ingame when i started the level ended up 'floating' above the walls.  directly on the top level of the walls, and nothing dropped into the trenches.  i've still got that level if anyone wants to see it.  i'm wondering if it could be used for a flying level by taking out all the walls.  or something.
if you could set up random maps, and wandering monsters, well...that would be groovy.
Title: Re: Map Creation Utility-ish
Post by: Boalt92 on March 30, 2009, 12:24:54 PM
Great idea GP.  Was looking at Tommyboy's mega maps and had a similar thought.

In addition to walls, how about terrain features/geography?  For example, a plateau with one or two ramps could allow you to "create" both elevated plains and valleys.  You could also "create" a lake or beach using the same theory.

These would be attached directly to the terrain, and could be added hidden/copied/pasted via nifskope

In the end, you'd end up with a new TV - Terrain Versatile

I know it's not what you're doing, it's just an idea I had.  (no idea how difficult this would be)


B92
Title: Re: Map Creation Utility-ish
Post by: yell0w_lantern on March 30, 2009, 04:16:01 PM
Ingenious! Maybe I won't have to make those map meshes I've been putting off for months.
Title: Re: Map Creation Utility-ish
Post by: GogglesPizanno on March 30, 2009, 10:09:23 PM
Quote from: bearded on March 30, 2009, 08:58:27 AM
is there a way to go totally rogue and make random maps?

Potentially you could but the math and coding for maze generation is beyond what my brain is wanting to handle. HOWEVER, if by random you meant a collection of maps stored as a giant array and a random one gets loaded at the start of the mission, that will work. That was actually what phase one of this was. The problem is that because the map is loaded and created on mission load there is no way to add details in FFEdit. It would just be like a bland maze... 

Quote from: Boalt92 on March 30, 2009, 12:24:54 PM
In addition to walls, how about terrain features/geography?  For example, a plateau with one or two ramps could allow you to "create" both elevated plains and valleys.
These would be attached directly to the terrain, and could be added hidden/copied/pasted via nifskope

In the end, you'd end up with a new TV - Terrain Versatile

Some of the many failed attempts I made was something similar to this. If you tried using nifskope to "build" a versatile map out of pieces, it would build ok, but the game engine had a real problem with computing move paths. Characters would get stuck in certain blocks, or move around areas that should be open etc.. And the behavior was random. Adjust one thing slightly, and it would throw off movement in 5 other places. I tried several different methods and each one cured one issue and created 2 more. Thats not to say it can't be done, its just I never figured out a way to make it stable enough to play..
Title: Re: Map Creation Utility-ish
Post by: UnkoMan on March 31, 2009, 05:51:54 PM
Wotta cool idea. Hopefully people will utilize this when all the bugs are worked out.
Title: Re: Map Creation Utility-ish
Post by: GogglesPizanno on March 31, 2009, 06:14:37 PM
Quote from: UnkoMan on March 31, 2009, 05:51:54 PM
Wotta cool idea. Hopefully people will utilize this when all the bugs are worked out.

BWA Ha ha ha ha.... (ahem).
Title: Re: Map Creation Utility-ish
Post by: yell0w_lantern on April 01, 2009, 01:21:49 AM
Goggles Pizanno drives like a man coming home on the freeway!
Title: Re: Map Creation Utility-ish
Post by: cmdrkoenig67 on August 30, 2009, 01:14:49 PM
Any luck with this project too, Goggles?

Dana
Title: Re: Map Creation Utility-ish
Post by: GogglesPizanno on August 30, 2009, 03:57:52 PM
I actually started looking at this again a couple of weeks ago.
Its still kind of where it was, though I have Corner/Angled walls now.... woo hoo?

I'll try and get something sorta useable worked out. Its still very much in an alpha state however.
Title: Re: Map Creation Utility-ish
Post by: cmdrkoenig67 on August 31, 2009, 01:28:22 PM
Cool....I was just very curious, being the map-maker I am.

Dana  :thumbup: