Inventive Dingo forums Inventive Dingo forums
News:
 
*
Welcome, Guest. Please login or signup. January 21, 2020, 01:53:57 am


Login with username, password and session length


Pages: [1]
  Print  
Author Topic: Maps  (Read 12103 times)
Kahn
Space cadet
*
Posts: 9



View Profile
« on: August 23, 2008, 03:13:33 pm »

Hi,

Is there any way for the player to create custom maps?

Sincerely,
Kahn
Logged

Sincerely,
Kahn
Chris
Administrator
*****
Posts: 410


Developer


View Profile WWW
« Reply #1 on: August 24, 2008, 02:05:04 am »

Hi Kahn,

Glad you asked! Yes there is. I've been wanting to document it and properly support it for some time. Since you asked, I'll take this opportunity to give a tiny crash course, for you and for anyone else who runs across this topic.

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, 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.

Hope that helps, and sorry for drowning you in so much information!
« Last Edit: August 24, 2008, 02:06:49 am by Inventive Dingo » Logged
Kahn
Space cadet
*
Posts: 9



View Profile
« Reply #2 on: August 24, 2008, 03:00:44 pm »

Hi ID,

No, by all means, you've done a wonderful job of explaining how maps work.

On a related topic, is there anything that has to be done to the AI to intelligently work with a custom map?  Can there be several different AI's (i.e.: Aggressive, Defensive, sneaky ones that like invading backfield planets, etc.)?  How would one edit these, if possible?
Logged

Sincerely,
Kahn
Chris
Administrator
*****
Posts: 410


Developer


View Profile WWW
« Reply #3 on: August 25, 2008, 09:30:28 am »

No AI customisation available, I'm afraid. On the plus side, no AI customisation is necessary either - they'll navigate whatever map you give them with reasonable competence.
Logged
Kahn
Space cadet
*
Posts: 9



View Profile
« Reply #4 on: September 06, 2008, 09:58:40 pm »

OK Mate,

I just bought a copy.
Logged

Sincerely,
Kahn
Chris
Administrator
*****
Posts: 410


Developer


View Profile WWW
« Reply #5 on: September 07, 2008, 01:21:23 am »

Cheers! Let me know if you have any more questions.
Logged
Kahn
Space cadet
*
Posts: 9



View Profile
« Reply #6 on: September 08, 2008, 12:34:04 am »

Hi Chris,

Already finished 2 maps.
Globular Cluster (medium) - A circular galaxy with 47 stars.
Star Cluster 5 (large) - An star shaped galaxy with 5 starting points (127 stars).
I've played both and the AI had no problem (little bugger AI kept doing "Hail Mary" plays towards the end of the game on the large map).

Any way to upload these to your site?

A map editor would also help.  Might get around to programming one myself, if time allows.  I used MS Excel to help generate both of these maps.
Logged

Sincerely,
Kahn
Chris
Administrator
*****
Posts: 410


Developer


View Profile WWW
« Reply #7 on: September 08, 2008, 08:16:02 am »

Hi Chris,

Already finished 2 maps.
Globular Cluster (medium) - A circular galaxy with 47 stars.
Star Cluster 5 (large) - An star shaped galaxy with 5 starting points (127 stars).
I've played both and the AI had no problem (little bugger AI kept doing "Hail Mary" plays towards the end of the game on the large map).

Great!

Quote
Any way to upload these to your site?

Good idea. I've made a new board for the purpose. I suggest the use of the forum's attachment feature (expand the Additional Options box underneath the main post editing box when creating a topic) to upload maps.

I've also added a  mapping discussion board.

Quote
A map editor would also help.  Might get around to programming one myself, if time allows.  I used MS Excel to help generate both of these maps.

Excel is a great solution. I wrote throwaway scripts in Python, myself.

Yes, I've been wanting a map editor for some time. You're welcome to take the task off my hands if you like. Wink
« Last Edit: September 08, 2008, 08:34:44 am by Chris » Logged
Kahn
Space cadet
*
Posts: 9



View Profile
« Reply #8 on: September 08, 2008, 11:50:04 pm »

Hi Chris,

Thanks, but you might have a bit of tweaking to do.  I tried to upload one of my maps (4.90 K) and received the following message:

An Error Has Occurred!
Cannot access attachments upload path!

Seeing how the permissions are wide open, my first guess would be the spaces in the path directories and the file name are presenting a slight problem.
"C:\Program Files\Mayhem Intergalactic\data\base\maps\Globular Cluster (medium).ini"
Logged

Sincerely,
Kahn
Chris
Administrator
*****
Posts: 410


Developer


View Profile WWW
« Reply #9 on: September 09, 2008, 09:16:05 am »

Try again now. Smiley

* test upload.txt (0.02 KB - downloaded 480 times.)
Logged
Kahn
Space cadet
*
Posts: 9



View Profile
« Reply #10 on: September 11, 2008, 11:54:15 pm »

Thanks Mate!

Check em' out.  Grin
Logged

Sincerely,
Kahn
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