LuaGadgets for discrete income economy ? (I think Gundam had?)

LuaGadgets for discrete income economy ? (I think Gundam had?)

Discuss game development here, from a distinct game project to an accessible third-party mutator, down to the interaction and design of individual units if you like.

Moderator: Moderators

Post Reply
SeanHeron
Engines Of War Developer
Posts: 614
Joined: 09 Jun 2005, 23:39

LuaGadgets for discrete income economy ? (I think Gundam had?)

Post 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 :) !
Google_Frog
Moderator
Posts: 2464
Joined: 12 Oct 2007, 09:24

Re: LuaGadgets for discrete income economy ? (I think Gundam had?)

Post 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.
SeanHeron
Engines Of War Developer
Posts: 614
Joined: 09 Jun 2005, 23:39

Re: LuaGadgets for discrete income economy ? (I think Gundam had?)

Post 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.
SeanHeron
Engines Of War Developer
Posts: 614
Joined: 09 Jun 2005, 23:39

Re: LuaGadgets for discrete income economy ? (I think Gundam had?)

Post 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 :P.

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 :P ).
User avatar
Beherith
Posts: 5145
Joined: 26 Oct 2007, 16:21

Re: LuaGadgets for discrete income economy ? (I think Gundam had?)

Post 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
SeanHeron
Engines Of War Developer
Posts: 614
Joined: 09 Jun 2005, 23:39

Re: LuaGadgets for discrete income economy ? (I think Gundam had?)

Post by SeanHeron »

Thanks for the pointer. I'll look into it :) !
Google_Frog
Moderator
Posts: 2464
Joined: 12 Oct 2007, 09:24

Re: LuaGadgets for discrete income economy ? (I think Gundam had?)

Post 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.
Google_Frog
Moderator
Posts: 2464
Joined: 12 Oct 2007, 09:24

Re: LuaGadgets for discrete income economy ? (I think Gundam had?)

Post 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.
User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6240
Joined: 29 Apr 2005, 01:14

Re: LuaGadgets for discrete income economy ? (I think Gundam had?)

Post 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.
SeanHeron
Engines Of War Developer
Posts: 614
Joined: 09 Jun 2005, 23:39

Re: LuaGadgets for discrete income economy ? (I think Gundam had?)

Post by SeanHeron »

Nice :)!

Wasn't expecting anything on this front anymore :P.

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

Return to “Game Development”