Race Conditions with Wonders

For what's not in 'Top Priority Game Design'. Post your ideas, visions, suggestions for the game, rules, modifications, etc.

Moderator: Oberlus

Message
Author
Argus
Space Floater
Posts: 23
Joined: Fri Aug 19, 2005 4:28 pm
Location: Montreal, Canada

Race Conditions with Wonders

#1 Post by Argus »

Just playing a little civ and I had a thought about 2 players building the same wonder. In FreeOrion if two players start building the same wonder the same round and finish the same round what happens? I'm assuming we're having all players submit their turns at the same time and it's not like player 1's move then player 2's move etc. and of course we're talking about wonders which there can only be one of.

I'm not sure if this has been discussed yet. I did a search for this but what the heck search words do you use for race conditions and wonders that doesn't give you tons of things on races, conditions, and/or wonders and I didn't want to think too hard or read too much to find it so I figured I'd bring it up just to make sure.

Sapphire Wyvern
Space Kraken
Posts: 149
Joined: Wed Nov 09, 2005 3:25 am
Location: Melbourne, Australia

#2 Post by Sapphire Wyvern »

You know... that's a very good question.

Let's generalise it a bit. Given that FO has synchronous turn resolution, how do we handle "simultaneous" occurence of mutually exclusive events?

Possibilities include:
1) all events occur (eg everyone gets the Wonder, or "first build" bonus if we use the Greater/Lesser Wonder system that's been suggested)
2) randomly select a valid set of events (a random player gets the Wonder)
3) deterministically select a valid set of events based on some other criterion which may vary (eg, the player with the most money in the bank completes the Wonder first)
4) Deterministically select a valid set of events based on some fixed criterion (eg, imposing a resolution order that means that some empires always build buildings before other empires).
5) None of the events occur (No one gets the Wonder, or both builders get the lesser version of the Wonder as no one completes it first).

Zpock
Space Kraken
Posts: 101
Joined: Wed Oct 20, 2004 2:24 pm

#3 Post by Zpock »

Random feels right.

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 12853
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

#4 Post by Geoff the Medio »

The game should attempt to resolve who builds something "first" in some reasonable way.

I'd suggest, starting at the top and going down if not yet resolved:

1) If one player started the turn with more PP spent on the project than the other, that player finishes first. (This would require at least one turn to have been spent at less than the max production rate, otherwise both players will build in even full-turn cost increments)

2) If one player has more total PP, then that player finishes first.

3) If one player has a higher industry meter at the build location (if applicable)

4) Randomly pick one player

I'd avoid using the turn a player enqueued something, or the turn they started producing it (turn it first had PP spent on it), as this would make it advantageous to preempitively enqueue stuff you have no intention of funding production of for quite a while, just to get it on the queue early to get the better chance of getting it in case of conflicts.

Zpock
Space Kraken
Posts: 101
Joined: Wed Oct 20, 2004 2:24 pm

#5 Post by Zpock »

If it depends on how much PP you spend this or the last turn etc it would end up pretty semi-random anyway. There's no point having something you can just barely manipulate, just adds more unnecesary micromanagement.

User avatar
utilae
Cosmic Dragon
Posts: 2175
Joined: Fri Jun 27, 2003 12:37 am
Location: Auckland, New Zealand

#6 Post by utilae »

Why should the effect of the wonder be applied to only one player, when both players build them?

I say that if two players build a wonder at the same time, then they both get the effect. It's better for competition.

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 12853
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

#7 Post by Geoff the Medio »

Zpock wrote:If it depends on how much PP you spend this or the last turn etc it would end up pretty semi-random anyway. There's no point having something you can just barely manipulate, just adds more unnecesary micromanagement.
There is no such problem because there's no way to get any benefit by micromanaging things. If you're in a race condition, and start with equal progress, then spending anything less than the limit of allowed PP / turn would cause you to lose. You can't get an advantage by spending less than a full turn's worth in order to get a partial turn's progress, as then you'd fall a turn behind. If you started with unequal progress, then just spending the limit will cause the player who started with more progress to win. It's not semi-random at all, as if both players are fully funding the project, the one who started it first will win, and if there's less than full funding, the one who funds it more will win.
utilae wrote:Why should the effect of the wonder be applied to only one player, when both players build them?
Because that's the point of a one-in-the-galaxy wonder... there can be only one.

There could also presumably be some that only work correctly if there's just one... though I can't think of an example of this...

Zpock
Space Kraken
Posts: 101
Joined: Wed Oct 20, 2004 2:24 pm

#8 Post by Zpock »

If both players can get it, then it's going to be exploited for example 2 allies timing it so they both can have it. If it's random you could try and exploit that by load/saving in singleplayer I guess. So maybe it is best to give it to the player with the most PP after all. The system should be designed so you can't trick it. For example there was some trick in civ4 to build settlers while still growing food (not chopping). I dont remember exactly, think it was to change production in the last minute. This leads to uneccesary mm that could be avoided either by just letting the player do it in a straight forward way, or not at all.

User avatar
skdiw
Creative Contributor
Posts: 643
Joined: Mon Sep 01, 2003 2:17 am

#9 Post by skdiw »

some crazy ideas:

1. one of the players gets a offer back of the pp invested or maybe a bit of bonus added on top. or if we have group wonder thing, then the other player chose another wonder that gets built instantly.

2. start a bidding war.

3. the players alternate in controlling the effects of the wonder

4. both get a version that's half the effect of the wonder.
:mrgreen:

Argus
Space Floater
Posts: 23
Joined: Fri Aug 19, 2005 4:28 pm
Location: Montreal, Canada

#10 Post by Argus »

1. The planet with the largest economy builds it. So if planet A and B are building the same wonder and tie then if planet A produces 17 PPs a turn and planet B only 14 PPs then planet A gets the prize. If the planets tie then consider star systems economy then empire as a whole... (It doesn't even have to be PPs depending on the wonder actually. If wonders get categorized then it could be dependant on the category. a Research wonder might look at research points, agriculture wonder food produced etc or maybe primary and secondary foci)

2. The player who is higher in the standings gets the prize. This of course raises the issue of determining standings.

3. In the case of a true tie (everything is dead even) it will unfortunately come down to a random player OR just plain give both players the prize.

Zpock
Space Kraken
Posts: 101
Joined: Wed Oct 20, 2004 2:24 pm

#11 Post by Zpock »

66. Both players have to start over :lol:

Dreamer
Dyson Forest
Posts: 228
Joined: Sun Mar 13, 2005 6:44 am
Location: Santiago, Chile

#12 Post by Dreamer »

I think that the ocurrence of stuff like this is not very common. So any complex rule or chain of rules to decide this seems overkill to me (and so break the KIS rule).

Using the fact that empire grow will be procesed one empire at a time anyway, a very easy way to implement it in code is:

Empire 1 grow for this turn is processed. Building is finished. Event that anounces that this wonder has been completed is triggered, empire 2 (wich would have also finished the weonder this turn, rolls back). If this is not acceptable, process empire turns randomply each turn. This handles EVERY possible conflict in the game with no extra code.

Magus
Space Squid
Posts: 72
Joined: Mon Mar 21, 2005 12:21 am

#13 Post by Magus »

Heres a question: What wonder would be one-per-galaxy? And why? Civ wonders have that, mainly because the wonder as itself does very little, but its in game effects are huge vaguely representing nationalism and reknown. If you're building a cross-dimensional hyperturing AI god, then maybe it makes sense (since the first one made would stop any others from being made to rival it), but I have trouble thinking of any other sci-fi wonder that would be 'One Per Galaxy'

haravikk
Space Kraken
Posts: 104
Joined: Wed Mar 31, 2004 10:04 pm

#14 Post by haravikk »

Could the wonder's effect be reduced? Obviously having more than one identical wonder in the galaxy would reduce the popularity of both, thus they'd have 50% output (or 33% etc).

Alternatively, why would you even know what wonders you are building in the first place? Surely it would make more sense that researches can unlock the building "Wonder", you build it and randomly complete one of several available wonders that were unlocked.
So all you know you're building is "Wonder", say the tech "Fusion core" was the one that unlocked it, the available buildings could be:
Cyntathian Fusion Planetary Core (+10% fusion weapon damage)
Palakarin Fusion Rail Gun (+500% to the planet's defensive capabilities during combat)
Gordin Fusion Nebula Generator (+20% population morale, +10% trade to that planet)

The "Wonder" building can be constructed multiple times until all wonders in that 'block' are done. The wonders would all be named after the planet that builds them (so Cyanthia, Palakir and Gordin are planet names), so should two or more planets complete the "Wonder" building in the same turn, and there is only one left, they both build one with effects split.

IMO it makes it more rich and interesting, as the people who were building the Hanging Gardens of Babylon didn't know they were going to become such a historical place, just that it would be pretty.

Wonders wouldn't even have to be related to the tech that unlocks them, they could be completely random things that just so happen to appear at that stage.

Actually, here's a completely off-the-wall idea here, but what if the construction of a wonder was REQUIRED in order to develop a certain technology? In the example, say the planetary fusion core must be constructed (by any empire), or else fusion technology cannot be developed and thus that category of research halts for everyone (who is at that point). It could make for a very interesting system of research, meaning a research heavy empire has the head-start on wonders, but has to have the production capability to remain ahead, effectively stopping whenever a wonder is required and everyone can catch up to pose a challenge again.

This wouldn't require the random construction idea, but it could make for some VERY interesting games when a research category hits a solid wall because no empire so far has built the wonder required, so empires are struggling to build third and fourth wonders just to unlock the next stage. Some might say annoying, but would our understanding of particle physics be any further one without the construction of huge particle accelerators?
I know realism isn't a huge factor, but wonders should be primarily interesting, but functionality of this kind could make for some cool dynamics!

Dreamer
Dyson Forest
Posts: 228
Joined: Sun Mar 13, 2005 6:44 am
Location: Santiago, Chile

#15 Post by Dreamer »

haravikk wrote:Alternatively, why would you even know what wonders you are building in the first place? Surely it would make more sense that researches can unlock the building "Wonder", you build it and randomly complete one of several available wonders that were unlocked.
Mmm, I got some concepts but I think I'm going to other thread with this... since we are going very off-topic.

Post Reply