Deployments

Deployments

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

Moderator: Moderators

User avatar
Guessmyname
Posts: 3301
Joined: 28 Apr 2005, 21:07

Deployments

Post by Guessmyname »

Basically, in my more whimsical moments, I dreamt up this:

1. Host hosts a game, sets up a points limit and deployment zones (the boxes used in start-pos selection?)
2. Players join, select sides
3. Game start. Force Selection and Deployment Stage. Nothing moves or shoots or anything like that. Players select units to use in the coming battle, preferably something like this:

Select unit class (ie Tank, Infantry, Aircraft etc)
Select specific unit type (ie Predator Tank)
Select version of unit (ie Predator Annihilator with Heavy Bolter Sponsons)

4. Players place their units on the map (icon-list of units to be deployed at side - drag drop onto map?)

5. When a player has deployed his forces, he clicks the ready button (like when you're choosing a start position). When all players have done this, the game begins

Most of this should be possible in lua (the deployment phase for example - tell lua to create certain units...). The menu system for choosing units, the drag-drop thing and pretty much all of 'point 5' and 'point 1' are the things I'm not sure about.

What does everyone think? Feasable?
User avatar
Snipawolf
Posts: 4357
Joined: 12 Dec 2005, 01:49

Post by Snipawolf »

Sounds like liberation day, in Spring.. If this works I may just make a game for it :P
imbaczek
Posts: 3629
Joined: 22 Aug 2006, 16:19

Post by imbaczek »

Doable, more-or-less.

Make a unit which has commands to spawn and despawn some units in a region. (Maybe it's possible to access start area data after game start, if not, should be trivial to add.) Points and stuff can be kept by Lua, with presentation using gadgets. When the user clicks ready (either a command in the spawner or a gadget button), the spawner gets despawned and game starts - units are given their proper LOS and unimmobilized.

What would be needed: unit drag'n'drop in deployment phase. Dunno if that's possible.
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

This would be done via a lua start script, aka a lua mission that doesnt specify a map or mod.

The only code that'd need changing outside of lua would be the lobby.
trepan
Former Engine Dev
Posts: 1200
Joined: 17 Nov 2005, 00:52

Post by trepan »

Guessmyname
I had the same idea a long time ago (think I picked it up from someone
else's thread at that). I liked it then, and I like it now. Thanks for the
reminder.

I've got most of it implemented in a LuaRules module that is used before
the regular game gadgets code is loaded. I'm not too sure I want to add
team switching, but I think you'll be pleased with the rest of it. I'm also not
touching the initial commanders (except to rig the command buttons during
the deployment phase).

imbaczek
You describe the setup I'm using pretty closely, with the biggest difference
being that all units are build using the ICON_BUILDING type. Note that
this allows you to see the valid locations for units. I'm also replacing the
real command descriptions with fake ones for the dummy units, and using
the commander tooltip to show how much metal and energy you have
remaining. Builds that have become too expensive have their buttons
disabled (greyed out).

AF
Huh?
trepan
Former Engine Dev
Posts: 1200
Joined: 17 Nov 2005, 00:52

Post by trepan »

Additions:

- A countdown timer (host can reset)

- Host can change the timer, radius, metal, and energy levels
on the fly (units are removed in reverse chronological order for
resource adjustments)

- Build buttons show the number of units of their type that could
be built with the remaining resources

- On-screen display of remaining resources, players that are
ready, the deployment radius, and the timer (probably player
countries too)

I'll probably package this into a mod mutator for folks to try. This
method also has the advantage of letting players know what they
are getting into before joining a battle.
User avatar
Guessmyname
Posts: 3301
Joined: 28 Apr 2005, 21:07

Post by Guessmyname »

niiiiiice...
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

Lua missions can also eb sued as start scripts.

Theres a tag in script.txt that allows the lobby to specify a start script to go long with the battle. Thus allowing game modes other than fixed/random/choose ingame using lua.

This way capture the flag or commander respawn type games are possible. It doesnt require lua mod rules, and its a choice for the user, not a part of the game mechanics the modder sets up.

The onyl obstacle so far has been betalord nto adding support to the lobby and server.
User avatar
1v0ry_k1ng
Posts: 4656
Joined: 10 Mar 2006, 10:24

Post by 1v0ry_k1ng »

so its pick armies of certain sizes then duke it out?
wouldnt it be just as easy to have a single factory for a commander that can build anything instantly but has finite resources?
imbaczek
Posts: 3629
Joined: 22 Aug 2006, 16:19

Post by imbaczek »

ivory: There's that 'Ready' button issue.
trepan
Former Engine Dev
Posts: 1200
Joined: 17 Nov 2005, 00:52

Post by trepan »

AF
How would you implement the deployment feature with a start-script?
User avatar
Guessmyname
Posts: 3301
Joined: 28 Apr 2005, 21:07

Post by Guessmyname »

1v0ry_k1ng wrote:so its pick armies of certain sizes then duke it out?
wouldnt it be just as easy to have a single factory for a commander that can build anything instantly but has finite resources?
If that unit was a factory units would have to exit it before the next could be built. Thus, not instantaneous. Plus, with the number of units present in the mod I was thinking of, a factory's buildmenu would have over ten pages at least. The user would have to flick between them, causing more delay. All the units would also be around said factory, not deployed were the user wants from the get go (not all deployable stuff would necessarily be mobile)

If the unit was a mobile / nano-tower unit that built stuff where the user wanted, because of Spring's oh-so-smart pathfinding, it would still try to move closer to the place the thing it's build is. More delay. The buildmenu issue would also still be in effect.
trepan
Former Engine Dev
Posts: 1200
Joined: 17 Nov 2005, 00:52

Post by trepan »

Current Setup:
Image

The green numbers in the lower left corner of the buildpics are the number
of units for that type. The yellowish numbers in the upper right corner of the
buildpics are the number of units that can still be created of that type (based
on maxUnit, maxMetal, and maxEnergy).

All build units have a Delete command (not shown in the screen shot). The
Delete command is bound to the "stop" action, so you can use whatever key
you have bound to the normal Stop command to delete units.
User avatar
1v0ry_k1ng
Posts: 4656
Joined: 10 Mar 2006, 10:24

Post by 1v0ry_k1ng »

sweet. SOMEONE MAEK A MOD!
User avatar
Guessmyname
Posts: 3301
Joined: 28 Apr 2005, 21:07

Post by Guessmyname »

I have a mod for use with this, just need the code and up-to-date dev version of Spring first before fitting them all together
trepan
Former Engine Dev
Posts: 1200
Joined: 17 Nov 2005, 00:52

Post by trepan »

This can be used with any mod, the code does not currently have any
mod specific unit names. The default setup is to load the available builds
with everything that the commander can build, and everything that the
commander's builders and factories can build (so Tech Level 1). This can
be customized for a mod with little effort.

The maxUnits, maxMetal, maxEnergy, and maxTime defaults can be
changed be editing the defaults (a no brainer). The host can also change
all of these parameters in game using the .deploy command.

I'll probably be releasing the code as a mutator for BA47 once it's done.
Then you can just copy the LuaRules/ code into your mod, make a few
simple edits, and you're good to go.
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

Ironically similar to the way you did it.

I'd have a metal and energy bar, a paralysed commander and I'd let the user plonk down virtual units, then when the game starts theyd all spawn and off you'd go. Or they'd be actual units that're paralyzed like yours.
User avatar
Shadowsage
Posts: 73
Joined: 01 Dec 2005, 05:50

Post by Shadowsage »

Why am i reminded of Metal Fatigue?
Cainen
Posts: 22
Joined: 11 May 2007, 23:18

Post by Cainen »

You weren't the only one to be reminded of it; this sounds almost exactly like the prebuild time in MF, though it doesn't look like it has the tech limits of that. However, MF was extremely clunky and did many things much worse than the things it did right.

Also, I'd suggest having a slightly different approach to that, one more like MF: if it's possible, read the resource limit that's set upon the game's start and take the resources from that, rather than giving you free resources; in MF, you could hold onto your metajoules so you could tech up earlier than you would be able to otherwise, or you could build an instant anti-rush.
User avatar
Erom
Posts: 1115
Joined: 25 Apr 2006, 05:08

Post by Erom »

Metal Fatigue wrote:metajoules
The most ridiculous psuedoscience name for a resource ever conceived!
Post Reply

Return to “Lua Scripts”