Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 2 [3] 4 5 ... 31

Author Topic: Proceedurally Generated RTS  (Read 57013 times)

Draco18s

  • Bay Watcher
    • View Profile
Re: Proceedurally Generated RTS
« Reply #30 on: January 08, 2011, 07:36:56 pm »

Alright, the Super Kite (Range 146+, speed 16+) can only be beaten by either a) something that out-kites it, or b) anything with more Speed and more damage.  Which is countered by Just Damage in Spades.

Algorithm needs some tweaking, I ended up with some Speed 0 units, and the range is getting out of hand (speed needs to be worth more points).
Logged

forsaken1111

  • Bay Watcher
    • View Profile
    • TTB Twitch
Re: Proceedurally Generated RTS
« Reply #31 on: January 08, 2011, 08:02:16 pm »

Speed+range has always been a killer in combat. If you can fire at an enemy and stay out of danger, you are king. How are you currently weighing the various stats?
Logged

winner

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

what is also interesting is the pairs that are nearly evenly matched
Logged
The great game of Warlocks!

Draco18s

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

A ship gets 18 "build points."

In order:

1-5 BP spent on HP at 1 BP = 25 HP (min 175). [BP spent is r; so HP = 150 + r * 25 ] *
0-5 BP spent on Armor at 1 BP = 2.75 armor (rounded down to the nearest integer) [BP spent is t]
2-9 BP spent on Damage at 1 BP = 3 damage [BP spent is m]
if the damage is 12 or lower, the unit gets Armor Piercing (free):
     AP value is equal to 20 - (m * 5)
     And m is recalculated to be m - 5 (low damage ships get a slight boost to speed and number of shots)
Speed is a function of HP, Armor, and Damage.  Speed = 16 - (r+t+Math.ceil(m/1.75));
Number of shots is fiddly, but essentially, a random number squared times 6, rounded up.  However, m plays a small portion in this as well: more damage, fewer shots.
Costs (NumShots * 3 / 4) round up.
Reload Speed is a function of damage and number of shots.  (Damage * (NumShots-1, min 1) / 12)+1.  Keeps things roughly in the same DPS area.  More damage or more shots -> longer reload
Then some fiddly bits with speed to cut down on long range + speed combos as well as units that have near 0 speed.  The former costs BP for units with speed > 10, the latter trades 2 BP for 3 speed (only if the unit's speed is less than 4).  Both insure that there will still be adequate points for the range function below.
The remaining BP is spend on range: (pointsLeft-4)*(pointsLeft-4) + 25

*I am looking at allowing a wider range.  Starting at 100, and making each BP worth 30.
« Last Edit: January 08, 2011, 08:31:56 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 #34 on: January 08, 2011, 09:50:52 pm »

In terms of the simulation you are doing now, perhaps introduce a "cost" factor, which limits the quantity of units? this would allow you to have occassional battles with one really tough unit fighting lots of weaker ones (something that I imagine will happen at least somewhat frequently in an RTS)
Logged

Draco18s

  • Bay Watcher
    • View Profile
Re: Proceedurally Generated RTS
« Reply #35 on: January 08, 2011, 10:31:38 pm »

I'll have to at some point, definitely.
Logged

iceball3

  • Bay Watcher
  • Miaou~
    • View Profile
    • My DA
Re: Proceedurally Generated RTS
« Reply #36 on: January 08, 2011, 10:49:55 pm »

I'ma watching this.
Logged

Draco18s

  • Bay Watcher
    • View Profile
Re: Proceedurally Generated RTS
« Reply #37 on: January 08, 2011, 10:56:16 pm »

Good news!  I managed to find an easy way to determine if a Triangle set of units exists, and the first run found one!  But the program failed when it tried to print them as I had not removed an event listener!

Oh well, it only took about 5 minutes to run and I'm doing it again.

I still have some tweaking to do, I'd like the units to stop bouncing around when they kite.  At superspeed it looks awful and can allow the kited unit to fire.

Anyhow, here it is for your viewing pleasure.  Movement and firing rate are upped 10x in order to resolve conflict in a timely manner.  Its less accurate, I'm sure, but should produce accurate results in the end.
Process: find 10 units in a progressive manner whereby each unit can beat the previous one in the list.  Once 10 are found, run through each one, pairing it with the one two higher in the list.  The first time the lower-indexed unit can beat the higher indexed one, a match is found and the program terminates and displays the three units.

Edit:  appears that there is a bug in the final display.  Working to fix now.
« Last Edit: January 08, 2011, 10:58:15 pm by Draco18s »
Logged

forsaken1111

  • Bay Watcher
    • View Profile
    • TTB Twitch
Re: Proceedurally Generated RTS
« Reply #38 on: January 08, 2011, 11:14:09 pm »

Okay, I was gonna mess with it but will hold off for bug fix
Logged

Draco18s

  • Bay Watcher
    • View Profile
Re: Proceedurally Generated RTS
« Reply #39 on: January 08, 2011, 11:15:12 pm »

I don't blame ya.  I wish I could see the three units myself!

But for some reason its only showing one.
Logged

forsaken1111

  • Bay Watcher
    • View Profile
    • TTB Twitch
Re: Proceedurally Generated RTS
« Reply #40 on: January 08, 2011, 11:16:07 pm »

Hit it with a code-wrench until it works!
Logged

Draco18s

  • Bay Watcher
    • View Profile
Re: Proceedurally Generated RTS
« Reply #41 on: January 08, 2011, 11:22:14 pm »

Hit it with a code-wrench until it works!

Hahaha.  Shame I'm a code monkey and not an engineer.
Logged

Draco18s

  • Bay Watcher
    • View Profile
Re: Proceedurally Generated RTS
« Reply #42 on: January 08, 2011, 11:49:17 pm »

HAHA!



Works now.

It isn't guaranteed to find a triangle match, but should have very good odds.  If it finds nothing its just going to stop.  These are pretty rough compiles.
Logged

Askot Bokbondeler

  • Bay Watcher
  • please line up orderly
    • View Profile
Re: Proceedurally Generated RTS
« Reply #43 on: January 08, 2011, 11:57:07 pm »

i have had a slightly related idea for ages...  i've dreamed of an rts where you could design an rts faction ever since i played the first age of empires. it seemed such an obvious idea, but i've seen only a few disappointing stabs at it, like spore, or impossible creatures...
i've never learned any programming language, but i've had a semi-serious project with the warcraft 3 world editor that has died and been revived countless times... i've thought about bringing it back to life, latelly, and i'm not sure if this inspired me or humbled me. it interests me immensely, though, and i'm subscribing the thread.

Cruxador

  • Bay Watcher
    • View Profile
Re: Proceedurally Generated RTS
« Reply #44 on: January 09, 2011, 12:04:46 am »

Hm, I generated something that takes all comers. I lost track but it's beaten something like 100 others now, quite possibly much more, and it's still going. It's HP 175 Armor 2 Dmg 21x1 AP 0 RoF 2 Speed 10 Range 146.

Something that seems to contribute to this is probably a bug - as it kites, some of the opposing units are left behind in the middle of the screen, and just sit there. Then those opposing units are drawn off and killed in small groups.

That's not all of it though, it destroys ships without that bug tons of times.
Logged
Pages: 1 2 [3] 4 5 ... 31