PDA

View Full Version : Map randomiser



norrismcwhirter
12-02-2006, 16:11
Brcn:

As requested, I've written a randomiser but putting the randomised names back into the properties files is tricky due to the construction of the file.

How do you want to do this?

a. Fully automatic where the server possibly calls the randomiser to shuffle things without human intervention (i.e. it has to handle the properties files properly)?

b. Semi-auto where it randomised the properties files correctly but you check then upload?

c. "Not very" auto where it generates a randomised map list and you cut and paste it into the properties files?

I'd prefer b because the server is flaky enough as it is without introducing something to potentially cause more problems.

Having said that, you're going to have to be careful with b. to make sure that the server will actually pick up the files correctly (quite a few things can go wrong here if we have a missed character or newline etc).

Ta,
Norris

Brcn
12-02-2006, 16:32
Hi,

It is not going to edit the properties file, as I want this randomiser for the .ini files that Server Commander uses to decide on what next map will be. I think i will prefer 'a', and the program will handle the .ini files better as they are more simple. I can send you an .ini file if you want.

norrismcwhirter
12-02-2006, 16:34
That might be useful ;)

Ta,
Norris

Brcn
12-02-2006, 16:38
Check your mail, m8.

norrismcwhirter
12-02-2006, 18:56
Will do.

Ta,
Norris

norrismcwhirter
12-02-2006, 19:28
Hi,

If you want to go for a), how are you going to invoke this program which shuffles the map? Can you get the commander to call the .exe at the end of the map cycle (and wait for a short period while it runs) to cause the shuffle to occur?

It sounds dangerous to me as, although the ini files are a lot easier to manipulate than those of FBD, things can go wrong + there are server security implications to consider.

The ini files you have sent have no 'next map' entries in them so do you have a list of the maps that you would have put into them 'by hand' ?

Also...how do you populate the ini files?

[Team1]
NextMisWin=somemapwithteam1bonusplanes.mis
NextMisLost=
[Team2]
NextMisWin=somemapwithteam2bonusplanes.mis
NextMisLost=
[Common]
TimeLimit=75
VoteLevel=-1
NoWinnerMission=somemapwithnobonusplanesmis

i.e. obviously, if team 1 wins, team 2 must lose so which entry does the server use IF they both have entries? Or, as I suspect, do you only populate the winner entries as shown above?

Ta,
Norris

norrismcwhirter
12-02-2006, 20:02
Hi,

It does, thanks.

How are they set up at the moment, though? Is Team 1 "NextMisWin=" the same as Team2 "NextMisLost=" ?

If things are randominsed on each cycle, there's not a lot of point making them different if you get my meaning.

Ta,
Norris

Brcn
12-02-2006, 21:28
There is no randomisation at all:

Here is how it works:
Let's say this ini file is for map X

[Team1]
NextMisWin=/folder/folder/Objective_Y.mis
NextMisLost=/folder/folder/Objective_Z.mis
[Team2]
NextMisWin==/folder/folder/Objective_Q.mis
NextMisLost==/folder/folder/Objective_W.mis
[Common]
TimeLimit=75
VoteLevel=-1
NoWinnerMission==/folder/folder/Objective_M.mis

It is any map you input there, so if you want the same map can be played whatever the mission outcome is, and that is what we have on UKD2 now.

I have to input all these missions manually. It is possible, but it is time consuming, and when you do it, always the same mission after one mission will play.

I don't know if it is possible for server commander to call an exe and decide on the next map according to what that exe file does. It would be perfect if it can be possible. I have no experience in programming, so I am expecting you to say if it is possible or not.

If randomisation that will work with Server Commander is not possible, you can just make a tool that makes a simple text file to make a randomisation on all 5 possible outcomes after I show the tool the folder of the mission files/ini files. I will then edit the maps manually. I may just run the tool every now and then and then edit the next maps whenever I have time.

norrismcwhirter
12-02-2006, 22:20
Hi,

I still need the names of the maps, preferably grouped by type. e.g.

REDBONUS:
mapa.mis
mapb.mis
BLUEBONUS
mapc.mis
mapd.mis
NOWIN
mape.mis
mapf.mis

etc

The randomiser could either:

a) read the existing ini files, build up a list of map files by type, randomise them then write out a new set of ini files by overwriting the first few lines

b) Simply generate a randomised list of ini entries from a list such as that shown above then overwrite as in a.

Presumably, you don't have a list of ini files with the win/loss/nowin mapnames already in otherwise you'd have passed them on so it's up to you which way you want to do it.

I made a prototype randomiser for the FBD scripts so most of the work is already done.

Also, when I said that it randomised on each cycle, I meant that we'd still have to randomise but there would be little point in randomising the win AND lose map references.

Let's say we had:

MAP1.INI ->

[Team1]
NextMisWin=TEAM1BONUS_MAP2.MIS
NextMisLost=TEAM2BONUS_MAP2.MIS
[Team2]
NextMisWin=TEAM2BONUS_MAP2.MIS
NextMisLost=TEAM1BONUS_MAP2.MIS
[Common]
TimeLimit=75
VoteLevel=-1
NoWinnerMission=MAP2.MIS

then there wouldn't be a whole lot of point randomising all entries to get something like:

MAP1.INI ->

[Team1]
NextMisWin=TEAM1BONUS_MAP4.MIS
NextMisLost=TEAM2BONUS_MAP7.MIS
[Team2]
NextMisWin=TEAM2BONUS_MAP3.MIS
NextMisLost=TEAM1BONUS_MAP10.MIS
[Common]
TimeLimit=75
VoteLevel=-1
NoWinnerMission=MAP8.MIS

but, rather, we could have:

MAP1.INI ->

[Team1]
NextMisWin=TEAM1BONUS_MAP7.MIS
NextMisLost=TEAM2BONUS_MAP11.MIS
[Team2]
NextMisWin=TEAM2BONUS_MAP11.MIS
NextMisLost=TEAM1BONUS_MAP7.MIS
[Common]
TimeLimit=75
VoteLevel=-1
NoWinnerMission=MAP14.MIS

because we'd be randomising the whole process at a regular interval anyway.

It's not much more effort to code the different win/lose entries....it's just that I don't see a lot of point in it + it's probably easier to inspect the results of the randomiser for errors IF we don't have it, for want of a better description, "very random"

Ta,
Norris

norrismcwhirter
13-02-2006, 17:11
Brcn - check your mail:

Randomiser takes directory containing ini files and randomises 'next map' settings.

usage is:

maprandomise <dir>

e.g.

maprandomise c:\maps

I added some dummy map names to the ini files you sent then ran the randomiser. Of the few times it randomised, it appeared to be correct although I'd suggest some heavy duty testing wouldn't go amiss.

Sample output:

C:\Maps>maprandomise c:\maps

Parsing file c:\maps\Moonlight.ini...
Found Team1 Winmap = MAPCR
Found Team2 Winmap = MAPCB
Found No Winmap = MAPC

Parsing file c:\maps\Sevastopol44.ini...
Found Team1 Winmap = MAPFR
Found Team2 Winmap = MAPDB
Found No Winmap = MAPB

Parsing file c:\maps\Singapore.ini...
Found Team1 Winmap = MAPAR
Found Team2 Winmap = MAPBB
Found No Winmap = MADB

Parsing file c:\maps\Smolensk2.ini...
Found Team1 Winmap = MAPDR
Found Team2 Winmap = MAPEB
Found No Winmap = MAPA

Parsing file c:\maps\Solomons.ini...
Found Team1 Winmap = MAPER
Found Team2 Winmap = MAPAB
Found No Winmap = MAPE

Parsing file c:\maps\Spain.ini...
Found Team1 Winmap = MAPBR
Found Team2 Winmap = MAPFB
Found No Winmap = MAPF

Shuffling data...

Modifying file c:\maps\Moonlight.ini...
New Team1 Winmap = MAPER
New Team1 Losemap = MAPCB
New Team2 Winmap = MAPCB
New Team2 Losemap = MAPER
New NoWin Map = MAPC

Modifying file c:\maps\Sevastopol44.ini...
New Team1 Winmap = MAPCR
New Team1 Losemap = MAPDB
New Team2 Winmap = MAPDB
New Team2 Losemap = MAPCR
New NoWin Map = MAPA

Modifying file c:\maps\Singapore.ini...
New Team1 Winmap = MAPDR
New Team1 Losemap = MAPEB
New Team2 Winmap = MAPEB
New Team2 Losemap = MAPDR
New NoWin Map = MADB

Modifying file c:\maps\Smolensk2.ini...
New Team1 Winmap = MAPAR
New Team1 Losemap = MAPBB
New Team2 Winmap = MAPBB
New Team2 Losemap = MAPAR
New NoWin Map = MAPF

Modifying file c:\maps\Solomons.ini...
New Team1 Winmap = MAPBR
New Team1 Losemap = MAPAB
New Team2 Winmap = MAPAB
New Team2 Losemap = MAPBR
New NoWin Map = MAPE

Modifying file c:\maps\Spain.ini...
New Team1 Winmap = MAPFR
New Team1 Losemap = MAPFB
New Team2 Winmap = MAPFB
New Team2 Losemap = MAPFR
New NoWin Map = MAPB

Done

Ta,
Norris

norrismcwhirter
20-02-2006, 12:58
It's working fine here. It doesn't output to root, just overwrites previous files.

Ta,
Norris

Brcn
21-02-2006, 02:15
Hi,

I tried it with 171 ini files, it worked but with some errors. Here is a part of what it did;


Modifying file d:\maps\RKuban.ini...
New Team1 Winmap = dogfight/UKDa/SC/
New Team1 Losemap = dogfight/UKDa/SC/
New Team2 Winmap = dogfight/UKDa/SC/
New Team2 Losemap = dogfight/UKDa/SC/
New NoWin Map = dogfight/UKDa/SC/Balkans.mis

Modifying file d:\maps\RKursk.ini...
New Team1 Winmap = dogfight/UKDa/SC/Sevastopol44.mis
New Team1 Losemap = dogfight/UKDa/SC/Solomons.mis
New Team2 Winmap = dogfight/UKDa/SC/Solomons.mis
New Team2 Losemap = dogfight/UKDa/SC/Sevastopol44.mis
New NoWin Map = dogfight/UKDa/SC/

Modifying file d:\maps\RMalta.ini...
New Team1 Winmap = dogfight/UKDa/SC/
New Team1 Losemap = dogfight/UKDa/SC/
New Team2 Winmap = dogfight/UKDa/SC/
New Team2 Losemap = dogfight/UKDa/SC/
New NoWin Map = dogfight/UKDa/SC/

Modifying file d:\maps\RMarianas2.ini...
New Team1 Winmap = dogfight/UKDa/SC/BoB.mis
New Team1 Losemap = dogfight/UKDa/SC/Channel42.mis
New Team2 Winmap = dogfight/UKDa/SC/Channel42.mis
New Team2 Losemap = dogfight/UKDa/SC/BoB.mis
New NoWin Map = dogfight/UKDa/SC/Smolensk2.mis

Modifying file d:\maps\RMoonlight.ini...
New Team1 Winmap = dogfight/UKDa/SC/
New Team1 Losemap = dogfight/UKDa/SC/
New Team2 Winmap = dogfight/UKDa/SC/
New Team2 Losemap = dogfight/UKDa/SC/
New NoWin Map = dogfight/UKDa/SC/Moscow.mis

Modifying file d:\maps\RNormandy.ini...
New Team1 Winmap = dogfight/UKDa/SC/Bocage.mis
New Team1 Losemap = dogfight/UKDa/SC/
New Team2 Winmap = dogfight/UKDa/SC/
New Team2 Losemap = dogfight/UKDa/SC/Bocage.mis
New NoWin Map = dogfight/UKDa/SC/Spain.mis

Modifying file d:\maps\ROder.ini...
New Team1 Winmap = dogfight/UKDa/SC/RBerlin.mis
New Team1 Losemap = dogfight/UKDa/SC/Finland.mis
New Team2 Winmap = dogfight/UKDa/SC/Finland.mis
New Team2 Losemap = dogfight/UKDa/SC/RBerlin.mis
New NoWin Map = dogfight/UKDa/SC/

Modifying file d:\maps\ROkinawa.ini...
New Team1 Winmap = dogfight/UKDa/SC/
New Team1 Losemap = dogfight/UKDa/SC/
New Team2 Winmap = dogfight/UKDa/SC/
New Team2 Losemap = dogfight/UKDa/SC/
New NoWin Map = dogfight/UKDa/SC/Moscow.mis

Modifying file d:\maps\RPearl.ini...
New Team1 Winmap = dogfight/UKDa/SC/Schweinfurt.mis
New Team1 Losemap = dogfight/UKDa/SC/Birma44.mis
New Team2 Winmap = dogfight/UKDa/SC/Birma44.mis
New Team2 Losemap = dogfight/UKDa/SC/Schweinfurt.mis
New NoWin Map = dogfight/UKDa/SC/

Modifying file d:\maps\RProkhorovka.ini...
New Team1 Winmap = dogfight/UKDa/SC/Channel43.mis
New Team1 Losemap =
New Team2 Winmap =
New Team2 Losemap = dogfight/UKDa/SC/Channel43.mis
New NoWin Map = dogfight/UKDa/SC/

Modifying file d:\maps\RSingapore.ini...
New Team1 Winmap = dogfight/UKDa/SC/BoBred.mis
New Team1 Losemap = dogfight/UKDa/SC/
New Team2 Winmap = dogfight/UKDa/SC/
New Team2 Losemap = dogfight/UKDa/SC/BoBred.mis
New NoWin Map = dogfight/UKDa/SC/

Modifying file d:\maps\RSmolensk2.ini...
New Team1 Winmap = dogfight/UKDa/SC/Tunis.mis
New Team1 Losemap = dogfight/UKDa/SC/BKurland.mis
New Team2 Winmap = dogfight/UKDa/SC/BKurland.mis
New Team2 Losemap = dogfight/UKDa/SC/Tunis.mis
New NoWin Map =

I have 3 versions of each ini file. Moonlight.ini, RMoonlight.ini, BMoonlight.ini. So I want it to choose a RMap.ini if the red team wins, a BMap.ini if the blue team wins and a Map.ini when no team wins.

I hope you can make this work, it will be a pain to edit 171 files manually :(

Thanks

norrismcwhirter
21-02-2006, 08:01
Hi,

The number of maps with similar names shouldn't be a problem.

The '/' path characters could be causing problems as I only tested it with files that were assumed to be in the same directory. I say this because I would have used one of the widely available Perl modules for parsing ini files but, unfortunately, someone over at whoever makes SC decided that they'd use ini files...but not ones that comply with the standard format...and I ended up having to do it in a not very elegant way.

The only other thing is some error in the ini files in the first place? They all need to be populated with map names (at least each 'team win' and 'no winner' fields).

e.g.

[Team1]
NextMisWin=TEAM1BONUS_MAP2.MIS
NextMisLost=Don't care
[Team2]
NextMisWin=TEAM2BONUS_MAP2.MIS
NextMisLost=Don't care
[Common]
TimeLimit=75
VoteLevel=-1
NoWinnerMission=MAP2.MIS

I hope you made a backup of the ini files first otherwise this could have overwritten them with the faulty paths :wall:

As requested, if you send me the ini files, I'll look at what's going on.

Cheers,
Norris

norrismcwhirter
21-02-2006, 13:10
Had a quick 5 mins so I just tried this on my set of files. Modified maps to have paths:

e.g.



Singapore.ini
[Team1]
NextMisWin=dogfight/UKDa/SC/MAPCR.mis
NextMisLost=dogfight/UKDa/SC/MAPBB.mis
[Team2]
NextMisWin=dogfight/UKDa/SC/MAPBB.mis
NextMisLost=dogfight/UKDa/SC/MAPCR.mis
[Common]
TimeLimit=75
VoteLevel=-1
NoWinnerMission=dogfight/UKDa/SC/MAPF.mis
[Army1]
Planes=75
Pilots=75
[Army2]
Planes=75
Pilots=75
[Target1]
side=2
1=1 0 0 0 800 30257 30165 400
[Target2]
side=1
1=1 0 0 0 900 21657 25747 400
[PlanesArmy1]
HurricaneMkIIb=20
HurricaneMkI
J8A
BlenheimMkIV=10
[PlanesArmy2]
D3A1
Ki-43-Ia
Ki-43-Ib
Ki-43-Ic=20
B5N2

became:

[Team1]
NextMisWin=dogfight/UKDa/SC/MAPDR.mis
NextMisLost=dogfight/UKDa/SC/MAPAB.mis
[Team2]
NextMisWin=dogfight/UKDa/SC/MAPAB.mis
NextMisLost=dogfight/UKDa/SC/MAPDR.mis
[Common]
TimeLimit=75
VoteLevel=-1
NoWinnerMission=dogfight/UKDa/SC/MAPB.mis
[Army1]
Planes=75
Pilots=75
[Army2]
Planes=75
Pilots=75
[Target1]
side=2
1=1 0 0 0 800 30257 30165 400
[Target2]
side=1
1=1 0 0 0 900 21657 25747 400
[PlanesArmy1]
HurricaneMkIIb=20
HurricaneMkI
J8A
BlenheimMkIV=10
[PlanesArmy2]
D3A1
Ki-43-Ia
Ki-43-Ib
Ki-43-Ic=20
B5N2



after this:



C:\Maps>perl maprandomise.pl c:\maps\1

Parsing file c:\maps\1\Moonlight.ini...
Found Team1 Winmap = dogfight/UKDa/SC/MAPAR.mis
Found Team2 Winmap = dogfight/UKDa/SC/MAPCB.mis
Found No Winmap = dogfight/UKDa/SC/MAPE.mis

Parsing file c:\maps\1\Sevastopol44.ini...
Found Team1 Winmap = dogfight/UKDa/SC/MAPBR.mis
Found Team2 Winmap = dogfight/UKDa/SC/MAPDB.mis
Found No Winmap = dogfight/UKDa/SC/MAPB.mis

Parsing file c:\maps\1\Singapore.ini...
Found Team1 Winmap = dogfight/UKDa/SC/MAPCR.mis
Found Team2 Winmap = dogfight/UKDa/SC/MAPBB.mis
Found No Winmap = dogfight/UKDa/SC/MAPF.mis

Parsing file c:\maps\1\Smolensk2.ini...
Found Team1 Winmap = dogfight/UKDa/SC/MAPFR.mis
Found Team2 Winmap = dogfight/UKDa/SC/MAPAB.mis
Found No Winmap = dogfight/UKDa/SC/MAPA.mis

Parsing file c:\maps\1\Solomons.ini...
Found Team1 Winmap = dogfight/UKDa/SC/MAPER.mis
Found Team2 Winmap = dogfight/UKDa/SC/MAPFB.mis
Found No Winmap = dogfight/UKDa/SC/MAPB.mis

Parsing file c:\maps\1\Spain.ini...
Found Team1 Winmap = dogfight/UKDa/SC/MAPDR.mis
Found Team2 Winmap = dogfight/UKDa/SC/MAPEB.mis
Found No Winmap = dogfight/UKDa/SC/MAPC.mis

Shuffling data...

Modifying file c:\maps\1\Moonlight.ini...
New Team1 Winmap = dogfight/UKDa/SC/MAPAR.mis
New Team1 Losemap = dogfight/UKDa/SC/MAPCB.mis
New Team2 Winmap = dogfight/UKDa/SC/MAPCB.mis
New Team2 Losemap = dogfight/UKDa/SC/MAPAR.mis
New NoWin Map = dogfight/UKDa/SC/MAPF.mis

Modifying file c:\maps\1\Sevastopol44.ini...
New Team1 Winmap = dogfight/UKDa/SC/MAPCR.mis
New Team1 Losemap = dogfight/UKDa/SC/MAPDB.mis
New Team2 Winmap = dogfight/UKDa/SC/MAPDB.mis
New Team2 Losemap = dogfight/UKDa/SC/MAPCR.mis
New NoWin Map = dogfight/UKDa/SC/MAPC.mis

Modifying file c:\maps\1\Singapore.ini...
New Team1 Winmap = dogfight/UKDa/SC/MAPDR.mis
New Team1 Losemap = dogfight/UKDa/SC/MAPAB.mis
New Team2 Winmap = dogfight/UKDa/SC/MAPAB.mis
New Team2 Losemap = dogfight/UKDa/SC/MAPDR.mis
New NoWin Map = dogfight/UKDa/SC/MAPB.mis

Modifying file c:\maps\1\Smolensk2.ini...
New Team1 Winmap = dogfight/UKDa/SC/MAPER.mis
New Team1 Losemap = dogfight/UKDa/SC/MAPFB.mis
New Team2 Winmap = dogfight/UKDa/SC/MAPFB.mis
New Team2 Losemap = dogfight/UKDa/SC/MAPER.mis
New NoWin Map = dogfight/UKDa/SC/MAPE.mis

Modifying file c:\maps\1\Solomons.ini...
New Team1 Winmap = dogfight/UKDa/SC/MAPFR.mis
New Team1 Losemap = dogfight/UKDa/SC/MAPBB.mis
New Team2 Winmap = dogfight/UKDa/SC/MAPBB.mis
New Team2 Losemap = dogfight/UKDa/SC/MAPFR.mis
New NoWin Map = dogfight/UKDa/SC/MAPA.mis

Modifying file c:\maps\1\Spain.ini...
New Team1 Winmap = dogfight/UKDa/SC/MAPBR.mis
New Team1 Losemap = dogfight/UKDa/SC/MAPEB.mis
New Team2 Winmap = dogfight/UKDa/SC/MAPEB.mis
New Team2 Losemap = dogfight/UKDa/SC/MAPBR.mis
New NoWin Map = dogfight/UKDa/SC/MAPB.mis


Done




So, no problems with the files with / in the path. Seems to be ok if there are spaces in the paths, also (although that, obviously, will never work on the server).

It's either the number of files causing the problem (but I use Perl to deal with 100MB+ text files so I doubt that) or maybe some of the ini files just never had maps defined in the first place?


Norris

Brcn
21-02-2006, 13:15
Yes, some of the files dont have any maps defined. And also format of some .ini are different than the one you have. do you want me to put them in the same format and send it? Or can the randomiser handle that?

EDIT:


maybe some of the ini files just never had maps defined in the first place?

This is not the case, i think as

NextMisWin=dogfight/UKDa/SC/RSpain.mis
NextMisLost=dogfight/UKDa/SC/BSpain.mis
[Team2]
NextMisWin=dogfight/UKDa/SC/BSpain.mis
NextMisLost=dogfight/UKDa/SC/RSpain.mis
[Common]
TimeLimit=60
VoteLevel=-1
NoWinnerMission=dogfight/UKDa/SC/Spain.mis

become

NextMisWin=dogfight/UKDa/SC/
NextMisLost=dogfight/UKDa/SC/Channel43.mis
[Team2]
NextMisWin=dogfight/UKDa/SC/Channel43.mis
NextMisLost=dogfight/UKDa/SC/
[Common]
TimeLimit=60
VoteLevel=-1
NoWinnerMission=

norrismcwhirter
21-02-2006, 13:23
It can only handle what I know about ;)

The randomiser can only randomise what it finds in files...it can't make things up...and no map entries will mean spaces appearing as you've found.

Also, it doesn't matter if the ini files aren't exactly the same because the script only bothers looking at these lines:

[Team1]
NextMisWin=dogfight/UKDa/SC/MAPCR.mis
NextMisLost=dogfight/UKDa/SC/MAPBB.mis
[Team2]
NextMisWin=dogfight/UKDa/SC/MAPBB.mis
NextMisLost=dogfight/UKDa/SC/MAPCR.mis
[Common]
NoWinnerMission=dogfight/UKDa/SC/MAPF.mis

So, if these appear in the file somewhere, and in that order, it'll be fine.

Don't forget that you only have to populate the NextMisWin and NoWinnerMission of each ini file....the randomiser WILL fill the NextMisLost bits in by itself but that's all that it can do.

Ta,
Norris

Brcn
21-02-2006, 15:54
Well, i edited them manually :) Bu i hope we can make this working :)

norrismcwhirter
21-02-2006, 16:42
Yes, some of the files dont have any maps defined. And also format of some .ini are different than the one you have. do you want me to put them in the same format and send it? Or can the randomiser handle that?

EDIT:



This is not the case, i think as

NextMisWin=dogfight/UKDa/SC/RSpain.mis
NextMisLost=dogfight/UKDa/SC/BSpain.mis
[Team2]
NextMisWin=dogfight/UKDa/SC/BSpain.mis
NextMisLost=dogfight/UKDa/SC/RSpain.mis
[Common]
TimeLimit=60
VoteLevel=-1
NoWinnerMission=dogfight/UKDa/SC/Spain.mis

become

NextMisWin=dogfight/UKDa/SC/
NextMisLost=dogfight/UKDa/SC/Channel43.mis
[Team2]
NextMisWin=dogfight/UKDa/SC/Channel43.mis
NextMisLost=dogfight/UKDa/SC/
[Common]
TimeLimit=60
VoteLevel=-1
NoWinnerMission=

This will happen if any of the ini files have missing maps because the current randomiser will 'read in the gaps' then stuff the gaps back out later.

There is no error checking although I suspect I could implement an algorithm that would check how many 'gaps' there are and then avoid having any gaps when the files are written back out again.

I suppose what I could also do is to make a tool that reads in the names of all the map names available then autopopulates the map ini files up front, prior to running the randomisation tool.

There's no point in that, though, if you've got all the map ini files completed. If you want, send them over to me and I'll run a test with them to see how it works; it's probably easier for me to do it as I can easily check the validity using Beyond Compare etc.



Bu i hope we can make this working


As I tell my boss, anything is possible given the time, inclination and the right information :)

Ta,
Norris

norrismcwhirter
21-02-2006, 17:10
Hi,

I'm using this as I've been having some trouble with gmail...

The ini's you sent cannot work properly on the server as they don't have all the information included (or, unless I'm missing something obvious) - that's what's causing the problem.

e.g.

I ran the tool but stopped it short of modifying the files...


Parsing file C:\Maps\MAP1\Alps.ini...
Found Team1 Winmap = dogfight/UKDa/SC/
Found Team2 Winmap = dogfight/UKDa/SC/Channel43.mis
Found No Winmap =

Parsing file C:\Maps\MAP1\Balkans.ini...
Found Team1 Winmap = dogfight/UKDa/SC/
Found Team2 Winmap =
Found No Winmap = dogfight/UKDa/SC/Kuban_43.mis

Parsing file C:\Maps\MAP1\BAlps.ini...
Found Team1 Winmap = dogfight/UKDa/SC/RBerlin.mis
Found Team2 Winmap = dogfight/UKDa/SC/Bagration.mis
Found No Winmap = dogfight/UKDa/SC/Tirpitz.mis

Parsing file C:\Maps\MAP1\Balta.ini...
Found Team1 Winmap = NewGuinea.mis
Found Team2 Winmap = dogfight/UKDa/SC/Ardennes.mis
Found No Winmap = dogfight/UKDa/SC/Tunis.mis



The alps.ini file looks like this:


[Team1]
NextMisWin=dogfight/UKDa/SC/
NextMisLost=dogfight/UKDa/SC/Channel43.mis
[Team2]
NextMisWin=dogfight/UKDa/SC/Channel43.mis
NextMisLost=dogfight/UKDa/SC/
[Common]
TimeLimit=60
VoteLevel=-1
NoWinnerMission=


which matches what my tool parsed out of it.

Also, this file doesn't have a path for newguinea..is that right?

balta.ini:


[Team1]
NextMisWin=NewGuinea.mis
NextMisLost=dogfight/UKDa/SC/Ardennes.mis
[Team2]
NextMisWin=dogfight/UKDa/SC/Ardennes.mis
NextMisLost=NewGuinea.mis
[Common]
TimeLimit=120
VoteLevel=-1
NoWinnerMission=dogfight/UKDa/SC/Tunis.mis


I'd say that 50% of the files didn't look right...are these the latest set?

The balps.ini file looks alright as parsed.

Ta,
Norris

norrismcwhirter
21-02-2006, 18:03
OK, I renamed the map inis as follows:

BAlps.ini
BArdennes.ini
BAutumnStorm.ini
BBagration.ini

etc


etc

NAlps.ini
NArdennes.ini
NAutumnStorm.ini
NBagration.ini
NBalkans.ini

RAlps.ini
RArdennes.ini
RAutumnStorm.ini
RBagration.ini
RBalkans.ini

etc

So, the map ini type is denoted fully by the prefix letter.

I wrote a tool which finds all the ini files in a directory, groups them by type (according to prefix letter) then writes out ALL the ini files with the new map types. You can prefix a dir etc so, the usage is:

obtainmaps.exe "C:\Maps\A2" "dogfight/UKDa/SC/"

and the output is:


Modifying file C:\Maps\A2\BAlps.ini...
New Team1 Winmap = dogfight/UKDa/SC/BWarszawa.mis
New Team1 Losemap = dogfight/UKDa/SC/RWarszawa.mis
New Team2 Winmap = dogfight/UKDa/SC/RWarszawa.mis
New Team2 Losemap = dogfight/UKDa/SC/BWarszawa.mis
New NoWin Map = dogfight/UKDa/SC/NWarszawa.mis

Modifying file C:\Maps\A2\BArdennes.ini...
New Team1 Winmap = dogfight/UKDa/SC/BTunis.mis
New Team1 Losemap = dogfight/UKDa/SC/RTunis.mis
New Team2 Winmap = dogfight/UKDa/SC/RTunis.mis
New Team2 Losemap = dogfight/UKDa/SC/BTunis.mis
New NoWin Map = dogfight/UKDa/SC/NTunis.mis

Modifying file C:\Maps\A2\BAutumnStorm.ini...
New Team1 Winmap = dogfight/UKDa/SC/BTirpitz.mis
New Team1 Losemap = dogfight/UKDa/SC/RTirpitz.mis
New Team2 Winmap = dogfight/UKDa/SC/RTirpitz.mis
New Team2 Losemap = dogfight/UKDa/SC/BTirpitz.mis
New NoWin Map = dogfight/UKDa/SC/NTirpitz.mis


There is, of course, some duplication but you can then run the randomiser on these files to get from this:


Parsing file C:\Maps\A2\BAlps.ini...
Found Team1 Winmap = dogfight/UKDa/SC/BWarszawa.mis
Found Team2 Winmap = dogfight/UKDa/SC/RWarszawa.mis
Found No Winmap = dogfight/UKDa/SC/NWarszawa.mis

Parsing file C:\Maps\A2\BArdennes.ini...
Found Team1 Winmap = dogfight/UKDa/SC/BTunis.mis
Found Team2 Winmap = dogfight/UKDa/SC/RTunis.mis
Found No Winmap = dogfight/UKDa/SC/NTunis.mis

Parsing file C:\Maps\A2\BAutumnStorm.ini...
Found Team1 Winmap = dogfight/UKDa/SC/BTirpitz.mis
Found Team2 Winmap = dogfight/UKDa/SC/RTirpitz.mis
Found No Winmap = dogfight/UKDa/SC/NTirpitz.mis


to this:


Modifying file C:\Maps\A2\BAlps.ini...
New Team1 Winmap = dogfight/UKDa/SC/BPearl.mis
New Team1 Losemap = dogfight/UKDa/SC/RSchweinfurt.mis
New Team2 Winmap = dogfight/UKDa/SC/RSchweinfurt.mis
New Team2 Losemap = dogfight/UKDa/SC/BPearl.mis
New NoWin Map = dogfight/UKDa/SC/NBalkans.mis

Modifying file C:\Maps\A2\BArdennes.ini...
New Team1 Winmap = dogfight/UKDa/SC/BBalkans.mis
New Team1 Losemap = dogfight/UKDa/SC/RBirma44.mis
New Team2 Winmap = dogfight/UKDa/SC/RBirma44.mis
New Team2 Losemap = dogfight/UKDa/SC/BBalkans.mis
New NoWin Map = dogfight/UKDa/SC/NItaly.mis

Modifying file C:\Maps\A2\BAutumnStorm.ini...
New Team1 Winmap = dogfight/UKDa/SC/BAlps.mis
New Team1 Losemap = dogfight/UKDa/SC/RBagration.mis
New Team2 Winmap = dogfight/UKDa/SC/RBagration.mis
New Team2 Losemap = dogfight/UKDa/SC/BAlps.mis
New NoWin Map = dogfight/UKDa/SC/NPearl.mis


The Balps.ini would therefore be:


[Team1]
NextMisWin=dogfight/UKDa/SC/BPearl.mis
NextMisLost=dogfight/UKDa/SC/RSchweinfurt.mis
[Team2]
NextMisWin=dogfight/UKDa/SC/RSchweinfurt.mis
NextMisLost=dogfight/UKDa/SC/BPearl.mis
[Common]
TimeLimit=60
VoteLevel=-1
NoWinnerMission=dogfight/UKDa/SC/NBalkans.mis
[Army1]
Planes=80
Pilots=80
[Army2]
Planes=60
Pilots=60
[Target1]
side=2
1=1 0 0 0 750 13500 16100 300
[Target2]
side=1
1=1 0 0 0 750 13400 17650 200
[PlanesArmy1]
F4U-1C=20
P-38L_Late
P-47D
P-51D-20NA
MustangIII
P-63C
SpitfireMkVIIICLP
P-80A=40
BI-1=10
I-185M-71
La-73xB20
Yak-3P
Yak-9UT
[PlanesArmy2]
Bf-109K-4
Bf-109Z=10
Fw-190D-9_Late
Ta-152H-1
Go-229A-1=10
He-162A-2=20
Me-163B-1a=10
Me-262A-1a=30
Me-262A-1aU4=30
Me-262A-2a=30


Is that better?

You're going to have to rename some of your map files but you can do that with irfanview or a batch renamer quite easily. All you have to do now is to keep to the naming convention and everything should be fine.

There is still scope for the following happening:

Players play map A, red win so goes to map C
Players play map C, blue win (as if!) so goes to map N
Players play map N, blue win (double as if!) so goes to map C

but the probability of that should be quite low.

Either way, it should be a lot better than now where you can get map winning 'runs' because of cumulative favourable bonus situations etc.

Ta,
Norris

Brcn
24-02-2006, 15:08
Bah, stupid me. I ve just seen this post. I am trying it now.

Brcn
24-02-2006, 15:39
For some reason I get this result for all the ini.

Modifying file D:\Maps\RWarszawa.ini...
New Team1 Winmap = dogfight/UKDa/SC/ROkinawa.mis
New Team1 Losemap = dogfight/UKDa/SC/BTunis.mis
New Team2 Winmap = dogfight/UKDa/SC/BTunis.mis
New Team2 Losemap = dogfight/UKDa/SC/ROkinawa.mis
New NoWin Map = dogfight/UKDa/SC/Kuban.mis

I added a 'N' all the no bonus maps, but the randomiser puts them in the inis without the N

Well, it s no bid deal, i ll just delete the N from the map names.

Other than that, it's working perfectly, thanks a lot.