Economy via LUA!

Economy via LUA!

Discuss Lua based Spring scripts (LuaUI widgets, mission scripts, gaia scripts, mod-rules scripts, scripted keybindings, etc...)

Moderator: Moderators

User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Economy via LUA!

Post by Argh »

Y'know, I've got a whacky idea. How hard would it be, really, to remove all of the economic code from Spring and just make it all run through LUA instead? Doing that would open up a HUGE number of opportunities gameplay-wise...

I don't think it'd be terribly hard, honestly. The only hard part would be to have this script track units as they were created/destroyed and then get the values either internally from itself or from the unit's definition. It'd be really interesting to combine that with unit-morphing and couple of other things to create totally new economic models, freed at last from Spring's core constraints.
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Post by KDR_11k »

Removing it would be the hard part. Spring was hardcoded to use metal and energy, there's loads of tags pertaining to these, including even the default mass, cost and the handling of the experience gain.
trepan
Former Engine Dev
Posts: 1200
Joined: 17 Nov 2005, 00:52

Post by trepan »

Please provide specific examples of what you'd want to do
(so that I can let you know how hard it would be to do). Try
to take into account building / repairing / reclaiming type
operations, or new modes such as morphing, cloning, resource
transfers, etc... Would you also want the 'proximity benefit' type
of setup that I've been told SupCom has? (might not be that
hard). How many new resources would you want? Would they
require carriers as in StarCraft?

P.S. I'm guessing that replacing all economy operations will be
prohibitively expensive, but it might be worth trying it out. If your
requirements aren't too great, and with a few 'smart' tricks, it
could be workable.
User avatar
tooleh
Posts: 57
Joined: 14 Jul 2005, 00:47

Post by tooleh »

So if we follow this path, spring is going to become a graphics engine for an entirely Lua powered game engine?

o.-

Whats Lua like performance wise?
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Post by smoth »

argh, I plan on adding a third resource controlled only through lua, I definitely see it as possible. You just have to stop using the old legacy tags and WHAMMO!
User avatar
rattle
Damned Developer
Posts: 8278
Joined: 01 Jun 2006, 13:15

Post by rattle »

WC style food or pilots? Mmmm :)

That's one major features I've been looking for.

Hmm I assume it's possible to change the limit tag on the fly via LUA. I was thinking of a support type of building which sends something like an "I'm alive" signal to some LUA script. The script then remembers the unit by ingame ID (to allow more than one support building) and changes limits for a certain unit (or units) accordingly or resets them if the unit doesn't respond anymore, or one can send a signal that it's dead in the Killed() function, yeah that would be better I guess.
User avatar
tooleh
Posts: 57
Joined: 14 Jul 2005, 00:47

Post by tooleh »

How secure is Lua with regards to people cheating and changing game mechanics by modifying their lua?
User avatar
Guessmyname
Posts: 3301
Joined: 28 Apr 2005, 21:07

Post by Guessmyname »

The modrules lua (and some other stuff, but I can't remember what) is synced, so if it's different between two people, the game don't work.
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Post by KDR_11k »

IOW, about as abusable as changing your .fbi files.
User avatar
1v0ry_k1ng
Posts: 4656
Joined: 10 Mar 2006, 10:24

Post by 1v0ry_k1ng »

woudnt doing this shoot every skirmish AI in the head?
User avatar
Neddie
Community Lead
Posts: 9406
Joined: 10 Apr 2006, 05:05

Post by Neddie »

1v0ry_k1ng wrote:woudnt doing this shoot every skirmish AI in the head?
Yes, exactly what I was concerned about.
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Post by KDR_11k »

1v0ry_k1ng wrote:woudnt doing this shoot every skirmish AI in the head?
Eh, happens.
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Post by smoth »

1v0ry_k1ng wrote:woudnt doing this shoot every skirmish AI in the head?
how so? for gundam and EE, they already have a hard time thanks to the fact neither mod works off of TA styled econ. Currently RAI seems to play gundam the best because it doesn't con assist and it builds more random stuff. I have not tested EE but it may work well with ee.

Once a project goes away from a ta-styled econ it already has issues.

If the resources just require a building then some ais may figure it out. Others will not at all. Some like NTAI with complex build configs can also work it out. In the end the projects are going to start becoming separate games in and of themselves that utilize spring as a platform to run content and will require custom ais.
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

NTai isnt complex unless you make it complex. Its complexity is directly proportional to the number of extra features you make use.
User avatar
1v0ry_k1ng
Posts: 4656
Joined: 10 Mar 2006, 10:24

Post by 1v0ry_k1ng »

gundam and EE could be played by NTAI perfectly, the config tool is very flexible.
KAI played EE like he-man before the hubs change.

people dont seem to realise but most non-star players do use the AI's to learn mods and practice. if you check the lobby at least 1/2 the games contain just one person; AI skirmish players. not counting players who use spring SP.
If this was done, if would have to be optional. its not fair on players and the AI devs who have put in a billion man hours to break their AI's for the sake of experimenting with new mods.
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Post by smoth »

1v0ry_k1ng wrote:gundam and EE could be played by NTAI perfectly, the config tool is very flexible.
KAI played EE like he-man before the hubs change.

If I made the config for gundam I can promise you that it would be outdated in a new release. I tend to change the build menus and resource system around frequently to meet new features in the spring engine as springs features allow me to move closer to what I originally planned. So I would have to stop development at each version and redo the config for NTAI at each release. Not exactly productive.


*edit please stop talking about ai issues, we are derailing the thread.*end edit*
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

Hence the addition of 20-30 generic universal build routines. In such a case as gundam you would build a small number of tasklists and assign generic keywords as much as possible. That way NTai economy algorithms do the work as best they can rather than you defining each and every unit needed for every revision.

However I doubt that'll pursuade you. In the mean time a gundam config that played rather well can easily be built in several minutes thanks to the nature of gundams economy in 1.11.

I'm sure that when the time comes trepans AI interface bindings can be leveraged to AI devs and modders a platform for standardizing lua features such as sockets, superweapons, or resource harvesting.
User avatar
1v0ry_k1ng
Posts: 4656
Joined: 10 Mar 2006, 10:24

Post by 1v0ry_k1ng »

AF speaks true on how easy it is, I could put together a working config that played the game quite well in about 20 minutes. changing build menus around wouldnt effect it, advise you to check out the NTAI toolit even if your not interested in making an AI
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

Now let us all bow our heads and return to the topic at hand, lua economics.
User avatar
Erom
Posts: 1115
Joined: 25 Apr 2006, 05:08

Post by Erom »

I'd be concerned with speed. I think LUA would work marvelously for things like a food limit, or even *craft style ore and gas, because the frequency of changes are so much smaller than in TAesque games (only need to update when a supply depot is killed or built, or when a worker returns with ore / something is build/cancelled)

Now that I think on it, 90% of RTS's use discrete economic units that would be LUA-able without too much of a performance hit (Disclaimer: I'm speaking of LUA in general, here, as I'm unqualified to comment on Springs specific implementation. So some things I say are "possible" may be really hard.) Starcraft, C+C (even generals)... most anything. The only things is might be too slow for would be TA-style, and Z-style economics.
Post Reply

Return to “Lua Scripts”