Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Running multiple game areas at the same time  (Read 1330 times)

Tamren

  • Bay Watcher
  • Two dreams away
    • View Profile
Running multiple game areas at the same time
« on: June 04, 2007, 10:13:00 pm »

With the new version coming up travel will be slightly more "freeform". The problem is if i spend 20 minutes walking on the road, what happens back at my fortress?

From what ive read so far, having 2 "instances" of areas running at the same time would make DF explode. So what if we had sort of a "parralel time" system. Here is how it works:

Say you built your fortress in a nice volcanic mountain, complete with central heating! Unfortunatly it seems from your explorations that all the silver in your mountain is in unstable and dangerous areas. A couple months later your scouts happen to track an ettin to his lair. A squad of soldiers rolls out and kicks the ettins ass. When they get back they mention that the cave has silver ore for walls.

To mount a mining expedition you gather up a small force of miners, a few craftsdwarves such as a carpenter and mason, and several soldiers. To carry all the spare gear and food the convoy is composed of a couple wagons. The convoy sets off and soon dissapears off the side of your fortress map.

At this point, time stops at your fortress. Your focus is shifted over to the convoy as they travel to the ettins lair one map "square" at a time. On the way the convoy might be attacked by wild animals or bandits, you can also lead out small parties to gather plants or hunt.

Lets say it takes about 10 minutes to travel to the ettins lair. Once you get there you start to set up camp, expanding and cleaning out the ettins cave in preparation for mining. Setting up your outpost takes a futher 10 minutes. At this point it has been 20 minutes. Back in your fortress time is still frozen. Your outpost is up and running and the silver veins are being dug out. Your crew stays for a few days, making the outpost more livable and filling the wagons with ore.

So about 20 minutes later the wagons are loaded with as much as they can carry, exploratory tunnels reveal the mine goes on for quite a distance making a possible return trip profitable. Your dwarves store the non-perishable goods and lock the gate.

The convoy then turns around and treks back to your fortress. This takes about 20 minutes since the wagons are slower. As soon as they get back to the fortress map square time stops again.

At this point there is 60 minutes of "slack time" when you compare the convoy which has just returned and your fortress that has been frozen in time. To make up for it, the fortress starts running again, picking up where it left off and continues normal operation. At this point the convoy has *just* left.

An hour later, the convoy re-appears loaded down with ore having traveled to the cave and back.

This system would have to be simplified or else it would be tedious with multiple "instances" that need upkeeping. Lets say that instead of counting the minutes, the game keeps track of how many months or days of game-time has gone by. This is rounded down or up.

The problem with this is that it effectively doubles the amount of time you have to spend in the game. To get around this you would be able to "develop" intervening map squares. For instance, you could create a proper road between the outpost and your fortress speeding travel.

Once the road is complete, you can post guards along the route. The more developed a path is, the safer it is. Instead of having to guard each convoy in person you could sort of "let it slide".

So say 2 years later you decide to get some more silver. By this time you are connected to your nearest neighbor, the "human empire of burning cats" (or something). It is a simple matter to add the outpost to the trade road network. Both your soldiers and the human soldiers patrol the road in the interests of traveler safety and free trade.

This time your convoy has a safe journey and you would not have to lead it. The computer estimates how long it takes the convoy to get to the outpost and gives you a timer. You continue operating your fortress as normal uninterrupted until the convoy reaches the outpost and time stops again. If you failed to provide enough food for the entire journey, the convoy will stop and you will have to take control and lead hunting parties.

Once the convoy arrives, the focus shifts to that area and operation begins again. The mine is filled with monsters that have come up from the deeps or dug around the door, but the living area and storage rooms are all in pristine condition.

Mining proceeds as normal. This time instead of driving many heavy wagons your convoy consists of only 2, herding a group of mules beside it. Your carpenter builds wagons and the free mules are assigned to them for the return trip.

The convoy fills up and starts heading back for your fortress. Again the computer estimates the time it takes for the journey and you pop back to your fortress and pick up where you left off. After the timer is completed the convoy again appears at your fortress.

The effort of building the road was well spent as you no longer have to deal with travel time and all of your game time is spent actively managing one location or another.

This system becomes more complicated once we add the possibility of multiple outposts at the same time, but the basic mechanics remain the same.

If you send out two expeditions at the same time. The one with the shortest travel time will have to be dealt with first like this:

1. Convoy 1 gets to its destination in 10 minutes, convoy 2 takes 15 minutes.

2. In this case destination 1, which happens to be a kobold cave is not added to the road network, so once you reach the point where the convoy goes offroad you would have to be at the convoy in person. The journey takes 10 minutes until the road ends, and another 5 minutes trekking through the woods.

3. Your arrived soldiers duke it out with the kobolds, combat takes about 20 minutes, after which the convoy turns around and heads back to the road network. This takes 20 minutes as you must deal with the wounded and the wagons are filled with swag.

4. Convoy #1 arrives at the nearest road house and begins its journey home. At this point the convoy is replaced by a timer and your focus changes back to the main fortress.

Since convoy 1 started its journey on the road network your fortress runs for 10 minutes until it leaves the road and you must guide it. Once the convoy is back on the road network you come back to your fortress.

Convoy 2's timer has been ticking down as well and after another 5 minutes at your fortress they reach thier destination which is a human city. You do some trading and whatnot which takes 10 minutes then turn back onto the road and you go back to your fortress.

At this point the timers would look like this:
Convoy 1 is still 55 minutes out and has just left the road network.
Convoy 2 is 25 minutes out and has *just* arrived at the human city.

After 25 minutes at your fortress the trade convoy gets back filled with goods. Half an hour later your soldiers get back from the kobold cave having gone there, fought and journeyed back in the intervening time.

Once both get back all of the "timelines" then match up and the game continues as normal. This seems really damn complicated but it is really not. This system could be expanded in any number of ways.

Logged
Fear not the insane man. For who are you to say he does not percieve the true reality?

Toady One

  • The Great
    • View Profile
    • http://www.bay12games.com
Re: Running multiple game areas at the same time
« Reply #1 on: June 05, 2007, 01:38:00 am »

All right, from what I gather, in your suggestion, you go back in time to a prior state of the world when you return to a location you haven't played for a while.  This is not something I can do, because when you are playing, you might be focused on one area, but the entire world is moving.  All of the armies, the weather, all of the future caravans, etc.  And it would somehow need to incorporate the future actions you have already made into that.  And you could actively work to see that your future actions couldn't happen.  The essential thing is that each of the instances do not occur in a vacuum.  The entire world needs to be considered.

There are a few ideas floating around now. One involves zipping off to a frozen time "instance" to resolve a small action, like a battle at a distant location.  The entire world, weather and all, is frozen, and creatures do not age.  Once the battle is over, you can return to your primary location (it would have to restore the saved game and incorporate the changes, but the changes are relatively minor and only involve one site and the units and items from the battle.  Historical events can just reference "The Battle of <whatever>" as the time in question).  There would be a few complications setting this up, but it can be done.

The other, which I wasn't really considering until human town mode, would be swapping focus between areas and abstracting all but one.  It all happens in the same timeline though.  If you return to an abstracted area, it would have to update it (age the creatures, etc), but this is already being done to some extent in reclaimed fortresses or any of the sites you visit in adventure mode.

Logged
The Toad, a Natural Resource:  Preserve yours today!

ryak2002

  • Bay Watcher
  • Master Computerdwarf
    • View Profile
Re: Running multiple game areas at the same time
« Reply #2 on: June 05, 2007, 01:48:00 am »

Yeah this occured to me too.  What if you sent your mining party out then controlled them mining for several months and when you finally go back to your fortress you send out a supply/reinforcement party immediately after the miners.  

But you already played the miners and you didn't get a supply party.  Then the universe implodes in a giant black hole of inconsistency.

Logged
Dwarf: Excuse me, sir.  This !!x cave spider silk tunic x!! is on fire.<BR>Store Clerk: Oh, how about half price?<BR>Dwarf: deal!

Zereth

  • Bay Watcher
    • View Profile
Re: Running multiple game areas at the same time
« Reply #3 on: June 05, 2007, 01:51:00 am »

quote:
Originally posted by Toady One:
<STRONG>There are a few ideas floating around now. One involves zipping off to a frozen time "instance" to resolve a small action, like a battle at a distant location.  The entire world, weather and all, is frozen, and creatures do not age.  Once the battle is over, you can return to your primary location (it would have to restore the saved game and incorporate the changes, but the changes are relatively minor and only involve one site and the units and items from the battle.  Historical events can just reference "The Battle of <whatever>" as the time in question).  There would be a few complications setting this up, but it can be done.</STRONG>

This approach seems like it would work reasonably well for now, since dwarves a thousand miles away in your fortress can't really direclty affect your goblin-stabbing force, so it should be possible to run the world until they get there, switch to them and have them stab stuff, then switch back in case you piss off somebody else they run into on the way back.

However, if you ever add magic which can be used to directly affect things a long way away, suddenly the dwarves in the fortress _can_ direclty affect what's going on in Stabbytown, Population: Goblins from in the fortress, so you might want to keep future developments such as that in mind. (And I hope you will, eventually, add such things, so we can play Crazy Wizard In A Tower mode.)

Logged

Gauteamus

  • Bay Watcher
  • Ignitur!
    • View Profile
Re: Running multiple game areas at the same time
« Reply #4 on: June 05, 2007, 02:17:00 am »

quote:
<STRONG>Originally posted by Toady One:
One [idea] involves zipping off to a frozen time "instance" to resolve a small action, like a battle at a distant location (...)  Historical events can just reference "The Battle of <whatever>" as the time in question).</STRONG>

There is strong precedence in the bible for this way of resolving battle. Joshua 10:1-15    :)

[ June 05, 2007: Message edited by: Gauteamus ]

Logged

slMagnvox

  • Bay Watcher
  • Attend Party
    • View Profile
Re: Running multiple game areas at the same time
« Reply #5 on: June 05, 2007, 03:28:00 am »

I can't imagine a scenario when I'd want to control some silver miners in a remote location.  Judging from the size and layout of the new maps, you could have several "remote" mining operations all within the same map.  Roads, wagons, food shortages, month long journeys, all without leaving your map.

Maybe I am just too accustomed to current gameplay, but I am not even sure I'd want to change focus ever.  Even for my campaigning army's engagements.  Didn't I just promote Cog to Captain?  Let him figure it out.  However, the instanced battles might win me over, that does sound fun.

Meanwhile, current gameplay already requires a significant investment of time.  I am sure I've put over 40(?) hours in my primary fort and its barely in its fourth year.  The more complexity that gets added, the more important it'll be (to me) for the focus to remain consistent.

Logged

Toady One

  • The Great
    • View Profile
    • http://www.bay12games.com
Re: Running multiple game areas at the same time
« Reply #6 on: June 05, 2007, 03:30:00 am »

Yeah, TT and I were talking about the issues with frozen time on the phone tonight.  I'm not sure what we'll end up doing.  It's attractive as a quick-fix solution, but eventually it would break down.  I'm definitely pro-wizard tower, especially since I'd written a half-finished game called The Wizard Tower Battle Research Game that has now been absorbed into the DF plans, and it was pretty fun, though incomplete.  There are lots of potential issues with frozen-time vs. magic, like death effects and all that kind of thing, so that if somebody died in the army in frozen-time, it might want to immediately destroy some imposing structure on the other side of the world, liberating some oppressed population.  It can get all messy.  In the end, it might not even be worth it.  Which leaves us with the abstraction problem.  Now, adventure mode time runs 72 times slower than fortress mode time, so these battles, if they run in adv mode time, shouldn't have too much effect on fortress games even if they are abstracted, but if you had one on say the boundary where the ice melts, it would still need to reposition dwarves even after a short period.  And there's the problem of wanting to be two places at once, to see two battles, but there might not be any way to do that with the way things are structured.
Logged
The Toad, a Natural Resource:  Preserve yours today!

hactar1

  • Bay Watcher
    • View Profile
Re: Running multiple game areas at the same time
« Reply #7 on: June 05, 2007, 09:11:00 am »

FWIW, commercial games deal with this problem in a similar, non-lifelike way.  If you're familiar with Sims 2, if you leave the house and go to the store, time passes at the store and your Sim's mood might change (the get sleepy). When you return to the house, no time has passed but their mood stays the same.  This leads to silly time problems like wanting to go to bed at noon on Sunday.

Obviously we wouldn't want the fortress to be on autopilot when we're off fighting a battle; certain things like food production and defense can't reasonably be handled automatically, at least in a way players would be satisfied with.  I don't even know if aging stuff in the time-frozen zone would be a good idea; I could return to find that my new legendary armorsmith, who I was counting on to outfit an invincible army, has since retired and hasn't produced anything in the meantime.

Logged

Tamren

  • Bay Watcher
  • Two dreams away
    • View Profile
Re: Running multiple game areas at the same time
« Reply #8 on: June 05, 2007, 09:42:00 am »

Freezing time *works* but using it can lead to a series of massive paradoxes. Talk about dividing by zero -_-
Logged
Fear not the insane man. For who are you to say he does not percieve the true reality?

slMagnvox

  • Bay Watcher
  • Attend Party
    • View Profile
Re: Running multiple game areas at the same time
« Reply #9 on: June 05, 2007, 04:55:00 pm »

So "fort mode" time is compressed at 72x "adventure mode" time.  A brief excursion in "adv mode" time, a combat sequence --"I am Regergeshud the Cyclops.  Prepare to die!"-- or perhaps a diplomatic sequence --"I am Relo Neleffin the Elf Druid.  Prepare to die!"--, should be perfectly acceptable as a "frozen time" sequence since a playable span of adventure mode time would only be a couple ticks back at the Fort.

Wouldn't that effectively alleviate some of those weather and ice melting conflicts also?  If some creatures were marching across thin ice in world mode time, fort mode time, real time, they'd be asking for trouble even without visiting a brief "adventure time" instance?

And the long range spell issue just made me think that if we wanted to use our Crazy Tower-Wizard's spells in an instanced encounter, we had better have them prepared in advance.  A lot of magic .. systems involve months and years of research and meditation.  When my army met some goblins in a remote location I could use that new Earthquake spell I'd been dying to try out only provided I had prepared it well in advance.  And my wizard does have some way of knowing when and where that engagement was taking place?

Logged

Spelguru

  • Bay Watcher
  • Rabid Swedish Person
    • View Profile
Re: Running multiple game areas at the same time
« Reply #10 on: June 05, 2007, 09:57:00 pm »

Cubes of scrying. Orbs of scrying are lame and give some weird image distortion! :P
Logged
Got Ninja?
Orkz Orkz Orkz Orkz, Orkz Orkz Orkz Orkz... WAAAAAGH!
NHP (Non human pact. Copy and paste if you are going to destroy all human-like creatures in spore.)

Zereth

  • Bay Watcher
    • View Profile
Re: Running multiple game areas at the same time
« Reply #11 on: June 06, 2007, 12:48:00 am »

quote:
Originally posted by slMagnvox:
<STRONG>And the long range spell issue just made me think that if we wanted to use our Crazy Tower-Wizard's spells in an instanced encounter, we had better have them prepared in advance.  A lot of magic .. systems involve months and years of research and meditation.  When my army met some goblins in a remote location I could use that new Earthquake spell I'd been dying to try out only provided I had prepared it well in advance.  And my wizard does have some way of knowing when and where that engagement was taking place?</STRONG>

I was thinking it might work something like spellcasting in Master of Magic. Some things you can cast over and over wherever you are, some things you have to be in your tower with its array of magical implements to cast, and some things you need to be in your tower and spend days to cast. So your city-destroying earthquake spell wouldn't go off unless you gave your minions orders (over the magic scrying communications device you gave them, of course) to wait until it does to move in, say, but you could watch them on the Magic CCTV and throw fireballs at their enemies just fine, or wander off with them and throw smaller fireballs at things and watch the dwarves or whatever run around setting everything on fire.

Or you just use magic to make a skeletal flaming elephant and send it into the dwarven fortress and have all your apprentices gather around the scrying pool and laugh.

EDIT: Admittedly, this doesn't help with the current issue, which is dealing with events happening simultaneously in multiple locations.

[ June 06, 2007: Message edited by: Zereth ]

Logged