ZMap - Mayhem 3 (and Zero Hour) Map Generator and Editor

The place to discuss scripting and game modifications for X³: Terran Conflict and X³: Albion Prelude.

Moderators: Moderators for English X Forum, Scripting / Modding Moderators

User avatar
Hairless-Ape
Posts: 316
Joined: Wed, 6. Nov 02, 20:31
xr

ZMap - Mayhem 3 (and Zero Hour) Map Generator and Editor

Post by Hairless-Ape » Wed, 10. Aug 22, 16:01

(A full featured Map generator and editor. For use with Mayhem 3 and follow-on mods such as Zero-Hour)

"Unlike the original map generator, ZMap allows you to have full control over Gates and Systems without being forced to regenerate a new map. -mm"

-Version 1.7.5 is out. 10/31/2023
See release notes below.
This release REQUIRES Zero-Hour Version 1.8 or higher, or Mayhem 3 Renegades .
If you are using previous versions of Zero-Hour, or simply using Mayhem 3 by itself, then download ZMap V1.5, which works great but does not generate Terran sectors.

Using ZMap V1.6+ with old maps:
You can load an old map generated by a previous release or even Joubarbe's original Map generator, but you'll need to fix any race relations by simply adjusting them in your U.I. to your liking, and then simply re-save your map and it will be fixed and all is good. Also remember, your "old" map won't have Terran sectors, so it won't work with Zero Hour 1.8, which expects them. You can however, simply load the old map, change ownership of some sectors to Terran, and save it and then you're good to go.

A few people have reported incorrect spoken sector names when generating Large Z-Maps.
Run the original map generator (not zmap) one time. Create a map. Run it. Exit. This initializes mayhem to accept new maps. After this, you should be able to create and run maps from Zmap without issues related to system voice names. This has been confirmed by a couple people now so I believe this is what's happening, and it fixed the issue for them.
-

https://i.imgur.com/fxVJu5h.png

Executable and Source Code
https://github.com/Hairless-Ape/ZMap/releases

Installation
  • Run Joubarbe's original Map editor 1 time. Create a map and run it with his editor, and then exit out of it. There's something it does to the Mayhem 3 install to set it up to use these maps and I'm not sure yet what that is :)
  • Download the ZMapX.X.zip file from the link above. Put it in any new folder you wish, or in your Mayhem 3 folder.
  • Backup any of your current save games just to be safe.
  • Run the program. Setup folder locations for your Mayhem 3 root and for your X3AP save location.
  • Enjoy the Mayhem.

Features
  • Written from scratch using C#/.NET. Source code readily available.
  • Greatly improved map generation algorithm.
  • Larger more readable presentation.
  • Gates and system stats are displayed.
  • Gates and system statistics can be independently re-generated for a map.
  • Gates can be added or removed individually
  • System stats can be individually edited.
  • Sunlight levels can be adjusted per system.
  • Startup locations per race can be set.
  • Corporations can be set for each sector.
  • Maelstrom startup location can be set (requires Zero-Hour 1.6)
  • Special game starts for Peaceful and Chaotic Xenons (requires version "tbd" of Zero-Hour)
  • Old maps can be loaded (with restrictions if using ZMap 1.6 or above).
  • Also now generates Terran Sectors, which is required when running Zero-Hour V1.8 or above.
  • A new feature was added for ZH 2.0 allowing you to perform a random change of up to 30% to all ship or weapons stats. Every ship (or weapon) can have it's statistics altered by a single random value from -30 to +30 % of nominal. This process is done for all ships, or all weapons, but each has it's own unique random value applied. This provides some interesting replay-ability whereby your old favorite ship may now suck and the old suckiest ship may now be pretty darn good.
Kudos
  • Special thanks to Metallumere for his great insights, technical help, and most of all the relentless testing he performed. Without whom, this release would not be possible.
  • Thanks to Hector0x for his help, technical support, and for his new Zero-Hour Mayhem 3 mod addition.
  • Thanks to Joubarbe for creating the ultimate X3AP mod.
  • Thanks to Fallout for localization testing and Russian translations.

This was a labor of love. I very much hope you enjoy what you see.
-Hairless-Ape
Last edited by Hairless-Ape on Thu, 15. Feb 24, 17:14, edited 43 times in total.
Out of my mind. Back in 5 minutes.

User avatar
Hairless-Ape
Posts: 316
Joined: Wed, 6. Nov 02, 20:31
xr

Re: ZMap - Mayhem 3 Map Generator and Editor

Post by Hairless-Ape » Wed, 10. Aug 22, 16:03


Version 1.7.5 2/15/2024

Changed defaults to System statistics and Terran Memory sectors are turned ON by default when you generate a new map.
These can be turned off with the icons on the top bar of the application.
Changed the fields for Default X3 install and saved-game locations to appear like "links", so that it's a lot clearer to users they need to click those fields in order to set them.
Updated version number displayed and release notes.


Version 1.7.4 10/31/2023

Fixed a lockup condition if you choose Chaotic Start at the same time as the Clustered Voids selections.


Version 1.7.3 10/29/2023

Updated for Zero Hour 2.0
Fixed issue with it overwriting your install directory in settings file.
Updated TBullets.txt and TShips.txt for ZH 2.0 (see 1.7 notes below for what this means)
Updated so that if your /addon/types folder does not exist when using the new randomize ships/weapons feature, that it will now just create the folder for you. Note this
folder does not exist in Mayhem by default.
Updated ship and weapons randomizer to allow up to 30% change in stats. For ship having 5 or more base shields, shield count will now also be adjusted by +/- 1 shield depending on the random generator.


Version 1.7 8/3/2023

Added a new feature allowing you to globally change certain key statistics on all ships in the game. This feature applies a random value between -20% and +20% to key ship statistics. This value is applied uniformly to each ship, but each ship gets a new random value to apply. This allows you to play a new game with some random adjustment, so that you can no longer be sure your favorite ship is your favorite anymore (or worst). You will need to re-discover which ships are now top performers. These change are made by adding a new TShips.txt or TBullets.txt file to the /addon/types folder which serves as an override for your games. You can simply delete these files anytime you want to revert to game defaults.

Also added a new feature similar to the one above for Bullets (weapons). This feature also allows you to selectively target a single race only, and also allows you to specifically lower or raise stats by random amounts so you can choose to improve, or worsen the weapons of a given race if you want. This feature creates a TBullets.txt file in the /addon/types folder to override weapons. You can simply delete that file if you want to revert.

Fixed a bug where your race's selected "starting system" would not be remembered if you edited another system.



Version 1.61

Added Terrans.
This release REQUIRES Zero-Hour Version 1.8 or higher, which supports the addition of Terrans.
If you are using previous versions of Zero-Hour, or simply using Mayhem 3 by itself, then download ZMap V1.5, which works great but does not generate Terran sectors.


Version 1.5

Added ability to edit sunlight levels per system.
Fixed bug with setting Maelstrom sector.
Updated Russian translations.


Version 1.4

Added ability to add or remove Gates in the sector editor.
Added "Peaceful" and "Chaotic" Xenon start options. These starts require the supporting version of Zero-Hour to be effective.
---Essentially, a Chaotic start has half the map covered by Xenon and Integration support with Zero-Hour provides the proper number of OCV invader fleets and defenders to the game. A Xenon crisis would trigger sometime during the first in-game day. A peaceful start has 1 Xenon sector only and has a delayed Xenon aggression period.
Added visual offset to gate lines that extend more than 1 system in length, so you can identify them. (X3 does not allow visual gate lines to extend in length more than 1 system, but this offset allows you to see that they are 'long' gates).


Version 1.3

Added Localization capability and provided a Russian translation file.
(NOTE: to use the Russian translation file, rename it to localizations.json and copy it to your executable folder, overwriting the english version of the file.)
Several bug fixes.
Added ability to set the OCV Maelstrom startup location in the sector editor. This requires a new version of Zero-Hour (1.6 perhaps) to have an effect.


Version 1.2

Fixed Extra System stats not working on new map generation.
Fixed loading old galaxy maps. Note: U.I. settings from old maps are not retained.
Fixed asteroid generation. No more Nvidium.
Added override in Settings.txt file allowing you to set how much space you want to be empty. If set (from 16-50%), the shattered galaxy setting will not be used.
Added override in Settings.txt file allowing you to override how much space you want owned by the Xenon (4-10%).
Last edited by Hairless-Ape on Thu, 15. Feb 24, 17:18, edited 20 times in total.
Out of my mind. Back in 5 minutes.

User avatar
Joubarbe
Posts: 4796
Joined: Tue, 31. Oct 06, 12:11
xr

Re: ZMap - Mayhem 3 Map Generator and Editor

Post by Joubarbe » Wed, 10. Aug 22, 18:45

Congrats! Very happy that someone could improve the standard generator. With that and Zero Hour, I think my job is done here :)
Enjoy.

User avatar
alexalsp
Posts: 1820
Joined: Fri, 18. Jul 14, 05:28
x4

Re: ZMap - Mayhem 3 Map Generator and Editor

Post by alexalsp » Wed, 10. Aug 22, 18:51

People, comrades, warriors, will there be support for other languages for the generator? :roll:

User avatar
Hairless-Ape
Posts: 316
Joined: Wed, 6. Nov 02, 20:31
xr

Re: ZMap - Mayhem 3 Map Generator and Editor

Post by Hairless-Ape » Wed, 10. Aug 22, 19:04

Support for localization is on my to-do list for sure.
Sorry, it was a secondary goal and I had my hands very full with getting this first cut out there, but as time allows, I'll add the capability.

I was also asked why people are not seeing the system stat numbers when they generate a galaxy. Note, that this is off by default. There is a toggle icon for it in the top left. There is another toggle icon up there as well that will cause Terran Memory systems to be highlighted on the map.
Out of my mind. Back in 5 minutes.

Betelgeuse97
Posts: 286
Joined: Sat, 20. Aug 11, 17:27
x4

Re: ZMap - Mayhem 3 Map Generator and Editor

Post by Betelgeuse97 » Thu, 11. Aug 22, 09:17

I made a galaxy and played it for about 6 in-game hours. I like it so far; it's impressive that you reverse engineered the old generator and added some stuff that's not in the original!

I noticed these bugs:

- Extra system stats option doesn't boost stats when sector stats are regenerated or when a new galaxy is generated.
- You cannot load an old galaxy made from the old galaxy generator. Doing so will display an exception error message box.
- Miners get Nividium from mining (debris generated by the galaxy should spawn only Ore and Silicon).
- Attempting to switch between old galaxies (from the old generator) and new galaxies (from ZMap) results in saves for the latter not properly backing up.

Also, galaxies generate a fixed number of sectors depending on the galaxy size. The number of sectors below is for square maps:

- Small galaxy: 65 with shattered option, 85 without
- Medium galaxy: 110 with shattered, 144 without
- Large (actually a 17x17 square, not 16x16 as suggested): 188 with shattered, 246 without

I'd love to see more come out! Will these come in the future?

- More variance in galaxy sizes. What about an option to randomize the percentage of empty spaces (e.g., make it random between 15-25% for normal and 35-50% for shattered) or allow the player to input how much empty space (in percentage) they want for galaxy generation?
- Adjustable number of Xenon sectors generated in the galaxy (without manually editing each sector).
- Start in an unknown or Xenon sector?

User avatar
Hairless-Ape
Posts: 316
Joined: Wed, 6. Nov 02, 20:31
xr

Re: ZMap - Mayhem 3 Map Generator and Editor

Post by Hairless-Ape » Thu, 11. Aug 22, 15:07

Thank you Betelgeuse97 :)

1.2 is out there now. I was able to fix the major issues you pointed out, and I also added some override options you can put in your Settings.txt file that would allow you to increase either void/empty space up to 50%, or to increase Xenon space up to 10%. I don't think these are mainstream enough to add to the U.I., but you can certainly change those values now if you really need to. You also have the source :)

Ability to start in unknown or xenon space is on my todo list. Although, I am wondering if staring in xenon space is a viable option.

Regarding the "Attempting to switch between old galaxies (from the old generator) and new galaxies (from ZMap) results in saves for the latter not properly backing up." issue:
This is mentioned in my original ReleaseNotes.txt file and is also why a huge WARNING dialog is brought up when you first start ZMap. Joubarbe had his own way of tracking saved games which is different than the way I track it, and this is the result and is not avoidable. I would say either stick with the old one, or the new one, but if you're going to switch between them, you'll have to manually deal with your save game backups.

Regarding galaxy size, it is working as intended and for now I think the 3 options are enough. You can now override the void/empty space now using the Settings.txt file if you really want more empty space. Hopefully that will be sufficient.

I'm still looking over localization. That one is a bit tricky and I have a few unknowns to resolve regarding what needs to be done with the mayhem files being generated, and absolutely another area where Joubarbe did a far better job. I'm working on it though. Other than the U.I. elements needing localization, from what I can tell, the only difference in the files being generated are the filenames for 8379-L0XX.xml and 9970-L0XX.xml. Not sure what other implications there are for another language.. If you have any info on the technical aspects for this, please private message me. Much appreciated.
Out of my mind. Back in 5 minutes.

SaulGoodman
Posts: 7
Joined: Sat, 28. May 22, 08:57

Re: ZMap - Mayhem 3 Map Generator and Editor

Post by SaulGoodman » Mon, 15. Aug 22, 22:57

My project involves implementing the Terran into the mayhem 3 universe. I have all but the galaxy generator part finished.
If you could give me permission to do so and point me in the right direction regarding changes that need to be made to your software to allow for 2 new races to be generated I would be glad.

User avatar
alexalsp
Posts: 1820
Joined: Fri, 18. Jul 14, 05:28
x4

Re: ZMap - Mayhem 3 Map Generator and Editor

Post by alexalsp » Mon, 15. Aug 22, 23:17

Source code on GITHUB

User avatar
Hairless-Ape
Posts: 316
Joined: Wed, 6. Nov 02, 20:31
xr

Re: ZMap - Mayhem 3 Map Generator and Editor

Post by Hairless-Ape » Wed, 17. Aug 22, 13:28

SaulGoodman wrote:
Mon, 15. Aug 22, 22:57
My project involves implementing the Terran into the mayhem 3 universe. I have all but the galaxy generator part finished.
If you could give me permission to do so and point me in the right direction regarding changes that need to be made to your software to allow for 2 new races to be generated I would be glad.
Are you working with Hector0x to include your changes for Terrans into his Zero-Hour release ?


Cheers.
Out of my mind. Back in 5 minutes.

User avatar
alexalsp
Posts: 1820
Joined: Fri, 18. Jul 14, 05:28
x4

Re: ZMap - Mayhem 3 Map Generator and Editor

Post by alexalsp » Wed, 12. Oct 22, 21:15

A little creativity :oops: :roll: :)

https://imgur.com/a/DOk7Luo

User avatar
alexalsp
Posts: 1820
Joined: Fri, 18. Jul 14, 05:28
x4

Re: ZMap - Mayhem 3 Map Generator and Editor

Post by alexalsp » Thu, 13. Oct 22, 23:58

Maelstrom startup location can be set (requires Zero-Hour 1.6)
Special game starts for Peaceful and Chaotic Xenons (requires version "tbd" of Zero-Hour)
Are these options only for the ZH mod or can they be used for other Mayhem based mods as well?

User avatar
Hairless-Ape
Posts: 316
Joined: Wed, 6. Nov 02, 20:31
xr

Re: ZMap - Mayhem 3 Map Generator and Editor

Post by Hairless-Ape » Fri, 14. Oct 22, 14:41

alexalsp wrote:
Thu, 13. Oct 22, 23:58
Maelstrom startup location can be set (requires Zero-Hour 1.6)
Special game starts for Peaceful and Chaotic Xenons (requires version "tbd" of Zero-Hour)
Are these options only for the ZH mod or can they be used for other Mayhem based mods as well?
These options are only truly supported by ZH v1.7a or above. For other Mayhem 3 mods, you would have to ask HectorX what the net effect would be.
Out of my mind. Back in 5 minutes.

User avatar
alexalsp
Posts: 1820
Joined: Fri, 18. Jul 14, 05:28
x4

Re: ZMap - Mayhem 3 Map Generator and Editor

Post by alexalsp » Fri, 14. Oct 22, 22:50

Hairless-Ape wrote:
Fri, 14. Oct 22, 21:18
I don't think you are asking the right question.

If you use ZMap to create a map using one of the special game starts, all you're doing is changing the number of Xenon owned systems at game start and where the maelstrom location is. It's only a static Map change. ZMap does not make programming changes in your game no matter what mod you use.
So your answer is technically YES. You could absolutely use one of these options in ZMap with some other mod. It just won't "DO" anything special with it, so why would you want to?
What you really want to know is:

The difference is that HectorX has added special programming in Zero-Hour to detect these special game starts which does some special work with it.
As I understand it, he does the following:

. Adds appropriate number of OCV invader fleets and Xenon defenders to the game. This would create a similar situation like if the game was running already for a couple days.

. A Xenon crisis would trigger sometime during the first in game day.

. For the peaceful start, resources would be removed from faction outposts and some timing would be changed to allow you to build up before another xenon crisis occurs again.

If there's more, or if this needs correcting, HectorX will need to chime in. Hope that helped.
I thought these two options (Aggressive and Peaceful) in the generator were made for ZO and if so, they couldn't be used for Mayhem and other mods based on it.
According to your answer, these options can be used for any mods based on Mayhex 3, is that correct?

I want to know if these two options are worth hiding if not a ZO mod.

User avatar
Hairless-Ape
Posts: 316
Joined: Wed, 6. Nov 02, 20:31
xr

Re: ZMap - Mayhem 3 Map Generator and Editor

Post by Hairless-Ape » Sat, 15. Oct 22, 15:49

You can turn on these options in ZMap and use some other Mayhem 3 mod and your game will not break. Only ZH looks at these particular flags and they are harmless to Mayhem 3 otherwise.

I'm not coding this for every mod. It's intended to be used for Zero-Hour in the long run.

Cheers.
Out of my mind. Back in 5 minutes.

User avatar
alexalsp
Posts: 1820
Joined: Fri, 18. Jul 14, 05:28
x4

Re: ZMap - Mayhem 3 Map Generator and Editor

Post by alexalsp » Thu, 10. Nov 22, 11:46

ZMap 1.6

Who can be an Owner Dejure race? All or just Argon, Boron, Paranid, Teladi?

When I select Owner Dejure: Xenon, Terran or Unknown I get an error. Video to help...

https://youtu.be/9pKzUUwVsvg

Please fix this. The text does not change during translation.

Code: Select all

"lblTerranSpread": "Terran",
Spoiler
Show
Image
Last edited by alexalsp on Sat, 12. Nov 22, 13:06, edited 1 time in total.

User avatar
alexalsp
Posts: 1820
Joined: Fri, 18. Jul 14, 05:28
x4

Re: ZMap - Mayhem 3 Map Generator and Editor

Post by alexalsp » Fri, 11. Nov 22, 23:44

Bag ...

https://youtu.be/KhsKRPTlLjA

In version 1.5 everything is fine.

User avatar
Hairless-Ape
Posts: 316
Joined: Wed, 6. Nov 02, 20:31
xr

Re: ZMap - Mayhem 3 Map Generator and Editor

Post by Hairless-Ape » Sat, 12. Nov 22, 14:44

Good catch on the "Terrans as Dejure owner" issue.
That bug has been fixed and 1.6.1 has been published.

Regarding your last post however, understand that you can not do what you are attempting to do; by design.

ZMap 1.6 or above will NOT successfully load the "Race Relations" part of maps created by earlier versions (1.5 or below).
Technically, all maps stored the 5x5 race relations grid in a linear/serial sequence of ID's (5-29) inside the 9970-L044.xml file.
The new design has a 6x6 race relations grid, and so it uses ID's 5-40. This was a design choice of the original mayhem 3 creator, and not
something added by myself. Bottom line is, that when you try to load an old map with the new Generator, it attempts to load 36 ID's
and only has 25 present. Now technically, this is still a usable map.. All you have to do is click on your race relations in the U.I. to fix it
the way you want it, and then re-save your map. I'll leave that to you to do if it's that important to you. Otherwise, just create a new
map and you should be fine, assuming no more actual bugs are in there.
Out of my mind. Back in 5 minutes.

User avatar
alexalsp
Posts: 1820
Joined: Fri, 18. Jul 14, 05:28
x4

Re: ZMap - Mayhem 3 Map Generator and Editor

Post by alexalsp » Sat, 12. Nov 22, 17:05

The map on the video was made in version 1.6.
The tests were carried out on the same map.

1.6.1
https://youtu.be/9huqSDJPqPU
Hairless-Ape wrote:
Sat, 12. Nov 22, 14:44
Good catch on the "Terrans as Dejure owner" issue.
Same with Unknown and Xenon. Errors remain. Or they cannot be as Dejure owner?

But Terran was fixed.

I'm guessing it should be.

Code: Select all

                case 6:
                    return @"\033C" + GetLocalizedText("{Xenon}");
                case 14:
                    return @"\033C" + GetLocalizedText("{Unknown}");
                case 18:
                    return @"\033C" + GetLocalizedText("{Terran}");
And they didn’t fix it here. :(
alexalsp wrote:
Thu, 10. Nov 22, 11:46
Please fix this. The text does not change during translation.

Code: Select all

"lblTerranSpread": "Terran",
Spoiler
Show
Image

User avatar
Hairless-Ape
Posts: 316
Joined: Wed, 6. Nov 02, 20:31
xr

Re: ZMap - Mayhem 3 Map Generator and Editor

Post by Hairless-Ape » Sat, 12. Nov 22, 19:58

Thanks Alexalsp, You do great testing :).

Sorry I didn't get it right the first timer.. I got covid a week ago and just sort of out of it.. I have brain fog.

Anyway, I believe I have both issues fixed. I tried a few tests and it seems to be going ok.
There was an unrelated problem remaining with save/load for the race relations, and I also added that terran label for localization.

Also, you are correct. You can NOT set Unknown or Xenons as Dejure owner of a system.

I've updated the 1.6.1 source and release files on github. Let me know if you experience any other issues, and thanks again for the help.

-cheers.
Out of my mind. Back in 5 minutes.

Post Reply

Return to “X³: Terran Conflict / Albion Prelude - Scripts and Modding”