.com.unity Forums

.com.unity Forums (http://forum.shrapnelgames.com/index.php)
-   Space Empires: IV & V (http://forum.shrapnelgames.com/forumdisplay.php?f=20)
-   -   SE4 Map analyser (http://forum.shrapnelgames.com/showthread.php?t=12098)

Suicide Junkie May 21st, 2004 06:47 AM

SE4 Map analyser
 
I was thinking of making an SE4 map analyser, for helping to make sure the distribution of planets for gas/ice/rock and each atmosphere stays fair.

It would have to read the quadranttypes, and get you to pick one, probably.
Then it would grab the info from the planetsizes.txt to get statistics on the value of each planet size.
And then it would scan the sectortypes file to get find how many of each get placed, and total the value of each surface/atmosphere combo.

Now, the question is, what stats does it need to end up with?

Total Facility slots for sure.
Total Population capacity too.

If it reads settings.txt for the popmodifiers too:
Total SY rate?
Total production rate?

Aiken May 21st, 2004 06:55 AM

Re: SE4 Map analyser
 
You can consider future conVersion of all asteroids to planets. Just an idea.

Fyron May 21st, 2004 06:57 AM

Re: SE4 Map analyser
 
Quote:

Originally posted by aiken:
You can consider future conVersion of all asteroids to planets. Just an idea.
<font size="2" face="sans-serif, arial, verdana">To me, this does not seem like it would affect the balance at all. The planets have the exact same chance of becoming a particular planet type as when a planet is generated when the map is first made. The balance should be unaffected, unless you do something silly like make all asteroids tiny... but I am not sure that you can even call for specific sized asteroids in SystemTypes.txt...

Suicide Junkie May 21st, 2004 06:04 PM

Re: SE4 Map analyser
 
I hadn't thought of finite games...

That would be exactly proportional to the count of colonizable planets, would it not?

Aiken May 21st, 2004 07:05 PM

Re: SE4 Map analyser
 
Yes, it would... I just figured out that my request was kinda silly: average percentage of resources (as well as total res for finites) will be always the same, so no need to calculate it. Sorry.

Suicide Junkie May 21st, 2004 07:15 PM

Re: SE4 Map analyser
 
True, but you would still need the program to output the count of planets, which wasn't in the list yet.

Baron Munchausen May 22nd, 2004 12:16 AM

Re: SE4 Map analyser
 
Do you know the format of SE IV map files? Or is this only reading the text files (Quadrant_types and System_types)? If it is only using the text files, the use of 'random' ('any') values would make analysis rather difficult. If you can actually read map files it would be interesting to produce statistics on how connected systems are as well as planetary tallies. Number of systems unconnected, number connected to only one other system, number connected to two other systems, etc.

Suicide Junkie May 22nd, 2004 12:42 AM

Re: SE4 Map analyser
 
The point of this would be to read the mod, and tell you how fair the random maps are expected to be without a lot of playtesting and map generation.

Aiken May 22nd, 2004 01:47 AM

Re: SE4 Map analyser
 
Ok, yet another suggestion: is it possible to calculate average resource richness or total amount of resources (in finite res game)?

PvK May 22nd, 2004 03:44 AM

Re: SE4 Map analyser
 
Hmm. Number of planets, and number of planets per system, and distance between systems with planets of a certain type, also have effects on balance. Balance is also different depending on Empires' traits. If ya really care that much.

PvK

[ May 22, 2004, 02:45: Message edited by: PvK ]

Suicide Junkie May 22nd, 2004 05:12 AM

Re: SE4 Map analyser
 
It sounds like you think this is intended to analyse existing maps...
It will not.

Rather, it will read the mod files, and generate stats to tell you the average balance between the different homeworld choices.

Remember that colored circle graph of atmosphere distributions somebody made a few years ago?
This will be an automated way to generate that and more.

------

Status update:
Phase 1 - Basic UI, data structures & mod detection
<font color=#008000>-= completed =-</font>
Phase 2 - Read in planetsize.txt & initialize planet stats (names & facil/pop space)
<font color=#008000>-= completed =-</font>
Phase 3 - Read in secttypes.txt & add to stats (atmo/surface distributions)
<font color=#008000>-= completed =-</font>
Phase 4 - Read in settings.txt & add to stats
(SY rates)
<font color=#008000>-= completed =-</font>
Phase 5 - Read in systemtypes.txt & initialize system stats ("any" types calculated from phase 3 info)
-= 50% =-
Phase 6 - Scan requested quadrant in quadranttypes.txt & sum up final results
-= 0% =-
Phase 7 - Fancy presentation, graphs & such.
-= 0% =-


The phase 3 and phase 2 info can be seen currently in some list boxes which will not be visible for the finished program.
http://imagemodserver.mine.nu/other/MM/SE4/tools

PS:
To decode the stats:
</font><blockquote><font size="1" face="sans-serif, arial, verdana">code:</font><hr /><pre style="font-size:x-small; font-family: monospace;">Const STAT_NUM = 1
Const STAT_FAC = 2
Const STAT_FAC_DOMED = 3
Const STAT_POP = 4
Const STAT_POP_DOMED = 5
Const STAT_GG = 6
Const STAT_ROCK = 11
Const STAT_ICE = 16
Const STAT_VAC = 0
Const STAT_H2 = 1
Const STAT_O2 = 2
Const STAT_CO2 = 3
Const STAT_METH = 4</pre><hr /></blockquote><font size="2" face="sans-serif, arial, verdana">STAT_NUM is the number of duplicate planetsizes with the same name.
(for mods which duplicate say "Tiny" so that tiny moons will randomly have 4, 5 or 6 facility slots instead of just 5 all the time)

When looking for a planettype, add the atmosphere and surface. So an Oxy Gas Giant is 2+6 = 8th number in the list.
This is the count of oxy gas giants of the planetsize named on the left.
Entry # 6 should always be zero, since there are no vaccuum gas giants (0+6)

[ May 22, 2004, 22:21: Message edited by: Suicide Junkie ]

Suicide Junkie May 24th, 2004 04:11 AM

Re: SE4 Map analyser
 
Argh... I've got a screen full of lists, which themselves have many 5-10 entries, each entry consisting of a list of 10-20 stat counters.

I'm suffering from stack overflows in my brain, and it looks like this stage is going have to do a lot more than I initially thought...

Suicide Junkie June 15th, 2004 02:08 AM

Re: SE4 Map analyser
 
Well, I think it may just be just about working...

Very slow right now, but it does finish the system stat calculations.
Its just a matter of summing those over the probability of each system in the quadrants file and drawing the results to get the operation completed.

First things to do are debugging.
The planet counts for each race atmo/surf combination look OK, and the facility slots are on the right track, but the other stats have gone really wonky.

Then speed improvements.

Suicide Junkie July 29th, 2004 06:36 AM

Re: SE4 Map analyser
 
Alrighty, a couple of copy-paste bugs down, and a fix for the ring/sphereworld entries messing with the stats.

I think its working now...
Just need to make the systemtypes.txt analysis much more efficient so it dosen't take all day to finish.

Then the quadranttypes part will be a simple sum of the system stats!

I'm letting this beast run overnight on the stock datafiles to see what it comes up with http://forum.shrapnelgames.com/images/icons/icon7.gif

Fyron July 29th, 2004 07:56 AM

Re: SE4 Map analyser
 
To answer a few questions from IRC...

Quote:

[09:02:37-PM] <SJ> Heh, GG/none ringworlds...
[09:02:49-PM] <SJ> Do those actually build properly in game?
<font size="2" face="sans-serif, arial, verdana">No, they are impossible to build in-game. Your program needs to ignore them.

Quote:

[09:39:27-PM] <SJ> I wonder if the ring/sphereworlds are driving up the numbers when huge is a possibility...
[09:39:49-PM] <SJ> Are they a special case?
[09:55:54-PM] <SJ> Hey.
[09:56:52-PM] <SJ> Is it the "constructed world" tag that makes the diff?
<font size="2" face="sans-serif, arial, verdana">I believe that is what makes the difference. I do not know if size matters for constructed planets, though I suspect that it does.

Suicide Junkie July 29th, 2004 07:59 PM

Re: SE4 Map analyser
 
Ok, its down to 5-10 seconds per system instead of per planet http://forum.shrapnelgames.com/images/icons/icon10.gif

Now to sum over the systems in the quadrant, and display a pretty graph of the data http://forum.shrapnelgames.com/images/icons/icon12.gif

Suicide Junkie July 29th, 2004 10:19 PM

Re: SE4 Map analyser
 
http://imagemodserver.mine.nu/nick/t...apanalyse1.gif

I'm also planning to make some pie charts on a separate screen.

Any requests or comments on what kind of output you guys would find mose useful?

Kana July 30th, 2004 03:29 PM

Re: SE4 Map analyser
 
Slightly off topic...Sorry SJ. The picks on the GIF gave me a thought. Scarey I know...

Can you MOD the specific Atmosphere/Planet type to a certain component? Basically the colonizing component will only work on the specific Atmosphere/Planet conditions?

Kana

*Now back to your regularly scheduled thread*

Ruatha July 30th, 2004 04:10 PM

Re: SE4 Map analyser
 
What are you writing it in for language? C#/++ or VB or Delphi? Just curious!

If started from a Run commando does it take any parameters?..... (I e if I make a plug-in text file for the companion to start it should I send any parameters, ie paths or such?)

I think it looks real good, and it will help settle all those discussion (You had more planets, facilities, huges ones etc once and for all http://forum.shrapnelgames.com/images/icons/icon12.gif )

Will it show asteroids and special systems aswell?

[ July 30, 2004, 16:19: Message edited by: Ruatha ]

Fyron July 30th, 2004 06:20 PM

Re: SE4 Map analyser
 
Quote:

Originally posted by Kana:
Can you MOD the specific Atmosphere/Planet type to a certain component? Basically the colonizing component will only work on the specific Atmosphere/Planet conditions?
<font size="2" face="sans-serif, arial, verdana">Sadly, no. The only colonizing abilities available are the 3 planet type ones. The ability to colonize by atmosphere instead was lost in the transition from SE3 to SE4 (SE3 had no planet type, just size and atmosphere). There are colony modules for all of the different atmospheres in the graphics files, but there is no practical use for them. http://forum.shrapnelgames.com/images/icons/icon9.gif

Suicide Junkie July 30th, 2004 07:19 PM

Re: SE4 Map analyser
 
Quote:

Originally posted by Ruatha:
What are you writing it in for language? C#/++ or VB or Delphi? Just curious!

If started from a Run commando does it take any parameters?..... (I e if I make a plug-in text file for the companion to start it should I send any parameters, ie paths or such?)

I think it looks real good, and it will help settle all those discussion (You had more planets, facilities, huges ones etc once and for all http://forum.shrapnelgames.com/images/icons/icon12.gif )

Will it show asteroids and special systems aswell?

<font size="2" face="sans-serif, arial, verdana">Its in VB. Not overly efficient, but it works. http://forum.shrapnelgames.com/images/icons/icon7.gif
I don't look at commandline parameters... You'll want to look at the charts and graphs and numbers when its done.
I figure the best way to use it is to run through the analysis, tweak the mod, and then re-analyse the parts you changed.
Repeat until your maps are fairly balanced http://forum.shrapnelgames.com/images/icons/icon7.gif

Asteroids and special systems don't contribute to any of the current stats (# colonies, # facility slots, population max, etc)

-----

The actual maps will vary from the average statistics, of course, but at least you will know that, on average, your mod will produce fair maps.

Ruatha July 30th, 2004 08:19 PM

Re: SE4 Map analyser
 
It's just that I've been in discussions as to "How many asteroids" are thjer in this map, and in the game there is no way to find out except counting them manually.
And it would be good too see how many special systems are produced, to see if they are too many or too few, perhaps an extra page
Black holes : 1
Nebulae: 2

etc, if it's doable. (No pressure, just a suggestion, disregard at will http://forum.shrapnelgames.com/images/icons/icon12.gif )

About commandline parameters, I just wondered how one loads a map into it, is there a "open dialog" or do you run it with "Mapanalyzer.exe c:\se4\mods\AImod\mymap.map" or whatever..
Like in SE4 you can start it with "SE4.exe savegames\mygame.gam" or something like that.

I think VB is quite efficient these days, it was different when it was an interpretating language instead of compiling as it is today!

[ July 30, 2004, 19:24: Message edited by: Ruatha ]

Suicide Junkie July 31st, 2004 12:06 AM

Re: SE4 Map analyser
 
http://imagemodserver.mine.nu/other/...E4mapstats.rar
Here we go!
There are some extra options available on the pie charts, even!

Note: All stats are PER SYSTEM.

-----

Ok, you're confused as to the nature of the program http://forum.shrapnelgames.com/images/icons/icon7.gif
This thing looks at data files, and calculates what the stats of the average map are from systemtypes.txt, planetsize.txt, and such.

-----

BTW, I did improve the efficiency by about a factor of 10...
The systemtypes analysis still takes a minute or two, but its not insane anymore.

I've added a progress bar so you can tell that the system analysis is actually working http://forum.shrapnelgames.com/images/icons/icon10.gif

http://imagemodserver.mine.nu/nick/t...apanalyse2.gif

The tree shows you the dependencies, just click the button corresponding to the things you've changed, to update the stats. Green lines show things that have been completed, yellow is in progress, and red is incomplete items.

Once you get down to the quadrant types analysis button, it will open a new window, and tally up the stats for that quadrant type. You'll see the numbers roll for about 5 seconds, then they will be rounded off and steady.
Click the option buttons to switch between pie graph view, and the numerical chart view.

[ July 31, 2004, 00:55: Message edited by: Suicide Junkie ]

narf poit chez BOOM July 31st, 2004 06:00 AM

Re: SE4 Map analyser
 
Yaay!

Ruatha July 31st, 2004 05:02 PM

Re: SE4 Map analyser
 
Ahh, now I get it.
It's not what I thought but it's still nice.
So then there's still a niche open for an "existing map" analayzer. http://forum.shrapnelgames.com/images/icons/icon12.gif

Suicide Junkie July 31st, 2004 08:42 PM

Re: SE4 Map analyser
 
New Version of the Map Analyser ( http://imagemodserver.mine.nu/other/...E4mapstats.rar )
I'm not sure if the previous Version had the 4th pie graph mode, but this one does, and fixes a bug with vaccuum/gas/tiny planet stats.

"Common Max" is a very handy mode, and lets you compare different surface types effectively.
It sets 360 degrees to be the maximum of all three surface types, so surface types that have lower scores than the others will have a black slice of pie taken out.

http://imagemodserver.mine.nu/nick/t...tockSYrate.gif
As you can see here, in stock, the Gas Giant races have only half the potential planetary construction rate that Rock races do.
And Ice is only about 120% of Gas and 60% of the Rock rate.

Xentropy July 31st, 2004 09:28 PM

Re: SE4 Map analyser
 
In which data files is the information on what random chances each possibility is assigned? I looked around for this a while back and couldn't find it. I assumed "Any" in a system setup was an equal chance of all possibilities, but obviously I was wrong since (for example) there are more rock planets than ice in a normal mid-life quadrant.

Also, is it a bug in your program's analysis or are rock/methanes slightly more common than average rock worlds and ice/methanes slightly less? I ask because it's the only non-vacuum data point that shows a difference in probabilities between atmospheric types.

Great program! My friend and I will definitely be rethinking our co-op strategy (currently we play gas/hydrogen and ice/methane because rock/oxygen and CO2 are relatively easier to gain from AI's...but if ice really do suck as much as these graphs show, I'll be switching to rock/methane ASAP!). Thanks a ton for posting this! http://forum.shrapnelgames.com/images/icons/icon10.gif

Suicide Junkie July 31st, 2004 09:37 PM

Re: SE4 Map analyser
 
In stock SE4, there is actually one extra small/rock/methane planet, and one missing small/ice/methane planet.
That is what you are seeing in the methane stats.

To decide an "any" option, the game looks through the sectortypes.txt file, and picks a random planet that matches all of the requirements. (And "constructed" planets like ring/sphereworlds never get randomly chosen - see planetsize.txt for which sizes have constructed := true )

---

PS:
If you're planning to capture rock colonization tech early on anyways, sticking with Ice is probably a good idea.
That way you get all three fast, instead of having to hunt down the elusive ice race or spend the 500k points to research it.

[ July 31, 2004, 20:44: Message edited by: Suicide Junkie ]

Xentropy July 31st, 2004 10:05 PM

Re: SE4 Map analyser
 
Ah ha, excellent information. Could be just what my friend and I need to solve our medium bonus problem http://forum.shrapnelgames.com/images/icons/tongue.gif http://www.shrapnelgames.com/cgi-bin...;f=23;t=012210

I have more questions, though (aren't you glad? http://forum.shrapnelgames.com/images/icons/icon12.gif ), if you don't mind.

First, what units are "spaceyard rate" in, and what is the calculation based on?

Second, what is resource rate based on? Just assuming all facility slots are used for mines, or are the planetary value %'s different for each type as well (rather than just a random value from 0-150 for all planets, ignoring asteroids)?

Lastly, how are the vacuum/gas giant statistics non-zero? I didn't think it was possible for a planet to be GG/none.

Thanks for putting up with my curiousity http://forum.shrapnelgames.com/images/icons/icon10.gif

--
Edit:
Quote:

PS:
If you're planning to capture rock colonization tech early on anyways, sticking with Ice is probably a good idea.
That way you get all three fast, instead of having to hunt down the elusive ice race or spend the 500k points to research it.
<font size="2" face="sans-serif, arial, verdana">Well, I definitely noted a severe drop in my expansion rate when I switched from rock/oxy to ice/meth. I think I may be taking too large a hit from having crappy worlds early on to make up for the fact I could have ice/gas to start and all 3 on turn 25 instead of rock/gas to start and all 3 on turn 45.. Not having those beautiful rock worlds is painful to both research and resource generation.

[ July 31, 2004, 21:16: Message edited by: Xentropy ]

Suicide Junkie August 1st, 2004 12:18 AM

Re: SE4 Map analyser
 
Spaceyard rate is in %
One planet with a max population such that it gets no bonuses or penalties, would have 100.0

Spaceyard rate = Chance of Planet * build rate modifier (at max population) for this planetsize

-----

Planet qualities all average out to the same ((max+min) /2), so they are ignored.

The production rate = Chance of Planet * facility limit * production modifier (at max population)

-----

The Gas/None stats are what a Vaccuum breathing race would get if they had gas giant colonization tech. All their planets would be domed, but they would still have some facilities/pop/etc.

Unless the mod is fairly extreme, they would also have ice or rock tech, but that is beside the point.

Fyron August 1st, 2004 02:06 AM

Re: SE4 Map analyser
 
So I was analyzing the first quadrant type in FQM Deluxe, and got an error: "Found unrecognized system type in Quadrant." What does that mean? Could it have to do with filler systems in SystemTypes.txt such as ***Standard Systems*** that do not act as actual systems, but instead as section headers for organizational purposes? Maybe the error message should display the name of the unrecognized system? Seems like a 100% useless error message without it.

[ August 01, 2004, 01:07: Message edited by: Imperator Fyron ]

Suicide Junkie August 1st, 2004 05:59 PM

Re: SE4 Map analyser
 
Updated.

The analyser will now stop on anything other than a "type..." line.

It will report the name, the linenumber and display the entire offending line when it finds an unrecognized systemname.
Not just for debugging anymore http://forum.shrapnelgames.com/images/icons/icon7.gif

[ August 02, 2004, 03:50: Message edited by: Suicide Junkie ]

Captain Kwok April 17th, 2006 01:21 AM

Re: SE4 Map analyser
 
When I try to run the program with my Space Food Empires mod - I get the following error when trying to analyze the systemtypes.txt file:

Run-Time Error '9': Subscript out of range

It occurs before any of the system types have been analyzed (i.e. it still says 0 out of 100). I'm not sure what might be causing it.

Suicide Junkie April 17th, 2006 01:41 AM

Re: SE4 Map analyser
 
Odd.

Can you send me the files you were analysing so I can try it?

Captain Kwok April 17th, 2006 02:08 AM

Re: SE4 Map analyser
 
The files were sent to your pbw e-mail.

Suicide Junkie April 17th, 2006 01:33 PM

Re: SE4 Map analyser
 
The problem is that the population modifiers provided are too small to cover the largest planets.

You need to either add more, or make that last modifier 99,999 instead of merely 9999.

I have updated the program to give a better message.

Captain Kwok April 17th, 2006 06:24 PM

Re: SE4 Map analyser
 
Thanks. It works now. My planet size file actually has smaller max populations for regular planets, although the ringworld entry (no sphereworlds) was in excess of the largest pop-modifier.

I did notice the program generates entries for none atmosphere and gas giant...?

Suicide Junkie April 17th, 2006 06:31 PM

Re: SE4 Map analyser
 
The atmosphere is what the race breathes. The surface is the colony module that the race owns.

Vaccuum breathers can get gas giant colonization, but all their planets will be domed. Thus they do get some benefit, but it is smaller than most.

Captain Kwok April 17th, 2006 06:46 PM

Re: SE4 Map analyser
 
Duh. Makes sense. I'll try and think these things through next time. http://forum.shrapnelgames.com/image...ies/tongue.gif


All times are GMT -4. The time now is 12:28 PM.

Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©1999 - 2025, Shrapnel Games, Inc. - All Rights Reserved.