adaptive canis

Interesting mapping tools and mapping help.

Moderator: Morax

adaptive canis

Postby CookieNoob » 27 Aug 2016, 00:10

I made a new version of canis (I know there are thousends already), BUT: this one adopts to the number of players that are in the game by adjusting the number of mexes/hydros. The map can be played 1v1 or 7v7, it doesnt matter!

Furthermore there are some lobby options that allow for some customization of the map before the game launches. Currently implemented are the options to disable the adaptive spawning of mexes (and spawn a fixed configuration, very similar to canis 4v4), putting an additional hydro on the hill on the sides and some configuration for the adaptive spawning.

However, there are the bugs that I just cant track down:
1) Solved: (thanks to KeyBlue) if the adaptive spawning is active, the hydros on the hill are not spawned. If the fixed spawn is active (second option) the hydros will spawn when selected to. I dont know why they dont spawn when the adaptive option is chosen.

2) Solved: (thanks to KeyBlue) for some reason all players are put in separate teams. I.e. independent of the game settings, the game will always be FFA. This is a major issue that has to be solved. Since this is the first time I did something with lua/FAmapeditor/scripting I dont really see a realistic chance to find out what causes this on my own.


It is planned to add an option to have some salem wrecks in the middle of the map or a stratbomber wreck on the sides. (I have no idea how to do so yet though)


Help is greatly appreciated! Feedback too.


If you think that this concept is a good idea, post below or like the post. If this sort of map is accepted, I will also do this other maps with symmetrical distributions of spawn positions and mexes. It was planned for Wonder and maybe also for Wonder open NA, but due to the assymetrical distribution of mexes, starting locations and reclaim this is really a painful thing to do. If some mapper would redo that and put the markers on the map in a symmetrical way, I will do that immidiately :)


If other maps are requested I will see what I can do and if it is worth the effort.
Attachments
Canis Ultimate.v0001.zip
(957.6 KiB) Downloaded 106 times
Last edited by CookieNoob on 27 Aug 2016, 15:30, edited 7 times in total.
Check out the next level of maps: viewtopic.php?f=53&t=13014
For adaptivity, customizability and less clutter in the vault.
User avatar
CookieNoob
Priest
 
Posts: 477
Joined: 02 Aug 2014, 17:07
Has liked: 65 times
Been liked: 249 times
FAF User Name: CookieNoob

Re: adaptive canis

Postby KeyBlue » 27 Aug 2016, 00:29

I think issue 2 is solved by removing

Code: Select all
ScenarioFramework.SetPlayableArea('AREA_1' , false)


Running the map gave an issue regarding this function.
I commented the line out and that seems to have solved the team problem.


A quick look at the map showed me that AREA_1 was set to 0,0,0,0.
So either make a correct Area or don't do SetPlayableArea
User avatar
KeyBlue
Priest
 
Posts: 403
Joined: 28 Jan 2016, 01:06
Has liked: 140 times
Been liked: 93 times
FAF User Name: KeyBlue

Re: adaptive canis

Postby CookieNoob » 27 Aug 2016, 00:46

thx very much, that indeed solved it.
Check out the next level of maps: viewtopic.php?f=53&t=13014
For adaptivity, customizability and less clutter in the vault.
User avatar
CookieNoob
Priest
 
Posts: 477
Joined: 02 Aug 2014, 17:07
Has liked: 65 times
Been liked: 249 times
FAF User Name: CookieNoob

Re: adaptive canis

Postby KeyBlue » 27 Aug 2016, 01:28

Found the 1st issue.
Which was very badly explained if i might add :p. Had to try several combinations to recreate the situation.
The only reason why the hydro's spawned when "disabled high mass" was chosen, was because you just spawn everything. Even if you disabled the hydro's, you would get them.



When giving the default value for one of your options, you don't actually get that value when a player doesn't change anything (everything default). You just get a nil value.

To solve this, you just need to put this at the start of your CreateResources function :

Code: Select all
ScenarioInfo.Options.automex = ScenarioInfo.Options.automex or 1
ScenarioInfo.Options.mirrormex = ScenarioInfo.Options.mirrormex or 1
ScenarioInfo.Options.hydroplus = ScenarioInfo.Options.hydroplus or 1

This'll keep the set value or put in your default value (always 1 here because the keys of your default values are all 1)

You can remove the following code now, since it just disguised the issue. It was probably an attempt to solve it without knowing what was actually wrong.
Code: Select all
        if(mirrormex1 != 1 and mirrormex1 != 2) then
            mirrormex1 =1;
        end



Next i suggest to also remove this (not sure what the point of it was):
Code: Select all
      if(Armies < 4) then
         doit = false;
      end

This piece of code says that you should never spawn anything when there are less than 4 players. So you can't play with 3 players. And when playing with 2, you can't have the extra hydro's.


Finally i would suggest to not use your HydroPlus 'magic' but instead give both hydro's this value in the _save file:
Code: Select all
remove        ['SpawnWithArmy'] = STRING( 'Hydroplus' ),

add                    ['hydroplus'] = BOOLEAN( true ),

This would be a lot cleaner, since hydroplus has nothing todo with the amount of armies you spawn.


Then you can simply write this:
Code: Select all
if (tblData.resource and not tblData.SpawnWithArmy) then
    -- standard resources, spawn it
    doit = true;
elseif (tblData.resource and ScenarioInfo.Options.hydroplus == 1 and tblData.hydroplus) then
    -- extra hydro, spawn it
    doit= true;
elseif (tblData.resource and tblData.SpawnWithArmy) then
.
.
.
User avatar
KeyBlue
Priest
 
Posts: 403
Joined: 28 Jan 2016, 01:06
Has liked: 140 times
Been liked: 93 times
FAF User Name: KeyBlue

Re: adaptive canis

Postby CookieNoob » 27 Aug 2016, 01:32

great! I solved the issue with one acu not spawning and then all currently known issues are solved! :) thx very much!!

So V0001 is ready for release ^^ now I only have to get Downlords client to work xD
Check out the next level of maps: viewtopic.php?f=53&t=13014
For adaptivity, customizability and less clutter in the vault.
User avatar
CookieNoob
Priest
 
Posts: 477
Joined: 02 Aug 2014, 17:07
Has liked: 65 times
Been liked: 249 times
FAF User Name: CookieNoob

Re: adaptive canis

Postby CookieNoob » 27 Aug 2016, 15:26

new map similar to Canis Ultimate:
Hilly Plateau Ultimate

known bugs: currently no bugs known

v0002: changed a small typo
Attachments
Hilly Plateau Ultimate.v0002.zip
(856.32 KiB) Downloaded 81 times
Last edited by CookieNoob on 27 Aug 2016, 22:42, edited 1 time in total.
Check out the next level of maps: viewtopic.php?f=53&t=13014
For adaptivity, customizability and less clutter in the vault.
User avatar
CookieNoob
Priest
 
Posts: 477
Joined: 02 Aug 2014, 17:07
Has liked: 65 times
Been liked: 249 times
FAF User Name: CookieNoob

Re: adaptive canis

Postby Lieutenant Lich » 27 Aug 2016, 19:59

CookieNoob's version of Canis is great and logical. Well done, CookieNoob!
Don't complain about that which you aren't willing to change.

My mod:
viewtopic.php?f=67&t=12864
User avatar
Lieutenant Lich
Evaluator
 
Posts: 952
Joined: 01 Feb 2016, 05:28
Location: United States
Has liked: 992 times
Been liked: 818 times

Re: adaptive canis

Postby KeyBlue » 27 Aug 2016, 20:34

In case you haven't found out how to add optional reclaim:


Add the units (that you want to have like wreckage) like you would do if you wanted to add Civilians:
see http://wiki.faforever.com/index.php?tit ... _civilians
Instead of using NEUTRAL_CIVILIANS->INITIAL you should use ARMY_15->Optional_Wreckage (or different group name)


Now that you have a group with the units, you can add the code to spawn them.
You ofcourse need a new option inside your _options file.

Inside your CreateResources function you can add the following code (outside of the for loop)
Code: Select all
ScenarioInfo.Options.optional_wrecks = ScenarioInfo.Options.optional_wrecks or 1

Code: Select all
if ScenarioInfo.Options.optional_wrecks == 1 then
    ScenarioUtils.CreateArmyGroup('ARMY_15', 'Optional_Wreckage ', true)
end

The 3rd argument "true" turns the armygroup into wrecks.
User avatar
KeyBlue
Priest
 
Posts: 403
Joined: 28 Jan 2016, 01:06
Has liked: 140 times
Been liked: 93 times
FAF User Name: KeyBlue

Re: adaptive canis

Postby CookieNoob » 27 Aug 2016, 22:51

@KeyBlue: thanks very much! I will have a look at this tomorrow and add the options for the maps I treated so far :)

This afternoon I made a new version of New Zeta Wonder, the map is relatively symmetrical compared to wonder (suprisingly) so it's a feasable task to do it.
Attachments
Zeta Wonder Ultimate.v0001.rar
(860.44 KiB) Downloaded 108 times
Check out the next level of maps: viewtopic.php?f=53&t=13014
For adaptivity, customizability and less clutter in the vault.
User avatar
CookieNoob
Priest
 
Posts: 477
Joined: 02 Aug 2014, 17:07
Has liked: 65 times
Been liked: 249 times
FAF User Name: CookieNoob

Re: adaptive canis

Postby Lieutenant Lich » 28 Aug 2016, 00:06

I shall test it then
Don't complain about that which you aren't willing to change.

My mod:
viewtopic.php?f=67&t=12864
User avatar
Lieutenant Lich
Evaluator
 
Posts: 952
Joined: 01 Feb 2016, 05:28
Location: United States
Has liked: 992 times
Been liked: 818 times

Next

Return to Mapping

Who is online

Users browsing this forum: No registered users and 1 guest