Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

FPSC Classic Product Chat / [TUTORIAL] Exporting a Level made in any 3D software to FPSC

Author
Message
007
13
Years of Service
User Offline
Joined: 22nd Aug 2011
Location:
Posted: 29th Mar 2013 16:33 Edited at: 29th Mar 2013 16:43
Hello Folks,

After a lot of hard testing, trials, errors, and headaches , i think i found a way to export a level made in any 3D Program to FPSC.

Off course, with the help of Rolfy and Uman, their tips, i think now is possible to have a "perfectly" (i mean playable) level made entirely in a 3D Sotware in FPSC.

What is the point on creating a level entirely in a 3D software instead of just creating it in FPSC?

First of all, is completely possible create a WONDERFULL level in FPSC, take a look a E.L.E (both the old and the new version). Take a look of some of the Best of the Bests FPSC Games. Take a look at Into the Dark (from Ertlov), and such.

However, as i came from the 3D Market (Advertising), i am more habituated to working in a 3D Software (3dsmax), and i think it has yet some advantages, like those:

* You have more freedom to working in a 3D space by changing the camera view (you are not limited to a top view)

* You have more control on position the objects, moving, rotating, scaling

* I think is easier having a level made of entities exported from a 3D package, than having to create segments for FPSC, which is a tedious process. Slicing it in the exact size of a segment, aligning it in the Segment Editor, and other difficulties, which are witnessed by more experienced members here like Rolfy himself told me

* This technique of making a level inside a 3D software is better suited if you want to have baked shadows, because you can achieve more impressive results using lighting plugins like VRAY (which is avaible to Google Sketchup) and even then you can overcome the Memory Cap problem. I am not saying that is not possible to have a good lighting using FPSC Dark Lights Lightmapper

* If you search on youtube some making off from famous games, you will see that the a big part of studios, even when using those Advanced Engines like Unreal Engine, Crysis Engine, they design the level environment insise a 3D Package (like 3dsmax, Maya, Softimage XSI, and such. I recommend those aspiring to become Game Developers, even by fun (not comercially), to always take a look of those making offs, it will make you gain more knowledge. In example, the last making off i have seen was from Assassins Creed III. I have seen that Ubisoft developed an in-house engine called Anvil Next Engine (so good as Unreal Engine). But they said clearly that all the levels environment were created in 3dsmax. Also the game Metal Gear Solid 4 (PS3), which uses a in-house engine developed by Konami, which also has some cool features like Global Illumination, Dynamic Shaders, and such, all the levels were designed inside Softimage XSI then exported to their engine.

So, after this long introduction, i will like to share some tips on how to do this, because i love to share knowledge, even if is something little, maye some people may benefit of this mini-tutorial. As soon as i have time, i will elaborate a more complete tutorial with photos.

1- First of all, you need to adjust your 3D software to FPSC units. It may vary from software to software, however the real life size of a segment is 8.33ft or 2.54 metres squared. For 3dsmax my units setup is set to US Standard Feet w/Fractional inches 1/1 Default Units Feet. So after setting up those units, i have tested and seen that one segment (one floor piece, in example), inside 3dsmax, has the exact size of 100'00" x 100'00" x 1'00". so i have created a box in this size, then exported to FPSC, and it matches perfectly the size of a segment. Inside fpsc this box fits perfectly inside one grid unit of the FPSC map editor. So, as the editor is 40x40, so we need 80 pieces of this segment to fit the entire map editor grid. So i also adapted my 3dsmax grid to Grid Spacing: 100'00", Major lines every Nth Grid Line: 10, and Perspective View Grid Extent: 20. Now it means that i have inside my 3dsmax the same size of FPSC Map editor. You can do this with any software (Blender, Maya, Lightwave, and such). Just is important to test it extensively and see if one segment made inside the 3d software is in the same size of a segment inside FPSC.

2- Now you model your level normally, create what you want, the way you want. Model houses, buildings, trees, and such. You can even have multi-floor levels, is not a problem. But is important that when you model your level you need to separate the level geometry (walls, floor, buildings) from the level props (trees, cars, light bulbs, and such).

3- When texturing your level, use a bump channel in the materials, because this way we can simulate almost perfectly the normal map effect without need to use a shader in FPSC.

4- Now after having your level modeled and textured, it's time to add some lighting. I recomend that you search for a lighting plugin for the software you use and don't bee confined to the software's default lighting system. Also bear in mind that you need to search a good plugin for baking textures. I have found in the web a awesome plugin for Blender uses, that does the samething as Flatiron (the plugin which i use) does for 3dsmax (baking textures).

This is the link: http://blenderartists.org/forum/showthread.php?265750-TextureAtlas-create-LightMaps-ShadowMaps-for-entire-scene

I did not test this plugin, however you need to understand that for fpsc, the UVW Map channel of the texture (baked texture) of the exported object (*.x file) must be set to 1, otherwise, you will get blank textures inside FPSC.

5- So after you have your beautifull level ready (model, texture, and lights), is now time to export for FPSC and here comes the main core of this mini-tutorial.

6- First of all, fill the entire fpsc map editor (40x40) with a floor segment with total black texture (invisible floor)

7- Second, you need to export the entire level object as one single mesh and import it in FPSC. You need to make it a dynamic entity (we will be using only dynamic entities), with no physics, immobile and you must edit it's appear script to add a "coloff" command to this entity, because we will be using it as a reference model to align all the parts of your level. So before exporting the entire level, adjust it`s pivot to the origin of the grid (0,0,0) and export it as directx file. And inside FPSC, you just need to insert this entity (using "B" key to snap) in the coordinates X:19 and Z:19.

8- Now come back to your 3D software and begin to "slice" (break) your level. In example, separate the walls in various pieces (not too much), separate the doors, the windows, and such. But now comes a important tip, is that your pieces must be only in one direction in the 3d space. In example, if you have a wall in the "L" format, you must break it into two perpendicular pieces the "|" and the "_" this way:

|
|
|
|
|_ _ _ _ _ _ _

Original wall

|
|
|
|
|

First piece

_ _ _ _ _ _ _

Second piece


This is because we will be using only box collision for those entities, and they must be set to dynamic entities (to use multiple textures) and also because FPSC does not cull static entities, except if they are surrounded by wall Segments (not entities). And trying to enclose the entire level with invisible walls segments, would add more polygons to the level, and would not be efficient. Also, i tested, FPSC Culling system culls perfectly dynamic entities that are outside the view of the player, while for static entities, it does not culls at all (only if surrounded by walls).

7- This will give you a lot of work, however, i think the results are worth trying (especially in my case because i am using VRay to have photorealistic visuals).

9- Now inside your 3D Software, you need save this level like mylevel_export (to don`t lose the original level). Now you will export each piece that you have broken from your level (door, wall, windows, pillars, and such), one by one. But before exporting, you need to place this object in the origin (0,0,0) and also adjust it`s pivot to be centered to the object, then export it. If you export the object without centering it`s pivot, it will lose the collision, because the center of mass of the entity wil not be centered on itself, so this will not work.

10- Now come back to FPSC, and place this piece in the map, but how you will know the correct place? Simple, we have our entire level already in FPSC, so you just place this piece above it`s own place in the entire level object that is already in FPSC. Do it for all the pieces, and after you placed your pieces, just delete the entire level object! Now is finished!

11- But just to remember, the level pieces must be a dynamic entity (we will be using only dynamic entities), with no physics, immobile and the collision must be set to box.

12- Now the trick is that the floor must be like the entire level object (with no collision), because it will have an underneath floor below it, so the characters will walk perfectly above this fake floor (which need to be flat).

13- And if you have a multi floor level, yes, you can make your characters walk in the second floor, above your level pieces, which will be dynamic entities. Just take a look at this tutorial from our friend Rolfy:

http://forum.thegamecreators.com/?m=forum_view&t=197834&b=21

As for the player, it can walk normally above any entity (dynamic and static).

14- It`s all folks, hope you liked it.


Goldenye 007 N64
007
13
Years of Service
User Offline
Joined: 22nd Aug 2011
Location:
Posted: 3rd Apr 2013 04:49
Did anyone try this out?

If someone who is trying to do this has any doubts, feel free to ask me, i will love to help.

Cheers,

007.

Goldenye 007 N64
Disturbing 13
20
Years of Service
User Offline
Joined: 12th Apr 2005
Location: Murder Capital of the World
Posted: 3rd Apr 2013 10:48
I've been doing this for a while and have great results, especially in frame-rate since in a modeler I don't have to render walls or faces that don't get seen. Segments are great for quick levels but the amount of wasted geometry that gets processed is incredible. This method is by far the best.

Model pack 66-99 high quality items...cheap!!
"Who loves ya baby!"
007
13
Years of Service
User Offline
Joined: 22nd Aug 2011
Location:
Posted: 3rd Apr 2013 15:46
Quote: "I've been doing this for a while and have great results, especially in frame-rate since in a modeler I don't have to render walls or faces that don't get seen"


Yes bro, this is the best feature of this method, you don`t waste geometry, so you render on screen only what is seen.

Just the negative point on this method is the extensive ammount of hand work that must be done, but in the end, as i said, this is very worth trying, the results are very impressive.

By the way, i am happy of this mini tutorial being usefull for the folks here.

Goldenye 007 N64
Wolf
17
Years of Service
User Offline
Joined: 8th Nov 2007
Location: Luxemburg
Posted: 5th Apr 2013 19:54 Edited at: 5th Apr 2013 19:55
I do this too whenever my laziness does not conquer me.

I must say that creating entire levels in an external software is not advisable and you have to break it up in several individual models. Hybrids out of segments and models is the most stable approach.

Nice tutorial. However, some example pictures would made it read a little bit better



-Wolf

http://www.serygalacaffeine.com
Without struggle,no progress and no result.Every breaking of habit produces a change in the machine.
007
13
Years of Service
User Offline
Joined: 22nd Aug 2011
Location:
Posted: 6th Apr 2013 02:02 Edited at: 6th Apr 2013 02:14
Hi Wolf,

First of all, i would like to say congratulations on your new project, Spyra. Man, you really know how to make a "i can`t believe it is FPSC" game.

The atmosphere and the "shader intensive" visuals are very cool. I love your style of work, althought your scenes are very dark, but is "eye-candy".

Yes, i am struggling to slice one test level i imported from a Source Engine Game, just for study purposes, and as soon as i slice it (maybe take months ), i will update this post with pictures from the entire process, slicing, lighting, baking, and exporting to FPSC.

Just, a kind of "off-topic" question, i am accompanying Lee`s Blog on Reloaded Project, and i have seen some very cool features. I loved the new explosions effect, and i think is better than any thing you can achieve now with FPSC. Off course, with actual FPSC you can have a triggered explosion on it`s own using a shader effect for animated texture (so you render a explosion in 3dsmax or after effect, and then use it as a kind of animated video sequence), but i think you can`t change the explosion on entities without changing the source code.

I think i may wait for Reloaded for releasing my 007 Fan Game, but i would like to know, in example, the workflow will be the same? If i want for FPSCR use a external level modeled in 3dsmax, can i do the same way? Or i have heard that it will be even easier to import external meshes in FPSCR.

And about my characters and model assets, if i began to make them fpsc ready, in example, my guns and character enemies, if i finish them all, with rigging, animations, basic fpsc scripting, ragdoll adjustments in FPSC, and such, they will work "just outside the box" in the new FPSCR, or i will have to redo all the scripting, change the animation range of the characters (in example, the default fpsc animation sequence for weapon types, and so on).

Because if i can reuse all my assets, so is fine, i can begin my project with organizing the model assets, and whenever i finish them all, i think i will already have FPSC Reloaded.

Do you know something about this?

Cheers.

007.

Goldenye 007 N64
Nomad Soul
Moderator
18
Years of Service
User Offline
Joined: 9th Jan 2007
Location: United Kingdom
Posted: 6th Apr 2013 03:34
@007

FPSC maps will not be backwards compatible with FPSCR but model packs will be so you can assume that character and weapons will still work in FPSCR.

Its likely the AI in FPSCR will be changing so your scripts might need to be redone on the characters to take advantage of FPSCR.

Regarding your thread, I am interested in trying this out but please can you explain the following part in more detail and perhaps with some pics

Quote: "8- Now come back to your 3D software and begin to "slice" (break) your level. In example, separate the walls in various pieces (not too much), separate the doors, the windows, and such. But now comes a important tip, is that your pieces must be only in one direction in the 3d space. In example, if you have a wall in the "L" format, you must break it into two perpendicular pieces the "|" and the "_" this way:"


I have no idea how to slice a map up so would appreciate more information on that please.

007
13
Years of Service
User Offline
Joined: 22nd Aug 2011
Location:
Posted: 6th Apr 2013 06:24 Edited at: 6th Apr 2013 06:29
Off Course Nomad Soul,

Here it goes:

In this example, i am importing a entire level exported from BSP Map Viewer (Source Engine), most especifically, a map from Counter Strike Source.

So whenever you export it from the BSP Map Viewer, you will get one OBJ file with the tga textures (also uvw mapped), which is one unique mesh inside the 3D software.

So as now i have inside 3dsmax my level, which is one single mesh (editable mesh), already textured. So i need to break it down in pieces.

I tried a lot of maxscripts and plugins for slicing geometry, but as the entire mesh which i imported in 3dsmax is not uniform (because all the walls have different height, and other things), so i found that the unique and most efficient way to "slice" this map, is do it manually.

But how do you this?

Is very easy, just select the faces (polygons) you want, and "detach" them from the entire object mesh.

So you select in example, some walls from the level and detach them, you select the windows and detach them, and so on.

But if you are modelling the level form scracth (not importing), so is far easier, just you model each piece separated, in example, you model the walls, the fences, windows, doors, and export each object, one by one.

What i said about breaking the objects in to only one direction is that if you export to fpsc a curved wall, it will not work, you need to break the walls like in this picture attached.

Hope it helps you.

007.

Goldenye 007 N64

Attachments

Login to view attachments
rolfy
18
Years of Service
User Offline
Joined: 23rd Jun 2006
Location:
Posted: 6th Apr 2013 07:44 Edited at: 6th Apr 2013 07:46
In your image above setting the model to poly collision will enable entry to the corner. So no need to break this down into separate parts. As far as I have found so far only the floor needs slicing and this is only to enable enemy collision.

All walls with windows, even static doors there is no need to break apart, its better to properly uv map these to create staic entitys, dynamic doors of course would be separate entity's anyhow

I don't trip over...I do random gravity checks.
007
13
Years of Service
User Offline
Joined: 22nd Aug 2011
Location:
Posted: 6th Apr 2013 18:54
Hi Rolfy,

Thanks for the comments.

But here comes what i discovered after testing it extensively and watching close inside wireframe mode (in test game mode).

Using poly collision will drop down frame rate (and this last beta 1.20 16 is not so good in performance).

I have been testing the FPSC Culling System, and this is what i have found so far:

1- FPSC Culling System works better for dynamic entities small in size. In example, if you have a explosive barrel (from scifi stock entities), if you far away from it, it will fade-out from the scene, and if you come close to it, it will show. So, the engine will not render the polygons if you are far away from it.

2- For dynamic entities big in size, FPSC culling system works a bit different. It does not occlude the object because of your distance to it, it occludes the dynamic entities that are not pointing for the player view. So if you are in front of a big house model, and you look to another direction (left) to the extent that this entity will not be shown on screen, the engine does not render it polygons (you will see a decrease in poly count metter).

3- The same is not true for static entites. The engine will continue to compute the polygons of static entities, even if you are far away from them, and even if they are not showing on the screen (if you are looking to another direction). Static entities only are culled the same way level geometry are culled, if surrounded by segments. Because when building the game, fpsc will create the so called portals (if you know Valve Hammer Editor is the same as Area Portals). So if i use static entities, i will need to use segments to surround them, which will mean more polygons on screen, lower fps

4- And last, but not least, you can`t use multiple texture for static entities, and if you are used to a model software, is very important have the power to use multiple textures. In 3dsmax, it will only use the first material slot of a Multi/Sub Oject Material. This is something very odd, because the X-file itself renders well the multi-texture (using direct-x viewer), and even inside FPSC Map Editor. But in-game, you don`t get the multi-texture information.

Anyway, i am very happy to change those informations with the "pros" here in TGC Forums.

Goldenye 007 N64
Wolf
17
Years of Service
User Offline
Joined: 8th Nov 2007
Location: Luxemburg
Posted: 6th Apr 2013 22:11
Quote: " So, the engine will not render the polygons if you are far away from it."


Thats a bug in 1.20.15 as far as I'm aware.

http://www.serygalacaffeine.com
Without struggle,no progress and no result.Every breaking of habit produces a change in the machine.
007
13
Years of Service
User Offline
Joined: 22nd Aug 2011
Location:
Posted: 6th Apr 2013 22:29
Maybe a bug, however, as i said, it helps to improve frame rate.

If you remember the times of old N64, PSX, (the first generation of 3D Consoles), this was know as "clipping", so the levels would be appearing in parts, the geometry would be generating gradually, according to the player distance to the object.

But i would like to know if Scene Commander will solve the problem of low fps in this latest beta. I even tried the Original Theater Model Pack Scene in this beta, it runs very, very slow (15 fps). I remember in the last version i tested (1.19), it worked perfectly smooth (45-60 fps).

Goldenye 007 N64
rolfy
18
Years of Service
User Offline
Joined: 23rd Jun 2006
Location:
Posted: 6th Apr 2013 23:25 Edited at: 6th Apr 2013 23:34
Dynamic entity's only use spherical and box collision, also multiple textures will snag more memory than single. Of course you are baking textures for this and probably find it easier the way you are doing it but for me the trade off with all the breaking up and slicing just wouldn't be worth it. Particularly for something as simple as walls which need not be 'boxes' as you have them and simply planes to cut down on poly count. I am also fairly skeptical about enemy collision with dynamic entity's rather than static and all sorts of issues will arise with any lighting you do put in, you still need some lighting in scene for characters and weapons.
Quote: "Static entities only are culled the same way level geometry are culled, if surrounded by segments. "

I find it better to use larger entity's which are then contained within segments and static entity's become part of the level geometry at build, the entire roof for Dark house is one single entity/segment. The only sliced section is the floor which uses a 4096x4096 texture to cover the entire area.
If you make walls dynamic enemy characters will not recognize these as obstacles and see right through them. You will also find that pathfinding for AI gets screwed up.

What your doing is fine for nice scenery but practical issues will arise when you try to create any sort of gameplay.

The culling system is actually deliberate and a fairly recent addition. And the distance objects are culled can be scripted.

I don't trip over...I do random gravity checks.
007
13
Years of Service
User Offline
Joined: 22nd Aug 2011
Location:
Posted: 7th Apr 2013 02:23
Thanks rolfy for the tips.

You`r right,

I tested right now,

Thanks for those tips.

The characters enemies recognize the dynamic walls as obstacles, but the problem is that sometimes (not always), yes, the characters stays trying to "penetrate" the wall untill he does it, passing over it.

So you are right, i will use it as a static entity. Regarding the multiple texture need, as i will use baked textures, i won`t need to use multi-textures.

But i think i will make dynamic floors entities that will be in the 2nd floor to make the enemies walk over them (like you did in your tutorial).

I think this is the best way to learn something, hear comments from other people.

Thanks for the tips.

Goldenye 007 N64
rolfy
18
Years of Service
User Offline
Joined: 23rd Jun 2006
Location:
Posted: 7th Apr 2013 02:58 Edited at: 7th Apr 2013 03:28
Make your floors segments

TBH I would use a large dynamic plane (baked texture) with no collision script and stock floor segments just a hair beneath to make it easier for yourself. Its only necessary to slice into segments for terrain, so npc's can follow contours.

Aside from slicing they will follow contours on a terrain above in the way I described in the past using a height offset with floor segments one level below, but if your floor is flat then there's no point in either method.

I don't trip over...I do random gravity checks.

Login to post a reply

Server time is: 2025-05-17 15:59:00
Your offset time is: 2025-05-17 15:59:00