Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 5 6 [7] 8 9 ... 31

Author Topic: Proceedurally Generated RTS  (Read 57072 times)

Armok

  • Bay Watcher
  • God of Blood
    • View Profile
Re: Proceedurally Generated RTS
« Reply #90 on: January 13, 2011, 01:05:57 pm »

Thats... not how you evolve a well balance and interesting unit. That's a very roundabout way of evolving the strongest unit possible. You need to have the fitness function be the thing that you actually want to maxemize.

Secondly, there is no reason to bother with things like simulating chromosomes as bits. Just add a random factor to each stat and then subtract half it's max value. If you actually wanted to simulate chromosomes properly you'd have to do somehting way more complicated than anything anyone has done or suggested anywhere in this thread.
Logged
So says Armok, God of blood.
Sszsszssoo...
Sszsszssaaayysss...
III...

Draco18s

  • Bay Watcher
    • View Profile
Re: Proceedurally Generated RTS
« Reply #91 on: January 13, 2011, 01:42:16 pm »

By "chromosome" I mean "a binary representation of the base building blocks of the unit."  Which means: the five RNG calls.

Quote
Thats... not how you evolve a well balance and interesting unit. That's a very roundabout way of evolving the strongest unit possible.

Not necessarily.  Remember that the units have a rock paper-scissors-relationship.  Or at least, that's the goal, but the fact that such triangles exist mean that there is no "best" unit, unless the stat-generating algorithm is flawed.  By evolving the unit towards beating what I have, then making it the goal to beat, is doing no more than what I've already done.  Except that instead of hoping the RNG spit out what I need one after another, it spits out 10 attempts and refines from the most successful.

Quote
If you actually wanted to simulate chromosomes properly you'd have to do somehting way more complicated than anything anyone has done or suggested anywhere in this thread.

I refer you to this article: http://www.ai-junkie.com/ga/intro/gat1.html
It is in fact not more complicated than "anything any one has ever done before."  It is, in fact, the very basis of genetic algorithms.

Also, no one here suggested it, but this ain't the only thread I have, buster.

Quote
Just add a random factor to each stat and then subtract half it's max value.

Lets say, for sake of example, that for whatever reason only 1 stat matters, and that stat needs to be high (for example we need a unit with speed such that it can kite a slow bomber-ish unit).

First itteration the RNG spits out 0.364[...] (only the first three digits making a difference).  Its not "high" enough, so the second itteration spits out 0.284[...], adding the two together we get 0.648[...] and then subtract 0.5 (half max) and get 0.148.  Wait a second, that's not better, that's worse!
« Last Edit: January 13, 2011, 01:48:24 pm by Draco18s »
Logged

Armok

  • Bay Watcher
  • God of Blood
    • View Profile
Re: Proceedurally Generated RTS
« Reply #92 on: January 13, 2011, 02:27:45 pm »

that's not really "proper" simulation or how chromosomes work in real biological cells. But I'll give you points for actualy trying and doing research I guess.

That tutorial is still not quite optimal for this specific project thou. Don't bother with binary and stuff like that, recombination can be more easly made by this procedure:

Chose two units to mate
For each stat, make the child's stat equal to (Bigeset of the parents stats - smaller of the parents stat)*rand()+smaller of the parents stat

EDIT: Also, I'd suggest the folowing procedure for evolving them, without set generations:

1) Spawn 20 completely random units, 10 on each side.
2) run simulation until an unit is killed:
3) Increment the POINTS value of the unit who killed it
4) Create a new unit on the side of the unit that was killed
5) find the two units that have most POINTS, regardless of side
6) set the stats etc. to the result of mating those two units according to the above function
7) set the POINTS of the new unit to 0
8) subtract 1 from the POINTS value of each of the parents
9) check if the simulation has ben running long enoguht etc. and GOTO 11 if it has
10) GOTO 2
11) return the unit with the highest point count as the winner.
« Last Edit: January 13, 2011, 02:40:23 pm by Armok »
Logged
So says Armok, God of blood.
Sszsszssoo...
Sszsszssaaayysss...
III...

Draco18s

  • Bay Watcher
    • View Profile
Re: Proceedurally Generated RTS
« Reply #93 on: January 13, 2011, 03:01:51 pm »

Chose two units to mate
For each stat, make the child's stat equal to (Bigeset of the parents stats - smaller of the parents stat)*rand()+smaller of the parents stat

In other words, stats could never increase or decrease beyond their parents' values.  Every successive child would be no better and no worse than the average of its parents.  This system neither allows for mutation or growth.

Quote
EDIT: Also, I'd suggest the folowing procedure for evolving them, without set generations:

1) Spawn 20 completely random units, 10 on each side.
2) run simulation until an unit is killed:
3) Increment the POINTS value of the unit who killed it
4) Create a new unit on the side of the unit that was killed
5) find the two units that have most POINTS, regardless of side
6) set the stats etc. to the result of mating those two units according to the above function
7) set the POINTS of the new unit to 0
8) subtract 1 from the POINTS value of each of the parents
9) check if the simulation has ben running long enoguht etc. and GOTO 11 if it has
10) GOTO 2
11) return the unit with the highest point count as the winner.

Bwu?  How does this locate 3 triangle units at all?
Logged

Armok

  • Bay Watcher
  • God of Blood
    • View Profile
Re: Proceedurally Generated RTS
« Reply #94 on: January 13, 2011, 03:11:30 pm »

It doesn't... actually it might, but that's not what I had in mind. Just that specific rule isn't sufficient to drive balance on it's own anyway.

If you have lots more units on each side it might actually produce triangles. hmm... Might want to add a step occationaly adding in a new completely random unit, as the only such units that would survive those more powerfully evolved units would be the next one in the triangle.
Logged
So says Armok, God of blood.
Sszsszssoo...
Sszsszssaaayysss...
III...

Draco18s

  • Bay Watcher
    • View Profile
Re: Proceedurally Generated RTS
« Reply #95 on: January 13, 2011, 03:31:16 pm »

*Sigh*
Look.  You're not helping.  Please stop.

Right now the goal is, "To find 3 unique triangle units in the least number of computation cycles possible."

Continuously spawning unique units and throwing them against other units, not a single unit identical to another does nothing useful.  There's no logic that says that this new unit picks the "best" opponent for its stats (because there's no way to determine this!) and as such, while it might be very powerful against unit479 over there, unit319 was closer, and so the new unit dies quickly.
Logged

Armok

  • Bay Watcher
  • God of Blood
    • View Profile
Re: Proceedurally Generated RTS
« Reply #96 on: January 13, 2011, 03:55:17 pm »

That's unavoidable without making trade-offs against other things I think.
Logged
So says Armok, God of blood.
Sszsszssoo...
Sszsszssaaayysss...
III...

Virex

  • Bay Watcher
  • Subjects interest attracted. Annalyses pending...
    • View Profile
Re: Proceedurally Generated RTS
« Reply #97 on: January 13, 2011, 03:57:35 pm »

Isn't rock-paper-siccors balance like the number one reason people hate modern RTSes? I don't know if it's a good idea to strive to recreate that...
Logged

Eagleon

  • Bay Watcher
    • View Profile
    • Soundcloud
Re: Proceedurally Generated RTS
« Reply #98 on: January 13, 2011, 03:58:46 pm »

Genetic algorithms work best on a highly statistical basis, where low level chance occurrences disappear against a broader stroke. If you want to use them with any kind of accuracy, your best bet is to determine fitness per cycle, instead of per lifetime - meaning each attack or movement alters the fitness of the unit. Alternatively, you can use a ton of units at once to even out random disturbances. Spawn five or six individual entities of a particular generation, instead of just the one, and give them a little bit of individual variation that isn't transferred to their descendents.

They also work wonderfully if your traits have some intrinsic tradeoffs. It's very easy to put down an arbitrary cost for your attributes that modify the final fitness value, but it's much more interesting if, say, your weapons systems draw from the same power source as your movement abilities, or if making a tougher unit decreases its speed, as well as the size of its weapons. The ideal for any particular survival strategy will settle in a finite happy medium, instead of jumping in leaps and bounds in one direction. Your job is then to tweak the benefits and tradeoffs of each so that there's more than one viable strategy, so that you see walls of armor alongside tenacious but low-damage darts and glass cannons, all in their place. If you can implement a sort of ecology of resources, all the better - perhaps units could salvage wreckage to make repairs, etc, and the different attributes could modify what they can get from them.
Logged
Agora: open-source, next-gen online discussions with formal outcomes!
Music, Ballpoint
Support 100% Emigration, Everyone Walking Around Confused Forever 2044

Mephansteras

  • Bay Watcher
  • Forger of Civilizations
    • View Profile
Re: Proceedurally Generated RTS
« Reply #99 on: January 13, 2011, 04:08:36 pm »

This is a pretty cool project. I look forward to seeing how it goes.
Logged
Civilization Forge Mod v2.80: Adding in new races, equipment, animals, plants, metals, etc. Now with Alchemy and Libraries! Variety to spice up DF! (For DF 0.34.10)
Come play Mafia with us!
"Let us maintain our chill composure." - Toady One

Draco18s

  • Bay Watcher
    • View Profile
Re: Proceedurally Generated RTS
« Reply #100 on: January 13, 2011, 04:15:33 pm »

That's unavoidable without making trade-offs against other things I think.

1) What's unavoidable?  Which part of my post are you replying about
2) Such as?

Isn't rock-paper-siccors balance like the number one reason people hate modern RTSes? I don't know if it's a good idea to strive to recreate that...

Explain?

They also work wonderfully if your traits have some intrinsic tradeoffs. It's very easy to put down an arbitrary cost for your attributes that modify the final fitness value, but it's much more interesting if, say, your weapons systems draw from the same power source as your movement abilities, or if making a tougher unit decreases its speed, as well as the size of its weapons.

There's already a trade off involved.  Essentially 5 random numbers determine 4 stats, which are then used to derive the remaining 4.  So high health/armor/damage -> lower speed (just as you suggest).
Logged

forsaken1111

  • Bay Watcher
    • View Profile
    • TTB Twitch
Re: Proceedurally Generated RTS
« Reply #101 on: January 13, 2011, 07:50:16 pm »

Isn't rock-paper-siccors balance like the number one reason people hate modern RTSes? I don't know if it's a good idea to strive to recreate that...

Explain?
I can't speak for everyone, but I know I personally detest RPS balance and I don't play games which rely on it. I'd prefer unit balance to be more realistic, or at least more varied. If unit A can only be economically countered by unit B which can only be countered by C whose only weakness is unit A, it just becomes a tedious exercise in micromanaging units rather than playing a game.
Logged

Korbac

  • Bay Watcher
  • I'm very annoying, so tell me to STFU if need be
    • View Profile
Re: Proceedurally Generated RTS
« Reply #102 on: January 13, 2011, 08:04:13 pm »

I agree with what your saying, Forsaken, but with Draco's system, I don't think it'll quite achieve RPS balance. What I mean by that is there's nothing on one unit which says "deal double damage to A, take double damage from B" - it's not as clear cut as the classic drudgery of RPS. It'll be more like a web of balance if done correctly (which seems possible with the paramaters he's using now), which will be more interesting.
Logged

Draco18s

  • Bay Watcher
    • View Profile
Re: Proceedurally Generated RTS
« Reply #103 on: January 13, 2011, 08:28:56 pm »

I agree with what your saying, Forsaken, but with Draco's system, I don't think it'll quite achieve RPS balance. What I mean by that is there's nothing on one unit which says "deal double damage to A, take double damage from B" - it's not as clear cut as the classic drudgery of RPS. It'll be more like a web of balance if done correctly (which seems possible with the paramaters he's using now), which will be more interesting.

Quite, but first one has to insure that every unit can be countered by an equal number of at least one other unit.

Unlike where it seems AI War is going where you spend a fleet of 1000 units to kill 5 because the AI gets better units.

I'm trying to avoid "this unit does 2 times as much damage" .... mechanics, but I think I will implement armor and bullet types, but it'll be treated differently (I'm currently thinking about it being +10 armor piercing--its not more damage but that armor--if the target has any--is less effective).  It'll also always be a "X ammo is good against Y armor."
« Last Edit: January 13, 2011, 08:31:23 pm by Draco18s »
Logged

Korbac

  • Bay Watcher
  • I'm very annoying, so tell me to STFU if need be
    • View Profile
Re: Proceedurally Generated RTS
« Reply #104 on: January 13, 2011, 08:36:13 pm »

"X ammo is good against Y armour"...was what I thought you were avoiding, but with randomized stats, it could be plausibly carried off. The main risk you have there is you gen a fairly balanced selection of, say, 10 units, 6 of which have one type of armour. That means the units with guns good against that armour are going to see more use.
Logged
Pages: 1 ... 5 6 [7] 8 9 ... 31