30 Oct, 2009, Skol wrote in the 21st comment:
Votes: 0
Back to the actual thread…

Stary, cool stuff man. I'm going to have to start playing with Ruby sometime heh.
So is it storing the objects/mobs etc as actual files? I guess I could see it done that way or simply in a database.
The area/midgaard, and obj/shire/one.ring type approach is cool stuff.

Since it's 'vnum'less (with regards to a Diku-deriv line), could you still have say 'two' of the same item names, yet different items etc? Or would it be simply something like obj/shire/one.ring/fake.version etc? (With the fake being an instance of one.ring with modified properties etc).

I know it's more 'What is Ruby doing', but it's got me curious.
30 Oct, 2009, JohnnyStarr wrote in the 22nd comment:
Votes: 0
Wow, so I'm not going to take sides, but for what it's worth I wasn't
offended by DH. Him and I have been talking about C for about a year now. And
ironically I think this is sad because I've learned a ton from both you guys.
In fact it was DH that helped me with a ton of questions, and Tyche that inspired
me to learn Ruby. So, I hope you guys figure this one out.

On to business…

Skol said:
Since it's 'vnum'less (with regards to a Diku-deriv line), could you still have say 'two' of the same item names, yet different items etc? Or would it be simply something like obj/shire/one.ring/fake.version etc? (With the fake being an instance of one.ring with modified properties etc).


I won't lie to you, I haven't worked out all the kinks. I only recently started using this kind of file path
vnum system. Yes, the prototypes for objects are stored in .yml files with respective file paths.
I'm storing these prototype objects along with Rooms in ruby Hash tables with the key being the path-
vnums and the value being the objects themselves. so:

p room_hash['shire.room.clearning'].description #=>"you are standing in a clearning."

Like I said, I'm not yet done, so any suggestions would be great.
30 Oct, 2009, JohnnyStarr wrote in the 23rd comment:
Votes: 0
er, can't edit it now, but i noticed that i separated the 'shire.room.clearing' with '.'s
which i have changed to suit my needs. in each game object loaded from YAML, i have a vnum, path, name and keyword member. for vnum, i found the best convention is using '.'s to separate the object
path, then '-'s for the spaces: shire.room.johnnys-room, this would be converted to: shire/room/johnnys-room for the 'path' member. the keywords would be "johnnys room" and the name would be "Johnnys room". I'm still playing with it, but I've found this to work best for me.

I am not using a SQL db for now, I am serializing objects using YAML. But, I am separating files
by area/mob, area/room, area/obj. This is where the prototypes are being stored. I got the idea
from LPC and help from others on this forum. Now, As far as resets go, I haven't made up my
mind. I know that LPC might use something like 'shire/room/johnnys-room/mobs/balrog', but I
don't see the benefit of making resets literal files. Once a prototype is loaded, it will only be
loaded again from disk if A: the file is changed in OLC or manually, and B: on loading the server.

I would like to think as far as vnums go, that when hard coding literals (if desired) you could use
the '.' to sort of dereference the area object. Yes, I know that this is not actually happening, but from
a programmers standpoint, it's simply a matter of preference. EG. mob_hash['shire.mob.giant-balrog']
30 Oct, 2009, kiasyn wrote in the 24th comment:
Votes: 0
i would probably do:

room:shire/clearing

or even

room://shire/clearing
31 Oct, 2009, Skol wrote in the 25th comment:
Votes: 0
Stary, you could also use vnums, but in a perhaps different way (thinking 'sorting' as far as mapping things going, knowing what lays where etc).
ie: room:shire/1.clearing, mob:shire/32.gandalf.wizard

Although that's me from a Diku background wanting to tag a number on things heh.
I do like the idea that you could grab a 'desert' room, and apply to it though. Or a goblin mob, and add on etc. (Much like 'race' is used from a diku side, parent stats then you modify).

I'll be totally interested to see how you do 'versions' of mobs/objs/rooms using a parent from a different area. You could set up a quasi 'limbo' area (or equipment, monsters, etc).
31 Oct, 2009, elanthis wrote in the 26th comment:
Votes: 0
Quote
Geez, somebody's feeling kind of grumpy today.


Tyche is always grumpy. Him and I could start the Grumpy Old Men club, but the last thing either of us want is to have a dick and an ass in the same place at the same time.
31 Oct, 2009, Tyche wrote in the 27th comment:
Votes: 0
elanthis said:
Quote
Geez, somebody's feeling kind of grumpy today.


Tyche is always grumpy. Him and I could start the Grumpy Old Men club, but the last thing either of us want is to have a dick and an ass in the same place at the same time.


One gets tired of correcting a poster's steady stream of diarrhea on certain topics.
You'd think people would catch on and demand examples of ruby code illustrating this so-called "good advice".
31 Oct, 2009, Tyche wrote in the 28th comment:
Votes: 0
David Haley said:
- If you saw a thread about some other language that was doing something shady, I would most certainly expect you to share your knowledge with people as to why that technique is shady, or potentially dangerous at least, and how to avoid problems with it.


Trolling. Q.E.D.
31 Oct, 2009, David Haley wrote in the 29th comment:
Votes: 0
Tyche said:
David Haley said:
- If you saw a thread about some other language that was doing something shady, I would most certainly expect you to share your knowledge with people as to why that technique is shady, or potentially dangerous at least, and how to avoid problems with it.


Trolling. Q.E.D.

Where is the trolling on my part here?
31 Oct, 2009, Tyche wrote in the 30th comment:
Votes: 0
David Haley said:
Tyche said:
David Haley said:
- If you saw a thread about some other language that was doing something shady, I would most certainly expect you to share your knowledge with people as to why that technique is shady, or potentially dangerous at least, and how to avoid problems with it.


Trolling. Q.E.D.


Consider these "shady" practices you disparage are actually the preferred and recommended techniques of programming in Ruby. The language, its standard libraries and most of the gems are in fact actually written extensively using module mixins and duck-typing. Ruby is not C++ or Java. Warning someone to avoid them is like warning a Haskell programmer about the pitfalls of functional programming. More often than not, C++ and Java programmers write painfully ugly and slow code in Ruby until they adopt these "shady" practices. If these practices only work on small or single authored projects then nobody would be running Ruby or hundreds of Ruby gems, because the projects simply wouldn't exist. You can't even write Ruby code that doesn't duck-type because it uses it internally on every single call. These dire warnings about "shooting yourself in the foot" are the product of other paradigms. Paradigms of people who actively choose not to use Ruby.
I'm not interested in engaging in a language design argument every time someone posts a Ruby question.

Since the moderators don't wish to respond to my request to stop this cross language trolling, and you insist you'll just continue, then flaming you every time you do it seems to me to be the best way of handling it.
01 Nov, 2009, David Haley wrote in the 31st comment:
Votes: 0
Tyche said:
Warning someone to avoid them

Did you even read what I posted? I never said to avoid them – in fact I said precisely the opposite! Just in case you missed it,
David Haley said:
I absolutely agree that you should not shy away from these techniques

I'm not sure how this can be any more clear! I hope we've cleared up this little disagreement now, and perhaps you will stop incorrectly portraying what I have said.

Tyche said:
I'm not interested in engaging in a language design argument every time someone posts a Ruby question.

Then why do you keep starting them, when I haven't said "avoid Ruby" or "Ruby sucks" or "Ruby is evil" or ……? It seems that you are the one who keeps this up, Tyche. You are the one turning these things into fights, putting words in my mouth that I never said.

Tyche said:
then flaming you every time you do it seems to me to be the best way of handling it

Well, at least somebody is trying to do the mature thing here.

Seriously man, this is rather unbecoming and certainly very unnecessary.
01 Nov, 2009, elanthis wrote in the 32nd comment:
Votes: 0
Girls, girls… You're both very pretty.
01 Nov, 2009, Skol wrote in the 33rd comment:
Votes: 0
Rofl, I'm with elanthis, take it to tells ladies ;p.
20.0/33