News News

LUA script type system

Type system is a little bit like traits.

Firstly, there are two kind of objects - type objects and consumer objects.
 
Type objects, are defining type (like player, monster), and contain methods on consumer objects.
Usually they have only one instance and it's undesirable for them to change during program execution.
 
Consumer objects, are instances of type objects ('Player Romuald', 'Npc Roths').
There is a preference to NOT store any function pointers on them. They're only container for data handled by
type object methods. Currently, data is shared between type object instances (unlike in traits) but this
might change.
 
You can treat type objects as perspective from which you are looking onto consumer-object.
So, instead of inheritance, you are just changing perspectives.
 
You can look on a 'Player John' from players perspective so he can be banned:
Player.ban(john)
 
You can look on him as entity as well, so he can teleport
Entity.teleport(john, position)
 
As you can see, convention is to pass object as first argument.
So, it's similar to passing `this` in classical object oriented programming.
The difference lays in control of object, and different look on problems.


No comments yet. Be the first.

Would you like listen to a fantasy radio?

Nawia helps to relay a non-commercial and non-profit fantasy radio - Radio Rivendell.

You can listen here music from fantasy games, movies and fantasy-themed orchestral songs.

If you like fantasy (you probably do, if you are there), why don't you give a try? Tune-in here.

Happy listening!



No comments yet. Be the first.

Everything is going on well

If you've been looking at projects progress it could look like a slow. Low commit rate and even the page was down! ugh...

Don't worry, everything is completely fine.

Firstly, we've been migrating to fully dedicated server (rather than VPS).

Secondly, we're working a bit on server-side (quests, map, etc.).

We cannot release game server opensource yet (it's not ours fault, sorry) but i assure, it will be 100% GPL or AGPL (actually it's already GPLv3).

So, nothing changed:

  1. Server-side GPL/AGPL
  2. Web services GPL/AGPL/LGPL or LAGPL
  3. Client code, GPL/LGPL
  4. Visual and audio art, some of CC (depends on artists will)

Of course we have to keep story-related data files private, which is crucial for players RPG experience, but we'll keep providing examples for that. Things like entity management, item groups, probably races (everything which wont break mystery) is reusable for another worlds (which we would like to see!)

Good night!



No comments yet. Be the first.
Showing 1 - 3 of 7 results.
Items per Page 3
of 3

Categories Navigation Categories Navigation

Tags Navigation Tags Navigation

There are no tags.

Tag Cloud Tag Cloud

There are no tags.