Custom Map #2285: [ITEM SHOP] The Credit Card. By: CS Z

Started by AutoPost, September 04, 2021, 10:20:37 PM

Previous topic - Next topic

AutoPost

This topic is for discussion of map #2285: [ITEM SHOP] The Credit Card


Author: CS Z
Size: 128x250

CS Z

Welcome to The Rift Lab Store!

This map features an item shop where the currency is energy generated per second (GEN).  You have to nullify all enemies and eliminate all debt to leave this world.  The Rift Lab Store has everything you need to win...for a price.  Enter and exit the store by pressing the ~ (tilde/backtick) key.  Type the underlined letters/words in to perform the relevant action in each menu.

The ADA message is pretty long but I highly recommend reading it and following the instructions to get started.  I'm attaching a couple of images of what I consider to be a fairly ideal start.  In the first screenshot, you can see a bunch of units in creeper right before selecting "Construct Units Instantly" and "Supply Units w/ Max Ammo".  The second screenshot shows all of the creeper on the two mesas completely cleared in just 3 seconds as well as moving the units to their next location, two more cannons were created and loaded up with ammo and sent down too, eight mortars (fully loaded, of course), and the Factory.

My favorite aspect of this map is that the principal is automatically paid down on a 1/2 second delay in reaction to changes in the average amount of energy in USE.  If there is excess energy, GEN is adjusted to pay down principal but generally not cause a deficit (or only very briefly).  It's really cool to watch a real-world concept like debt and loans play out in real-time in CW4.

The Factory may actually be your most important asset.  You can pay down principal directly with AC, Arg, and Liftic at slightly different exchange rates in the "Manage Finances" menu.  It can be useful when there is too much debt such that there is no available GEN overhead to pay any of it off.

For those who are interested in using this in their own map, the mission script is extremely flexible with all kinds of variables to adjust and also has the code for the menu system.  I tried to balance everything out to be fun and present a variety of options for various playstyles but there is probably room for improvement.

Enjoy!

"Buy now.  Pay later.  Fight creeper!"

Durikkan

That was certainly an interesting map.  The opening is a bit tricky, though part of that is I didn't go into debt enough the first few times.   Died a few times trying to hold the center, before realizing a good way was to start at the resource terrain in the bottom, throwing down a bunch of cannons and laying several miners, and erning them as fast as possible.
I'm known as Auri in cw4.

CS Z

Quote from: Durikkan on September 05, 2021, 12:09:06 AM
That was certainly an interesting map.  The opening is a bit tricky, though part of that is I didn't go into debt enough the first few times.   Died a few times trying to hold the center, before realizing a good way was to start at the resource terrain in the bottom, throwing down a bunch of cannons and laying several miners, and erning them as fast as possible.

Thanks!  Glad you enjoyed it!

I've found the sweet spot to be around 8,000 debt, staying close to about -8.5 GEN/s for a few minutes, and pay off about 2,000 debt before the interest kicks in.

Ago1896


TrickyPlayer

Quote from: Ago1896 on September 05, 2021, 05:46:59 AM
Unable to play the map. No ~ key on my keyboard...
` also works on mine (good luck figuring out what the heck that is called though XD)
When you want an explanation for something I use in my levels, or if you want to suggest something, feel free to tell me. Just don't ask/suggest things every other day please :P

CS Z

Quote from: TrickyPlayer on September 05, 2021, 07:18:10 AM
Quote from: Ago1896 on September 05, 2021, 05:46:59 AM
Unable to play the map. No ~ key on my keyboard...
` also works on mine (good luck figuring out what the heck that is called though XD)

That's called the backtick (Unity calls it a backquote).  On a standard 104-key U.S. QWERTY keyboard, the ~ and ` key are one and the same (usually using Shift to denote which one is being pressed) and is above the Tab key and next to the 1.  In a number of games, that keypress toggles a console for entering commands into the game but is not used by CW4, so I figured it to be a decent choice for this map/game mode.  A number of popular programming languages/shells use ` to launch commands, so it didn't occur to me that the key might not even physically exist on other keyboards.

There's always risk of a keypress conflict with existing keymappings.  I tried to minimize the risk against the CW4 default keymappings since there's no way to let CW4 know that a keypress has been consumed at the 4RPL level while, at the same time, use a key that some gamers might already be familiar with.

If the keyboard in question is a 60% keyboard, Fn + Shift + ESC (or maybe Fn + ESC) might work for emitting the keypress.  On international keyboards without either key, binding ~ to "Right AltGr" + some unused key might work.  There are apps like the "Microsoft Mouse and Keyboard Center" for Win10 that can rebind keyboard keys.  Hopefully that works and Unity picks up the correct keypress.

If key rebinding doesn't work or someone doesn't want to rebind keys and doesn't mind editing some code, edit the "Mission.4rpl" script to select a Unity keypress that is supported on the keyboard.  Editing 4RPL requires configuring CW4 for editing code in a text editor.  Wouldn't be able to post a score, but would at least be able to play the map.  The code in question is:


# Handle switching between typing and regular camera modes.
if (GetKeyDown("BackQuote" false) GetKeyDown("Tilde" false) || <-ugm_showing && IsADAMessageShowing ! &&)


Try replacing the "BackQuote" or "Tilde" with "Slash" or "Semicolon"...but good luck avoiding existing keymappings in CW4 that someone else has set, which is what I was trying to do.

A more permanent solution at the 4RPL level that requires the fewest code changes would be to use the button option of ShowGameMessage() to toggle the menu as well as the ~ hotkey.  But the button is kind of distracting and covers up a bunch of the screen.  Maybe pressing the ~ key the first time makes the button go away.

cornucanis

Quote from: CS Z on September 05, 2021, 10:32:31 AM
Quote from: TrickyPlayer on September 05, 2021, 07:18:10 AM
Quote from: Ago1896 on September 05, 2021, 05:46:59 AM
Unable to play the map. No ~ key on my keyboard...
` also works on mine (good luck figuring out what the heck that is called though XD)

That's called the backtick (Unity calls it a backquote).  On a standard 104-key U.S. QWERTY keyboard, the ~ and ` key are one and the same (usually using Shift to denote which one is being pressed) and is above the Tab key and next to the 1.  In a number of games, that keypress toggles a console for entering commands into the game but is not used by CW4, so I figured it to be a decent choice for this map/game mode.  A number of popular programming languages/shells use ` to launch commands, so it didn't occur to me that the key might not even physically exist on other keyboards.

There's always risk of a keypress conflict with existing keymappings.  I tried to minimize the risk against the CW4 default keymappings since there's no way to let CW4 know that a keypress has been consumed at the 4RPL level while, at the same time, use a key that some gamers might already be familiar with.

If the keyboard in question is a 60% keyboard, Fn + Shift + ESC (or maybe Fn + ESC) might work for emitting the keypress.  On international keyboards without either key, binding ~ to "Right AltGr" + some unused key might work.  There are apps like the "Microsoft Mouse and Keyboard Center" for Win10 that can rebind keyboard keys.  Hopefully that works and Unity picks up the correct keypress.

If key rebinding doesn't work or someone doesn't want to rebind keys and doesn't mind editing some code, edit the "Mission.4rpl" script to select a Unity keypress that is supported on the keyboard.  Editing 4RPL requires configuring CW4 for editing code in a text editor.  Wouldn't be able to post a score, but would at least be able to play the map.  The code in question is:


# Handle switching between typing and regular camera modes.
if (GetKeyDown("BackQuote" false) GetKeyDown("Tilde" false) || <-ugm_showing && IsADAMessageShowing ! &&)


Try replacing the "BackQuote" or "Tilde" with "Slash" or "Semicolon"...but good luck avoiding existing keymappings in CW4 that someone else has set, which is what I was trying to do.

A more permanent solution at the 4RPL level that requires the fewest code changes would be to use the button option of ShowGameMessage() to toggle the menu as well as the ~ hotkey.  But the button is kind of distracting and covers up a bunch of the screen.  Maybe pressing the ~ key the first time makes the button go away.

There are actually a series of mappable custom hotkeys reserved for use with scripts. They're labelled "Custom0" through "Custom9" and can be detected with "GetMappedKey." Using the custom keys might be a lot more reliable in this case, since the user can map it to anything they like.

EricPhail

Could really have done with more redon deposits, or a significantly longer delay on spores/air sacs imo, I hated having to pay fo r supply 1-2 times per cycle

CS Z

Quote from: EricPhail on September 07, 2021, 08:43:02 AM
Could really have done with more redon deposits, or a significantly longer delay on spores/air sacs imo, I hated having to pay fo r supply 1-2 times per cycle

The entire left island area can be dealt with pretty easily:  A line of snipers for the skimmers and blobs.  Spores are easily dealt with by building 4 launchers right outside of the the spore launcher - they go off immediately and spores aren't a threat to the base except for the very first time they fire.

The air sacs are a little bit trickier.  You need about 6 fully loaded launchers + ERN portal distance upgrade + snipers to deal with the orbs they fling to quickly deal with those.  I didn't modify any of the standard placement unit factories, so they only require standard strategies to deal with them.

There is the Redon Booster upgrade, which improves the Redon generation rate.  I never really used it.  An ERN on the Mining ERN portal slot doubles the generation rate, which is sufficient.

During my last playthrough, I was able to get all the way to the edge of the dark tower region in 7 minutes and had the first emitter fully nullified shortly after 4 minutes without losing a single unit.  Getting to the first emitter acquires sufficient Redon from the Redon node to defend against spores and air sacs.  If you aren't getting to the Redon node before the 7 minute clock runs out, then you aren't being aggressive enough on instantly building and powering units.  It might help to realize that as long as you are using the max ammo option, you might as well also instantly construct units.  Max ammo, which includes rift lab storage, is 20% more costly than waiting for energy generation + time to complete for a normally built unit.  That is, you should build units by using instant construction for the first few minutes since it'll cost 20% more energy to build units normally using energy from your rift lab that was put there using the max ammo option.  Once energy generation is self-sufficient, the max ammo option becomes unnecessary and building normally becomes cheaper than instant build.  The only time to use instant construction after that point is to speed up nullifiers and costly units like airships (airship debt is a quite enjoyable endgame option to rapidly clear the left island without having to deal with mesh).  Then it is just a matter of paying down the principal.  Selling AC and Liftic are the fastest pay down mechanisms.