Forums  /  Majesty: The Fantasy Kingdom Sim  /  Data Gathering
  TsundrakiTsundraki

I am working on researching more data about how the various system of the game work in order to optimize the runs. I have organized the data into a spreadsheet:

https:/​/​docs.​google.​com/​spreadsheets/​d/​1RcjGIVDE0EgocmO5I6jm7CSDkWR1XBqBdZucf6QhE4A/​edit?usp=sharing

There are still a lot of things I need to figure out, but it is a start

 
  lagdotcomlagdotcom

Decent stuff there - I did a lot of work decoding the map generation years ago but it's mainly gone now. I suppose I could try to figure it out again 🙂

 
  TsundrakiTsundraki

If you look through the Majesty Gold HD files you can find an SDK for modding that shows a bit of how the quests are generated by the system. The most useful thing that I would like to figure out is how the game engine goes about decided the seed for the randomization, because if that could be cracked in a way that is useful it might be possible to manipulate the seed you get. If we could do that, then things would start to go a lot faster!

 
  lagdotcomlagdotcom

I can look into that... I've done some disassembly work before. It will probably be your standard computer clock seed though.

 
  lagdotcomlagdotcom

Well, I found the code that generates the next random number.
http://lag.codes/temp/majesty-dis-rand.jpg

Not sure how useful that is without finding the seed function. 😃

TsundrakiTsundraki likes this. 
  TsundrakiTsundraki

Interesting, well it's a start! I figured it's probably time-based generation

 
  RealityReality

I don't know much technical stuff, but I do know that if you open the RGS editor up and you can look through the vanilla game.

From RGS > File Open > steamapp common Majesty HD Quests > the .q files not the mxql files

Once you have them open the thing that is most important to a speedrunner is in the Quest Tab.

Check the Force Patterns.

The randomization for every level is shown here on a 5x5 grid. Techincally the 5x5 grid represented by the Force Patterns is 25 smaller 5x5 grids, (the Unit Patterns), But luckily almost every important Building (Lich Queen Lair, Tower Prison, etc) is almost always centered... usually it's only things like wild random Chests or minor creature dens that are off center.

Now the important thing to narrow down on. is that for many quests, although the quest important building IS randomized, it won't be randomized over the whole map, but typically only some of it. For example, in Quest for the Magic Ring , it will only appear in Spaces 1-3 2-2 2-4 3-1 3-5 4-2 4-4 and 5-3 in short, a Big diamond connecting the 4 cardinal directions.

The Force Pattern IS pre-map rotation, so you have to orient yourself by which side of the map your palace is on. Typically, the game will consider the row your Palace is on as the 5 row. (even if it's a column due to a left side map start)

In my opinion you can minimize randomness enough to make Rogues (and occasionally berserking Barbarians) the only exploration unit you need. Rangers have no use in a speedrun except if you start out with them by default.

TsundrakiTsundraki likes this. 
  TsundrakiTsundraki

Awesome, that helps me understand some of the variable in that program that I wasn't sure about. I have been looking at that for some of the quests to get an idea of initial spawns. There are some patterns that I have noticed over multiple runs that help identify if its a good spawn pattern for the buildings or not, and the editor saves me a lot of time that I would have spent just reloading over and over to get a view of the map.

There is a lot of information in the files that has helped put more specific numbers to some suspicions I have had about how the mechanics of the game work.

As far as rangers vs rogues, you spend about 20% more to fill a guild of rangers vs rogues. Rangers do have the useful trait of following and supporting barbarians, so I think they are useful in tandem with barbs. Rogues greed factor though being off the charts makes them a lot more responsive to what you want. It just depends on what you need and how much you are willing to pay for it.

 
  lagdotcomlagdotcom

Both is also often an option. 😛

The stuff about map generation fits what I remember from my explorations years ago. Internally it's saved as letters from A to Y, where A is the top left and Y is the bottom right. Of course, map generation can also flip and rotate the map after it is made, which is what makes it more random than just "picking from ABF" or whatever.

 
  RealityReality

You can check a more easily readable version of level-specific scripts by going to

Majesty HD > SDK > Original Quests > GPLMx > Rules > Epic_Quest_Scripts

These are GPL files and open in Notepad just fine. I don't think it's too useful compared to the RGS, but can be fun to browse through if you want to know about pre-set monster waves and stuff.