#Custom Level Language Discussion
133 messages ยท Page 1 of 1 (latest)
what do you want to know? ๐
mostly just what inspired it
is it a completely new language or based off an existing one
well its based on my own ideas, but I try not to be different if there isn't a good reason for it
makes sense
however, I am still building it as if it would become its own standalone thing
So no compromises ๐
what do you plan on naming it then?
I think I will name it wrench
lol
I am wondering how the actual level creation will work? is it similar to zachtronics or different
Wrench is because its a simple unassuming, but reliable tool
No you will just write a few functions
ah
Here is what the current level language looks like
this one is very simple and not compiled
its interpreted, which is kind of a hack
what's going on with the random numbers at the top? shouldn't out be based on in?
actually for context, (if this is an ingame level) which level is this?
this is for the bus level
ah that makes a lot more sense lol
in decides which input to read from and out which output you send to
and val1 and val2 are the 2 byte inputs
yeah
nice
so you will basically write a couple of functions like this to create a custom level
it actually seems pretty similar to zachtronics
there also needs to be a way to design the starting layout of the level and a few other things like that
at least TIS and shenzhen
I see
since (and it's been a while since I've made a level in them) you generated an input, and then put that through some algorithm you made in lua to get the output
I might be wrong though
is that a previous version of the language?
or was the one in #general the previous version
No that one is the one that is in the game right now
which I am going to replace
ah
Maybe the syntax looks a bit similar, but they work very differently
the one that is in the game right now took 1 or 2 weeks to make or something like that
from what I understand about the new one (which might be incorrect but hopefully it isn't) it looks pretty cool
thanks ๐
I'm not really an expert at high level languages, only asm
which, kind of a missed opportunity to program the custom levels using an ingame computer lol
anyways gl on the language
do you mean generically typed methods or generic tests?
Here is an example of a generic function
normally you use name types T for some reason
T I assume is short for Type
here generic types are just named starting with $
in c# at least generically typed methods are usually done with angle brackets T my_func<T>(T n)
yeah
from the image in general I assume angle brackets are for arrays/lists?
oh nice
though not very helpful for me since I only recall using an enum once lol
so you struct could be something like this:
{ operating_system :<windows, linux, macos> whateever :int }
don't you have to also assign those values?
above would be a type definition
But actually, you are right in type definitions you actually give the default value, not a type
The way you specify a value of some type is like this :int
For example:
var my_number :int
or
var my_number :int 4
But you can use it anywhere since its actually part of the value
do you mean type of a variable?
yeah for example if you want to make an array of u8 you could do this:
[:u8 1, 2, 3, 4]
because the first item is u8, it figures it out
you could also do this :[u8] [1,2,3,4]
and I'd assume here windows/linux/macos are classes defined elsewhere?
No they are enum identifiers
ok
kind of like variables where windows is equal to 0 etc
yes
so operating_system.windows == 0
no, you actually have to convert it to an int like this: ord(windows) == 0
but the ord() thing isn't done yet
ord = ordinal?
I think I will actually just let you do it like this :u8 windows == 0
will there be an ingame ide for it (hopefully better than the ingame assembler) or will it need to be made outside the game?
wdym, aren't chars normally a primitive type?
when it gets interpreted you should be able to just treat 'a' as 42(?).
no you would need to cast
I mean in the asm
since the processor doesn't distinguish between an int and a char
pointers are also just ints
oh right
but floats are different in hardware
is there even a different type for pointers in HLLs
but your hardware doesn't keep track of what is typed or untyped, and most operations are the same anyway
most high level languages abstract away pointers
ah
they may give you references which are kind of safer pointers
also slightly curious, will the language be interpreted directly to machine code or to another language like LEG or C++?
directly machine code
ah
I want it to be as fast as possible
actually I am going to make your circuits also convert to this language (well not to the text but to some later step in the compilation)
which means level code and your circuit will melt together and be converted to binary and run fast
nice, in that case I'd recommend making it compiled (if possible) since compilation is faster than interpretation, though it may result in a lag spike when hitting the "run fast" button
though I can also see why you wouldn't since I would assume (again I've never written a compiler/interpreter) that compilation would be harder than interpretation
this is a compiler
wait what
oh nvm interpretation was for the current language lol
I mean I didn't do all the optimizations, but I was curious to find out how it all works ๐
I mean if you were rich you could hire millions of people to manually compile it with perfect optimizations
it has to compile every time you change your circuit
ok anyway, better get back to work