Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 68 69 [70] 71 72 ... 98

Author Topic: Sim City 5  (Read 191723 times)

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: Sim City 5
« Reply #1035 on: March 14, 2013, 01:23:59 am »

Oh, the sims got smarter in 3.

Not that that helped Sim City.

ank

  • Bay Watcher
    • View Profile
Re: Sim City 5
« Reply #1036 on: March 14, 2013, 01:43:17 am »

There is a danish radio program called "the harddisk" that talked about sim city in relation to traffic emulation.
here is the fun part: they called sim city 5 an evolved version of the Sims... lol, so true!
Logged

MrWiggles

  • Bay Watcher
  • Doubt Everything
    • View Profile
Re: Sim City 5
« Reply #1037 on: March 14, 2013, 01:46:18 am »

Oh, the sims got smarter in 3.

Not that that helped Sim City.
Why would it?
Logged
Doesn't like running from bears = clearly isn't an Eastern European
I'm Making a Mush! Navitas: City Limits ~ Inspired by Dresden Files and SCP.
http://www.bay12forums.com/smf/index.php?topic=113699.msg3470055#msg3470055
http://www.tf2items.com/id/MisterWigggles666#

sneakey pete

  • Bay Watcher
    • View Profile
Re: Sim City 5
« Reply #1038 on: March 14, 2013, 02:06:14 am »

To be fair, DF's pathfinding only works with, what, a few hundred entities pathfinding at once, this would have to cope with 1000's, its a bit of a different situation.


Not sure how best to do it. Anything advanced enough to be logical would probably slow the game down way to much, when you think about it. Perhaps assigning route costs based on current traffic conditions...?
Logged
Magma is overrated.

Skyrunner

  • Bay Watcher
  • ?!?!
    • View Profile
    • Portfolio
Re: Sim City 5
« Reply #1039 on: March 14, 2013, 02:26:14 am »

There are techniques.
Example: HPA*, which divides the big region into blocks and precomputes exits for each block, then only does pathfinding from the object->nearest exit of its block, then from the block to the block where the destination is, then from the exit to the destination. It emulates how we actually pathfind with maps, where we go to the nearest big road, follow it, then find our way to the destination. We don't actually look through every half forgotten country route :D
Also unforgivable is that Simcity has defined roads. That means it's a much smaller pathfinding grid than DF. Intersections could be nodes, and blocks could just be geographical..

* Skyrunner rambles
« Last Edit: March 14, 2013, 02:28:39 am by Skyrunner »
Logged

bay12 lower boards IRC:irc.darkmyst.org @ #bay12lb
"Oh, they never lie. They dissemble, evade, prevaricate, confoud, confuse, distract, obscure, subtly misrepresent and willfully misunderstand with what often appears to be a positively gleeful relish ... but they never lie" -- Look To Windward

alway

  • Bay Watcher
  • 🏳️‍⚧️
    • View Profile
Re: Sim City 5
« Reply #1040 on: March 14, 2013, 03:06:00 am »

Yeah. Given the small city size, readily available route capacity & traffic data, and (usual-case) relatively sparse intersections, it's the sort of problem a CS student half-way through their first year could solve for homework. DF's graph size is relatively open and relatively dense (paths traverse in the range of hundreds to thousands of intersections); it's actually a much harder case because of that. While SC has on the order of a magnitude or two more agents, it's actually incredibly easy in comparison.
Compare:
DF:
100 agents
5x5 embark = 57600 tiles per layer, with a large number of layers resulting in the actual number being on the order of 200k+; each the equivalent of an intersection
obstacles/path heuristics can change once per frame
SC:
200k agents (let's say it's this; due to aforementioned worker vs population shenanigans, it's much lower, but let's assume they didn't bullshit things)
Assuming a grid like that in the all-residential video, approximately 8x11 intersections, or around 100 for a fully built city, maybe 200 max without intentionally screwing with pathfinding calculations.
obstacles/path heuristics can change once per several seconds (time to get from one intersection to the next)

The other thing which helps with SC pathfinding is that high volume. Pathfinding for high-volume, low density is much easier than low-volume, high density. While in the latter, you can mostly only optimize with tricky pathfinding algorithm modifications, the former can be achieved very easily through a combination of precomputing and batching together agents. A simple analysis of data they already have (after all, they even display the data for the player) can figure out large-scale traffic patterns, adjusting values for road preferences for every agent at once based on traffic concerns; this is based only on the number of intersections, not the number of agents. With around 100-200 intersections, this can be done in negligible time.

Secondly, all traffic travelling from intersection A to intersection B with options to take intersections C, D, or E to get there, can all be processed at once. A value for each road for all of them can be computed just once. Using this on high-volume roads would very quickly figure out a big chunk of necessary traffic data. Beyond this, there's a variety of low-hanging-fruit as far as figuring out the value of roads for the agents travelling them.

Third, on a large-scale simulation like this, stochastic models come into their own. Just not in their current model, apparently. :P
Basically a stochastic model will take those relative path values calculated before and apply them as the agents decide which intersections to go through, but do so in a random manner. In the current system, it is clearly deterministic; if(value1 > value2), go through value1. By using a stochastic method, it randomly selects which route to take based on the value of the routes. If route1 has a value of 6, and route2 has a value of 4, then 60% of the time they take route1 and 40% of the time they take route2. These values are themselves updated every once in a while with changes to roads (deletion/creation of roads) as well as traffic (high traffic : capacity ratio = lower value).

In essence, most of the traffic should act like water flowing through pipes, rather than direct-route pathfinding.

*alway rambles more
Logged

Spitfire

  • Bay Watcher
    • View Profile
Re: Sim City 5
« Reply #1041 on: March 14, 2013, 03:21:54 am »

alway, great digression on pathfinding! Now I can't even look my Sims in the face, those dumb dumb automatons.
Logged
Quote from: Rex_Nex
Wanting boobs is primal, not something sparked by the degradation of humanity.

Silent_Thunder

  • Bay Watcher
  • World Heavyweight Champion
    • View Profile
Re: Sim City 5
« Reply #1042 on: March 14, 2013, 03:33:45 am »

So, I saw this online. Wow... just.. Ok I thought the Highway loop bug in SC4 was bad.

lordcooper

  • Bay Watcher
  • I'm a number!
    • View Profile
Re: Sim City 5
« Reply #1043 on: March 14, 2013, 03:36:00 am »

alway, great digression on pathfinding! Now I can't even look my Sims in the face, those dumb dumb automatons.

Now you know how politicians and CEOs feel!
Logged
Santorum leaves a bad taste in my mouth

ank

  • Bay Watcher
    • View Profile
Re: Sim City 5
« Reply #1044 on: March 14, 2013, 03:39:55 am »

Luckily in SC 4 the circular traffic was just graphical glitches.
Sims are a little dumb in their SC 4 pathfinding, but nowhere near the problems in SC 5
Logged

Guardian G.I.

  • Bay Watcher
  • "And it ducks, and it covers!"
    • View Profile
Re: Sim City 5
« Reply #1045 on: March 14, 2013, 03:42:01 am »

So, I saw this online. Wow... just.. Ok I thought the Highway loop bug in SC4 was bad.
*roundelay music*
Logged
this means that a donation of 30 dollars to a developer that did not deliver would equal 4.769*10^-14 hitlers stolen from you
that's like half a femtohitler
and that is terrible
Sigtext

alway

  • Bay Watcher
  • 🏳️‍⚧️
    • View Profile
Re: Sim City 5
« Reply #1046 on: March 14, 2013, 03:51:35 am »

Don't worry guys, that's actually a feature! You see, it's just NPCs pulling a prank. Smarter than you thought.
Logged

Mech#4

  • Bay Watcher
  • (ಠ_ృ) Like a sir.
    • View Profile
Re: Sim City 5
« Reply #1047 on: March 14, 2013, 04:47:52 am »

Once a sim joins the loop they cannot leave. Whole families have been born and raised in the loop. All shall be part of the loop in the end.



I can't decide whether it's more like a blackhole or an ouroboros.
Logged
Kaypy:Adamantine in a poorly defended fortress is the royal equivalent of an unclaimed sock on a battlefield.

Here's a thread listing Let's Players found on the internet. Feel free to add.
List of Notable Mods. Feel free to add.

Rose

  • Bay Watcher
  • Resident Elf
    • View Profile
Re: Sim City 5
« Reply #1048 on: March 14, 2013, 04:52:17 am »

its a dotor who episode
Logged

forsaken1111

  • Bay Watcher
    • View Profile
    • TTB Twitch
Re: Sim City 5
« Reply #1049 on: March 14, 2013, 04:54:37 am »

Maybe EA should hire Toady to rewrite their AI.

(heh)

Toady's AI is actually smarter. At least the dwarves know where their bedroom is. At least the dwarves know their job. At least the dwarves can be told that some ways are faster than others.
To be fair, Toady doesn't have to try and simulate 200,000+ people.
Logged
Pages: 1 ... 68 69 [70] 71 72 ... 98