Forum

> > Projects > Stranded III Dev. Blog - Comments
Forums overviewProjects overviewLog in to reply

English Stranded III Dev. Blog - Comments

1,827 replies
Page
To the start Previous 1 212 13 1491 92 Next To the start

old Re: Stranded III Dev. Blog - Comments

archmage
User Off Offline

Quote
user Hurri04 has written
for some reason I forgot about the double, maybe it because it was too late in the night already
also I think it wouldnt be bad to have "long" as a variable type.

Lua numbers are doubles. Why do you need a long type? A standard 4-byte integer has 4,294,967,295 different values! Why do you need more than this?

user Hurri04 has written
I suppose this means you are just to lazy to do it?

No it would be a waste of time. Just use a byte as boolean.

user Hurri04 has written
and dont forget being able to put multiple loops into one another. "for" and "while" loops

Can be done with Lua.
user Hurri04 has written
Java can be read WAY better than lua.
is lua even object oriented?

Lua is perfectly readable. And yes lua can be object oriented I actually used objects in this file.

old Re: Stranded III Dev. Blog - Comments

ohaz
User Off Offline

Quote
user Hurri04 has written
"char" can be realised by using "string" anyway.
you mean "string" can be realised using "char".
Quote
user DC has written
I didn't want to pack multiple booleans to bytes
I suppose this means you are just to lazy to do it?
No. It means that it's just useless. Every other language wastes 7bit for a single boolean (because the smallest unit you can access on a computer is a byte). Only using bytes allowes you to use these 7bits aswell (by bitshifting!)

Quote
user Nova has written
Important (in my opinion) are: All features of the stranded II scripting language + being able to save arrays + functions.
and dont forget being able to put multiple loops into one another. "for" and "while" loops might also be nice instead of just the old s2 cmd loop with the "count" parameter.

Hell yeah, Lua! But yeah, if DC creates his own scripting language, using multiple for and while loops within each other should be made possible

Quote
@user VADemon & @user Starkkz: I really think it would be better if the syntax would be more Java-like. in my opinion Java can be read WAY better than lua.
is lua even object oriented?
Is s2s even object oriented? Answer to your question: Lua supports object-oriented programming!

old Re: Stranded III Dev. Blog - Comments

Hurri04
Super User Off Offline

Quote
user archmage has written
Lua numbers are doubles. Why do you need a long type? A standard 4-byte integer has 4,294,967,295 different values! Why do you need more than this?

well, "long" is pretty much what you described, it uses 4 Byte and reaches from -2147483648 to +2147483647.
so far there's only "int" for natural numbers and it uses only 2 Byte, thus reaching from -32768 to +32767.

user archmage has written
Just use a byte as boolean.

I could, but it probably wouldnt result in an optimized code.


while we're at it, how about "enum"? forgot about it yesterday...

user archmage has written
Can be done with Lua.
and when DC implements it into an own new scripting language (s3s) it'll also be possible to use it there. your argument is invalid.


user ohaz has written
you mean "string" can be realised using "char".
no, I meant what I said. I know that a "string" consists of multiple "chars" but in return this means you can only put 1 letter into a "string" and use it like a "char" if you really have to.

user ohaz has written
No. It means that it's just useless. Every other language wastes 7bit for a single boolean (because the smallest unit you can access on a computer is a byte). Only using bytes allowes you to use these 7bits aswell (by bitshifting!)

as DC said, it would be possible to put the values of 8 booleans into 1 Byte but so far he "didnt want to do it".

user ohaz has written
Is s2s even object oriented? Answer to your question: Lua supports object-oriented programming!

no, obviously s2s is not object-oriented since you use functions into which you put the class and ID to refer to an object rather than writing "<CLASS>.<ID>.method(<PARAMETER>);"
but that doesnt mean it cant be done in s3s, except for leaving the <CLASS> away of course since there's going to be a joined ID space.

old Re: Stranded III Dev. Blog - Comments

Lee
Moderator Off Offline

Quote
It's impossible for an online interpreted code to be "optimized" by your standard unless you only distribute native machine code. In that case, you might as well just get rid of any scripting language in the first place and just have everyone write their own libraries in C and have stranded pull the code from that. For example, how would a character type be any more efficient than a string type if both need to be abstracted off to more or less the same data structure within the virtual interpreter? Once you settle on ease of use with scripting, size/time optimality isn't really a luxury you can afford.

old Re: Stranded III Dev. Blog - Comments

Nova
User Off Offline

Quote
user Hurri04 has written
user archmage has written
Lua numbers are doubles. Why do you need a long type? A standard 4-byte integer has 4,294,967,295 different values! Why do you need more than this?

well, "long" is pretty much what you described, it uses 4 Byte and reaches from -2147483648 to +2147483647.
so far there's only "int" for natural numbers and it uses only 2 Byte, thus reaching from -32768 to +32767.

In nearly all programming languages int uses 4 bytes. Byte = 1 byte (...) - Short = 2 bytes - Int = 4 bytes - Long = mostly 8 bytes

For completeness: float = 4 bytes - double = 8 bytes

(This are the values for Java. In 32 bit programms, C has similar values, just with long = 4 byte.)

old Re: Stranded III Dev. Blog - Comments

SD
User Off Offline

Quote
This is very hard to implement yet possible. Although I really don't understand why some of you want Lua replaced. I myself would actually vote for Python (hence someone has already mentioned that Lua is unreadable) - but it's another topic already.

old Re: Stranded III Dev. Blog - Comments

DC
Admin Off Offline

Quote
About not having a byte data type in the editor for local variables
Byte is actually the smallest native data type. Using booleans might actually be slower when "packing" multiple bytes together (because of the required packaging logic which has to be used in the background). Not packing them on the other hand would end up in 0 benefit at all. So the only advantage would be that you save some space but honestly: CPU speed is more valuable than memory at most current systems. That's the reason why I didn't implement a byte data type.

About Double and Long
Double or Long (64 bit) are not required in my eyes. Unity3D itself uses Float/Single (32 bit) for all coordinates. A scripting system doesn't need to be more precise than the underlying game engine. Also a 32 bit integer ranges from −2,147,483,648 to 2,147,483,647. I guess that you're doing something wrong if this is not enough for you.
It wouldn't be a big problem to add boolean/double/long later. I'll can add them later if people REALLY need them.

About having multiple programming languages:
Chaos. I don't think it's good. In worst case you get code from someone else which uses the other language so you have to learn both to understand everything.

Operator Overloading:
Somehow possible in Lua with meta tables. This is nothing which is really necessary for a game scripting language.

old Re: Stranded III Dev. Blog - Comments

AssassinLV
User Off Offline

Quote
Will the game support UniCode???
And will It been enable to use letters like: ē ū ī ā š ģ ķ ļ č ņ???

In case, (for example), if I would try to translate the game. It would be cool if there would be a "Language" file (where you can translate whole game.... (like in Mount&Blade))

old Re: Stranded III Dev. Blog - Comments

AssassinLV
User Off Offline

Quote
user DC has written
Probably not. I'll probably use a normal font (like in CS2D/CC) and not a bitmap font like I did in Stranded II.

Thats good. Cause usualy fonts like "Arial" or "New time Romans" supports all leters - including the speciffic ones.

But would you make a Language file - or it's cost too much of time to make all game with an indexes - to support multiple language - with possibility to switch between them???

old Re: Stranded III Dev. Blog - Comments

AssassinLV
User Off Offline

Quote
user DC has written
Sure, it's planned to make translations possible, yes.
Cool. Then this will be the first game of yours, wich will be possible in Latvian.

Maybe even in Russian (but I think russians are better in their gramatics then I am)
To the start Previous 1 212 13 1491 92 Next To the start
Log in to replyProjects overviewForums overview