Easy programming 'language' for all - concept and discussion

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
User avatar
ArchAngel075
Party member
Posts: 319
Joined: Mon Jun 24, 2013 5:16 am

Easy programming 'language' for all - concept and discussion

Post by ArchAngel075 »

So for a game concept I'm coming close to showing off the beginnings of, i need to allow users to 'program' AI of units individually.

The goals that i set myself is :
  • DOES NOT require programming knowledge.
  • CAN have (and would benefit from) pre-coded helper functions that can be used to perform basic tasks
    Most programmers would know how to use loops - but not the average user. IF the pre-coded functions provide ways of performing commonly performed tasks that would use loops then that would be great.
    one example is say unit A has a inventory of items. the user wants to get all food from the inventory. instead of using a for loop coded themselves a globally exposed function called 'GetItems(from,ofType)' could do the iteration and such for the user.
    Naturally these global-functions would not be made if experenced coders used say a raw-code system, but average joes and janes can easily benefit from them.
  • Variables made easy
    Essentially i have a variables class that allows you to save values to a key in a table. I use this in my AI system atm to set and get flags and values I want AIs to interact with. For instance unitA could wish to get unitBs 'isHarvesting' flag for some reason or other?
    [===========================================]
This goals will be expanded as needed though after the [===] break to set aside the initial goals and new discovered goals

My concept at the moment is inspired alot by the Warcraft 3 map editor - and i have a slowly wip concept here

I am wondering what are other peoples glancing ideas on attempting such a AI coding system?
What recommendations would users like to see?
What issues and concerns do users have based on the existing concept above and the goals etc?

I am stumped on the approach but would love to see a implementation beyond simply exposing a text editor in game for pure lua coding of AI.
MasterLee
Party member
Posts: 141
Joined: Tue Mar 07, 2017 4:03 pm
Contact:

Re: Easy programming 'language' for all - concept and discussion

Post by MasterLee »

If it come for functions that could be useful, simple steal from OpenClonk they did the think you are looking:
http://wiki.openclonk.org/w/C4Script_Documentation
but use LUA instead of C4Script. When LUA still is too difficult try something similar to Blockly.
User avatar
Beelz
Party member
Posts: 234
Joined: Thu Sep 24, 2015 1:05 pm
Location: New York, USA
Contact:

Re: Easy programming 'language' for all - concept and discussion

Post by Beelz »

Trainsported was a cool game that used programmable AI to complete challenges or "battle" your trains online. I highly recommend checking it out.

Code: Select all

if self:hasBeer() then self:drink()
else self:getBeer() end
GitHub -- Website
User avatar
raidho36
Party member
Posts: 2063
Joined: Mon Jun 17, 2013 12:00 pm

Re: Easy programming 'language' for all - concept and discussion

Post by raidho36 »

There's one major meta-flaw with all of those "does not require programming knowledge" languages - they are used by people with no programming knowledge, and conversely with no understanding of how to issue instructions to a computer. Invariably, result is a software that took long time to create (because instead of simply typing in commands, you have to navigate across graphical menus), is exceedingly simple (because that's the extent of what one can program without being a programmer) and is just barely able to run without crashing constantly (because that's the level of software quality you can expect from someone who's not a programmer).

As such, producing a "programming interface" that requires no knowledge of programming is a futile endeavor. It's single purpose -to enable non-programmers to create programs- leaves them with software in such a state that they'd be better off putting all that time and effort elsewhere and instead ask a competent programmer to do it.

Having that said, if "just barely runs" is acceptable level of quality for you, and you intend to leverage such unskilled programming by paying pennies to said unskilled "programmers", then sure enough there is a point in making such tools.
User avatar
zorg
Party member
Posts: 3444
Joined: Thu Dec 13, 2012 2:55 pm
Location: Absurdistan, Hungary
Contact:

Re: Easy programming 'language' for all - concept and discussion

Post by zorg »

It's also kind of an oxymoron if you think about it, and besides, the person still needs to learn a dialect, and you kinda did actively sabotage them of learning something decent, with forcing them to learn something tacked-together.

Also, i'm of the mindset that people should rather learn generic terms and stuff instead of concretes (at first, at least), and this isn't just in terms of programming; many people (especially elders, but some younger ones too) panic even at the simple fact that a (Desktop /) Window Manager differs in the most minute of details from another, one that they probably learned. Same with proglangs though, teach them basics, math, addition, subtraction, mul, div, modulo, functions, arity, a basic 1D memory model, the fact that memory access might allow arithmetic in some languages, (e.g. why a[ i ] and i[ a ] in C points to the same location*), the notion of variables and constants (at least the theory of them)...
tl;dr This might lead to a "one-trick pony" (opposite of "jack of all trades..." is my intent here) mentality bubble one probably can't break out of, in many cases.

Another negative for this is the following "rule":
"Greenspun's Tenth Rule of Programming: any sufficiently complicated C or Fortran program contains an ad hoc informally-specified bug-ridden slow implementation of half of Common Lisp." - Philip Greenspun
"Including Common Lisp." - Robert Morris
It's more about C/Fortran programs, but here's what i took from it: The language is a tool, you don't need to invent a new one, unless you really want to for whatever reason. Good ones already exist, and lua's dynamic enough to allow many things already.

Now, despite all of the above,
I don't want to discourage anyone from doing what they want, but most of us are singular devs, doing everything; maybe a small team of 2-3, but most projects here on the forums that i've seen, all participants were taking part in the coding aspect, and that meant that they learned lua, up to some point they were comfortable with. And lua is a good choice for AI scripting as well, the run-of-the-mil example being Crytek using it for just that purpose.

If i'd need to do anything similar, i'd just load lua code into a sandbox, and maybe swap out some of the lua/love functions i don't want to expose towards the users that would use that -subset- of the language in my project... that said, i kinda worry about people who cannot grasp what choices (if/else) are or what a loop / iterating means, on the mental level i mean, not the word's meaning... :o:
Me and my stuff :3True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.
MasterLee
Party member
Posts: 141
Joined: Tue Mar 07, 2017 4:03 pm
Contact:

Re: Easy programming 'language' for all - concept and discussion

Post by MasterLee »

DRAKON is an easy graphical language that was used by rocket scientists.
User avatar
ArchAngel075
Party member
Posts: 319
Joined: Mon Jun 24, 2013 5:16 am

Re: Easy programming 'language' for all - concept and discussion

Post by ArchAngel075 »

zorg wrote: Tue Apr 11, 2017 7:45 am -snip-
Your explanation supports what has also been dawning on me lately.

More and more i feel that limiting or simplifying the language into some graphical tool would cause too many issues and limitations on what i want of the users.
I am now leaning more towards a pure lua text editor system with some extra support (such as helpful documentation on some helper functions)
Additionally I need to learn up sandboxing or at-least security (aka private access classes on 'user accounts').

I am concerned how i will limit users from using cheatey methods for designing AI.
IE, at the moment one can easily alter variables on another users units simply by getting the object. If possible i wish to limit users to ONLY have access to what units they made and otherwise only have access to getters and not setters.

I use 30Log at the moment, it does objects and instances perfectly fine - but i have no way of limiting field get;set access.
(but that is another discussion with the soon demo of my game concept)

After coding an basic AI in my project using plain lua (no UI tools) I feel that using a text editor with extra features to improve quality of life will be best for now as the hassle of a UI based method would be too much.
MasterLee
Party member
Posts: 141
Joined: Tue Mar 07, 2017 4:03 pm
Contact:

Re: Easy programming 'language' for all - concept and discussion

Post by MasterLee »

So the question that arises for me is following:
What is the purpose of this?
Should the game:
1. teach peoples AI programming
2. teach peoples basic programming
3. teach people specific programming e.g. object orientation
4. teach people an specific programming language
5. Let peoples develop AIs for your game
6. Let people configure the behavior of their units in game, possible competing against other players AI
7. Let people configure the behavior of game objects in level editor
8. Something else
so here are my chooses
1. Build something with an Block like Structure and use only AI development specific instructions
2. Something similar to or Beginner’s All-purpose Symbolic Instruction Code itself
3. Depends on the specific learning goal but be sure to use something that didn't enable people to work around the goal
4. Maybe that specific language
5. Want strong AI let people choose their language. Want portable AIs go for Python or LUA
6. Build something with an Block like Structure but be sure to do something to prevent massive time consumption
7. Obviously choose LUA when using Love2D and alternative some block structures for the pure level designers
8. 42
User avatar
zorg
Party member
Posts: 3444
Joined: Thu Dec 13, 2012 2:55 pm
Location: Absurdistan, Hungary
Contact:

Re: Easy programming 'language' for all - concept and discussion

Post by zorg »

MasterLee wrote: Tue Apr 11, 2017 2:35 pm LUA
is not an acronym,so please stop CAPITALIZING it. :3
Me and my stuff :3True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.
User avatar
ArchAngel075
Party member
Posts: 319
Joined: Mon Jun 24, 2013 5:16 am

Re: Easy programming 'language' for all - concept and discussion

Post by ArchAngel075 »

MasterLee wrote: Tue Apr 11, 2017 2:35 pm So the question that arises for me is following:
What is the purpose of this?
Should the game:
1. teach peoples AI programming
2. teach peoples basic programming
3. teach people specific programming e.g. object orientation
4. teach people an specific programming language
5. Let peoples develop AIs for your game
6. Let people configure the behavior of their units in game, possible competing against other players AI
7. Let people configure the behavior of game objects in level editor
8. Something else
so here are my chooses
1. Build something with an Block like Structure and use only AI development specific instructions
2. Something similar to or Beginner’s All-purpose Symbolic Instruction Code itself
3. Depends on the specific learning goal but be sure to use something that didn't enable people to work around the goal
4. Maybe that specific language
5. Want strong AI let people choose their language. Want portable AIs go for Python or LUA
6. Build something with an Block like Structure but be sure to do something to prevent massive time consumption
7. Obviously choose LUA when using Love2D and alternative some block structures for the pure level designers
8. 42
I was inclined towards a building block/ puzzle block design for the editor, but currently it is too big a time sink. Presently my focus is more on adding the core components that units will use and the mechanics and helper functions involved. Also a recent redesign on a part of the game design was done to make way for a more interesting gimmick.

BUT to answer you more or less :
Having the ability to design the AI for units easily for all users alike is a 'desired feature' but not a 'must have' for me at this point.

some blurble : (me explaining the goal of the game)
My goal is to not teach coding or anything alike that, instead it is to observe the results of playing my game.

Units will not be directly controllable - all behavior is coded AI by players in Lua.
There are various limitations and systems players will need to familiarize themselves with (such as what component does what etc)
Lastly given the tools, a world and the ability to code AI for units the player will need to ensure their units survive.
IF the units survive the 'design' the player has created is to be shared to other players worlds - (much like Spore).
This ensures that new smarter 'designs' will compete with your own. The ultimate goal is to learn , adapt and survive.
--My interest lies in observing what players come up with, how they play, what strategies they use (ie a small query finds some of my friends wishing to use a 'zerg' approach, others would try and play it safe and I myself prefer environmental exploitation strategies)
to repeat : having the ability to design the AI for units easily for all users alike is a 'desired feature' but not a 'must have' for me at this point instead im focusing on adding the tools that diversify strategies in the game.
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 211 guests