A Complete Neophyte's Attempt to Make A Map From Scratch

Please post here for questions and discussion about unit modeling and general game modding. You can also post your new units and modifications here.

Moderator: EagleMountainDK

benpark
Posts: 3073
Joined: Mon Aug 12, 2002 1:48 pm

A Complete Neophyte's Attempt to Make A Map From Scratch

Post by benpark »

I have a semi free afternoon, and I wanted to see exactly how tough it is to make a map from scratch for PzCK. From reading the intrepid souls posts who have done this, I have gathered the tools needed from the furthest reaches of the interwebs.

I have opened the terrain generator, and it is asking me for numbers. What should these be input as, so that I have the correct starting size for when I open it again in MilkShape? These numbers are:

X Triangles

Y Triangles

Triangle Size (this will be figured from combining the first two fields?)

Thanks.
"Fear is a darkroom where the devil develops his negatives" Gary Busey
rickier65
Posts: 14253
Joined: Thu Apr 20, 2000 8:00 am

RE: Terrain Generator Size for Conversion into PzCK?

Post by rickier65 »

ORIGINAL: benpark

I have a semi free afternoon, and I wanted to see exactly how tough it is to make a map from scratch for PzCK. From reading the intrepid souls posts who have done this, I have gathered the tools needed from the furthest reaches of the interwebs.

I have opened the Google terrain generator, and it is asking me for numbers. What should these be input as, so that I have the correct starting size for when I open it again in MilkShape? These numbers are:

X Triangles

Y Triangles

Triangle Size (this will be figured from combining the first two fields?)

Thanks.


Uh oh, a free afternoon - unfortunately, I bet Stridor is the answer guy for this question, and by the time he's up and about, your free eafternoon will probably be turning into a busy early evening.

But maybe some other folks might know. I got confused when I saw the png mask files were 1024 pixels x 1024 rather than 1000 x 1000. The 3-d mesh stuff totally confuses me. But I think Mraah was doing something with Milkshake and Mobius might have some idea. Erik might know too.

Rick
benpark
Posts: 3073
Joined: Mon Aug 12, 2002 1:48 pm

RE: Terrain Generator Size for Conversion into PzCK?

Post by benpark »

So this is the map I have made in the free terrain maker program at the default settings:

Image

It's a river running through rolling country. I'm basing it loosely on the area around Simontornya in Hungary, where Operation Spring Awakening in Hungary (1945) stalled out.



Attachments
Untitled1.jpg
Untitled1.jpg (176.16 KiB) Viewed 436 times
"Fear is a darkroom where the devil develops his negatives" Gary Busey
benpark
Posts: 3073
Joined: Mon Aug 12, 2002 1:48 pm

RE: Terrain Generator Size for Conversion into PzCK?

Post by benpark »

Here is the exported height map:

Image

It looks pretty rough compared to the ones that I see that the game shipped with. There must be something I'm missing.
Attachments
image.jpg
image.jpg (23.79 KiB) Viewed 441 times
"Fear is a darkroom where the devil develops his negatives" Gary Busey
benpark
Posts: 3073
Joined: Mon Aug 12, 2002 1:48 pm

RE: Terrain Generator Size for Conversion into PzCK?

Post by benpark »

When I load the height map into Milkshape, I get this horrible looking, exaggerated terrain:

Image

How do I get something like what I am seeing with the first screen? I'm sure I'm missing some critical settings either in Milkshape, or my initial input in the mapping program.

Attachments
Untitled1.jpg
Untitled1.jpg (200.56 KiB) Viewed 437 times
"Fear is a darkroom where the devil develops his negatives" Gary Busey
User avatar
Stridor
Posts: 1391
Joined: Sat Sep 08, 2007 11:01 am

RE: Terrain Generator Size for Conversion into PzCK?

Post by Stridor »

Hi Benpark,

Hey I didn't know that google had a height map generator. That is really really cool. I am guessing that it can generate height maps from real world terrain? In that case I am sold, because making real world maps with real worlds contours will be a complete doddle!!!!!!!!!!!!!

I will have to check it out.

I answer to your problem it is a simple scaling issue.

In this SS I made a quick height map but clearly it is way too intense [;)]

Image
Attachments
test1.jpg
test1.jpg (113.47 KiB) Viewed 436 times
User avatar
Stridor
Posts: 1391
Joined: Sat Sep 08, 2007 11:01 am

RE: Terrain Generator Size for Conversion into PzCK?

Post by Stridor »

So to scale it back to something acceptable, select the mesh. Select scale, select origin and leave X and Z at 1.0, but enter a value < 1 for Y. I used 0.2 for the above example, you may need to play around a bit.


Also note that the origin of the map will need to be placed at the top left hand corner of the map (x = 0, z = 0). And the scale is 1 MS3D unit = 2.54 game meters! (this is default unless you change the scaling in MS3D).

This means that for a 1k x 1k map you need to have a width (x) of 393.7 units and length (z) of 393.7 units. The game engine can render further than this so if you are not at the origin or the height and width are larger than this the game will still work (and render out beyond a k), but the engine limits the play area to these limits.

If in any doubt, import one of the games base meshes into MS3D and have a look yourself.

Remember map design is an iterative process. You might have to come back and make changes, so remember to save your work often an in various stages so that you can fork it as necessary [;)] Also if you are unsure on scale issue you can import a game object like a house or tree onto your work in MS3D to help get the scaling correct.

Hope that was helpful.

Now I need to check out google height map generator, I was using Nem's free one but thanks again for the tip.





Image
Attachments
test2.jpg
test2.jpg (102.54 KiB) Viewed 436 times
benpark
Posts: 3073
Joined: Mon Aug 12, 2002 1:48 pm

RE: Terrain Generator Size for Conversion into PzCK?

Post by benpark »

Thanks, I'm going to try that out.

Cripes, I think I misspoke about the terrain generator being Google-I am using the Nem generator...sorry to get your hopes up!
"Fear is a darkroom where the devil develops his negatives" Gary Busey
User avatar
Stridor
Posts: 1391
Joined: Sat Sep 08, 2007 11:01 am

RE: Terrain Generator Size for Conversion into PzCK?

Post by Stridor »

Also in terms of X,Y setups, stick with 64x64 "Faces". This is what the game uses. It basically limits how complex the underlying terrain is (# of polys). If you have a fast rig you could increase it, but in general I would leave it alone.

If you need more polys for detail around certain structures like river beds, gun pits etc, then you can select those faces from the mesh in MS3D and then use the Face->Subdivide function to give you the extra vertices. You then drag them around as you need to. For an example import the Kharkov_L1B mesh into Ms3D and have a look at the wireframe for the river. This allows you to keep the poly number down for the rolling terrain parts, but increase it where extra detail is necessary, without impacting too much on rendering performance.

Cheers

S.

P.S. Could you provide me a link to the google terrain gen please.
User avatar
Stridor
Posts: 1391
Joined: Sat Sep 08, 2007 11:01 am

RE: Terrain Generator Size for Conversion into PzCK?

Post by Stridor »

For the png = 1024 and the map 1000 issue it is simply due to the fact that for efficent storage of most video memory things (like bitmaps) it is best if they are a power of 2 based (ie 64x64, 128x128 .... 1024x1024) everything works better that way. In some setups if you have non base 2 bitmaps it can impact on performance.

If it bother you, you can always make the map 1024x1024, offset the origin by -12,-12 so that your play area will always be 12 meters inside the rendered game area. This may confuse some people why they can't give orders to move near the very edge of the map however.

I agree confusing at first glance.
benpark
Posts: 3073
Joined: Mon Aug 12, 2002 1:48 pm

RE: Terrain Generator Size for Conversion into PzCK?

Post by benpark »

Thanks, Stridor.

As far as resizing the map, where are the fields for setting the faces so that the .bmp will cover correctly? I got it working with one of the stock maps, but when I tried it with my feeble map it looked like Terminator II gone wild.


"Fear is a darkroom where the devil develops his negatives" Gary Busey
User avatar
Stridor
Posts: 1391
Joined: Sat Sep 08, 2007 11:01 am

RE: Terrain Generator Size for Conversion into PzCK?

Post by Stridor »

Sorry ben I don't quite follow you?
benpark
Posts: 3073
Joined: Mon Aug 12, 2002 1:48 pm

RE: Terrain Generator Size for Conversion into PzCK?

Post by benpark »

ORIGINAL: Stridor


This means that for a 1k x 1k map you need to have a width (x) of 393.7 units and length (z) of 393.7 units. The game engine can render further than this so if you are not at the origin or the height and width are larger than this the game will still work (and render out beyond a k), but the engine limits the play area to these limits.

I believe the map as I have it now isn't within these parameters. How do I resize the entire map to fit the 393.7? I can't seem to find where to input.

Sorry about the basic Milkshape questions. My wading through tutorials isn't producing results.
"Fear is a darkroom where the devil develops his negatives" Gary Busey
User avatar
Stridor
Posts: 1391
Joined: Sat Sep 08, 2007 11:01 am

RE: Terrain Generator Size for Conversion into PzCK?

Post by Stridor »

That's ok

In MS3D

Go to Tools->Terrain Generator. Here you can load the heightmap you made in Nem's or randomly generate some terrain. By default it is set to 64x64. Leave it at that for the moment. Press Add terrain and you will see the terrain in MS3D.

Ok now in the top down wireframe view pan to the topmost left point it should a coord of x = -640, z = -640. Now pan to the bottom right corner and check the coords (x = 620, z = 620). You don't need to do this every time as I have memorized the numbers.

Ok that means that the width and height = 620 - (-640) = 1260 units. We need this to be 393.7 so we need to scale the map.

To do this ensure that the map is selected (Go to the groups tab on the right hand tool frame, click on the terrain mesh and then click on the select button).The wireframe will turn red if you did it right.

Ok now go back to Model tools and press the scale button. Next in the Scale options select "Center of Mass" In the X and Z boxes type the following:

393.7/1260 ~ "0.3125" <- This is the scale factor for X and Y.

Press scale and you will see that your mesh is now scaled to the right height and width but it may look really mountainous because of the Y coord was not scaled. Now unselect the X and Z buttons (they won't have the blue highlight) and with Y selected type a scale factor in like 0.5 and press scale. You may need to make Y bigger or smaller as you see fit (remember there is an undo function in MS3D).

Ok now you should have your meshed scaled and sized correctly, all it needs is to moved to the origin. Now select the Move option from the tools box and drag the wireframe in the top down view so that the top left corner is at the origin 0,0. And there you have it. Now all you need do is export it from the Direct X (JT) ... export option as I have explained elsewhere. Note for some reason the JT exporter wants to scale by 0.1 by default (make sure that you set this to 1.0 before export otherwise your map will be 1/10 normal size). Expert users who want to work in meters in MS3D can set the export value to 0.3937 here instead of doing it manually in the editor itself! But to start out I would just do the workflow I stated above until you get comfortable with how it all works.

If you use this newly exported mesh as an overwrite of a preexisting mesh it will work fine, however you will need to re-place all the trees and houses as they might be floating in the air or buried underground with the new mesh. However you can still play on it as all game units like tanks and inf are always placed on top of the mesh and affected by gravity.

S.


In a later tut I will explain how to extrude the edges of the map down to make those nice "earthen walls" you see.
benpark
Posts: 3073
Joined: Mon Aug 12, 2002 1:48 pm

RE: Terrain Generator Size for Conversion into PzCK?

Post by benpark »

The map is showing up in the scene editor...

Image
Attachments
Untitled1.jpg
Untitled1.jpg (72.24 KiB) Viewed 439 times
"Fear is a darkroom where the devil develops his negatives" Gary Busey
benpark
Posts: 3073
Joined: Mon Aug 12, 2002 1:48 pm

RE: Terrain Generator Size for Conversion into PzCK?

Post by benpark »

...but the position is off. Too high, and too far over. At least the size issue seems more accurate. Time to get some sleep.

Image
Attachments
Untitled2.jpg
Untitled2.jpg (80.16 KiB) Viewed 439 times
"Fear is a darkroom where the devil develops his negatives" Gary Busey
Capitaine
Posts: 1028
Joined: Tue Jan 15, 2002 10:00 am

RE: Terrain Generator Size for Conversion into PzCK?

Post by Capitaine »

A conceptual question: Can't we determine a more accurate scale multiplier for the Y coordinate rather than eyeballing it?&nbsp; I'm no mathematician so excuse my misunderstanding of such things, but wouldn't the scale multiplier for Y be the same as the amount of scale reduction for the X and Z?&nbsp; If not, what kind of data would we have to know in order to get the precise scale multiplier for Y?
User avatar
Stridor
Posts: 1391
Joined: Sat Sep 08, 2007 11:01 am

RE: Terrain Generator Size for Conversion into PzCK?

Post by Stridor »

Sure you can measure the height of a hill or other feature and scale it according to what you want. I am in the process of doing a tutorial map which will cover all this stuff in greater detail, might take a few days tho.

Ben, it looks like you haven't set the origin correctly.
User avatar
Erik Rutins
Posts: 39781
Joined: Tue Mar 28, 2000 4:00 pm
Location: Vermont, USA
Contact:

RE: Terrain Generator Size for Conversion into PzCK?

Post by Erik Rutins »

Impressive work, Ben - you're getting it!
Erik Rutins
CEO, Matrix Games LLC


Image

For official support, please use our Help Desk: http://www.matrixgames.com/helpdesk/

Freedom is not Free.
Mraah
Posts: 1085
Joined: Wed Feb 20, 2008 6:11 am

RE: Terrain Generator Size for Conversion into PzCK?

Post by Mraah »

ORIGINAL: Stridor
Ben, it looks like you haven't set the origin correctly.

Stridor and Ben,

First, thanks for tut Stridor!! Second ... great job Ben!!

Regarding setting original ... I've tried your tut ... comments :

1. I noticed that Nem maps don't set properly using your formula dispite 64x64. as a matter of fact, the terrain generator (when loading it into MS3D) say's the size is actually 65x65.

2. Using the Terrain generator via your tut (post #7) works great, in reference to scaling it right.

3. Level 8 terrain, dispite being flat, has extra "faces". Even though it's flat on the grid pattern it looks like you took a Coke can and stepped on it ... Also, some faces are missing, causing gaps ->Trying to move the vertex's to make a hill with these extra vertex's (or missing faces) causes holes or tearing. I'm at work so can't provide screen shot. Just load the Level 8 terrain up in MS3D and look at top view ... you'll see what I mean. I tried to remove the vertex points ... no problem ... however, adding new faces in the gap won't work ... some faces can't be made dispite selecting only 3 vertex points. Anyway, not a problem, it just makes "editting" level 8 a pain. I'm going to start fresh at some point and redo the whole level 8 ... maybe.

4. One final note ... When using Level 8 terrainX mesh, I can add the MAP texture on it and view the MAP bmp while editting. This is great, and gives me a good reference for the edit ... However, the terrain mesh built by Nem or by MS3D cannot have a material put on ... It appears to put the material on all the faces, instead of the entire mesh. Again, I'm at work, can't show ya a screen shot. I'm pretty good at adding a material texture to meshes (ie texture editor tool ... CTRL-T) ...(or I thought I was), but this problem throws me for a loop. No worries, I can't be messing with this until I finish my Level8 conversion.

Anyway, again ... Great work Ben ... Thank you Stridor for tut.

Rob
Post Reply

Return to “Maps, Models and Mods”