Ambrosia Garden Archive
    • New counter method


      There are a couple of counter methods available using ncbs and crons, but under certain circumstances, using outfits and crons may consume fewer resources. For anything counting to 5 bits or more, this may prove advantageous:

      Simple counter that sets a bit once counter reaches a value 'n'.
      n instances of outfit 2 are granted to set the trigger value
      instances of outfit 1 are used as the counter

      Crons:
      Enable On ... On Start ...... On End ... CIC Entry
      O2 & !b1 ..... D2 G3 G4 .................... Yes ........ Moves total into outfits 3 and 4
      O1 & O3 ...... D1 D3 ........ b1 ........... Yes ........ Compares counter, total in 3 by decrementing until 1 is zero
      !O3 & b1 ..... (trigger) ....................... No ........ If counter>=total then trigger fires
      O3 & O4 ...... G1 G2 D4 ... !b1 .......... Yes ........ If counter<total then total is moved back to outfit 2
      O1 & O3 ...... D1 D3 ......................... Yes ........ Sets counter back to pre-calc status

      Post hold off or duration should probably be set to 1 to make sure it works right.

      Using 5 crons, 4 outfits and 1 bit you can run a counter up to whatever value the outfit limit is (16 bits?).

      If the counter was to be run multiple times, an additional cron would be required:
      Enable On ... On Start ...... On End ... CIC Entry
      !O3 & O4 ..... G2 D4 ......................... Yes ........ Rezeroes 4 and restores the total in 2

      Of course, entering a number of any size would be a pain. Sticking in a thousand instances of outfit 2 wouldn't be fun. Could be achieved using another pair of cron and mission that advances the time by y days:
      Enable On ... On End ...... CIC Exit ... Duration
      !b0 .............. b0 ............. No ........... y
      !b0 .............. G2 * x ....... No ........... 0
      These would grant x * y instances of outfit 2.

      1. For a low pre-set or high generated, single use counter: 5 crons, 4 outfits, 1 bit
      2. For a low pre-set or high generated, multiple use counter: 6 crons, 4 outfits, 1 bit
      3. For a high pre-set, single use counter: 7 crons, 4 outfits, 2 bit, 1 misn
      4. For a high pre-set, multiple use counter: 8 crons, 4 outfits, 2 bit, 1 misn

      Method 4 would seem to be generally the most useful and is superior to the ncb counter method for values of 64 or higher if crons are a scarcity.

      ------------------
      (url="http://"http://homepage.mac.com/jonathanboyd/evn/index.html")Classic4Nova plug-in(/url)

    • You have way too much time on your hands, Jonathan. Way too much time.

      I'm sure I'll be able to find a use for this, though. It might just take awhile. But the resource count is indeed attractive.

      Of course, when I do find a way to use it, I won't say so, until someone else says "I have a cool idea!", whereupon I can say, "I already did that!", and ruin their day.

      ------------------
      ~Charlie
      Sephil Saga Homepage: (url="http://"http://www.cwssoftware.com")www.cwssoftware.com(/url)

    • Quote

      Originally posted by Masamune:
      **Of course, when I do find a way to use it, I won't say so, until someone else says "I have a cool idea!", whereupon I can say, "I already did that!", and ruin their day.

      **

      Oh, poor Az.
      Anyway, I can't believe you figured that out. Amazing.

      ------------------
      ((Ż'ˇ.¸(Ż'ˇ.¸Ť•-KAME-•ť¸.ˇ'´Ż)¸.ˇ'´Ż))
      I used to jog but the ice kept falling out of my glass.
      (url="http://"http://www.0three0.net/l-1551/")L 1551(/url) - The official site of RONIN and The Way and the ten thousand things

    • This is really clever.
      How do you get all those crons to run in order? Just thier RID order?
      I do worry about the effect on proformance of having even a few of these counters running. Does it cause any noticible delay when you have counters that start at like 1000 like you gave an example of? If the delay isnt a problem, then this is a real win for large counters.
      NCB counters still have an advantage for applications in which you need different things responding to different values (ie, where A would only happen if counter>5, and b would only happen if counter>8 etc), unless i am missing some way to expand on the Boyd Outfit Counter.
      -Az

      ------------------
      It is here. EVNEW Public Beta (url="http://"http://www.aznt.com/EVN/EVNEW")www.aznt.com/EVN/EVNEW(/url)
      Stuffit is a piece of .sit.

    • Quote

      Originally posted by Azratax2:
      This is really clever.
      How do you get all those crons to run in order? Just thier RID order?

      The way they're set up, the only conflict is between the 2nd and 5th crons, but I think Nova runs them in RId order, so by the time the 2nd has finished running, the criteria no longer exist for the 5th to run. I could guarantee it by chucking in another bit.

      Quote

      I do worry about the effect on proformance of having even a few of these counters running. Does it cause any noticible delay when you have counters that start at like 1000 like you gave an example of? If the delay isnt a problem, then this is a real win for large counters.

      Good question. I haven't tried yet, but it's only going to run once a day at most. Should try it out some time.

      Quote

      **NCB counters still have an advantage for applications in which you need different things responding to different values (ie, where A would only happen if counter >5, and b would only happen if counter>8 etc), unless i am missing some way to expand on the Boyd Outfit Counter. **

      The Boyd Outfit Resource Counter, or BORC for short is capable of doing this as well with a few tweaks. Basically you run 2 BORCs, sharing some of the resources. The BORC BORC setup would be:

      Enable On ............ On Start ...... On End .. CIC Entry
      O2 & !b0 .............. D2 G3 G4 ................... Yes ........ Moves total into outfits 3 and 4
      O1 & O3 ............... D1 D3 ........ b0 .......... Yes ........ Compares counter, total in 3 by decr until 1 is zero
      !O3 & b0 .............. trigger 1 ..................... No ........ If counter>=total then trigger fires
      b1 & !O3 & O4 ..... G2 D4 ......................... Yes ........ Rezeroes 4 and restores the total in 2
      O3 & O4 .............. G1 G2 D4 ... !b0 .......... Yes ........ If counter<total then total is moved back to outfit 2
      O1 & O3 .............. D1 D3 ......................... Yes ........ Sets counter back to pre-calc status

      O5 & !b0 .............. D5 G3 G4 ................... Yes ........ Moves total into outfits 3 and 4
      O1 & O3 ............... D1 D3 ........ b0 .......... Yes ....... Compares counter, total in 3 by decr until 1 is zero
      !O3 & b0 .............. trigger 2 ..................... No ........ If counter>=total then trigger fires
      b1 & !O3 & O4 ..... G5 D4 ......................... Yes ....... Rezeroes 4 and restores the total in 2
      O3 & O4 .............. G1 G5 D4 ... !b0 .......... Yes ........ If counter<total then total is moved back to outfit 2
      O1 & O3 .............. D1 D3 ......................... Yes ........ Sets counter back to pre-calc status

      Uses double the crons, 1 extra outfit, no extra ncbs, runs off the same counter. It is possible, depending on whether or not a cron can run twice in one day, that 2 crons could be dropped.

      In order to duplicate this using (url="http://"http://www.ambrosiasw.com/webboard/Forum9/HTML/002708.html")Regulus' method(/url) you would simply add a cron for each value you want to check, providing significant resource savings once you start running more than 2 checks. It does, however, have the disadvantage of being a 'equal to only' system i.e. won't trigger for counter values greater than the total you're looking for and isn't very human readable. Though it would be simple enough to program some crons to convert an ncb counter into a quantity of an outfit and vice-versa.

      If you're doing multiple checks on one counter for exactly equal to values and are happy with simply adding 1 each day, then ncb counters rule, resourcewise. If you're looking for greater than or equal checks, running multiple independent counters or need to add more than 1 to your counter each day, then you should be BORCing. Though ncb counters could add more than 1 a day with additional crons. Essentially you'd have 2 sets of bits, 1 representing the counter, another representing the value to be added and then add the two. I think you'd need n(n+1)/2 crons for it. And you still wouldn't get >= checking.

      Interestingly, in order to get certain mathematical operations such as multiplication to work on 1 single day, a combination of ncb counters and BORCing would be required. For instance if we have 2 numbers we want to multiply, each n bits long, but stored as an outfit quantity, we would convert one to a set of bits, then use an additional n+3 crons to perform the multiplication and tidy up. Unfortunately, the conversion seems to be a 2+5(n-2) = 5n-8 cron process at the moment, giving a total of 6n-5 To multiply one 4 bit number by another (not necessarily 4 bit) number, you would need 19 crons.

      I've roughly sketched out a system where you multiply a pair of n bit numbers in an ncb system, allowing for a 2n answer and it scales very unpleasantly, requiring over 6n bits and a large number of n^2 crons, or possibly n^3. Either way, it's messy and as far as I can see, impractical. The only decent way to do multiplication that I can tihnk of is by BORCing an ncb counter.

      ------------------
      (url="http://"http://homepage.mac.com/jonathanboyd/evn/index.html")Classic4Nova plug-in(/url)

    • I think we've seen the beginning of some new Dev Corner slang 😄

      Long live the BORC! Prepare to be assimilated.... </Star Trek Pun>

      And lets not forget the ARNC. I think these terms should now be used exclusively, so that our jargon may in time grow to be impenetrable to outsiders.

      ------------------
      ~Charlie
      Sephil Saga Homepage: (url="http://"http://www.cwssoftware.com")www.cwssoftware.com(/url)

      (This message has been edited by Masamune (edited 01-07-2004).)

    • Quote

      Originally posted by Masamune:
      **I think we've seen the beginning of some new Dev Corner slang:D **

      'Tis a beautiful thing, to witness new life come into the world :^)

      Quote

      **Long live the BORC! Prepare to be assimilated.... </Star Trek Pun>

      And lets not forget the ARNC. I think these terms should now be used exclusively, so that our jargon may in time grow to be impenetrable to outsiders.**

      I think it should be Regulus-Aranor NC B counter, or RANC. or NCB Aranor-Regulus Counters (NARCs). And of course for anything involving the use of ncb counters and BORCs together, such as the methods I've outlined, we will have Boyd Outfit/NCB Calculator or BONC.Collectively, these will be known as BARCs (Boyd/Aaranor-Regulus Counters).

      ------------------
      (url="http://"http://homepage.mac.com/jonathanboyd/evn/index.html")Classic4Nova plug-in(/url)

    • More proof I have way too much time on my hands. Or rather too little incentive to sleep:

      BORC Addition
      Adding two numbers stored as outfit quantities in 1 and 2 and returning the answer as a third quantity in 3:
      Enable On ... On Start ..... CIC Entry
      O1 .............. G3 G4 D1 ... Yes
      O3 .............. D3 G1 ........ Yes
      O2 .............. G3 G4 D2 ... Yes
      O3 .............. D3 G2 ........ Yes

      If you're prepared to put up with destroying your original numbers, it can be done in 1 cron, returning the answer in the quantity of the 1st outfit:
      Enable On ... On Start ..... CIC Entry
      O2 .............. G1 D2 ......... Yes

      BONC Multiplication:
      Multiplying the a number (quantity of outfit 2) by a 5-bit number (quantity of outfit 1) and returning the result in the quantity of outfit 3:

      Setup:
      Get a cron to assign all of these at the start of each day: G15 *16 G14 *8 G13 *4 G12 *2 G11

      Conversion:
      Enable On ... On Start .......... CIC Entry
      O1 .............. G4 G5 G6 D1 ... Yes
      O6 .............. G1 D6 .............. Yes
      O5 & O15 ... D5 D15 ............ Yes
      !O15 ........... b5 D4 *16 ........ No
      O5 & !O15 ... D5 ................... Yes

      O4 .............. G5 G6 G7 D4 .... Yes
      O7 .............. G4 D7 ............... Yes
      O5 & O14 ... D5 D14 ............. Yes
      !O14 ........... b4 D3 *4 ........... No
      O5 & !O14 ... D5 .................... Yes

      O4 .............. G5 G6 G7 D4 .... Yes
      O7 .............. G4 D7 ............... Yes
      O5 & O13 ... D5 D13 ............. Yes
      !O13 ........... b3 D3 *4 ........... No
      O5 & !O13 ... D5 .................... Yes

      D4 .............. b1 D4 ................ No
      O4 .............. b2 ^b1 D4 ......... Yes

      Multiplication:
      Enable On ...................... On Start .......................... CIC Entry
      O2 ................................. D2 G4 G5 G6 G7 G8 G9 ... Yes
      O4 ................................. G2 D4 ............................. Yes
      O5 & b1 ......................... D4 G3 ............................. Yes
      O6 & b2 ......................... D5 G3 *2 ........................ Yes
      O7 & b3 ......................... D6 G3 *4 ........................ Yes
      O8 & b4 ......................... D7 G3 *8 ........................ Yes
      O9 & b5 ......................... D8 G3 *16 ...................... Yes
      O5 | O6 | O7 | O8 | O9 ... D5 D6 D7 D8 D9 ............ Yes

      Requires 14 outfits (2n+4), 5 bits (n), and 26 crons including the setup one (6n-4).

      It's possible that a few more bits might be needed here and there to make sure things run in the right order, but I think it should be fine, especially if the post holdoff is set to 1.

      ------------------
      (url="http://"http://homepage.mac.com/jonathanboyd/evn/index.html")Classic4Nova plug-in(/url)

    • The original BORC counter can be downloaded (url="http://"http://homepage.mac.com/jonathanboyd/evn/BORC_test.sit.hqx")here(/url) now for testing.

      ------------------
      (url="http://"http://homepage.mac.com/jonathanboyd/evn/index.html")Classic4Nova plug-in(/url)

    • Very cool. This could be useful to some of you for (url="http://"http://www.ambrosiasw.com/webboard/Forum9/HTML/004789.html")The mrxak Challenge(/url). If not in this round, then surely eventually in some other round.

      ------------------
      Moderator- (url="http://"http://www.AmbrosiaSW.com/cgi-bin/ubb/forumdisplay.cgi?action=topics&number;=9&SUBMIT;=Go&mrxak;=cool")EV Developer's Corner(/url) | (url="http://"http://www.ambrosiasw.com/cgi-bin/ubb/forumdisplay.cgi?action=topics&number;=69SUBMIT=Go&mrxak;=cool")Uplink Web Board(/url) | (url="http://"http://forums.evula.com/viewforum.php?f=18")mrxak's Assorted Webspace Forum(/url) | (url="http://"http://forums.evula.com/viewforum.php?f=48")Starcraft Forum(/url) | | (url="http://"http://directory.perfectparadox.com/profile.php?id=00008")My Profile(/url) | (url="http://"http://blog.evula.net/mrxak/")My Blog(/url) | (url="http://"http://www.AmbrosiaSW.com/cgi-bin/ubb/postdisplay.cgi?forum=Forum10&topic;=007599-2&whichpost;=mrxak11-06-200203:22PM")mrxak(/url)
      (url="http://"http://www.evula.org/mrxak/")mrxak's Assorted Webspace(/url) | (url="http://"http://www.evula.org/mrxak/Haikus/haikuarchive.html")The Haiku Archive(/url) | (url="http://"http://www.evula.org/mrxak/EV/N/mbspt/mbspt.html")mrxak's Big Secret Plug-in/Tutorial(/url) | (url="http://"http://www.evula.org/mrxak/EV/N/amtc/amtc.html")A mrxak TC(/url) | (url="http://"http://www.ambrosiasw.com/cgi-bin/vftp/dl-redirect.pl/TheChallenge102.sea.bin?path=evn/plugins&file;=TheChallenge102.sea.bin")The Challenge v1.0.2(/url) | (url="http://"http://www.evula.org/mrxak/EV/TmC/TmC.html")The mrxak Challenge(/url)
      (url="http://"http://www.AmbrosiaSW.com/cgi-bin/ubb/search.cgi?action=intro")Search First(/url) | (url="http://"http://www.macgamer.net/games/uplink/")Uplink Guide(/url) | (url="http://"http://www.evula.com/survival_guide/")EV/O/N Guide(/url) | (url="http://"http://www.ambrosiasw.com/cgi-bin/ubb/forumdisplay.cgi?action=topics&number;=31&SUBMIT;=Go")Plug-in Guide(/url) | (url="http://"http://www.AmbrosiaSW.com/webboard/Forum9/HTML/003091.html")Plug-in Testers(/url) | (url="http://"http://www.AmbrosiaSW.com/webboard/Forum9/HTML/003196.html")Developers(/url) | (url="http://"http://www.AmbrosiaSW.com/games/evn/addons.html")Nova Addons(/url) | (url="http://"http://www.resexcellence.com/support_files/resedit.shtml")ResEdit(/url) | (url="http://"http://w00tware.ev-nova.net/")NovaTools(/url)
      "When you burn your bridges, just make sure they aren't in front of you." -mrxak

    • Quote

      Originally posted by mrxak:
      Very cool. This could be useful to some of you for The mrxak Challenge. If not in this round, then surely eventually in some other round.

      The funny thing is that I never bother with them. I only feel creative when there's no end purpose to what I'm doing.

      ------------------
      (url="http://"http://homepage.mac.com/jonathanboyd/evn/index.html")Classic4Nova plug-in(/url)

    • Quote

      Originally posted by Jonathan Boyd:
      **

      BONC Multiplication:

      **

      Woah, what does the BONC stand for?
      -Az

      ------------------
      It is here. EVNEW Public Beta (url="http://"http://www.aznt.com/EVN/EVNEW")www.aznt.com/EVN/EVNEW(/url)
      Stuffit is a piece of .sit.

    • Quote

      Originally posted by Azratax2:
      Woah, what does the BONC stand for?

      Boyd Outfit/NCB Calculator - combines the power of outfit based and ncb counters to do multiplication. It's not feasible with BORCs and RANCs would consume too many resources, but outputting a BORC to ncb form allows for relatively painless multiplication. Probably simpler with a BCCC though

      ------------------
      (url="http://"http://homepage.mac.com/jonathanboyd/evn/index.html")Classic4Nova plug-in(/url)

    • I'm impressed.

      -reg

      ------------------
      "As a rule we believe as much as we can. We would believe everything if only we could."
      ~ William James

    • I've made plugins for a while, but I find this completely incomprehensible. Could you explain it a bit more?

      ------------------

    • Quote

      Originally posted by geek#1:
      **I've made plugins for a while, but I find this completely incomprehensible. Could you explain it a bit more?

      **

      Hehehe... it gets like that sometimes. All these programmer people talking about cröns, and bits and whatever the hell they can make up. It's confusing, eh?

      I think I'll go make some graphics. Anyone care to explain to geek just what the hell you guys said here?

      ~A~

      ------------------
      "How can I make it go faster?" -Me-

    • Heh, you think you have it bad, Azdara. I'm the guy who has to read through these counters, comprehend their purpose, realize how they work, and find a use for them in Retribution :p.

      I'm confused too, and I still need to write the Resistance-Enlightenment string. Sorry, Azdara, but I think you're on your own regarding these counters :).

      ------------------
      Retribution: An Upcoming Plug-in for EVN.
      Visit the (url="http://"http://www.ambrosiasw.com/cgi-bin/ubb/forumdisplay.cgi?action=topics&number;=20&SUBMIT;=Go")Chronicles(/url) today! Be sure to read the short story ' (url="http://"http://www.ambrosiasw.com/cgi-bin/ubb/newsdisplay.cgi?action=topics &number;=20&forum;=*EV/EVO+chronicles&DaysPrune;=100&article;=000262&startpoint;=")Fiery Descent(/url)'!
      (url="http://"http://www.cwssoftware.com")Sephil Saga(/url): An upcoming TC, visit the web page today.| | | Both the best and the worst plug-in editor for Windows! (url="http://"http://www.aznt.com/EVN/EVNEW")EVNEW(/url)!

    • Unfortunately, Jonathan Boyd has been a bit hard to reach lately...

      I understand this counter system, though. Counters in general are simply a means to keep track of the exact value of some number that can't be kept track of in the normal ways. Examples, you might want the player to do exactly 10 cargo missions as part of a string (kind of like the Rebel string in Nova, only that's random)- you could use a counter to keep track of the number of missions you've done, and do something else when you hit 10.

      At the time of this writing, there are 2 counter systems known to work, and a 3rd hypothetical one. The RANC (Regulus-Aranor NCB Counter), which is fully based on NCB's, and works almost exactly like a normal digital counter chip (for people who know how those work!). It starts at zero, and under whatever circumstances you want, increments by 1, and stores the result as a binary number in NCB's.

      This counter, the BORC (Boyd Outfit-Resource Counter), is the other confirmed method. It stores the result as a quantity of outfits. The disadvantage of it over the RANC is that you can only do greater than or equal to checks with the quantity, instead of being able to pull an exact count out at any time. (Jonathan did show a method around that- but it's basically 2+ counters running in parallel). It's advantage is that you can increment it by whatever value you want, and it uses fewer crons for a given capacity.

      Finally, if you skipped over all the tables of Cron values, Jonathan demonstrated using the BORC to do multiplication and addition operations.

      Does that summary help at all? I don't think I could explain the details of the operation any clearer than he has already- just look at each cron for a long time, and try to fathom what it's doing. The picture becomes clear with time.

      ------------------
      ~Charlie
      Sephil Saga Homepage: (url="http://"http://www.cwssoftware.com")www.cwssoftware.com(/url)