Jump to content


SDF Logic

Development Request for Comments Feature BoE

  • Please log in to reply
2 replies to this topic
sylae sylae

Wisebottom

  • Global Moderator
    • Member ID: 5,482
  • 3,336 posts
  • LocationPortland, Oregon, United States

Posted 10 April 2014 - 11:00 PM #1 SDF Logic

We should have some nodes to do quick and dirty arithmetic and logic checks.

For all the following, Stuff Done Flags is the result, Extra 1x is Input A, and Extra 2x is Input B.

  • SDF_ADD: Add SDF A and SDF B, store the result in Stuff Done Flags (A+B)
  • SDF_SUB: Subtract SDF A into SDF B, store the result in Stuff Done Flags (A-B)
  • SDF_MULT: Multiply SDF A and SDF B, store the result in Stuff Done Flags (A*B)
  • SDF_ADD: Devide SDF A into SDF B, store the result in Stuff Done Flags, rounded down (floor(A/B)
  • SDF_POW: Raise SDF A by SDF B, store the result in Stuff Done Flags (A^B) (will SDF limits be a concern?)

All of the following assume 0 or -1=FALSE, any other =TRUE

  • SDF_AND: Logical AND
  • SDF_OR: Logical OR
  • SDF_NOT: Logical NOT (ignoring SDF B)
  • SDF_NAND: Logical NAND
  • SDF_NOR: Logical NOR
  • SDF_XOR: Logical XOR
  • SDF_XNOR: Logical XNOR

With a bit of elbow grease this could allow designers to implement some logic beyond what we have now.

Celtic Minstrel Celtic Minstrel

Eye of Avadon

  • Global Moderator
    • Member ID: 5,296
  • 3,891 posts

Posted 12 April 2014 - 03:06 PM #2 SDF Logic

Definitely agree, with one exception: I doubt we need logical XOR or XNOR. Actually, logical XNOR already exists - it's called "SDF Equal". :p (I suppose it could differ in treating the SDFs as boolean instead of numeric...)

I expect the SDF limit can be dropped entirely, but I'm not sure your logic of where to store the result is good. Why not just use the "pic" field for the result SDF?

EDIT: Sorry, "pic" is one field and SDFs need two. Maybe the "message" fields, then. That said, I guess it doesn't particularly matter.
Exile 2 Book of Items (I didn't create it, I just converted it to HTML.)

"Man, I know how you feel. I once spent an hour playing WordPad before realising that it was a text editor." – Thuryl

"Dikiyoba just hopes no one ever blows up Saturn. Getting those rings back into their proper position would take hours."

"—Alorael, who spells phoenetically. No matter how much his orthography is a wreck, intelligibility rises from the ashes."

"I've never played a Spiderweb game. I didn't even know SW made games until I saw this thread." —Nikki

Celtic Minstrel Celtic Minstrel

Eye of Avadon

  • Global Moderator
    • Member ID: 5,296
  • 3,891 posts

Posted 09 December 2014 - 12:23 PM #3 SDF Logic

Thinking over this again, I think logical AND and OR are completely unnecessary - can't you get the same effect by simply chaining nodes together in the right way?

The arithmetic ones I'm currently in the process of adding. They'll probably work like this:

SDF1, SDF2 - Output SDF (for division, the quotient)
Ex1a, Ex1b - Input SDF (left operand) - if ex1b is negative, takes ex1a as a literal value
Ex2a, Ex2b - Input SDF (right operand) - if ex2b is negative, takes ex2a as a literal value
Ex1c, Ex2c - For division only, output SDF to store the remainder.

EDIT: Note - due to the implementation of pointers, the only guaranteed way for ex1a or ex2b to be negative would for it to have been set to -1; other values might get replaced by pointed-to values.
Exile 2 Book of Items (I didn't create it, I just converted it to HTML.)

"Man, I know how you feel. I once spent an hour playing WordPad before realising that it was a text editor." – Thuryl

"Dikiyoba just hopes no one ever blows up Saturn. Getting those rings back into their proper position would take hours."

"—Alorael, who spells phoenetically. No matter how much his orthography is a wreck, intelligibility rises from the ashes."

"I've never played a Spiderweb game. I didn't even know SW made games until I saw this thread." —Nikki





Also tagged with one or more of these keywords: Development, Request for Comments, Feature, BoE

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users