yairm210 / Unciv

Open-source Android/Desktop remake of Civ V
Mozilla Public License 2.0
8.5k stars 1.58k forks source link

Quicker selection of civilizations for custom maps #11229

Closed PLynx01 closed 7 months ago

PLynx01 commented 8 months ago

Before creating

Problem Description

I enjoy playing on custom maps with predefined starting locations. Unfortunately the only way to select the civilizations is to pick them manually. This is a inconvenient process and it may turn out that civilizations are spawned in the wrong place, too sparsely, too densely or the density is inconsistent, which make it necessary to do it again.

Related Issue Links

No response

Desired Solution

Add a game option to auto-fill the rest of civilizations after selecting human-controlled civilization.

Add also the presets of civilizations for map makers, that would enable the players to choose the different amount of civilizations, according to their civilization density preferences.

Alternative Approaches

If implementing the civilizations presets is not viable, add at least the option to auto-fill the civilizations list when they have a defined starting locations on a selected map.

Additional Context

I have some coding skills, so I can try to implement that feature. If I will have a problem, you can help me with that.

SomeTroglodyte commented 8 months ago

Sounds familiar. Didn't we already do something in this direction? Wasn't there a similar issue not too long ago?

PLynx01 commented 8 months ago

Sounds familiar. Didn't we already do something in this direction? Wasn't there a similar issue not too long ago?

I've posted similar issue several months ago, but I wasn't able to implement it back then.

I recently took a second try to implement that function, so maybe I will post a PR with that feature.

PLynx01 commented 8 months ago

That's it: https://github.com/yairm210/Unciv/issues/10255

SomeTroglodyte commented 8 months ago

See - even if we ignore you, we remember :upside_down_face: :zany_face: - bad joke.

Without Studio open I associate

Once you know which nations a map "endorses", you can play around. Simply sort them to the top in Nation Picker? New buttons for auto-population? Possibilities...

PLynx01 commented 8 months ago

See - even if we ignore you, we remember :upside_down_face: :zany_face: - bad joke.

Without Studio open I associate

  • I think New game screen is a mess. Too cluttered, the portrait mode works - maybe, not really optimal, and the implementation of interrelations between different controls is too complicated. Said so before. Very tempted to ditch the thing and start over, with a "wizard" approach - then anything on "done" pages is static and won't need to adapt to new choices. Started once, didn't get far - reusing existing elements isn't trivial either.

Yes, I agree with you that new game screen is somewhat cluttered. I think we should make the "Specified Starting Locations Mode Wizard". It would be the separate screen, partially independent from the new game screen.

  • That story just means - For any new UI element taking space - think small or think really big.
  • You need the map json parsed to read out starting locations. Long ago, new game didn't load the map at all until you were done. Now - map preview (the graphical one) must load something. Or - is there a TileMapPreview class? Look into what that does and how and which usecase it serves. Might be fine to add the starting locs to the preview to parse them quicker...

I used the MapSaver class to get the starting locations. I made them as a public variable

  • Don't forget Coroutines. At least map preview (the graphical one) runs async, so make sure the info you need now doesn't arrive until later.

Coroutines? When I used the MapSaver class I didn't use coroutines or async. The map loaded quickly. (My CPU is i5-13500, so it's very powerful). But on low-end android device it might be a problem.

  • I believe it possible the random civ placement routine already favours nations with a starting loc - check that. No, it's not the code in MapRegions, that stuff isn't used for loaded maps.

Once you know which nations a map "endorses", you can play around. Simply sort them to the top in Nation Picker? New buttons for auto-population? Possibilities...

There is indeed many possibilities, especially when making the separate wizard screen, mentioned above.

You could list the UI elements necessary for the "Specified Starting Locations Mode Wizard". We need to discuss that with @yairm210 , other devs and players.

PLynx01 commented 8 months ago

@SomeTroglodyte what is your opinion? Please reply.

SomeTroglodyte commented 8 months ago

Please reply

Can't quite imagine - either I invest time and basically do half the work to see what could work, or you do the work and show off mock-ups, or - you ask specific questions. But also - I'll be offline soon for a few weeks.

Idea while typing this - there was that thing where you could limit the "pool" of nations "random" is allowed to choose from. What if you do no more UI than a Toast "Hey there were starting locations, so we set your random pool to those, go look over there" - for a first minimalistic version? Sounds too easy - what if there's just one st-loc in there, or some but less than the user asks for...

SeventhM commented 7 months ago

@PLynx01 Probably some one will look over this issue and find a good way to implement it (For maps with predefined Civs, I would assume something where the Civs themselves are listed as normal, but can't be changed besides who is or isn't AI, But I can imagine it maybe being messy on the backend. Haven't checked).But please don't have two issue for the same thing. Since this is almost entirely the other issue, I'm closing the other issue