Knuckle Cracker

Creeper World 3 => The Coder's Corner => Topic started by: GoodMorning on June 05, 2016, 05:53:40 AM

Title: Finite energy map.
Post by: GoodMorning on June 05, 2016, 05:53:40 AM
Hello again,

I was wondering if there's a non-(CRPLed Guppy) way to produce a finite energy source? I was thinking of a map similar to the recent "walking dead" one, but making ll resources, including energy, finite. Thus the player must grab the loot lying around. Possibly this will take a while to extract, as well. I wanted to avoid Guppies, as the base will be vulnerable, and they auto-return to it, but I can't figure out a way to stop CNs from making power, or to stop Guppies trying to fly away if, say, you run out of AC (which would not be a losing condition, just a handicap until you found some more Ore). I also recall it being impossible to make proper packet dispatchers purely with CRPL.

Any ideas? Or will I just have to put up with Guppies?
Title: Re: Finite energy map.
Post by: J on June 05, 2016, 07:37:37 AM
Guppies and CNs are the only things that can dispatch energy packets. So other creating your own energy infrastructure, guppies are your only option.
Title: Re: Finite energy map.
Post by: Builder17 on June 05, 2016, 07:54:13 AM
Could you explain it more clearly , I didn't get your idea.  :(
Title: Re: Finite energy map.
Post by: mthw2vc on June 05, 2016, 09:31:41 AM
An alternative might be a CRPL'd structure eating exactly a CN's natural supply rate, with a loss condition if it runs out of energy.


$MAX_ENERGY:10.0
$CONSUMPTION_PER_FRAME:0.05

once
  self CONST_MAXAMMO <-MAX_ENERGY setUnitAttribute
  self CONST_AMMO    <-MAX_ENERGY setUnitAttribute
  self CONST_CONNECTABLE    true setUnitAttribute
  self CONST_CANREQUESTAMMO true setUnitAttribute
  self CONST_REQUESTPACKETS true setUnitAttribute
  self CONST_PACKETREQUESTDELAY 1 setUnitAttribute
  self CONST_COUNTSFORVICTORY false setUnitAttribute
  self CONST_NULLIFIERDAMAGES false setUnitAttribute
endonce

self CONST_AMMO self CONST_AMMO getUnitAttribute
dup <-CONSUMPTION_PER_FRAME lt if
  failMission
  endif
<-CONSUMPTION_PER_FRAME sub setUnitAttribute


That should do the trick for one CN.

EDIT: I guess practically, the structure should also be indestructable and irrelevant to victory. Don't be too surprised if there are other details that hinder your application that I'm too lazy to think of right now! :)
Title: Re: Finite energy map.
Post by: Builder17 on June 05, 2016, 09:48:12 AM
I got new map idea from your script.  :o
Title: Re: Finite energy map.
Post by: mthw2vc on June 05, 2016, 09:54:38 AM
In case anyone wonders, I adapted this idea from the (seriously cool) CW1 map Temple of Moloch (http://knucklecracker.com/creeperworld/mapcomments.php?id=3572). Also, I slightly modified the above script and added a disclaimer right after you posted, just so you know.
Title: Re: Finite energy map.
Post by: Sorrontis on June 05, 2016, 11:00:23 AM
Can I take it too? It's noice!
Title: Re: Finite energy map.
Post by: mthw2vc on June 05, 2016, 12:54:36 PM
Use it how you like, but please give credit where credit is due.
Title: Re: Finite energy map.
Post by: Sorrontis on June 05, 2016, 01:16:40 PM
Quote from: mthw2vc on June 05, 2016, 12:54:36 PM
Use it how you like, but please give credit where credit is due.

Always! You're handle is "mthw2vc" ?
Title: Re: Finite energy map.
Post by: GoodMorning on June 05, 2016, 09:50:04 PM
Slight issue: the CN tries to distribute packets evenly. Therefore, having two units, only one of which is allowed to run out of power, means either micromanagement or never getting a deficit.

I think I'll have to use the "GUPPYAIR" and protect the base. The idea is that all, or almost all, resources are scattered in deposits around the map, and must be extracted. So, you will have chronic energy problems, and using a CN will result in a constant deficit.

Therefore, using something like the "nuclear core" in Kalek's" The 8th Passenger" will result in certain doom.

Builder17: Imagine that all resources, even packets, are finite. You are given a small number of units, and must work your way around the map, gathering resources and battling Creeper and CRPL. Possibly a "Fog of war" could also turn up. Perhaps a few production facilities might appear, but these will be few and far between, and require you to go back to collect the resources. Perhaps you are trying to salvage components for a ship to get you out of there. In any case, every packet counts, and there are only so many, so you can't just leave a PC or Mortar to "hold the fort" indefinitely. I don't think I will allow units to be built either, you must find what you will use.
Title: Re: Finite energy map.
Post by: mthw2vc on June 06, 2016, 11:23:58 AM
Quote from: GoodMorning on June 05, 2016, 09:50:04 PM
Slight issue: the CN tries to distribute packets evenly. Therefore, having two units, only one of which is allowed to run out of power, means either micromanagement or never getting a deficit.
I assumed for a finite energy map, something to the effect of all energy resources on the map being obtained via siphons, and running a deficit in that case is pretty much equivalent to running out of (non-replenishable) reserve energy. While winning with no energy left isn't necessarily completely impossible, I don't think it's worth worrying about from the perspective of creating a finite-energy map. You can also raise the MAX_ENERGY parameter if you want to allow somewhat greater leeway for this kind of thing.

I tried writing up another script to directly subtract energy from the CN reserves, which would be a little cleaner from that perspective, but it looks like CONST_AMMO is read-only for command nodes.