Sort Maps with AI Markers Option

Moderator: keyser

Sort Maps with AI Markers Option

Postby The Mak » 13 Dec 2012, 01:29

Hello, I would like to request an addition to the in-game Game Options menu. In Sorian's Lobby Enhancement Mod he included an option to filter maps if they have or have not AI markers. I went ahead and did all the necessary changes to the file faforever.faf (code work and UI changes) to make this work and it is functioning. Here are some screenshots:

In current version of FAF (before any of my changes)Image

Changes showing UI additions and modifications, please note the new filter option and the text in the map preview stating if the map has AI markers. I also cleaned up a little of the filters placement in the UI to make it look good.
Image

Another image showing a sorted list of maps with AI markers.
Image

Here is a link to the modified faforever.faf. Make sure to make a copy of the original before dropping that in the FAF folder.

Here is a zip file with the four files I changed which are:
panel_bmp.dds (/textures/ui/common/scx_menu/game-settings/panel_bmp.dds)
EnhancedLobby.lua (/lua/EnhancedLobby.lua)
mapselect.lua (/lua/ui/dialogs/mapselect.lua)
tooltips.lua (/lua/ui/help/tooltips.lua)

As well as a text file stating where all the changes are.

I tagged the additions and changes with ###New so that they can be found easily.

Most of the code for this addition comes from Sorian's Lobby Enhancement Mod. I just worked the code so that it can function properly with FAF modifications and be presentable in the Game Options menu. Since I play mostly with the AI, locating maps with AI markers saves me alot of time. Since I was working on making it look nice I cleaned up some of the filter spacing in the original image so it looks good.

One thing to note that it takes a bit of time to sort through the maps. This is because it needs to look through each of the maps and see if they have AI markers (specifically land markers). The program may appear to be doing nothing but the duration is dependent on your computer speed and the number of maps.

An idea of duration of a sorting maps with AI markers on my machines, I have just over 1,600 maps;
- Core I7-3630QM @ 2.4 GHz with 16GB RAM with an SSD hard drive: 5 to 6 seconds
- Core 2 Quad Q9650 @ 3.0 GHz with 8GB RAM with a 7200RPM hard drive: 65 seconds

So keep that in mind if it is taking you some time. The default filter setting by the way is "Any", so the delay only occurs if you want or do not want to sort maps with AI markers.

A possible bug is that it may not properly filter maps that have AI markers, but there are no land markers. I have not seen such a map but when I get a bit more time, I will see how to include these as well as any other cases that may come up.

If you want to try this for yourself.
-First make a backup of faforever.faf (default location: C:\ProgramData\FAForever\gamedata)
-Run the FA executable in the FAF folder (default location: C:\ProgramData\FAForever\bin\ForgedAlliance.exe)
FA will start as if you were running the game but all the changes that FAF has would be automatically loaded.

Make sure to copy back your original faforever.faf file (the one you made a backup of) to play as usual through the FAF lobby.

Please let me know if you run into any issues or have any questions.
User avatar
The Mak
Contributor
 
Posts: 342
Joined: 03 Mar 2012, 21:09
Location: New York, NY, USA
Has liked: 5 times
Been liked: 39 times
FAF User Name: The_Mak

Re: Sort Maps with AI Markers Option

Postby eXcalibur » 13 Dec 2012, 20:08

The Mak, this is REALLY nice!

I almost lost hope that something like this would ever exist. The AIs are just bad when they do not have any markers.

The only problem is now, to get it in the FAF Lobby.
Ze_Pilot always said that there would be no changes in the year 2012 anymore, but this does not include 2013 as well.
I doubt that there will be a lot of new versions of the lobby in the following months.

Therefore you could talk to Ze_Pilot or ColonelSheppard directly (write them a PM) or try to put this into the lobby yourself: viewtopic.php?f=45&t=1788

I have tried to get an overview of the lobby code myself, but I realized fast that I lacked programming/coding experience in order to even find the code I was looking for.
Maybe you are better in this!

When you did the changes in the source code (this is most important) and want another challenge (this is less important), you could try to do this as well: viewtopic.php?f=2&t=1349
eXcalibur
Priest
 
Posts: 302
Joined: 28 Apr 2012, 14:18
Has liked: 52 times
Been liked: 3 times
FAF User Name: eXcalibur

Re: Sort Maps with AI Markers Option

Postby ColonelSheppard » 13 Dec 2012, 21:40

EDIT: https://bitbucket.org/thepilot/forged-a ... ments/diff

EDIT2: pull request is accepted

EDIT3: a search map by name function would rock too i guess
User avatar
ColonelSheppard
Contributor
 
Posts: 2997
Joined: 20 Jul 2012, 12:54
Location: Germany
Has liked: 154 times
Been liked: 165 times
FAF User Name: Sheppy

Re: Sort Maps with AI Markers Option

Postby The Mak » 16 Dec 2012, 18:50

eXcalibur:
I think all those options are already there. Look in the screenshots I have posted, right column. The AI options are there. Maybe I have them because of a mod (*.scd format) in my gamedata directory of FA (default location: C:\Program Files (x86)\THQ\Gas Powered Games\Supreme Commander - Forged Alliance\gamedata). I think it may be powerlobby.scd.

Drop that into your gamedata directory and give it a go. If anything it shows how we can expand the UI menu.


ColonelSheppard:
Thank you so much for posting it there. That would have been the more appropriate location. Looks like I missed a change i made.

Search function may be a stretch within the UI. Perhaps we can make an exterior app that has all that functionality that is accessible through an overlay (think the Steam overlay). We can do the search or anything else we want there, and once you found it, the name will pop up, then you can scroll down to the map and select. Kinda of a long way around, but perhaps we can even modify the game creation screen that first pops up in FAF and have every option there. That way we do not need to muck around with the tedious FA code. Something to consider.
User avatar
The Mak
Contributor
 
Posts: 342
Joined: 03 Mar 2012, 21:09
Location: New York, NY, USA
Has liked: 5 times
Been liked: 39 times
FAF User Name: The_Mak

Re: Sort Maps with AI Markers Option

Postby eXcalibur » 18 Dec 2012, 20:20

i think you misunderstood the thread i have linked.

it does not say that we need AI opitons, but rather that the existing AI options are confusing/too much for the limited space we have in the UI. Therefore the AI options should only be visible, when you put an AI into the game but NOT when you play only against real people...

This is not really essential, because it only gives FA a nicer and cleaner UI.

When you read the thread, it tells you that custom maps can give you extra options as well (which are not there all the time - only when you select the custom map). Therefore it should not be impossible to do this.
eXcalibur
Priest
 
Posts: 302
Joined: 28 Apr 2012, 14:18
Has liked: 52 times
Been liked: 3 times
FAF User Name: eXcalibur


Return to FAF Suggestions

Who is online

Users browsing this forum: No registered users and 1 guest