This site uses cookies! Learn More

This site uses cookies!

armedunity.com uses cookies to improve user experience.

By continuing to use this site, you agree to allow us to store cookies on your computer.

  • 0
geckoo

Pseudo Code

Question

Here this is a strange discussion about computer language. Briefly I explain to you my will. In a project, I use a console as an interface in order to allow player to control himself (some features) and the environement. On this console, I display code which the player should understand - if he does an effort :) Then he ask himself - Should I execute this code or not? At start, I said to myself that I could use C#, but I assume that newbies cannot understand anything - and this way, the most important part of this gameplay is ruined. Finally I decide to synthetize an abstract language - something which could be understandable, but clever, forcing the player to assimilate progressively the main key of this game. I need to do something unclear at first which the player could decipher. As an example :

 

Debug.Mode OPEN~
kernel.get.<Player.script>().(float)forceJump;

(float)forceJump = 6.0;
(float)newValue = 1.5;
kernel.set.<Player.script>().forceJump =* newValue;

kernel.inject.<Player.script>();

kernel.get.<Player.script>().(float)forceJump;

(float)forceJump = 9.0;
Debug.Mode Close~

 

And this is my question - Do you understand this code?

Share this post


Link to post
Share on other sites

6 answers to this question

  • 0

I understand it perfectly, but to a newbie, I don't think that would be very legible at all. The reason is that newbies tend to remember how something is done, but forget how it's actually executed. For instance, most new programmers probably couldn't tell you what a float value is, but they can tell you what a decimal value is.

 

Assuming your writing your own compiler, reaching someone with no programming knowledge would be less like this:

Please login or register to see this code.

and more like this:

Please login or register to see this code.

Removing the semicolon which is also forgotten quite often and replacing it with two periods which is less forgotten because a period is used to close a sentence.

 

Another thing you might watch out for is the .<something>(). The reason, in tons of cases, is a newbie will skip over that period, thus causing an error. Another reason is because there is too many special characters to remember. When reaching out to someone with low programming knowledge, the less special characters you use, the better they will understand it. That's why in Unity, you can distinguish a new programmer by not seeing this:

Please login or register to see this code.

And more of this:

Please login or register to see this code.

So something like this:

Please login or register to see this code.

Would be easier for a newbie to remember. Less special characters, no hidden periods, and just two periods at the end to close the sentence.

 

But that's just my opinion and what I've observed over the years on the forum. But in my case, yes, your code is very readable.

Share this post


Link to post
Share on other sites
  • 0

I don't think asking in a game development forum if we can understand your code this way will really help unless some newbies answer, but yeah I agree with what OcularCash said.

 

On the other hand if you look at games like Space Engineers which allow you to actually write real (In the case of SE C#) code and compile it and use it in the game you see that players can do really awesome stuff with it! :d

Share this post


Link to post
Share on other sites
  • 0

Ok. I understand your point of view which helps me a lot of. I am trying to synthetize something which could be clever, but before all comprehensible.

However, if it is too easy - where is the interest? If it is too hard, it becomes quickly annoying. For the first time in my developer life, I am struggling hard with something which doesn't exist - an abstract language :)

Share this post


Link to post
Share on other sites
  • 0

You should ditch all the regulated programming language syntaxes, make it pseudo, as the title says or if you really want, make a simplified javascript style syntax for it.

An pseudo example:
 

Please login or register to see this code.

point i'm trying to make, most people understand reading programming code, if it in a simplified structure. The thing that confuses most people at start, is the programming language syntax and regulations, variable types etc. So maybe ditch the floats, integers, strings? Just a thought

 

Share this post


Link to post
Share on other sites
  • 0

Maybe for a total newbie this would represent a challange, but for a mediocre or a programmer that may play it just wouldn't be anything at all than plain boring. Since it is one of your game's core mechanics, I think it would be worth making a system with 3 difficulty levels, 1 being the custom language, 2 being one that bonds both together, and 3 just plain printed code.

Share this post


Link to post
Share on other sites
  • 0

I understand and I agree with you. I reduced the importance of the code in the main gameplay. I think now that it adds to the (cyber)mood, but it is not necessary to understand it. Furthermore, I comment that code at the end (like a real code) and all is explicit. To display the code on screen, I decided to write something which could be compared with the basic code using on Pico-8. Not too hard ++

1 person likes this

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now