What i've been up to

Discussion in 'Mapping Questions & Discussion' started by adamspurgin, Nov 8, 2010.

  1. adamspurgin

    adamspurgin L1: Registered

    Messages:
    42
    Positive Ratings:
    1
    i'm not very active within this community, but i've found you to be the best resource and probably the best place to "release" this project into the wild. i'm looking for input, assistance, whatever you can give really.

    i'm producing a novelty tool at the moment. It won't be useful to some of the more experienced mappers out there, but for the newbies it could help a lot. i've developed an interpreter/converter/compiler (whatever you want to call it) that takes an easy to understand script language and turns it into map entities and connections between them.

    it is not a "language" in the traditional sense, there are no return values, functions, etc... it defines relationships, for example:

    Code:
    number a = 9
    number x = 2
    a <- x +4
    this would generate 2 math_counter entities and set up connections between them so that "a" always equals "x + 4". if "x" changes values, then "a" changes to adapt to the relationship.

    i've worked out the interpreter part, but i would like some help figuring out the entity structures needed as well as any other feature you would like to see. i started working on this a while ago, but i didn't want to say much about it until i got it to the point where i was sure i could get it done.

    i've got the following done:
    • interpreter
    • tentative entity structures for basic math
    • tentative entity structure for conditionals
    • tentative entity structure for loops
    • tentative format for "other" inputs and outputs.


    so, i ask you this:
    1. is there anything you want to see in this pseudo-language? any features, structures, or notation?
    2. how would you represent some of the more common code structures (loops, conditional statements, etc...) with hammer intities?
    3. would this be something you would use or recommend others to use?
     
    Last edited: Nov 8, 2010
  2. nik

    nik L12: Fabulous Member

    Messages:
    987
    Positive Ratings:
    246
    snark is going to looooove you
     
  3. Impulse

    Impulse L2: Junior Member

    Messages:
    51
    Positive Ratings:
    15
    Defiantly going to be useful for people that don't want to take the time to setup these entities and debug them. However i think that this would become just as tedious as doing the work in hammer without a UI, maybe not for large setups, but it will deter many people from the tool and make the user errors more frequent in my opinion.

    Looking great so far and i know the UI will not come util you get the core of what you want done but thats just my 2cents.
     
  4. Draco18s

    Draco18s L9: Fashionable Member

    Messages:
    622
    Positive Ratings:
    136
    This could come in handy. Math entities are a b*tch to set up, though I'd personally like to have something like...

    if(a && b) {
    enable c
    }
    else {
    disable c
    }

    Because I've done stuff like that and ITS NOT EASY. Especially in the higher order logic statements.
     
  5. Draser

    Draser L3: Member

    Messages:
    144
    Positive Ratings:
    12
    im guessing im a newbie considering i don't even know what this is supposed to do. Could someone desribe what this will do in lamands terms?
     
  6. Leminnes

    aa Leminnes

    Messages:
    1,317
    Positive Ratings:
    801
    Draco's example above was a good one. You can set up entities with a code, of sorts, instead of actually having to create all of the logic entities. His example above was: "If A and B are captured, C is enabled." Like Gravelpit. Has a plethora of ways to be used.
     
  7. martijntje

    martijntje L8: Fancy Shmancy Member

    Messages:
    539
    Positive Ratings:
    168
    To be honest I dont have high hopes for this project. I tried doing something like this before, but found that the source eningine was just to limited, many structures require a multiple entities, and there is a limit of 1024 dynamic entities, allowing you to only create very simple structures. It wouldnt be that more diffucult to actually make such structures in hammer. Anyways, ignoring what I said.

    1.
    -A program that will calculate all prime (2,3,5,7,11,13,17, etc. but countinues to run, as long as you have memory)
    -a crashing program. Basicly an infinite loop, something al turing complete languages are capable of.
    -A turing machine interpeter.
    2.
    I would recommend trying to make OR,AND and NOT gates and using trigger_relay to pass on "current" from there consider it a physical computer.
    3.
    No, unless it was highly optimized, wich I dont see hapenning.

    p.s. If you actually succeed in this, you will be the god of all mappers.
     
  8. grazr

    aa grazr Old Man Mutant Ninja Turtle

    Messages:
    5,436
    Positive Ratings:
    3,557
    I guess it depends a lot on the individuals capacity for this trail of thought versus through an already efficient UI.

    Why would someone find this more efficient?

    There's already a lot to some entities so at what point does this become as basic as the UI we're already using?

    Say for instance someone needs to select a specific model from a database, would it have all the names so that the prop_static could use that prop and have settings like no collision etc. If someone is already required to open hammer to build and customise the environment when would someone come out of Hammer to setup the game entities?

    This may or may not help payload setups though...
     
    Last edited: Nov 8, 2010
  9. adamspurgin

    adamspurgin L1: Registered

    Messages:
    42
    Positive Ratings:
    1
    thanks for the feedback, but i suppose i should go into greater detail

    Like I said before, this is probably useless to the more experienced mappers out there. There will almost always be far more efficient ways of implementing the entity structures my program would create. What I am creating is more of a learning experience for me; I have never done anything like this before.

    Everything you can do is separated into 3 parts: triggers, actions, and relations.

    Triggers are things that are constantly being watched/performed. For example:

    Code:
    If (x == y)
    {
    	Activate cp_a
    	Close door_7
    }
    If at any point in time ‘x’ equaled ‘y’, cp_a would be sent the input of “activate” and door_7 would be sent “close”. For now all triggers are number based, I don’t know what you guys all want. So far I am working in open-ended input triggers using the “on” keyword, which would simply remind you that you need to trigger it with something.

    Actions are things that are triggered by a, well, trigger. You can only put these in trigger blocks. There really isn’t too much that’s special about these. With the exception of math operations, it’s not really different than plugging the vmf info in by hand. However, the time saving aspect is in the way it connects it to the trigger you specify.

    Relations are completely numerical (at this point) and serve as ways to combine data, like mentioned above. Out of anything I have done so far, this is the least efficient. I created a generic structure, but as it goes with all things, you can either have it easy or you can have it good. For example, the operation x = y+z would have 3 math_counter entities (x, y, and z) and one logic_relay entity. Between them there would be 4 connections. The operation x<- y+z would have the same number of entities, but there would be 6 connections.
     
  10. Tapp

    Tapp L10: Glamorous Member

    Messages:
    776
    Positive Ratings:
    211
    As good an idea as this project is, I'd have to agree with the pessimists that the source engine is far too limited for this kind of thing. And while tf2 maps generally have less entities than other maps, they need to be broadcasted over the network, which would only cause further issues. To get an idea, I hit the entity limit trying to make a 10x10 maze generator. Coding's gonna take a lot more entities, and if it doesn't take a lot of entities one could just do it themselves.
     
  11. Draco18s

    Draco18s L9: Fashionable Member

    Messages:
    622
    Positive Ratings:
    136
    It was a simplistic example. One of things I was doing in L4D was making randomized paths using wall_toggles. I would chose a random wall (between two) along a row, except the "cell" at the end (which had one wall). Said wall would need to be "open" if all of the other walls didn't allow passage to the next row (in order to create a small, random maze).

    So it was sortof:

    Code:
    if(Math.random() < 0.5) {
       open wall1a
    }
    else {
       open wall1b
    }
    /*repeat for walls 2 through 4*/
    if(wall1a == open && wall2a == open && wall3a == open && wall4a == open) {
       open wall5a
    }
    I was using logic_compare entities that took an additional input when the logic_random opened a given wall and if all of the inputs were the same value, then I would force a compare to get an output to either open (or not open) the last wall.

    On an even more complex front, I had this idea.
     
  12. adamspurgin

    adamspurgin L1: Registered

    Messages:
    42
    Positive Ratings:
    1
    how would you implement a random number generator? the only thing i could think of would be a logic_case with a pickrandom input, but that would be limited to integers and only 16 slots.

    also, this is how i'm planning on setting up my math operations, it's not very efficient, but it works for nearly all cases. can anyone think of a better way? the circle is a logic_relay set to activate on the outvalue from each number, it sends a "getvalue" to the first number, which in turn sets the target variable with its value and sends a "getvalue" to the next variable. the ongetvalue of the next one causes it to do the operation with its value to the target. the way i set it up can handle any situation and should maintain order of operations as defined by the parentheses, what do you guys think?

    x <- a+b
    [​IMG]

    x <- a+b+c
    [​IMG]

    x <- a+b*(c+d)
    [​IMG]
     
    Last edited: Nov 9, 2010
  13. Draco18s

    Draco18s L9: Fashionable Member

    Messages:
    622
    Positive Ratings:
    136
    Well, for what I was doing, I only needed two results, so a logic_case pickRandom was fine.

    For one I did in L4D2 I used up to 8 results (I didn't want any given result to have too low of a probability).
     
  14. adamspurgin

    adamspurgin L1: Registered

    Messages:
    42
    Positive Ratings:
    1
    i've run into a bit of an iceburg buried early on in my code that made it impossible to do some of the things i was aiming for. i still plan to make this work, but it'll take a little longer. i'm going to take more time planning it out so i don't run into this again.