Return to “General”

Post

Re: What about civilians?

#136
Hmm. I understand you've optimized the code, but I'm still not understanding why there's a magic number of 800% as a speed cap, rather than "whatever ludicrous speed of which your machine/browser is capable."
Hyperion wrote:
Fri Jun 30, 2017 3:31 pm
If you could make it where you could select a faction by clicking a planet or station, and then that of another faction to make the first attack the second, that would be super cool, because they never seem to take out the last posession, which builds up and then gets back in the fight
I was wondering the same thing, after watching for a while.

Now, once someone has completely dominated the galaxy, I can just refresh to start over.

Although I might feel differently about this if NPC ships could pop up little messages: "Oh, no, our culture is being destroyed! Lost in time, like tears in rain...."

...meanwhile:

1. What logic do fighters use to decide which neighboring planet or station to try to take over?

2. Why do some planets seem to generate a lot more civilians than other planets? I'm guessing the current number of consumer goods available is a key parameter.

3. One quirk: After all of a team's planets are conquered, they may still have some ships flying around. I was watching for this, and sure enough, once the green team's planets were conquered, there were still a couple of green Miner ships flying around forever.
Post

Re: What about civilians?

#137
Flatfingers wrote:
Sat Jul 01, 2017 12:02 am
Hmm. I understand you've optimized the code, but I'm still not understanding why there's a magic number of 800% as a speed cap, rather than "whatever ludicrous speed of which your machine/browser is capable."
I'm using setTimeout to put delays between frames. setTimeout has a minimum delay of four milliseconds. To increase speed past 100%, it simply increases the framerate. This is a rather lazy way of doing it, but it was a lot simpler to do than setting up a large framework of "when to call/when not to call" functions based on tick count, hence why I did it this way. A lot of actions are called once per frame; increasing it via a standard method (increasing the amount things change per frame) would mess them up. It's not impossible, but it was a problem I didn't feel like tackling. As the default fps is 30 at 100%, that means 800% is 240 fps (on a good computer), which is one frame every 4.1667 milliseconds - or very close to setTimeout's limit.

That's a rather technical answer. :P Not as technical as something Josh might've written up, but still.
Flatfingers wrote:
Sat Jul 01, 2017 12:02 am
Although I might feel differently about this if NPC ships could pop up little messages: "Oh, no, our culture is being destroyed! Lost in time, like tears in rain...."
I did think about doing something like this. Ultimately there wasn't screenspace for it.

...meanwhile:
Flatfingers wrote:
Sat Jul 01, 2017 12:02 am
1. What logic do fighters use to decide which neighboring planet or station to try to take over?
Fighters only attack if they're bunched in a group; this happens mostly by chance and isn't actually done intelligently. They patrol between planets/stations with priority toward places with high population, and places near enemy borders. Sometimes this causes them to sit at a single planet. When there are enough (six or more) grouped at or near a central area, the game checks to find a planet that:
  • is nearby
  • belongs to a different faction
  • has a lot of consumer goods stockpiled (permitting a higher population)
  • doesn't have too many enemy fighters hanging about
If an optimal planet is found above a certain threshold, they attack. Sometimes they'll "change their minds" due to fluctuating variables before they leave the parent planet/station's circle of influence. This makes them bounce back and forth because they can't quite make up their minds. :D It would be a simple fix, but I like how it makes them hover around a planet a bit before leaving. Oftentimes they end up wiping out a lot more transports/miners that way.
Flatfingers wrote:
Sat Jul 01, 2017 12:02 am
2. Why do some planets seem to generate a lot more civilians than other planets? I'm guessing the current number of consumer goods available is a key parameter.
Planets with high population see a lot more civilian traffic. Industrial goods create ships. One unit of ore produces two goods (optimally; low happiness can cause ore processes to be "botched" resulting in fewer goods). Each unit of goods produced has an almost-equal chance to be either industrial or consumer goods. Industrial goods create ships, consumer goods make planets and stations support higher populations. (Stations take twice the amount of consumer goods to maintain a specific amount). Planets split a portion of the goods they produce to their "outbound shipments" stock, which is then picked up by traders bringing in more ore/resources and carted elsewhere.

Sometimes you see a planet's population climb rapidly. This typically happens when they have more consumer goods available than are currently being used. Planets with low happiness get their pops scooped up by civilian ships. They then turn "Quarian" (Mass Effect reference) and stay in the civilian ship until they find a planet with more consumer goods available than are being used... at which point they exit the vessel and make their homes on the planet's surface. (Or in the station, as the case may be.)

If by "generate a lot more civilians" you mean the evacuees/refugees that flee while the planet is under attack, that's due to how many civilians are on the planet's surface at the time of the evacuation. Each fleeing civilian ship is equal to two units of population.
Flatfingers wrote:
Sat Jul 01, 2017 12:02 am
3. One quirk: After all of a team's planets are conquered, they may still have some ships flying around. I was watching for this, and sure enough, once the green team's planets were conquered, there were still a couple of green Miner ships flying around forever.
Yes, currently they don't have the ability to integrate with their captors. I like to think of them as relics of an dead civilization. For me, it's flavor. For others, it might be unrealistic, I suppose.


If you're interested, I also have a version without civilians, for reference. It's not balanced, though, so planets take a lot longer to conquer than if their populations simply flee somewhere else.
Have a question? Send me a PM! || People talking in IRC over the past two hours: Image
Image
Image
Post

Re: What about civilians?

#138
1. On timing: got it. I didn't know you were using setTimeout.

2. On attack decision-making:

A. I see some fighters cycling endlessly between two planets. "Need to gang up" explains why they aren't more aggressive about attacking or defending places; they never accumulate in one place.

B. I see one planet left for one team, with low population and low happiness, and it seems to live on for a long time rather than being targeted by all nearby teams as an easy mark. Is there logic to try to leave the last planet of a team intact, or is this just a quirk of the RNG in the simulation I'm currently running?

3. By "generating more civilians" I meant regular civilian traffic, not the diaspora when a planet or station is being attack. Certain planets in my sim seem to have a lot more civilian traffic than other planets, and the only thing I could see that distinguished them is that civilian traffic is very active to and from planets that have 10+ Consumer Goods. So I was curious if this observation was accurate, and about the conditions under which Consumer Goods accumulate rather than decrease. (Also, if they're able to accumulate to 12 or 13, why don't Consumer Goods increase to even higher numbers?)

4. On ships that survive the elimination of their "team": I actually liked this effect... and I also thought of the Quarians. :D

One odd possibility occurs to me. In Master of Orion, colony ships were different from military ships. One of the effects of this was that, because opponent AI didn't know to bring colony ships along with attack ships, there was often a delay between when an opponent would completely destroy all the population of an enemy planet and when they would occupy that planet with their own colonists. So an attentive and opportunistic human player could watch for these attacks, and have his own colony ship ready nearby. As soon as the original population was gone, but before the attacker could send a colony ship, the human player could grab that planet with his own colony ship at zero risk.

So I'm wondering what you think of the idea of, when one team destroys the population of a planet or station, it's basically "neutral" until any team can occupy it in some persistent way. Since civilians don't belong to any team, I'm imagining a rule like, "the first team to simultaneously land all of its fighters, or all of its miners, or all of its traders on a neutral planet can claim that planet for their team." This would have a couple of interesting effects. One, it would allow a team whose planets/stations have all been taken to reclaim a planet and restart their team. And two, if a team with planets moves all its miners or traders to a neutral world, it will take an economic hit; if it moves all its fighters, it leaves its other worlds open to attack.

This may or may not be in line with your overall intentions for this simulation tool. It's just a thought.

5. Finally, how omniscient are ships/teams? Can they "see" the entire map like we do, and make choices like "where do I attack" or "who needs ore?" based on global information? Or do they only do spur-of-the-moment "what's closest to me?" thinking?

...

I hope it's clear that none of these questions or suggestions are intended as criticism or second-guessing. You have built a cool thing!
Post

Re: What about civilians?

#139
Flatfingers wrote:
Sat Jul 01, 2017 2:29 pm
2. On attack decision-making:

A. I see some fighters cycling endlessly between two planets. "Need to gang up" explains why they aren't more aggressive about attacking or defending places; they never accumulate in one place.

B. I see one planet left for one team, with low population and low happiness, and it seems to live on for a long time rather than being targeted by all nearby teams as an easy mark. Is there logic to try to leave the last planet of a team intact, or is this just a quirk of the RNG in the simulation I'm currently running?
A: They defend regardless of whether they're clumped. Unfortunately their defense while unclumped is not as efficient as that of the clumped attackers, typically. :D "Defeat in detail", more or less; the attacker has the advantage by default because the defender's ships are not as centralized/organized. I could easily fix this to have them attempt to clump in the center of their territory, but I prefer it this way because it encourages a high rate of overturn - which keeps things interesting.

B. This is a quirk of the RNG. There is nothing keeping them from capturing the last planet, other than the fact that is has few resources and is thus less interesting than other targets. They simply keep their troops on hand for something larger. This could also be tweaked rather easily.
Flatfingers wrote:
Sat Jul 01, 2017 2:29 pm
3. By "generating more civilians" I meant regular civilian traffic, not the diaspora when a planet or station is being attack. Certain planets in my sim seem to have a lot more civilian traffic than other planets, and the only thing I could see that distinguished them is that civilian traffic is very active to and from planets that have 10+ Consumer Goods. So I was curious if this observation was accurate, and about the conditions under which Consumer Goods accumulate rather than decrease. (Also, if they're able to accumulate to 12 or 13, why don't Consumer Goods increase to even higher numbers?)
Consumer goods accumulate when ore is being brought to the planet, and when the planet sees increased traffic from traders carrying Consumer Goods. They deplete at a rate based on planetary population; a planet with 100 pops will consume Consumer Goods at a rate 10x higher than a planet with 10 pops. A planet with 150 pops will consume it even faster. However, more demand means traders want to go there over other targets; if the local economy can support it, traders will travel there more often. I've never seen a planet make it up to 200, 300, or even 500 pops, but that doesn't mean it's not theoretically possible, given the correct conditions. If you're familiar with Asimov's novel series "Foundation", you may have heard the phrase "All roads lead to Trantor" - this is something you would very much see in the sim at that point. :D
Flatfingers wrote:
Sat Jul 01, 2017 2:29 pm
4. On ships that survive the elimination of their "team": I actually liked this effect... and I also thought of the Quarians. :D

One odd possibility occurs to me. In Master of Orion, colony ships were different from military ships. One of the effects of this was that, because opponent AI didn't know to bring colony ships along with attack ships, there was often a delay between when an opponent would completely destroy all the population of an enemy planet and when they would occupy that planet with their own colonists. So an attentive and opportunistic human player could watch for these attacks, and have his own colony ship ready nearby. As soon as the original population was gone, but before the attacker could send a colony ship, the human player could grab that planet with his own colony ship at zero risk.

So I'm wondering what you think of the idea of, when one team destroys the population of a planet or station, it's basically "neutral" until any team can occupy it in some persistent way. Since civilians don't belong to any team, I'm imagining a rule like, "the first team to simultaneously land all of its fighters, or all of its miners, or all of its traders on a neutral planet can claim that planet for their team." This would have a couple of interesting effects. One, it would allow a team whose planets/stations have all been taken to reclaim a planet and restart their team. And two, if a team with planets moves all its miners or traders to a neutral world, it will take an economic hit; if it moves all its fighters, it leaves its other worlds open to attack.

This may or may not be in line with your overall intentions for this simulation tool. It's just a thought.
...This is possible, yes. They typically already have most of their fighters on a planet when it surrenders anyway, though. I could do it, but the idea doesn't interest me overmuch. A version of this is still possible, though: all you really have to do to take over a planet easily is wait for someone to bring it to its knees and conquer it. At that point the happiness is still low enough that you could capture it without too much trouble; just send your ships in right after the enemy captures it. By the time the enemy arrives to defend, it's already in your hands.
Flatfingers wrote:
Sat Jul 01, 2017 2:29 pm
5. Finally, how omniscient are ships/teams? Can they "see" the entire map like we do, and make choices like "where do I attack" or "who needs ore?" based on global information? Or do they only do spur-of-the-moment "what's closest to me?" thinking?
They see the entire map. On a larger-scale simulation, this would be a Bad Thing because of framerate, likely - you would want to LoD most of it away. :P Fortunately I don't need to bind myself to those restrictions. Javascript is a lot faster than I'd expected at handling large sims like this. I'm pretty pleased there. :) As to the "who needs ore" bit - yes, they take that into account too. Trade ships take both supply and demand into account. It's hard to notice when it's going at 800% speed and it looks like it's controlled by a great hive mind, but it's there.

I'm glad you like it! :D I'll undoubtedly make other things in the future. I've long wanted to make a game based loosely on localroger's "Passages in the void", for one. That idea and this one aren't so different.


edit: Oh, I should probably state - with all the above in mind, there is one mechanic that is "unnatural": Large (very large) factions are limited in the number of fighters they can produce (not the number they can have, only the number they can produce). The exact count is 24 - numberOfPlanetsAndStationsHeld as a maximum for production - in other words, a faction with a single station can produce up to 23 fighters, while a faction with 24 stations and planets cannot produce any new fighters at all. This keeps larger factions from snowballing beyond belief and wiping everything out. It's not a very good restraint - I'll be the first to admit that - and I would never include it in an actual game... but it's one worth mentioning.

There is also a limit on ships... but that's less surprising. This is mostly there to keep the ship count from spiraling out of control. (Also, miners do very strange things when there are too many.) The limit is set the first time a miner arrives at an asteroid that is completely devoid of ore and is forced to travel elsewhere. (This is something else I'd want to do more elegantly if it was an actual playable game.)
Have a question? Send me a PM! || People talking in IRC over the past two hours: Image
Image
Image

Online Now

Users browsing this forum: No registered users and 2 guests

cron