Has anybody got any questions for me??? I could use some to write in answers on the troubleshooting and how-to... seriously, THEY HELP!
I've decided to give back to the community a bit, I'm going to pour my knowledge into the wiki... in tutorial form...
I'm a perfectionist.... its kinda obvious.... soooo if I do finish this tutorial, expect images, graphic pointers... step by step whatever.. hell, maybe even gif animations..
the tutorial would have this kinda content structure (this edit [did] change):
- uv mapping
- importing the model (upspring)
- importing/exporting the texturemaps
- sizing and alignment in upspring
- drawing the texture (mostly pointers)
- finalizing the texture .dds or otherwise
- setting up a "testmap"
- placing the feature on the testmap
- compiling the testmap
- creating all the feature text documents
- packaging the feature with a useable directory structure
- loading the map
- advanced tricks
it'll probably end up about 12-20 pages or so... depending how detailed I get, and if I decide to put LOTS of images... it might be a whole damn lot longer.
if ANY, ANY of you guys have input on something, I.E. UV mapping in wings (I dunno spit about wings 3d) please add your input. I'll basically make full use of every tool I have in my arsenal, and have enough graphic examples to hopefully lower the amout of redundant annoying questions...
but yeah, hopefully this will not only encourage more people to make features, this will also make it easier for map makers to put them into their maps... cause I get alot of e-mails and pm's that are all:(nerdy voice) "in step 234 you said to click 4 pixles to the left of it, but do you mean 2 down and then 4 left? or 4 left of the left and drag back 2 to the right?"....
"I would add features, but I dunno how and I can't read.. blah"....
and Smoth, you are more than welcome to critique everything I do, and same with you aGorm... just don't dis it.. lols oh and everybody else.. stfu and gtfo! lol j/k ya'll are all welcome to jabber too this is an open source project and we are all a part.
wish me luck.
[edit:] I'll keep everyone updated here as well.
(04-19-07) Added Painting pointers to Tips and Tricks
(04-18-07) Added to Troubleshooting
(04-16-07) Troubleshooting Chapter begun
(04-13-07) Tips and tricks Chapter started
(04-12-07) Building the Testmap Chapter written and added
(04-11-07) Upspring Chapter Written
This is far from finished, and hardly even spell checked, don't be a nazi yet... just getting it out as I write it.
I'm currently writing it in MS Word at work, but I don't have a copy of MS office at home, damn licence from the university ran out, and when I upgraded to vista, it deleted it... sigh... I'll have to spend more money..
anyways, I'm sticking to text for now, I'll get images in later..
(hmmph, it fubared my tabbing and paragraphing.. ugg, I'll fix it later..)
This tutorial will take you step by step though the process of creating a feature for TA Spring. I will be using 5 main programs for the accomplishment of this task. 3dsMax, Deep Paint 3d, Photoshop, Upspring, and TA Spring. There are other programs that can be used to accomplish these tasks and you are welcome to try those as well. First I will walk you through some basic modeling, and considerations on creating a model, then how to UV map it. After you are complete and happy with the model and UV map, it is time to outsource it to upspring and your favorite painting tools. Mine are Photoshop and Deep Paint 3D. Both cost money to obtain legally, but you can still use gimp for free. There should be enough parallels between Photoshop and Gimp for you to follow along. As for the section on Deep Paint 3d, feel free to skip it if you don't have it, mostly it will be pointers. You can always paint a UV texture map in the flat, and not in true real-time 3d, but hey, 3d is fun! Upspring is pretty simple, and hard to screw up, so that is just a step-by step walkthrough. Once everything is in Upspring and satisfactory, building the final directory structure to place it on a map in Spring is pretty simple. I'll give you a basic outline and help you prepare a test map to place it on. Texturing is actually my final step, and probably the most hideous. From there, using the feature on your own maps, is completely up to you.
Chapter 1: Modeling
---- will complete later ----
Chapter 2: UV mapping
---- will complete later ----
Chapter 3: Upspring
Upspring is a fairly easy program all by itself. It is GUI driven, all the icons make sense, and its kinda hard to screw up. Getting your feature from your modeling program to Upspring is a simple task, and so is configuring it. Just follow along.
3.1 Step 1- (exporting)
Open the saved "model.max" file and double check everything. Click on file, then save as, and pick the dropdown for "*.3ds". Save it in a new directory that is easily accessible.
3.2 Step 2- (importing)
Copy/Move the blank texture used for the UV map into the same directory as the .3ds file. This will help you in terms of organization on your models. Also, make a copy of the texture file, and add a "2" to the end of the name. This will be the texture2 for the model and be used for transparency and specular reflection.
3.3 Step 3- (orientation)
Open the file with Upspring. After it is opened you may notice how large/small the object is, and you will definitely notice the incorrect orientation. This is remedied by clicking the transform controls in Upspring and rotating the model -90 degrees about the Z axis. After it is rotated move it to the baseline of the grid, or ever-so-slightly below it. (tip- this will help to make your model look grounded on the ground and not floating. If the model is to be placed on hilly terrain, consider the baseline where the very very centerpoint of the model will be, and have downhill parts of the model below the baseline. If you were around when I started making the map Severnaya Industrial, you'd see what I mean by when I was first placing the models for the radar dishes on the mountains, the center of the dish was at the "maximum height" and the outlying foundation piers were "below the baseline" thus, stretching under the model, and into the mountain, preventing it from seeming to float in air.) Anyways, after you upright the model, move it to the direct center of the grid, zoom in and out if you need to, to see the model and get it centered. Save the upspring model as "feature.s3o" in the directory with the 3ds and two textures. (its easier to keep the "working" files in the same folders for now.)
3.4 Step 4- (scaling)
After you have the orientation correct, and the model upright, and placed vertically where you want it, it is time to scale it to where it isn't too small, or too large in the game, (note how large the mushrooms I made are, and how small the cacti are, in my models, though this was intentional...) To scale it, be certain to scale all 3, X, Y, and Z, axis the same amount. Scaling them differently will squish and stretch your model in odd ways. This is probably undesired and will cause issues.
The grid on Upspring is very close to the "unit grid" on TA Spring... when you build structures and they have that "green grid" under them, that grid is very close to the grid on Upspring. The one on upspring is about 12 to 10 larger or, 20% at most. (I think this was a difference in developers using English measurement and Metric system. Feet vs. Meters.) Basically a Flash Tank is slightly larger than a 2 x 2 square on Upspring. Scale your features from there. When you input numbers into the scale factors for X, Y, and Z, they are numerical percentages. Where .5 is 50% 1 is 100% and 1.5 is 150%. Scaling them to fit should be fairly straightforward. Save this model as your "feature.3do"
3.5 Step 5- (file association)
Now you need to specify what texture(s) to wrap on the model. There are 2 main textures, the first is the color/teamcolor map, the second is the glow/specular/transparency map. For now, don't worry too much about getting the texture to line up on the model, just associate it with the model, and get it to appear in whatever alignment in Upspring, the rest can still be done in 3dsMax, Deep Paint 3d, and Photoshop. To associate it, click on the texture, and then pick the file, ding you're done. Now click the rendering method and select option 2, two textures, team color and everything. Save this model as your "feature.3do"
3.6 Step 6- (hitbox/selection sphere setup)
This is the last part of the Upspring chapter. The model needs a correct hitsphere. There are some automated tools used to create a sphere that will wrap the model easily, but they are very inefficient and buggy. First you will need to set the rendering mode on the model to "wireframe" and to display the bounding box and height. The feature has 2 types of bounding gizmos, 1 is spherical, and that is what you "mouse over" and "click on" within Spring, it also defines the visible arc of the model within the renderer of Spring, I call it the "selection sphere." The second is a rectangular box, the actual "hitbox."
To setup the first gizmo, the selection sphere, you need to define the model center. Since the wireframe sphere is on visible, it should be easy, just use the numerical entry for X, Y, and Z axis to move it to the middle of the model. Then you need to specify the radius of the sphere, the bigger the sphere, the "bigger" the area to click on within the model. (note: the sphere is ALWAYS centered on the model perfectly within spring (for rendering purposes), no matter what the coordinates are, but it will use the radius that is defined to specify when, and when not, to draw the object in the game engine.) setting the radius of the sphere to smaller than the WHOLE object is preferable to when you mouse over the object, and when you click on it to reclaim etc. but, when the radius is small, and the model is very large, it will make it flick on and off the screen on the edges of the "visual plane" within spring. Balancing the difference between a big sphere and small sphere is crucial. If it is way too large, everywhere you put the mouse in spring, (within the radius of the sphere) the info bar on the bottom will display the item description of the feature, and if you have the feature reclaimable, and a unit that can reclaim selected, it will attempt to reclaim the object. I.E. load the map I made "Blacklake Swamp"... the trees have HUGE spheres on them to make them display correctly (or at least close to correctly), and almost everywhere you put the mouse it says "Giant Swamp Tree"... thankfully I made them un-reclaimable, thus when you move a constructor it won't reclaim it from everywhere... but you can still be annoyed by everything saying "Giant Swamp Tree."
Anyways, simply pick the center, and make the sphere big enough to encompass the object, and you are good to go. (unless the object is very big)
For the second gizmo, the "hitbox", you need to be considerate of how much impact this feature will have on weapons fire, unit movement, everything. All features have square boxes, and you cannot rotate them, so be advised on round objects, there are some tricks, but they get complicated fast. I'll detail those at the end of the tutorial. Anyways, the X, and Y of the box are defined by the feature's .tdf file. The height, Z however, is defined by Upspring. There is a simple number box for the height, and a thick display line that is solid yellow on the 3d view for the height. Spin it up until you get to the top of your feature. (or near the top... you might have a building, or a wreck or whatever, with some pointy stuff off the top, that is VERY thin, and shouldn't block weapons fire, thus, don't extend the height up that high, only put it as high as the solid object). Remember how many "grid squares" the object is in both X and Y directions.
Ok, you now have a 3do feature object that has its model, UV map defined, textures applied, its bounding boxes set up, and its orientation correct. Save the model again. This should be your last save unless you have to troubleshoot the object.
Congratulations you managed to navigate your model though Upspring, and have it setup to work in TA Spring.
Chapter 4: Test Map
Setting up the test map is well, easy, I have one finished for you to download. Setting your feature to work on it though, is a bit of a task, though confusing at first, after you get one object to work, it becomes very easy. The file I have supplied is a simple flat map, with a grid on the surface. The grid is approximately the same as the footprint units of Spring, thus, if you want to make the feature 2 gridlines bigger in each direction, add 2 footprint units. The feature.bmp file should be the only file you have to edit, and simply just change the color of the red dot, or dots, to match the color of the feature or features, you are testing.
(linky for my tester soon, its on my fileserver at home)
4.1 Step 1- (the tdf file)
This file is by far the most complicated part of adding or creating map features. It is actually the definition values for the "code." The format is very simple though, so anyone can handle it. It is simply a list of triggers and the associated functions that are applicable. An list of the triggers are the following:
world=(allworld); defines the directory path the feature is in (only allworld is used, afaik)
category=(name?); ?? is this even used?
description=(description?); The name of the object shown in the game
object=(feature.tdf); The filename (case sensitive)
blocking=(0,1); Whether or not the object will prevent movement.
Hitdensity=(0-100); Where "0" is 100% blocking, and "100" is non-blocking.
indestructible=(0,1); Whether or not the object can be destroyed, or reclaimed.
reclaimable=(0,1); Whether or not the object can be reclaimed only.
flammable=(0,1); Whether or not the object will burn if fired on.
nodrawundergray=(0,1); Whether or not the object will show up "under" the fog of war. (out of your LOS)
featuredead=(feature); The name of the object that will replace the current one if its heath is reduced to 0, also can be used for ground decals I.E. "smudge01" (case sensitive)
upright=(0,1); Whether or not the object is aligned with the slope of the terrain, or 100% vertical.
energy=(#); The amount of energy the object is worth.
metal=(#); The amount of metal the object is worth.
damage=(#); The amount of damage the object can withstand.
collisionspherescale=(#); Multiplier to the collision sphere of the model in Upspring (unused,untested)
collisionsphereoffset=(x,y,z); Offset distance in footprint units? (unused,untested)
footprintx=(#); Number of horizontal footprint units in each direction (always rounded up)
footprintz=(#); Number of vertical footprint units in each direction (always rounded up)
(there will be MORE triggers to be used when I finish coding some parts to the LuaGaia code, I'm planning on adding the ability for objects to "grow" and possibly "return fire".. this is very incomplete as of now though)
willgrow=(0,1); turns the grow ability on or off
willgrownew=(0,1); will spawn new features around the current one
growrate=(#); wait period in ms for each cycle
growvar=(#); % variance in the grow rate (random) to keep the growing sensation form being seen as INSTANT cycles across the map
growsinto=(feature); the replacement feature that will replace the current one
growsnew=(feature); the ability for the feature to spawn NEW features with X square footprint distance and the feature name for the new feature.
growdistance=(#,#); min,max distances in footprint units for new spawn
... (and the rest of the associated weapon triggers units have)
Anyways, the point is, you fill out the associated values for each trigger to have the feature behave as you want it to. Feel free to look into other maps, other features, and examples for reference.
The overall format is like this: (example)
autoreclaimable=1; (I've seen this used A LOT but it is nowhere in the source code for the engine... I think this is a BS line added.)
(Note: the name within the [ ] brackets is the "feature name" and is used when a feature replaces another feature)
After you get the tdf figured out, save it and continue on.
4.2 Step 2- (fs.txt)
This file is very simple, it is literally just a line by line listing of the features on your map. It is case sensitive however, everything must be typed in exactly. Understand that "Tree2" is different from "tree2", as well as "TREE2" is different from them as well. However, the windows file system will recognize them all as the same name, so you cannot have both the uppercase and lowercase versions. Just make sure everything is typed correctly. The line by line order is very, very important. There is a maximum of 255 lines, or 255 different features per map. Each line corresponds with a different numerical value of red per pixel on the feature map bitmap for the map compiler. The first line on this file is red #255, the second is red #254, and so on.
Open the fs.txt file with notepad, or your favorite dos-based text editor. (note: MS Word or Wordpad will not work properly on any of the text documents, as it stores formatting with the text and will eff everything up.) Take the item or items listed on the document and replace them with the feature name (the name within the [ ] brackets on the tdf file.) of your feature or features you would like to test. Save and close this file, it is complete.
4.3 Step 3- (directory structure)
This is another simple step that seems to boggle a lot of map makers. The only files that need to be created and run with the mapconv program are the feature.bmp file, and the fs.txt file, everything else is just packaging. Anyways the directory structure is the following:
Put my map bitmaps in the root "testmap" folder. (downloaded)
Put your fs.txt file in the root "testmap" folder.
Put the s3o/3do files in the "objects3d" folder.
Put the UV texturemap files in the "unittexture" folder.
Put the tdf files in the "All Worlds" folder.
4.4 Step 4- (compiling)
This process is simple. Refer to this link: (many many tutorial have been written already) http://taspring.clan-sy.com/wiki/Maps:Compiling
4.5 Step 5- (testing)
This test is just an initial test, if your feature is on the map correctly, the feature should be white, with black outlines on the ends of all the faces. Its scale should be "close" to where you want it, and you can tweak it from there. Take some time with the s3o file in Upspring, and scale it correctly. Also, don't forget about the features footprint and selection sphere. You can always test the footprint size under the object by attempting to build something on top of it, and the parts where the footprint are located will be red. Again, every part square from the footprint to the vertical height of the object will block weapons fire. (unless they get past the density modifier within the tdf)
After you are satisfied with the object's size, density, and other attributes, lets move on to really texturing the feature.
Chapter 5: Texturing
---- will complete later ----
Chapter 6: Finalizing
---- will complete later ----
Chapter 7: Troubleshooting
Q- Why is the model all black with no texture?
A- Its associated texture file has errors or is missing.
Step 1- Double check the s3o model to make sure the textures filenames are spelled correctly.
Step 2- Make sure the alpha layer on your textures are present and correct.
Q- Why is the texture coming out screwy on the model, or very stretched in any orientation?
A- The associated texture file is either not flipped vertically, or the UV map on the model is mismatched with the texture map or corrupt.
Step 1- Make sure the texture maps are all flipped vertically when used on a model.
Step 2- Make sure the UV coordinates are correct on the model by either a- using the program to evaluate the mapping overlay ON the texture map, or use the texture map as a material within the modeling program and render the object. (remember the texture is flipped vertically so be sure to check the "flip vertically" check box.)
Q- The feature doesn't show up on the test map at all.
A- This can be many problems, from file structure, to naming conventions, to case sensitive text documents, to the actual feature bitmap.
Step 1- Replace the fs.txt with one that has a feature commonly used, and then put that feature and its associated tdf and textures with the map. See if it loads on the map, and you can determine that the bitmap is ok, then proceed. If not, make sure the pixel on the feature.bmp is perfect.
Step 2- The feature still dosen't show up, even with the common feature... This means that there is an issue with the file structure of the features in the map's zip file. Double check everything and correct as needed.
Step 3- The common feature loads, but the new feature doesn't... This means that the associated text documents with your new feature are incorrect or misspelled. Double check them all.
Q- My feature needs to stick straight up, regardless of the terrain.
A- This is a simple fix, just flip the "upright=0" line in the associated .tdf file to read "upright=1".
Q- I don't understand why the feature is blocking everything around it, even weapons fire when it clearly shouldn't.
A- Check the .tdf file's "footprintx=" and "footprintz=" dimensions, they may need to be reduced.
Q- My feature won't block anything, and I can walk right through it!
A- The feature is either, not set blocking, or it has a smaller footprint than required.
Step 1- Check the .tdf file to make sure that "blocking=1" not "blocking=0".
Step 2- Check the .tdf file for the "footprintx=" and "footprintz=" lines, you may need to increase them.
Q- My feature blocks construction properly, and movement, but it won't stop weapons fire, or rarely stops it.
A- The features "density" is too low, make more dense.
Step 1- Within the .tdf file the line "Hitdensity=#" set the number lower. (Remember that lower numbers are more solid, with 0 meaning 100% blocking, and 100 is no blocking.)
Q- My feature is halfway in the ground, and not on the surface! Help!
A- The feature has an incorrect origin location set by UpSpring, or the map is VERY erratic on altitude.
Step 1- Make sure the base of the object is on the bottom of the grid in the profile view within UpSpring, not centered on the bottom of the grid.
Step 2- Consider taking a look into the map's height map, and revise to give it a small amount of flat terrain around the model.
Q- My feature is flying in the air, it should be on the ground.
A- The model in Upspring does not have its base on the bottom of the grid, move it down, don't center the model on the grid in the profile view, center the baseline on the bottom of the grid.
Q- Which texture in Upspring do I use for what? what do they mean?
A- There are 2 textures per object... (they have to be *.TGA or *.PNG) with 4 channels Red, Green, Blue, and Alpha.
-A- team color (0 being no team color, and 255 being 100% teamcolor)
-R- Glow map color (0 no glow, 255 full-bright)
-G- Specular layer (shineyness, 0-255)
-B- ---- not used ----
-A- Transparency (0- opaque, 1-255 = completely transparent, there is no "partial" or "translucent".. yet...)
Note: Transparencies, and Team Colors might be flip flopped and 255= opaque or no team color dependant on the painting program used, if it comes out backasswards, just invert that channel.
Chapter 8: Tips and Tricks
I've developed a few tricks over the last two years piddling with the spring engine.
#1- This is probably the best tip I can give you. When you are drawing your layered bitmaps for your map in photoshop, or gimp, make use of the layers function. Put your texturemap, your heightmap, the featuremap, and all other maps together. Make a layer stack, something like: height->texture->land/water->resource->start locations->base locations->controllable areas->trees->grass->feature1->feature2-feature3->feature...->typemapping etc. This is beneficial because when you have 42 different features on the same map, that means you have 42 shades of red dots on the map, all that are close to max red, and very, very hard to tell apart. If you wanted to see where say, feature#13 was, turn that layer on, and the rest off.. and ding! You can see exactly where they are. Say you want to place features where the shoreline is, and nowhere else, (for example, the lilypads on my swamp map,) turn on the watermap, and click right next to the edges of the water...
#2- Just because you want a feature on the map, in a certain location, at a certain height, dosen't mean its "impossible" or "hard" to do. Think about what the feature is, how the map will load it, and how it will place it. Just a hypothetical example, but say you want to place 4 different buildings together in a similar location (say for passability reasons and not acting as a single footprint blocking obstacle), with all having the exact same celing height, all perfectly horizontal, regardless of the terrain height. The buildings are all set individually by a point on the heightmap, this point is also the CENTER of each buildings hitbox, thus you cannot move the building around on the point without screwing up the hitbox. If you place the buildings on the map with no bearing on how they are generated, they will have the exact height of the terrain, plus the difference within upspring on the model height. Say you don't plan on editing the buildings 1 by 1 and making a new feature for every building, because you plan on using the same building over and over... What you can do, is with the layering technique mentioned above, pick the points on the height field directly under the dots on the feature map, and make them all exactly the same. This will however, leave funny little spots under the buildings if reclaimed or destroyed (unless the difference is negligible), so consider this with your design and possibly opt out to have the features unreclaimable/indestructible.
#3- Trick to hide the selection sphere, yet still have the feature visible, and blocking, without causing problems. The solution is simple, if you consider how the selection sphere is generated, (it has to be large enough to encompass the object, regardless of its origin, though reset at the true center origin in upspring, but regardless of its location given within upspring.) This means, if you move it way, way off, say like 4,000,000 kilometers off the map, you will never, ever be able to click on it, and yet the sphere is still active. This is handy for very, very large objects such as my swamp trees. (though I did release that map without this trick in effect.. doh) Anyways, you have the sphere still large enough to make the object visible, its off the map and you can't click on it, and then you set the blocking hitbox to the correct sizes. It will now act as a solid object, that is uber huge, and you can mouse-over the area within its vicinity, without getting stuck ONLY reading that very large items description, or when you give a constructor a move order, it won't auto reclaim it every time.
#4- When painting a texture on a model, or feature, there are a few tips I know of to make it look "real." First, all dark lines recess into the object adding depth, or the middle of concave corners, all white lines look like glints of light reflecting off convex corners of objects. When you begin to paint, paint the base color/colors, then add the dark crevices. After adding the dark, add glints of highlights on the corner edges of the plate that butt up to the crevices. Contrast is important. Also, when you add mixed color to an object, parallel strokes of color look EXTREMELY flat, and dabbed blobs of color look very curved like an organic surface. Consider this when painting a flat sheet of steel, or a rubber curved gasket on an object.
#5- To add more realisim to the model and make it look less like a low-poly boring model, wrap the texture of a face on the model OVER the seam between to facets. Draw as if the UV map is one solid painting surface on a true model, don't think, "ok lets limit myself to only face A to paint window A..." paint on all the adjoining faces as well, even if it means only putting support beams and brackets, or angle iron, on them. Also, this works in the opposite fashion as well, your "window" dosen't have to be the enitre polygon either, use "part" of it, and add cracks and highlights to the surface paint to look like more polys/detail...
I'll add more later as I think of them... I'm tired of typing... [/b]