What i've been up to

adamspurgin

L1: Registered
Mar 22, 2010
42
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:

nik

L12: Fabulous Member
Aug 14, 2009
987
564
snark is going to looooove you
 

Impulse

L2: Junior Member
Nov 1, 2009
51
18
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.
 

Draco18s

L9: Fashionable Member
Sep 19, 2009
622
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.
 

Draser

L3: Member
May 17, 2010
144
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?
 
Jan 20, 2010
1,317
902
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?

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.
 

martijntje

L8: Fancy Shmancy Member
Aug 2, 2009
539
334
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.
 

grazr

Old Man Mutant Ninja Turtle
aa
Mar 4, 2008
5,441
3,814
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:

adamspurgin

L1: Registered
Mar 22, 2010
42
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.
 

Tapp

L10: Glamorous Member
Jan 26, 2009
776
215
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.
 

Draco18s

L9: Fashionable Member
Sep 19, 2009
622
136
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.

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.
 

adamspurgin

L1: Registered
Mar 22, 2010
42
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
Cub62.png


x <- a+b+c
szZyB.png


x <- a+b*(c+d)
3wBIH.png
 
Last edited:

Draco18s

L9: Fashionable Member
Sep 19, 2009
622
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).
 

adamspurgin

L1: Registered
Mar 22, 2010
42
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.