How to get editor to recognize different terrain sprites.

Discuss and post your mods and scenarios here for others to download.

Moderator: Vic

Post Reply
Xenomorph
Posts: 97
Joined: Wed Feb 26, 2014 1:35 pm
Location: Colorado

How to get editor to recognize different terrain sprites.

Post by Xenomorph »

Hello to all,

I can see there are many mods for terrain sprites but I can't figure out how to get the editor to recognize them.

For example, I see the editor recognizes: ...default/graphics/plain as its default directory for terrain. But I prefer, for example, the urban sprites in: ...graphics/alt/city. At first I thought to simply have the editor switch to recognizing that directory for those sprites but couldn't figure out how to do so.

So then I tried simply copying the sprites I like over to the default directory and renaming them to start with the wording "Urban" (since there are several terrain types in the default directory, the wording at the beginning of the file name seems to matter). I restarted the game & editor expecting the sprites to be there but they weren't. So now I'm at a loss.

Any help would be much appreciated! (If you could make your response as step-by -step detailed as possible. The tutorials definitely seem to skip steps bc they'll say for example, "click landscapes" but then show a screen that actually required several more clicks before actually getting to that screen. Frustrating given my time constraints. Thanks again!)
User avatar
Ormand
Posts: 754
Joined: Tue Feb 17, 2009 1:31 am

RE: How to get editor to recognize different terrain sprites.

Post by Ormand »

For this you will have to do some trial and error to figure out how it all works. But here is basically how you do this.

Go to the "Land" window in the editor. You will see the long list of terrain types. Click on any one, say plains. The first thing you will notice under the properties window is an image with several hexes. It will be green, etc. To the left, there is a blue button with a white arrow. Click this to change the image. It will then open a window to navigate to the directory where the image you want to use for this terrain. This the standard graphics size, and is 64 pixels high and a multiple of 48 long. The standard map graphic is 64x48 pixels. You will see that sometimes there will be hex images. For plains, there are seven. In this case, the game will cycle through the various images to make the map. This will reduce the repetition in the map. This is the base graphic for that terrain. Underneath this graphic is an overlay for the map. For plains and sea, this is a transparent hex. But, go to fields, and you will see that there is an image. To change this image, you click on the blue boxes with white arrows and navigate to the directory with the graphic. This will be displayed on top of the base graphic. There are actually three types here. Run the mouse over the blue boxes and there is a description above. To see what happens look at High Mountains. There are three sprites with the plains image as the base. In fact, the first sprite is the same as low mountains, and the second sprite goes on top of that. Now, if you go to the urban terrain, you will see that there are eight different sprites.

These are for the eight different people. There other times when more than one sprite is used as well. This occurs when the random map morphs terrain due to climate. Basically, the engine makes a map with the standard terrains and then changes them due to the climate based on Stringlist ID=40-43, with the sprite used listed in the second column.

The basic operation of changing the terrain is as above you change the base graphic and then the sprite overlays. It is not necessary to have sprites as the terrain can be in the base. But, you must have an image here. So, if you want the base terrain, the sprite has to be transparent.

The graphics are in directories under the graphics subdirectory. Default is in at2, the DC alternate graphics are in alt. If you create a standard graphics set, the game will automatically generate the BIG and SMALL graphics for you in a directory with BIG (128x96) and SMALL (32x24) added to your directory name.

Now comes the really hard part. If you have an image, you will notice that when you have to terrains, there will be a sharp line between the two terrains. This, of course looks ugly. So, it is possible to generate edges. The are 64 combinations of edges. The best example is in the Fields. Here you will note that the entry x64 doesn't have a blue box with white arrow, but a red box with redder X. This is because the 64 edge sprites are set, and this red button will cancel them. But, first look at the entry in "64 Special Sprites" in the properties box. Off to the left, you will see an image that has 64 hexes that represent all possible edges that can be made with a hex. Basically, the idea is that this image will lay on top of the adjacent hex so that you can have a smooth transition. Generally, it will be mostly transparent and be blended. These edges can be done in two ways. One is the Fred sheets, of which this is an example. All 64 hexes are in the same image. This means that there will be only one image for each edge. For Fred sheets, you navigate to the directory to enter it. The second method is 64 separate files for the edges. For the most part, Anewdawn doesn't use these, just the Fred sheets. The exception being the sea hexes, where there are 64 separate files named a1.png, b2-6.png, c1-15.png, etc. These are the same 64 hexes as in the Fred sheet. To enter these, you must give the directory path and they MUST have these names. The main reason that you would contemplate using these is that you can make multiple images for these. For example, you could a1.png have 6 or 10 hexes that would then be used randomly to make the map. This is mostly useful for coasts. Note that the coasts are make by the sea having an overlay on all terrain types.

This can get rather involved. The order at which the overlays are chosen is in the graphic overides slot. Here, you put the terrain you want this terrain's edges to go on top of. For example, low mountains are on top of just about everything, with high mountains on top of them, and sea on top of everything. The weight is the z-number. The higher the number the higher the weight, and which terrain will be on top if two terrains could overlay the hex. The box next to this is the overrides for extra interior. This is basically how to control two terrains that are similar, such as sea and stormy seas.

It gets worse. You can also specify a border for each terrain. The game will automatically draw a border for the terrain hex. An example, is swamp (and mud, snow, desert). This is specified with the PreHexBorder=25. This will use terrain 25 as a pre-hex border for swamp. I think the borders are on the bottom, and subsequent overlays cover it, but I am not sure. Borders can be quite useful. I used them to make a smooth interface between summer and winter mountains. The border put snow on the summer mountains.

If you look to the right, you will also see several buttons. The first is Interior Drawing Style = false/true. When false, the edges will be drawn outside the hex, and will overlap surrounding hexes. When true, the opposite happens. The edges are drawn on the inside of the hex. This is the style of the alt graphics used in DC. You can mix them. I used this style to make urban hexes that ran together to make a more realistic urban complex. Going with this are Extra exterior and extra exterior the same. Note that sea and stormy sea have extraexteriorsame set to true. This basically means that the they will be treated like the same terrain type. This is specified in that box Overrides for ExtraExterior.

The basic graphics are easy to deal with. Where things get more complex is the edge overlays. You just need to practice and see what the effect is.
One man alone can be pretty dumb sometimes, but for real bona fide stupidity, there ain't nothin' can beat teamwork -- Edward Abbey
Xenomorph
Posts: 97
Joined: Wed Feb 26, 2014 1:35 pm
Location: Colorado

RE: How to get editor to recognize different terrain sprites.

Post by Xenomorph »

Thanks so much Ormand! Unfortunately it just didn't work. Really frustrating because when you go into Landscape Types, choose Urban, choose "Sprites" (in the Property Sheets box that appears), choose "Urban 01" (in the Sprites box that appears) it will then show the sprite on the screen and if you then hover the mouse over the sprite, the bar that runs across the top of the editor area (the bar that runs between the map itself and the box that says "End Drawing Mode") will say: "Click to change the sprite". BUT...you can't. If you click on the sprite nothing happens. And so then you're stuck as far as I can tell. It's odd that it says you can click it but doesn't actually let you do so.

Finally I tried deleting the sprites that already existed in the default directory and replacing them with sprites I wanted. That worked. You have to rename them to same name as the existing default sprites. What's also odd is that you can't add any additional sprites. The existing default sprites are named "Urban 01" thru "Urban 05". So I thought to add "Urban 06" etc but the editor doesn't recognize them. So my next question is that if anyone knows haw to make the editor recognize a greater number of sprites it'd be really helpful.

I know Vic warns that the editor is a bit "quirky" but if I could change one thing it'd be that the editor were more user friendly and intuitive. If that were done I believe the very nature of this game would be transformed by the large number of modders that would be attracted to it. It's a wonderful game though. Just my 2 cents. Again, any help on my above question would be MUCH appreciated and THANKS AGAIN to Ormand for taking the time!!
User avatar
Ormand
Posts: 754
Joined: Tue Feb 17, 2009 1:31 am

RE: How to get editor to recognize different terrain sprites.

Post by Ormand »

Sorry for the long delay. I was away on travel - it is busy now as I have two more weeks of the stuff.

OK, I think I know what your problem is. As for the "click to change sprite". Don't click the image but the little blue box with the white arrow. There are three of them. The leftmost one, is the base sprite. The middle one adds a sprite at the end of the drawing, while the rightmost one is drawn over the hex above the landscape. In general, to change things, there are buttons. Note there are two other buttons in this area. "Plot Last" and "Over is Top". These also have an impact as they have to do with graphics that will always be on top (I think this has to with the edges. Mostly, you have to try them and see what happens). Click the leftmost blue button, and a dialog will open that will allow you to navigate to the graphic you want.

To add more sprites, look below the sprite window. There is a button with a "+" sign and says "Add Sprite" This will add a sprite and open the dialog to choose graphics.

You can do what you did, namely rename things, but of course it is better to make modifications and save it as a new scenario.
One man alone can be pretty dumb sometimes, but for real bona fide stupidity, there ain't nothin' can beat teamwork -- Edward Abbey
Xenomorph
Posts: 97
Joined: Wed Feb 26, 2014 1:35 pm
Location: Colorado

RE: How to get editor to recognize different terrain sprites.

Post by Xenomorph »

There is a button in the "Decisive Campaigns" games that has that + sign to add sprites but I don't see it in ATG. Are you possibly confusing the two or am I missing something? Speaking of which, is it possible to simply copy over the DC graphics to ATG? I like the terrain and unit graphics in DC much more than ATG so it'd be awesome to be able to do so. If anyone has tried it, I'd be interested to hear how it went. Thanks again!
User avatar
Ormand
Posts: 754
Joined: Tue Feb 17, 2009 1:31 am

RE: How to get editor to recognize different terrain sprites.

Post by Ormand »

No confusion, it is there in ATG as well. I haven't used the editor in DC actually. There is, however, an issue with at2 files that are not really scenario files, where you can't actually edit them. I have forgotten the details of how this comes about. The best thing to do is to open the newdawn or other official at2 scenario, save it to another name, and then edit this file. I think it will also become editable if you import a masterfile. For the most part, you want to edit a masterfile here, and not a scenario. I have edited many an ATG file (Fourseasons replaces just about every graphic in the game, uses borders and external and internal edges) (EDIT: It is about the most tedious exercise you can think of).

As for the DC graphics, I think this is what the alt graphics are. There are no seasons with them, however. They use a completely different approach to the edges, internal rather than external, so just trying to copy them will not work. But, like I said, you can play a random game with them, although perhaps anewdawn3 hasn't been converted to those graphics.
One man alone can be pretty dumb sometimes, but for real bona fide stupidity, there ain't nothin' can beat teamwork -- Edward Abbey
Post Reply

Return to “Mods and Scenarios”