Page 1 of 1
LuaGadgets for discrete income economy ? (I think Gundam had?)
Posted: 26 Nov 2021, 09:43
by SeanHeron
Ok, I'm starting to notice that quite a bit of stuff does happen in the span of 10 years ...
I'd like to make a mock up for a game concept I have. I want fixed /discrete income (+spending) (ie like in C&C or Starcraft, not continous income as is default in the Spring Engine).
iirc, Gundam had this, so I would have used that, but Smoth seems to have retracted the game (and I don't wager there is a GadgetDB anywhere in use).
Anyone know if any other game had this? I thought Evolution RTS maybe, but I was wrong there. Conflict Terra or The Cursed maybe?
Regards, Sean
P.S. If I want to move forward I probably need to build up on it so much I could implement it from scratch of course, but for a mock-up it would be nice to just reuse something :) !
Re: LuaGadgets for discrete income economy ? (I think Gundam had?)
Posted: 28 Nov 2021, 10:09
by Google_Frog
This is pretty easy to do but involves a few steps and systems (command handling, resources, etc...). Most of the steps are pretty generic so exist in a few games already. I don't have time to lay out all the steps now though. A discussion seems easier. The most active place for stuff like this is probably #modding on the ZK discord. It is bridged to the ZK server too. If you ask around there you should find people to provide guidance, and I'm likely to comment on things too.
Re: LuaGadgets for discrete income economy ? (I think Gundam had?)
Posted: 01 Dec 2021, 09:53
by SeanHeron
Thanks Google-Frog :).
I will be landing at the Zero-K Modder's scene I guess (certainly sounds like a good idea), as soon as I start rolling on this.
Still would have been nice to have something working just to do some trial runs :). I guess I'll try to ask Smoth.
Re: LuaGadgets for discrete income economy ? (I think Gundam had?)
Posted: 10 Dec 2021, 12:19
by SeanHeron
Looks like Confict Terra had this:
https://github.com/spring-archive/confl ... mining.lua
Though getting that to run (even on the engine it was intended to run with) will be a challenge in and of itself

.
Guess I'll just go with continous resources for the mockup (maybe insta-build, and paralyse for the duration till its supposed to be "done". Lets see

).
Re: LuaGadgets for discrete income economy ? (I think Gundam had?)
Posted: 10 Dec 2021, 18:44
by Beherith
You could make everything cost 0, and just tie the start of construction to allowcommand, would probably be less hacky than paralyze, and youd get all the advantages of stuff under construction
Re: LuaGadgets for discrete income economy ? (I think Gundam had?)
Posted: 11 Dec 2021, 08:41
by SeanHeron
Thanks for the pointer. I'll look into it :) !
Re: LuaGadgets for discrete income economy ? (I think Gundam had?)
Posted: 20 Dec 2021, 03:58
by Google_Frog
Yes, something like AllowCommand is part of it.
I think Beherith is suggesting:
- Give units zero energy and metal cost.
- Subtract the unit cost on AllowCommand, if the resources exist, otherwise don't allow the command.
- Use Spring's nanoframe construction system.
- Give refunds if the unit is cancelled.
This is a quick and easy way to do something close to what you want. But this isn't the only way. This is why you've got to poke around code and ask specific questions. As you explore the systems I expect what you want to be refined and revised.
If I were to make a Starcraft production system I'd probably barely use the engine. Starcraft production is just such a straightforward algorithm. There isn't any heavy lifting to send to Spring.
- Use AllowCommand to detect commands sent to the factory.
- Use GameFrame to update the status of the factory.
- There is a callout to use resources, and to attempt to use resources and return whether they were used successfully. But resources are just a number that can easily be reimplemented if all you want is a Starcraft system.
- Use the callout CreateUnit to create units as appropriate.
Re: LuaGadgets for discrete income economy ? (I think Gundam had?)
Posted: 20 Dec 2021, 04:00
by Google_Frog
Yes, something like AllowCommand is part of it.
I think Beherith is suggesting:
- Give units zero energy and metal cost.
- Subtract the unit cost on AllowCommand, if the resources exist, otherwise don't allow the command.
- Use Spring's nanoframe construction system.
- Give refunds if the unit is cancelled.
This is a quick and easy way to do something close to what you want. But this isn't the only way. This is why you've got to poke around code and ask specific questions. As you explore the systems I expect what you want to be refined and revised.
If I were to make a Starcraft production system I'd probably barely use the engine. Starcraft production is just such a straightforward algorithm. There isn't any heavy lifting to send to Spring. This isn't code golf, ie, I wouldn't approach this problem with the mindset of using inbuilt Spring things as much as possible. A whole Starcraft economy seems pretty simple to write and light to run. It would look like this:
- Use AllowCommand to detect commands sent to the factory.
- Use GameFrame to update the status of the factory.
- There is a callout to use resources, and to attempt to use resources and return whether they were used successfully. But resources are just a number that can easily be reimplemented if all you want is a Starcraft system.
- Use the callout CreateUnit to create units as appropriate.
Re: LuaGadgets for discrete income economy ? (I think Gundam had?)
Posted: 09 Mar 2022, 20:52
by FLOZi
For the ghosts of christmas yet to come:
MCL has a discrete implementation, after a kind, hacked into metal and energy.
https://github.com/SpringMCLegacy/Sprin ... income.lua
Deals with income, mostly through killing and damaging enemy units, as well as 'insurance' payouts for losing your own.
https://github.com/SpringMCLegacy/Sprin ... tposts.lua
Controls purchasing of 'base' buildings
https://github.com/SpringMCLegacy/Sprin ... pships.lua
Actually spawns and controls the ships that deliver all base buildings and combat units.
https://github.com/SpringMCLegacy/Sprin ... opZone.lua
Controls the actual purchasing of units.
It is indeed all done mostly in AllowCommand and CommandFallback callins.
Re: LuaGadgets for discrete income economy ? (I think Gundam had?)
Posted: 11 Mar 2022, 10:09
by SeanHeron
Nice :)!
Wasn't expecting anything on this front anymore

.
For one of the two factions, I want "ship" (actually plane / Airdrop) delivery anyhow, so this sounds perfect!