Page 1 of 2

What do biters do in their spare time? (Pheromone pathfind)

Posted: Thu May 08, 2014 1:19 pm
by muzzy
I moved this topic into Frequently Suggested, cause it has again and again some relevance to other subjects and is a basic technology for many, many other ideas.

Especially it looks like, that implementing this would enable to have "pseudo intelligent behavior" for the natives. All in all you should read the whole thread, especially page 3 is very interesting. :)

For an overview of that threads look at page 4 ( viewtopic.php?f=80&t=3440&start=30 ).
-- ßilk



Let's bring some life to biters.

Make them eat and drink, make them travel to water once every few hours and back to home. Make them eat something, maybe some new renewable resource that's useful for the player too. This should attract biters to the player base.

Change the pollution system so that it updates slower and supports more channels/layers of stuff. Use these for biter chemicals, pheromones, hormones, whatever. Killing biters should create a slowly dissipating cloud of danger stuff, biter food should create a cloud of some attractive smell for biters to follow. Biters coming back to home should also spread the food smell with them so other biters could follow the trails, and biters escaping from battle should do something like that too so that angry kamikaze swarm can then move out and follow the danger trail...

Throw out long distance pathfinding, use the chemical/light/pollution gradients from 3x3 grid of chunks to make movement decisions for biters. It could result in somewhat realistic behavior, biters hiding away from lights, finding ways around sparse defenses, other wonderful things.

Right now the only fun thing about biters is when a group of them goes make a new colony and decides to randomly run through the player's base while doing so. This needs some spicing up!

Re: What do biters do in their spare time?

Posted: Thu May 08, 2014 3:32 pm
by cube
Pheromone based pathfinding was one of the things we considered... it would have been fun :-)

Re: What do biters do in their spare time?

Posted: Thu May 08, 2014 4:28 pm
by Tenebrous
cube wrote:... it would have been fun :-)
* could still be fun

:P

Re: What do biters do in their spare time?

Posted: Thu May 08, 2014 5:24 pm
by ssilk
Cuuul idea. I watched their pathfinding and they run always the same way. I found out, if you know their paths you don't need to place so many walls/lasers. Just set some massive wall of lasers in their path. And because that's no fun I wanted to suggest that dead biters "smell". But pheromone and layers of pheromones - that's somehow cool and it could really work very fine.

Re: What do biters do in their spare time?

Posted: Sat May 10, 2014 5:22 am
by sniperXPrime
What about letting them solve the tree problem.

Let the biters go around nearby forests and plant trees. This would fall into their need to protect the environment as well as make players consider keeping small bases of biters around to replant trees for them. This may also create a more symbiotic relationship between them and the player, but if not it will give the biters another reason to hate the players who keep chopping down their forests at least.

Re: What do biters do in their spare time?

Posted: Sat May 10, 2014 7:48 pm
by ssilk
That also goes into the direction I would like to have the game...

Re: What do biters do in their spare time?

Posted: Sat May 10, 2014 8:12 pm
by Drury
I don't see the point of this. I mean if the game was zoo tycoon or something then it would make sense for animals to do something interesting rather than just standing around, but for 99% of Factorio players the biters are simply a threat. Adding conditions and timers for biters for things like drinking water and taking a piss would be absolutely useless for players and would only put more load on the CPU (especially if you have over 100 biters active at once).

They are already somewhat capable of waiting for their comrades from other nests and organizing rushes (whether it's intentional or not) and that's about enough. They're dumb animals that just want to eat your factory up, they don't have to be complex.

Re: What do biters do in their spare time?

Posted: Sat May 10, 2014 9:12 pm
by ssilk
Ants are also not complex, but due to their organization they behave like an intelligent organism.

This ideas also adds depth without too much complexity.

Re: What do biters do in their spare time?

Posted: Sat May 10, 2014 9:47 pm
by muzzy
Biters are not currently a threat because they're too simple and predictable. It's way too easy to deal with them once you know how they behave.

Re: What do biters do in their spare time?

Posted: Sat May 10, 2014 9:59 pm
by ssilk
Hehe, yes, have you ever tried to fight against ants? :)

Re: What do biters do in their spare time?

Posted: Sat May 10, 2014 10:39 pm
by Teurlinx
I don't know. The biters occasionally already stop moving and get stuck as is. Wouldn't that get much worse when they try to do more than just beelining towards the player?

Re: What do biters do in their spare time?

Posted: Sun May 11, 2014 7:33 am
by ssilk
For me the key is, to give them an explainable behavior.

Like in reality. Wolves, bears, lions are dangerous animals. But if you know how they behave you can use them for example to make a show in Las Vegas.

So my idea about that is, to either simple fight them with pure power, or to try to understand what they are doing and support that types of behavior, which are useful for us. For example this idea about planting trees. Or making them believe, that they need to lay their eggs near my factory. :) I think to about a dozen types of behavior (like eating, sleeping... Think of tamagotchis!) and every type is eventually useful. :)

Re: What do biters do in their spare time?

Posted: Sun May 11, 2014 8:07 am
by Drury
I'm yet to hear an example of how this idea would enrich gameplay. Can't really think of how it would make them "less predictable" or how them being "less predictable" would change anything.

Re: What do biters do in their spare time?

Posted: Sun May 11, 2014 11:57 am
by ssilk
Hm. Do I need to explain it? :)

Perhaps I explain from where this idea comes.

In spring/summer last year, some of the forum members thought, it would be a cool idea to enable a way of "not fighting". The result are the current way the pollution works, when the biters will begin to fight, the no-fight mode, the evolution and some more stuff.

Now we are at a point, where I feel, that pure flightless game won't work with the biters as they are now. And from gameplay it probably doesn't make sense.

So giving them a realistic behavior enables us to find ways, where this is eventually possible. Or might open other doors. I think it is a good direction, cause staying like as it is is a dead end.

Re: What do biters do in their spare time?

Posted: Sun May 11, 2014 1:52 pm
by Puzzlemaker
+1 for simple pheromone based pathfinding! Have them drop a danger pheromone every time they die. Any areas with danger pheromones costs more in the pathfinding calculation. The pheromone's slowly dissipate over time.

What it means is, if a bunch of them die in a certain spot, they will try to avoid that spot, so it will feel like they are probing your defenses. It would be pretty cool IMO and fairly easy to set up programatically.

Re: What do biters do in their spare time?

Posted: Sun May 11, 2014 2:05 pm
by Schmendrick
I have to agree with, at the very least, allowing the pollution "layer" (or any chunk based overlay) to be visible (and extensible) to modders. That way pheromones, multiple types of pollution, or even things like altitude or underground resource availablility/richness can be implemented with better hardcode-based support.

Biter pheromones seem like a fantastic way to go to me. Not only could a death pheromone lead to the sort of "probing" behavior suggested above, but there could also (occasionally?) be the inverse effect-vengeance squads (perhaps by a specific new type of biter). http://en.wikipedia.org/wiki/Hornet#Attack_pheromone

Generally, adding pheromone support means biter behavior at large can be given a lot of variety (and end up looking downright intelligent, without having to code any actual complex AI).

Re: What do biters do in their spare time?

Posted: Mon May 12, 2014 12:27 am
by ssilk
Thanks both. Couldn't express that better. :)
Two more points: randomness comes by the wind (for Drury ;) )
and there is a small problem with the calculation of this if the area will be smaller than a chunk.
...
A chunk is 32x32 tiles and the base for the pollution calculation. If it is smaller, more calculations have to be made.

Re: What do biters do in their spare time?

Posted: Mon May 12, 2014 1:58 am
by Coolthulhu
Smell based simulations tend to be either computationally heavy or imprecise.
While this would fit with the concept of pollution and could easily use existing mechanisms, weaker computers could have problems passing all those pheromones around.

I really like the idea of death pheromone. Could be used to make biters seem intelligent: place of death would be dangerous and thus avoided, but mad biters would still be attracted to its surroundings. That way biters would easily find player's base, but wouldn't attack it from first-best direction, instead "learning from their mistakes" and avoiding places where their predecessors died.

Re: What do biters do in their spare time?

Posted: Mon May 12, 2014 4:51 am
by Schmendrick
Obviously I don't know how it's implemented in the code, but adding a new layer to the chunks wouldn't necessarily have to be computationally expensive. I'm assuming pollution involves something on the order of 6-10 basic arithmetic operations, max, per chunk (apart from the individual pollution contributions from entities in the chunk), which is essentially nothing even with a large map, and moreover it's the sort of thing whose refresh rate can easily be reduced with little to no noticeable difference to the player. The idea isn't to get legitimately "intelligent" behaviour out of individual biters (and thus having each one perform "smell logic," but rather to give a feeling of organization to their community at large, which many of us feel sure even a simple pheromone system would provide quite well.

Re: What do biters do in their spare time?

Posted: Wed May 21, 2014 6:45 pm
by ssilk
I add here: Different layers of pheromones have different "spread", they "stay" differently long in the air. For example: "Angriness" spreads very fast into all directions over large areas and stays long, while the smell of dead biters spreads not very far and will last not so long. A "path-to-food"-pheromone keeps only in near distance, but lasts long. It would be interesting how real ants work with the pheromones.