[Home] [Downloads] [Search] [Help/forum]

Gammon Forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  Lua
. . -> [Subject]  Mapper! (Hehehehe.)
Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

Mapper! (Hehehehe.)

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page


Pages: 1 2  3  4  5  

Posted by Faux   United Kingdom  (77 posts)  [Biography] bio
Date Mon 17 Jan 2005 05:07 PM (UTC)

Amended on Mon 17 Jan 2005 08:27 PM (UTC) by Faux

Message
http://faux.servebeer.com/t/n.png

Edit: Non-no-ip url, if anyone else has problems. Try the other one first, though: http://fana.ssxh.net/t/n.png

100% Lua (with two extensions, LuaCOM and wxLua), reading Zugg's format.

More info when I've done more work on it :)

Faux, from Discworld. Feel free to come talk to me =)

http://faux.servebeer.com/
[Go to top] top

Posted by Poromenos   Greece  (1,037 posts)  [Biography] bio
Date Reply #1 on Mon 17 Jan 2005 05:52 PM (UTC)

Amended on Mon 17 Jan 2005 05:53 PM (UTC) by Poromenos

Message
I'm jealous :( Any chance that we will see the source/help/whatever? I'm starting to like Lua...

Vidi, Vici, Veni.
http://porocrom.poromenos.org/ Read it!
[Go to top] top

Posted by David Haley   USA  (3,881 posts)  [Biography] bio
Date Reply #2 on Mon 17 Jan 2005 06:20 PM (UTC)

Amended on Mon 17 Jan 2005 06:39 PM (UTC) by David Haley

Message
Server timed out for me... couldn't see the picture. :)

BTW Poromenos, it's not in the language, it's in what you do with it. :P

------------------------
EDIT:
Ah, ok, I can see the picture now. That's pretty cool. You're not actually auto-mapping, though, are you? You're displaying a ZMUD map?

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
[Go to top] top

Posted by Poromenos   Greece  (1,037 posts)  [Biography] bio
Date Reply #3 on Mon 17 Jan 2005 07:11 PM (UTC)
Message
My sentences were actually separate, I meant I like lua because it's small and powerful :P

Vidi, Vici, Veni.
http://porocrom.poromenos.org/ Read it!
[Go to top] top

Posted by David Haley   USA  (3,881 posts)  [Biography] bio
Date Reply #4 on Mon 17 Jan 2005 07:14 PM (UTC)
Message
That it is indeed. Although it should be noted that to do what he did, it took two fairly large extensions; additionally, the core Lua library is missing a lot of things such as easy array manipulation (e.g. give me a copy of the array, without element x) etc.

That being said, I recently used Lua for implementing algorithms for class homework, and I'm very impressed indeed. It certainly does remove the amount of extraneous details and lets you just focus on the algorithm's internals, as opposed to the language's internals.

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
[Go to top] top

Posted by Poromenos   Greece  (1,037 posts)  [Biography] bio
Date Reply #5 on Mon 17 Jan 2005 07:19 PM (UTC)
Message
I agree. I haven't had time to learn it yet, but it looks great. Sure, Python can do all that too, but Python's not 100 kb, and Lua is more integrated in MC... I will have to learn it...

Vidi, Vici, Veni.
http://porocrom.poromenos.org/ Read it!
[Go to top] top

Posted by Shadowfyr   USA  (1,783 posts)  [Biography] bio
Date Reply #6 on Mon 17 Jan 2005 07:35 PM (UTC)
Message
Nice...

Just one minor comment though. At some point it might be nice to use an OGL library or the like to create and iso-metric style map. One where going 'up' takes you to a room literally above the one you where just in. At least as an alternate display method. Even when showing non-iso, having a faded version of rooms 'under' the ones you are in would be useful, though how you deal with rooms where you climb up, wander around, then end up below again gets a bit more complicated. Maybe something that fades the last room that reconnects to 1/2 the fade of the one on the other level or something. Anyway, the point is that there are two solutions to 'levels', one is to throw out the level you just left and draw only what is on the new one, which leaves you almost as lost as before, the other is to find some way to show multiple levels at once. Possibly, with the isometric version, letting you pan and shift the camera in and out of the map (with simple zbuffer removal for part too close to the camera).

Though, just getting a mapper to work in a client that doesn't more directly support it is a feat itself anyway.
[Go to top] top

Posted by Faux   United Kingdom  (77 posts)  [Biography] bio
Date Reply #7 on Mon 17 Jan 2005 08:24 PM (UTC)

Amended on Mon 24 Jan 2005 10:10 AM (UTC) by Faux

Message
Sorry for the random ordering of replies. Hope I get everyone.

For those of you who can't be bothered to read all this..
Thanks, no source yet, almost definitely open/free source in the future.

Quote:
I'm jealous :( Any chance that we will see the source/help/whatever?

This is contained enough to be a plugin, (excluding the sandbox and the dlls required, and their dependencies..) but things like zone selection are still being done via some (relatively nice..) aliases. I'm a newbie at wx, this is my first play, so I'm going to look into tree/list/tabstrip controls, but I won't promise anything yet.
In short: It needs some serious cleaning up, and probably an actual installer to get it going (as apposed to a plugin). I'm working on it.


If anyone's had any luck getting the wxLua dll to build, I'd be interested. I've managed to get the VC6 package to build, but that fails to give you a dll.
At the moment it has two major limitations, being;

  • It's using outdated wx code (2.4.2)
  • You can't destroy windows, meaning MUSH hangs when you update the script file.


Quote:
It certainly does remove the amount of extraneous details and lets you just focus on the algorithm's internals, as opposed to the language's internals.

I still can't vouch for the functional branch of programming.. or even oo, but I am starting to like languages like php above c, simply due to the raw power and stability (and common syntax).


A note on the extensions:
wxLua: I'd be pretty impressed if there's a better way to get dialogs going from a scripting language, excluding having a standalone executable.
LuaCOM: This is used for the DB access _alone_. No other features from it are used. If there was a MUSH way to open dbs, run queries and get their results as lua tables, LuaCOM would be obsolete.

Quote:
You're not actually auto-mapping, though, are you? You're displaying a ZMUD map?

By automapping, you mean drawing and saving to the db? No. But the infrastructure is there to captures n,s,e,w, etc. and move the map around, it's just not fully written yet.
If anyone's interested, I've stolen Tubbeh's (http://clik.to/Tubby) Map (http://users.tpg.com.au/tubbeh/Maps/DiscworldMapsv5.zip) and I'm working off that. :)

Quote:
Server timed out for me... couldn't see the picture. :)

That's probably the cruddy no-ip stuff. Sorry. If it was the actual server (pretty costy dedicated.. etc.) then I'll be really.. off :p

Quote:
I'm starting to like Lua...

I used to think Lua was horrid, because trying to do thigns `the php way` simply doesn't work. There are, however, most of the things there, you just have to search through the documentation (google) until you find it. eg.
  • unset() becomes =nil
  • =array() becomes ={}
  • foreach ($a as $b => $c) becomes for b,c in pairs(a)
  • etc..

Anything less syntatical I'm trying to duplicate... Here: http://www.gammon.com.au/forum/bbshowpost.php?bbsubject_id=5152

Quote:
...such as easy array manipulation (e.g. give me a copy of the array, without element x)

You do not want to see my code for this and how much it gets used :p

Quote:
Just one minor comment though. At some point it might be nice to use an OGL library or the like to create and iso-metric style map.

LuaOGL exists, I believe, at least under wx. I've already tried and failed to do this in flash (writing the 3d code in actionscript isn't pretty, believe me). I'm definitely going to go for this once the code becomes more smooth. I'm pretty proficient with OpenGL, but there may be someone out there who is more so.
This, however, is _not_ a priority atm.

Thanks again :)

Faux, from Discworld. Feel free to come talk to me =)

http://faux.servebeer.com/
[Go to top] top

Posted by Poromenos   Greece  (1,037 posts)  [Biography] bio
Date Reply #8 on Mon 17 Jan 2005 09:53 PM (UTC)

Amended on Mon 17 Jan 2005 09:54 PM (UTC) by Poromenos

Message
Quote:

She, btw.

Omg, women who program. Email me at ILoveWomenWhoProgram@poromenos.org.

Just kidding. The address is real though. And do email me.

Vidi, Vici, Veni.
http://porocrom.poromenos.org/ Read it!
[Go to top] top

Posted by Poromenos   Greece  (1,037 posts)  [Biography] bio
Date Reply #9 on Mon 17 Jan 2005 09:56 PM (UTC)
Message
Sorry about that, I just married two friends of mine on the MUD I play, and the silliness is still there. I'll post the URL to the log later. Or not.

Vidi, Vici, Veni.
http://porocrom.poromenos.org/ Read it!
[Go to top] top

Posted by David Haley   USA  (3,881 posts)  [Biography] bio
Date Reply #10 on Mon 17 Jan 2005 10:25 PM (UTC)
Message
Quote:
She, btw.
Ah- sorry. :) I've known a few people who go by the name 'Faux' and all of them have been men, so that's why I assumed it was the same with you.
Quote:
I still can't vouch for the functional branch of programming.. or even oo,
The problem with all of these is that die-harders on every side will claim that their language is "the best". The real truth of the matter (IMHO) is that it's like a toolbox: every tool has a special purpose, and you use it when it's adequate.

You could, technically, use a screwdriver to hammer in nails (as I have done when I was sans hammer :P) but it won't work very well. Similarly, you could use OOP to write a recursive descent parser, but that'd be somewhat silly. It'd probably be just as silly to write a logic-manipulation application in C.
Quote:
I used to think Lua was horrid, because trying to do thigns `the php way` simply doesn't work.
Hehe... Indeed, it wouldn't. :P But rest assured, Lua people who go to PHP probably get frustrated by not being able to do it "the Lua way", too. :)
Quote:
I'm pretty proficient with OpenGL, but there may be someone out there who is more so.
I'm fairly handy with OpenGL; handy enough to tell you that you're better off not writing your own library, and looking for an open source one instead. Writing a 3d engine (even if it only appears as 2d) isn't a quick'n'easy thing to do. I would agree with you; this should not be a priority any time soon.
Quote:
You do not want to see my code for this and how much it gets used :p
I solved the problem by writing the functions with index into the array + length of the array, but my application didn't need to remove from the middle; I was just cutting the array in half recursively so it worked fairly well.


Anyhow I think you did a pretty fine job. Lua and wxLua are opening up all kinds of possibilities for MUSHclient, namely the ability to have all kinds of useful things like automapping that Nick (rightly IMHO) hasn't included in the core. :)


Edit:
Ah, yes, sometime soon I'll try building wxLua and I'll let you know how that goes.

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
[Go to top] top

Posted by Faux   United Kingdom  (77 posts)  [Biography] bio
Date Reply #11 on Mon 17 Jan 2005 10:41 PM (UTC)
Message
<flame>Functional languages have no point.. etc.. etc..</flame>

And I gave up on using arrays as mappings (php arrays/whatever they're called in other languages.. perl?) and went back to the C way. Watch the functionists wince :p

I remember now.. my comments about the dll were.. inaccurate. The version I tried to build without bothering to fully read the website (http://www.luascript.thersgb.net/) I tried to build the 2.3.5 version that doesn't actually come with a require dll. I may have a go at porting at some point..

And on the OpenGL thing.. I don't know :/


Faux, from Discworld. Feel free to come talk to me =)

http://faux.servebeer.com/
[Go to top] top

Posted by David Haley   USA  (3,881 posts)  [Biography] bio
Date Reply #12 on Tue 18 Jan 2005 02:04 AM (UTC)
Message
Functional languages are incredibly useful in many AI applications, or to solve problems that are inherently and fundamentally recursive in nature, among other things. Of course, if you're not solving a problem for which FP is a good tool, don't expect it to be too useful. :-) A simple example - solve the Farmer-Goat-Wolf-Cabbage problem in C. Have fun... :-) A LISP solution will be simpler and shorter - mainly because you can concentrate on the functional aspects of the program, and not all these low-level details. (This is, I suppose, more of an argument for high-level languages than for FP in particular.)

PHP uses associative arrays, as far as I know. Perl has both; it has both numerical arrays and associative arrays (hash tables.) You can't really do C arrays in Lua, for the simple reason that C arrays are in fact pointers to blocks of memory that are assumed to be of a given length. In fact, few languages implement C arrays, except for those that let you do low-level manipulation as C does.

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
[Go to top] top

Posted by Faux   United Kingdom  (77 posts)  [Biography] bio
Date Reply #13 on Tue 18 Jan 2005 03:26 AM (UTC)
Message
By c arrays I mean things like.. adding elements to an array by doing:
arr[arr_c++]=value;


I haven't reached a stage where I've had to do anything that abstract.. yet.

I have other personal arguments against functional programming, but I refuse to post them here.

Oh, yeah, that really irritates me about Lua. Would it kill them to add things like ++ (increment) and ..= (append)? The argument is probably for more readable code, but..
indexedroomarray[room['x']][room['y']]=indexedroomarray[room['x']][room['y']] / 8
isn't more readable, imho.

Faux, from Discworld. Feel free to come talk to me =)

http://faux.servebeer.com/
[Go to top] top

Posted by Faux   United Kingdom  (77 posts)  [Biography] bio
Date Reply #14 on Tue 18 Jan 2005 03:31 AM (UTC)
Message
Hmm.. another thought on the OpenGL.. Isometric doesn't work. If isometric is what I think it is, anyway..

Terms like north (being towards the top of the screen) break down. I wouldn't write anything with north being north-east, it'd make my brain explode.

I think the best soloution would probably be to have a 60 or 30degree view, looking north, with a squished perspective. As that made no sense, I'll do a concept demo (in c (maybe with some inline asm), of course, as any other languages are far too slow to render in, properly) or a "screenshot" at some point if I feel like it and I can get it looking good.


Faux, from Discworld. Feel free to come talk to me =)

http://faux.servebeer.com/
[Go to top] top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


34,521 views.

This is page 1, subject is 5 pages long: 1 2  3  4  5  [Next page]

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.

[Home]


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( https://gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Hosted at FutureQuest]