Loading...
  OR  Zero-K Name:    Password:   

noob / AI / balance

34 posts, 3858 views
Post comment
Filter:    Player:  
Page of 2 (34 records)
sort
Hi everyone,



I'm new to Zero-K (I'm even new to RTS), so I wanted to say hello to the community.

I've spectate a few battles, played a tutorial, and it looks like Zero-K is what I was looking for, without even knowing it, for a long time.

I have a question and a suggestion.

Question : I like "programming games" (where players must write the most efficient programs) like http://berrybots.com/ for example. In Zero-K, is there a way to program units or the commander ? Is it possible to write a Lua script that commands the entire army ?

Now the suggestion. I found this thread -> http://zero-k.info/Forum/Thread/888
It's an old thread, so I don't know how it is now. The suggestion would be a variable cost :
- If a type of unit is often used by players, its "cost" (energy/metal/time) rises
- If a unit is seldom produced, it becomes cheaper
After each battle, prices are modified. So, the game balances itself out automatically.

That's all!



I need a lot of training, but i hope to meet you soon on the battlefield :)
+5 / -0


11 years ago
Hi light laser turret!
+1 / -0
11 years ago
AFAIK you can make AI stuff with lua widgets, and the game already uses that for the fight command (units automatically dodge projectiles on fight order)
An example would be wolas' newton widget, which lets you draw "fire zones" for your newtons so all friendly units that get there get automatically aimed by those

You can also code bots (which would be great, current bots are pretty bad), but I think bots use a different system

The cost suggestion sounds interesting but I guess it would be too easy to break the balance with it

PS: welcome
+0 / -0
11 years ago
quote:
http://berrybots.com/

You are awesome! It looks like a super game. It is soooooo coooool.
Actualy, have you ever played CoreWar?
+0 / -0

11 years ago
You have full control over your units with the lua around, blow us :D
+0 / -0
@Emollient1 this game for you, you can make Lua AI for any type of individual unit or/and for the whole army.

One AI we lack and everyone agree that would be nice to have is one that make/connect the powergrind and mexs.
+1 / -0
11 years ago
Welcome to ZK!

Like ElStorage said, you can make widgets like that, but I think it would largely be considered cheating. As for that thread, it is REALLY old. Zero-K is completely different from how it was back then. I think if the game was balanced like that it would be too easy to abuse the mechanics to make ridiculously powerful units cost nothing. There are a few players that would deliberately unbalance the game for fun.

Your lua idea is interesting though, there are many different automation widgets already and more would be welcome. Some things people have thought of but have never been implemented:
quote:
Random Area Attack
- Bombard random spots in area with unit's weapon

Rally queue for individual units from factories (con, bombs)
- Give a queue to a con/bomb and select a factory, future cons/bombs get that queue instead of factory's

Athena rally queue
- Give Athena a queue, units built from it will inherit that queue

Gunship Jink
- Improves current gunship no-strafe behaviour to have small jink (as per gunship no swarm)

Build solar next to extractors
- automatically build solars in free space near mexes

Econ building priority
- Sets high priority on solar/wind and mexes depending on income state

Tactical missile launcher control
- Napalm/tacnuke guarding a shockley (and have an attack order after that) will time their attack command after so as to arrive 1.5 shield radius behind the shockley

Idle towers random fire
- Towers idling will slowly circle their range with shots... just in case
- Most applicable to llts vs cloak


Sniper Alert/Hunt (needs widget projectile detection)
- places marker at first sight of sniper round
- optional add-on: towers with nothing to do will fire on origin point if in range (cpu expensive)

Auto-jink (needs widget projectile detection)
- auto-swarm does not jink until detecting incoming projectile
- Note: CPU heavy

Shield Attack (not sure if possible)
- Looks for enemy shields in range of towers and makes towers attack them to drain shield power (stops if enemies come in range)

Initial Queue
- As in BA

Newton Control
- Experiment and use widgets to make newton cannons more accurate

Constructor Fight-Mexing
- Constructors on fight order build mexes

Reclaim pausing when (self/team) excessing metal

Auto-rebuild
- Mark buildings and constructors, cons will attempt to replace buildings when they are destroyed
- Good for radar, mex, windfarm

Nanotower reminder
- Factory + nanotower max spending < mex income + OD = reminder to build nanotowers!


Good luck with the game! 1v1 is probably the best for learning and most 1v1 players are very helpful in explaining what to do.
+3 / -0


11 years ago
Hello, Emollient1, and welcome to Zero-K! We're very glad you've come to play and very glad you've spoken up here on the forums.

I'd be very grateful if you could share with us how you found out about Zero-K, and what it is about Zero-K that you think you're going to enjoy.

As for programming units - Using Lua Widgets you can programmatically do anything that you as a player could do yourself. In fact, Zero-K's AI enemy (the one called "CAI") is written entirely in Lua. You could use that as an example to write your own. Or, as TheSponge points out, there are plenty of opportunities to write widgets which can automate some tedious manual tasks without necessarily implementing a bot which automates your entire army.

Good luck, have fun!
+0 / -0
"Like ElStorage said, you can make widgets like that, but I think it would largely be considered cheating."
What? Cheating?
I remember someone saying that any widget is OK, as long as it doesn't break obvious game rules (fog of war for example). Especially if you share it with community - it's OK.
Cause if some micro-intensive actions break the game - the game should be fixed, not the widget/micro.

And we will worry about bots defeating experienced players - when it happen. Not really soon, I think.
+0 / -0
11 years ago
I think maybe you have found the right place. If you're interested in that kind of programming, Zero-K is a veritable lua sandbox.

Anyway, a big welcome to the forums!
+0 / -0
11 years ago
If you're afraid of people feeling like you're cheating, just tell them beforehand that you're testing a new AI widget. As long as you're clearly interested in releasing it, I doubt anyone would have a problem with it.

As for autobalancing unit costs, I doubt that is a good idea. Some units are used very rarely, but are still very important when they are. For example, an infiltrator (the spider spy unit that can insta-stun must units) is only really used to counter striders/goliats or to assasinate coms. You can't really balance around that. Striders themselves have a similar problem, in that they are only really used to crack open defense on drawn-out games. Ships would start behaving weird as well.
+0 / -0


11 years ago
There are multiple interfaces to full-blown AI (Cpp, java, i think even a python one), but most of those are limited in their interactions with the game's Lua world.

You can write an AI as a "gadget", that is, a lua-scripted "game rule" - that's how CAI works. I'm sure there wouldn't be much resistance to including an extra bot.

Look more here:
http://springrts.com/wiki/AI:Development:Lang:Lua
+0 / -0
GBrankTheSponge: where did you get your list of possible widgets from?
+0 / -0
http://code.google.com/p/zero-k/source/browse/trunk/mods/zk/LuaRules/Gadgets/ai_CAI.lua

This may help, not sure where the unit's AI is...
+0 / -0
https://code.google.com/p/zero-k/source/browse/trunk#trunk%2Fmods%2Fzk%2FLuaRules%2FConfigs%2Fcai%253Fstate%253Dclosed

You might have an easier time looking at the configs. But it's hard to improve this if you're new to the game, it's made by AUrankAdminGoogleFrog who is a top 5 player.

Your balance idea might sound good but that is not how game design works.

Some units are easier to use, some are incredibly difficult to use at 100% efficiency by anyone but top players. Some units are used as a staple for every game, others are intentionally meant to be niche units only brought out for specific scenarios. Some units you only ever really need one of (Felons, Firewalkers, Screamers, Advanced radar towers).

Naturally, a unit that is more expensive is used rarely, even if it's worth the power, the price of Starlights and Banthas would drop precipitously. I mean, just the AA turrets, because there are 5-6, would all be cheaper just because you have the option of building any one over the other. Since each factory has an AA unit, their costs would also vary greatly to the point that you'd have to build certain factories just for their AA.

Think of the skuttle, a 500 cost anti-heavy cloaking suicide unit. It's used very rarely, but when it works you can make 2-4 cost. As it cost drops, it starts making cost vs cheaper and cheaper units.

Then there are all the players spamming units they like to use but don't know how to use, are losing anyway, and drive the unit price up further or further: or the people do do this -on purpose-.

This is just not what 'balance' means.

We actually keep stats on most things you can imagine from unit use per game, percentage of games used, damage done and dealt, damage done per unit class, damage done in cost of damaged unit and the all important cost in damage divided by investment, and cost in damage divided by cost of units lost.

But even this does not account for shields or repair, gives only vague notions of EMP or disable damage, and does not account for the biggest problem with all of these things, which is that almost all games are won on ECONOMY, rather than exclusively on units. This means that you can have an army 2-3x the size, which just doesn't take any damage from the enemies piddling opposition, and so seems to be doing much better than really warrants for it's power. Or that you can pour 2-3x the enemies whole economy worth of units uselessly into his static defenses and lose them all and -still- manage to win because you have 5x the economy. So what really won you the game was when you used a tiny handful of a totally different unit much earlier to contain his expansion and take the whole map, and now you're spamming some totally different unit at him after it's already over.

Which is why the only real way to judge a units power, to take in every single variable it is possible to do so, is for players with a deep understanding of the game to examine high level play using those units, and how they perform. Which is ultimately how every game that is balanced, in so far as it is balanced, is balanced. It would be nice to think there is some algorithm you can use, some piece of code you can write, which will perfectly simulate how the unit performs in game and tell you what it should cost. But such an algorithmic simulation already exists. It's the game itself.
+1 / -0
Widgets are pieces of lua code which can be run locally on your machine, you don't have to distribute the AI code to use it against people when you are playing. Each player has some set of widgets running on their machine, a lot of widgets come with ZK by default and the ones which are enabled by default make up the default UI.

Each widget has access to basically all the information that players have and they can give arbitrary order to your own units. In effect widgets can see and do anything a player could so any sort of AI could be written as a widget. If you write an AI this way it will be a 'helper AI' which is in the game alongside you and only controls your units. So you could program any unit. You should probably start here.

Here are some examples of widget which implement some behaviour.
http://code.google.com/p/zero-k/source/browse/trunk/mods/zk/LuaUI/Widgets/unit_stockpile.lua
http://code.google.com/p/zero-k/source/browse/trunk/mods/zk/LuaUI/Widgets/unit_shield_guard.lua
The first widget is a simple widget demonstrating their structure. It automatically queues some stockpile for newly produced units as we assume that when you make something with stockpile you made it to use the stockpile. The second widget is a bit more complicated, it implement some AI for mobile shields which causes them to slow down and wait for units which are following it.
The whole widgets folder is here found here
http://code.google.com/p/zero-k/source/browse/trunk/mods/zk/LuaUI/Widgets
that is a good source of examples. To get it in a more readable form you should do an svn checkout.

I'm going to go with "widgets are not considered cheating".

CAI is a lua gadget. This means that it runs on every machine during a game (so has no latency issues) and it can control an AI team. If you want to play against your AI locally you should make a lua AI. It is reasonably straighforwards to turn a widget AI into a gadget AI which anyone can then play against. Gadget AIs require the game to be modified so I think you should start with widgets and see how you go.

I don't think there is that much to be gained by messing with the CAI configs. CAI itself needs extension if it is to be improved.
+0 / -0
Someone already tried the variable cost thing. By all accounts, it really didn't work.
+0 / -0
11 years ago
CHrankConnetable I got the list from here. The 4th post down by USrankjseah.
+0 / -0

Wow, thanks a lot for welcoming me like this, that's very nice.

So yeah, I think I found the right place! At last...
I couldn't sleep this night, reading the manual on my phone :D



About AI and Lua scripting :

Sounds like... widgets really are what I'll play with. I won't touch CAI or CAI configs, and I won't make a gadget AI. In fact, I'm not excited about creating an AI, actually. What I really like is : designing tools that can be shared and used by players to create fighting AIs. In this case, widgets.

For example, a looped queue is already almost a program. What if we embed conditional queues in other queues ? Just a 5AM idea...

I believe that if everyone can use something, then it's not cheating.



About the variable cost :

I understand that there's obviously NO NEED for such a thing!



RUrankbanana_Ai : check out http://programminggames.org/ it's full of cool games ;)



USrankCrazyEddie : Simply put, I was thinking about creating a new programming game, involving swarms of bots, with some kind of easy visual icon-based programming interface. Somehow I realised that it was probably very close to RTS, so I decided to give RTS a try. I googled "open-source mmorts", and after digging a little bit, ZK popped up. The trailer was pretty attractive, so I downloaded it :) What I'm going to enjoy : the game is mature AND extensible...



Now I'm going back to my tutorials, lot of things to learn, lot of things to blow!!
+1 / -0
11 years ago
If there's a string of land maps, the shipyard and its ships would eventually become ridiculously cheap. So when a water map finally comes, the amphib and hover factory would have a large disadvantage, since the shipyard ships would be far cheaper.
+0 / -0
Page of 2 (34 records)