Inventive Dingo forums Inventive Dingo forums
News:
 
*
Welcome, Guest. Please login or signup. November 22, 2024, 01:50:16 am


Login with username, password and session length


Pages: [1]
  Print  
Author Topic: How do I make my own maps?  (Read 30630 times)
Chris
Administrator
*****
Posts: 410


Developer


View Profile WWW
« on: September 08, 2008, 08:19:04 am »

Glad you asked!

The following explanation is somewhat technical. Consider yourself warned. Smiley

Mayhem Intergalactic Custom Maps Crash Course

Please note that custom maps are not supported in the demo, since you need to use the Custom Game option to launch one. And unfortunately there's no map editor (yet?), so you have to edit text files by hand - not very intuitive, I know.

Maps are stored as .ini files in the folder [MayhemIntergalactic]\data\base\maps (replace [MayhemIntergalactic] with the game's installation directory, e.g. C:\Program Files\MayhemIntergalactic). The name of the file reflects the name of the map; e.g. "Milky Way.ini" will show up in-game as the map "Milky Way".

The format goes something like this. First you have a small section headed "[map]" which describes the details of the map.

Code:

[map]
name=Name of map (normally the same as the filename)
author=Your name. (optional)
description=A short description of the map, ideally including the recommended number of players. (optional)


The author and description fields aren't used in the game yet. I hope to change that in future.

Following that, you have as many "[planet]" sections as you like. Each "[planet]" section creates one planet. For example:

Code:

[planet]
x=1000
y=300


The "x" parameter sets the horizontal location of the planet. Higher values are further to the right, lower values are further to the left. It's measured in pixels of a 1600x1200 screen resolution, at the default zoom level. It can take negative values as well as positive ones. It must be a whole number.

The "y" parameter is the same except it sets the vertical location of the planet. Higher values go down, lower values go up.

There are also some optional parameters. "name" explicitly sets the name of the planet (if omitted, one is chosen from the file data\base\planetnames.txt). "startpriority" makes a planet more (positive) or less (negative) likely to get picked as a starting planet for some player. "baseproduction" sets the base level of production (ships built per turn) for the planet. "factoryproduction" sets the extra production gained per factory level. (Note that the planet's production at level 1 is baseproduction + factoryproduction.) "nativesproduction" sets the production level of the planet while natives control it.

NB: A few of these may not work until v1.2 is out, which will be soon.

For example:

Code:

[planet]
name=Kahn's Planet
x=-123
y=500
baseproduction=10
factoryproduction=1
nativesproduction=5
startpriority=-1


This planet will be called Kahn's Planet and be placed 123 units to the left of centre and 500 units below the centre. While natives control it, it will build 5 native ships per turn. While a player controls it and it is Level 1, it will produce 10+1 = 11 ships per turn. If it gets upgraded to Level 2, it will produce 10+1+1 = 12 ships per turn. And so on.

The startpriority of -1 means that no player will start in control of this planet, unless there are no available planets with a startpriority of 0 (default) or higher.

Version 1.2 will introduce an additional feature for custom maps, the "rift". A rift is basically a wall. You can't move ships through it. This opens up some interesting additional possibilities for map design. I'll elaborate on how to put rifts in your map after v1.2 is released.

For examples, just look in the data\base\maps folder and you'll see all the maps that shipped with the game. Feel free to open them up to see how they're constructed.
Logged
Jp
Pilot
**
Posts: 30


Yet Another Generic Information-Age User Name


View Profile WWW
« Reply #1 on: September 18, 2008, 10:40:07 am »

Any word on rifts? Looking through the files with 1.2, it looks like you specify a series of points and the rift is drawn as a polygon through those points. How many points can you specify?

Also, how fast do ships travel on standard settings, in terms of position-units?

(Oh, and finally - some of the maps shipped with the game just use \n for newlines - I assume they were made in Linux. Given how most people using them are using Windows, you might want to change those to \r\n)
Logged

I used to play Mayhem Intergalactic before it was cool.
Chris
Administrator
*****
Posts: 410


Developer


View Profile WWW
« Reply #2 on: September 18, 2008, 11:26:16 am »

Hey Jp, good to see you around again. Smiley

Ship speed

On default settings, ships move 200 units per turn.

Adding rifts to maps

Rifts are specified in a similar manner to planets, except that they have more than one location (and no other parameters); so instead of a single "x" and a "y" parameter, rifts have "x1", "y1", "x2", "y2", and so on. Each coordinate pair describes a point of the rift. The points must be numbered sequentially, starting from 1. The rift is drawn as a segmented line between each of the given points, in order. For example:

Code:
[rift]
x1=100
y1=90
x2=50
y2=60
x3=70
y3=10

This will create a rift from coordinates (100,90) through to coordinates (50,60) and finally to coordinates (70,10). The line doesn't get closed unless you specify the first coordinate again as the last coordinate.

There is practically no theoretical limit on the number of points each rift can have. I've successfully tested up to 65.

You can't specify curved rifts, incidently; but you could approximate one using a rift with lots of small straight-line segments. This would require some manual calculations to get it looking right.

The smaller spikes coming off rifts are not specified in the map file; they are mere decorative effects which are generated randomly and have no effect on gameplay.

------

Advanced: maxverts property

I mentioned above that the rift's points must be numbered sequentially. This isn't technically true. If you set the "maxverts" property then you can have gaps in the numbering sequence, but any points which are numbered higher than "maxverts" will be ignored. For example, this works:

Code:
[rift]
maxverts=5
x1=100
y1=90
x4=50
y4=60
x5=70
y5=10

But this will cause the point (70,10) to be omitted from the rift:

Code:
[rift]
maxverts=4
x1=100
y1=90
x4=50
y4=60
x5=70
y5=10

The maxverts property could be useful if you're trying to draw a particular shape and need to add and remove points from within the middle of the rift while you're working on it.

-----
Newline characters

Good point about the newlines. The game will read them on either platform just as ably, but if you try to open some of the shipped maps in Notepad then they will be mostly unreadable. I'll fix this for the next release.

In the meantime, you can use a more fully-featured text editor (I use TextPad) or Wordpad (just make sure you save as "plain text") to view these files.
Logged
Jp
Pilot
**
Posts: 30


Yet Another Generic Information-Age User Name


View Profile WWW
« Reply #3 on: December 05, 2008, 06:23:51 am »

I see some lines beginning with semicolons in a few of the supplied files - I assume those are comments?

EDIT: And another question: Must rifts be specified in that exact order? As in, which of these are legal:
Code:
[rift]
x1=
y1=
x2=
y2=
x3=
y3=
x4=
y4=

Code:
[rift]
y1=
x1=
x2=
y2=

Code:
[rift]
x3=
y3=
x1=
y1=
x2=
y2=

Code:
[rift]
x2=
y1=
x4=
x3=
x1=
y3=
y2=
y4=
« Last Edit: December 05, 2008, 06:59:22 am by Jp » Logged

I used to play Mayhem Intergalactic before it was cool.
Chris
Administrator
*****
Posts: 410


Developer


View Profile WWW
« Reply #4 on: December 17, 2008, 03:55:38 am »

All of those are legal. The game doesn't care about data order at all. As long as it's a valid .ini file and each key/value pair is under the appropriate section, it will find and use the data.

Misspelled sections and key/value pairs are simply ignored (though misspellings may cause errors if they cause expected fields to not be found; e.g. if you specify an x coordinate without a matching y coordinate).
Logged
Jp
Pilot
**
Posts: 30


Yet Another Generic Information-Age User Name


View Profile WWW
« Reply #5 on: February 19, 2009, 10:30:39 pm »

What are the default values for baseproduction, nativesproduction, factoryproduction, startpriority, etc?

I imagine startpriority defaults to 0, baseproduction defaults to 5, and factoryproduction defaults to 3. Don't know about nativeproduction. Is it more complicated than that?
Logged

I used to play Mayhem Intergalactic before it was cool.
Chris
Administrator
*****
Posts: 410


Developer


View Profile WWW
« Reply #6 on: February 19, 2009, 11:40:36 pm »

startpriority=0, baseproduction=2 (note that factoryproduction is taken into account even at level 1; i.e. a level 1 planet produces baseproduction+factoryproduction ships per turn), factoryproduction=3, nativeproduction=2.
Logged
Rich
Space cadet
*
Posts: 2


View Profile
« Reply #7 on: October 23, 2014, 06:37:05 pm »

I have a quick question regarding map making.    What are the limits of x and y for the game to still be playable.  I noticed that if you place a planet too far away, the AI doesn't work.    Sorry in advanced if this was covered else where.
Logged
Chris
Administrator
*****
Posts: 410


Developer


View Profile WWW
« Reply #8 on: October 26, 2014, 05:51:29 am »

Hi Rich! That sounds like it might be a bug. Can you send me the map file you were working on?
Logged
Rich
Space cadet
*
Posts: 2


View Profile
« Reply #9 on: November 23, 2014, 03:30:41 pm »

My logic here was that it would be much more difficult if AI planets took longer to travel to.   They would be able to rebuild and actually defend themselves.......    I cant remember which test map it was that I saw the AI doing nothing.

* test map.ini (0.27 KB - downloaded 1123 times.)
* test2.ini (0.22 KB - downloaded 1044 times.)
Logged
Chris
Administrator
*****
Posts: 410


Developer


View Profile WWW
« Reply #10 on: November 24, 2014, 09:40:03 am »

Thanks for those! I'll put it on the bug list, and let you know if I find anything when I get to it. Smiley
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC

Valid XHTML 1.0! Valid CSS! Dilber MC Theme by HarzeM