Add a new map: Maps and php

From SEOW Wiki (IT)
Jump to: navigation, search

Create new map folder

In Windows Explorer, go to the "\Scorched Earth\MP4\" directory of the Scorched Earth installation

  • Here you will see all the directories for the SE Map sectors currently supported.

Create a new directory with the name of the new map sector you wish to add.

  • If possible and for simpler integration in the PHP files later on, use a single name with no spaces.

Now, which current Scorched Earth map do you think is most similar to the one you wish to add? In this I mean; the size of the map, the number of districts and the amount of cities in the drop down lists etc. that you think will be similar to your new map. If its a large and complex map you will find a lot of files in the directory eg. Moscow, GulfOfFinland.

Use that map folder as an example of what you will be creating.

  • When having a look at the files be careful that you don't make any changes otherwise that map may not work properly or at all!

Copy PHP files from another map folder

The fundamental files you will need to create in your new map folder are: (just copy these from another map folder and edit the names)


"NewMap"-intel.php (this PHP file controls the sector, district and city drop down lists and the links on the main map image)




Note that the sector, district and city php files are the same internally but are just edited to suit. I'll explain further below.

Note that some of the PHP files have a jpg image file that go with them. Have a good look at your reference map folder and see how this has been done.

Before we edit the content of the PHP files to suit the new map lets get some images to go with them.

Image Capture

Please allow me to assume you have a good understanding of the FMB and a good quality graphics application. Otherwise this would be a very long process to descibe.

I'll use the the Imphal map as an example. In game and the FMB this is the Burma map. It was named "Imphal" in SE as this map mostly deals with the Battle of Imphal in March 1944.

To create good resolution images ensure the graphic settings in game are at least 1024x768 x32bit in resolution. I used 1152x864 x32 when capturing the images for Imphal.

How to get a quality map without texts

  • With modded maps, use ed_m01.tga in the maps folder.

- In Il2 main folder, look for fb_maps??.SFS of the map. Open it with sfs.exe extractor and "extract all" in a folder.

- Look for the ed_m01.tga file: generally, it's one of the max size file, rename it ed_m01.tga.

- Now you can edit it and use it for SEOW graphics.

Sector Map

First one to capture is the whole map view. This will be used to create both the districts-small and whole sector maps.

Open the Full Mission Builder (FMB) and open the map you are adding. use FMBplus

Ensure that the whole map is visible and take a screen capture (print screen). Make sure the grid coordinates a re visible along the edges.

Put an object in 4 edges of map and save as xxxsector.mis to get coordinates of image in FMB.

Open graphics program (ie PhotoShop etc) and open the screen capture file you just made. This will be "grab0000.tga" in your Forgotten Battles main directory.

Use the Rectangular Marqee tool to cut out the map from the overall screen grab to trim the image of the surrounding FMB sliders and frame. If the map doesn't completely fill a full grid then trim along the grid lines **only if the grid line in question is very close to the edge of map!!** This makes mapping the FMB co-ordinates to the image a lot easier.

Copy selection

Create new file


Save as Jpg file (adjust the JPEG compression to keep the file size reasonable, i.e. don’t make a 5 MB map image!)

Take a note of the image size in pixels. This is needed for the PHP file.

Here is Imphal_Sector.jpg as an example:

Imphal sector.jpg

You may see that the very top of map was trimmed . This was OK to do so as the edge of actual playable map was within the viewable image. This is how it was in the FMB and the map co-ordinates for the sector map had to be adjusted to suit as seen in the file below.

Edit Sector map PHP File

Here is Imphal_Sector.php. This was copied from another map folder and then edited to suit Imphal. The highlighted text is what you need to edit to suit the new map.

Imphal sector php.jpg

As you can see there is not a lot that you need to change.

All your doing is editing the names, the image size in pixels and the FMB co-ordinates that the image shows. The above PHP is an example for all the district and city php files as well!

Its the same file with appropriate changes made for each district. Look at another map folder and you will see how they are all the same bar the changes as made above.

  • The critical and probably most time consuming aspect of this process is getting the FMB map co-ordinates correct for your image file. You can't do that with any accuracy unless you have an operational Scorched Earth system to test it in. Enable the "ShowRoads" and railways section above when tweaking the Latitude and Longitude co-ordinates once the map is basically functional. This ensures you will be able line everything up nicely on top of your image.

Edit the "intel.php" file

This file brings all the php's and Jpeg's together.

Again, the highlighted text is what is edited to suit. At this point I like to think that you are getting an understanding of what the different lines in the file are actually doing.

Imphal intel.jpg

Edit the others php files

There are 3 files that need to be edited, MP-Admin.php, MP-Connection.php and default-green.php. I have added a Ukraine sector to my SE setup for a new sector that I am working on. Let's look at each one;

FIRST: backup these 3 files


Towards the top of this file look for these lines, insert your sector in the appropriate place, mine is Ukraine so goes at the end of the list;

Imphal admin.jpg


The connection data is in alphabetic order so navigate down the list to where your sector should fit and insert - Ukraine goes at the bottom;

Imphal connection.jpg


There are 2 areas in this file, the first area defines the Sectorlink, it's in alhabetical order so navigate down to where yours should fit in and insert. Then determine which region you are going to put your sector, in my case I've put Ukraine in the Eastern Europe region, navigate to where you want to insert your sector eg in my case immediately after Tunis and insert there.

Imphal defaultgreen.jpg

Airbases Layouts

Each airbase needs to have a layout model (location for statics aircrafts, balloons, searchlights…)

See informations : SE Airbase Layouts