Turn to the dark side: OOP and modern technology

New ideas, features you wish were in the game.
Post Reply
Berendol
Evil Iggy
Posts: 868
Joined: Mon 11.11.2002, 19:13
Location: Loot Pile
Contact:

Turn to the dark side: OOP and modern technology

Post by Berendol » Mon 21.07.2003, 08:08

It would be really, really nice if someone were to rewrite the entire monster system in a nice object-oriented fashion. Perhaps load them from an XML file instead of the current ASCII template file, and inserting them into a nice relational database. Oh, what the hack, maybe rewriting a LOT of the code to use objects would be really nice.

If anyone's thinking about this, I suggest you install Perl (with DBI, CGI, XML modules installed), MySQL, and Apache (with mod_perl.) Other useful software might include PHP and Python. Most Linux distributions come with all this, and it's all available for Windows, MacOS, and many other systems as well. Please, please, please get books on these and read them so that you learn the proven, size/code/cpu efficient ways of doing things. What about Java or Flash interfaces? Java is not necessary or even a good idea for simple interfaces that could be implemented by a good CGI or PHP that displays in *any* web browser, and trust me, you don't need anything terribly complex. Flash is just way too much icing on the cake. Don't waste time designing an animated interface for a data editor.

If you need any of that software, go to http://www.apache.org, http://www.mysql.com, and http://www.perl.org. Of course I always recommend GNU Emacs with syntax highlighting enabled for the editor, or a VI clone if you're one of "those people." Good Perl documentation can be found online at http://www.perldoc.org, http://www.cpan.org (download modules here also), and http://www.perl.com. MySQL documentation is available on the website, and I personally use Paul DuBois' book MySQL.

I say abandon backwards compatibility in the interest of progress. Need an example of why it's a bad thing, other than the massive faults in the codebase? Look where it's gotten Microsoft, especially with Windows! No, let's move on and use the technologies that have evolved since the 1989 C specification. Our game lives in 1989 as far as code is concerned. None of the realtime code ideas or networking specifications are newer than that. UNIX has existed since the 1970's, X Windows since the 1980's. Even installing timer interrupts is an ancient (but still useful) technique. That's *14 years* of innovation blissfully ignored, or the age of some of our youngest players. Let's not get into a discussion about how the 32-bit MS Windows client is using new technology, because X Windows was around and stable a long time ago before Microsoft 'invented' 32 bit Windows, which still isn't stable 8-10 years later.

Alright, that's way more than enough. Feel free to flame or say "AHH!!! Finally! Someone I can agree with!"
By appreciation, we make excellence in others our own property. (Voltaire)

Maegdae
Giant Mottled Ant Lion
Posts: 218
Joined: Sat 26.10.2002, 16:52

Re: Turn to the dark side: OOP and modern technolo

Post by Maegdae » Mon 21.07.2003, 22:23

Hmm.. I don't know much about how code works, but since every version of windows looks almost exactly the same no matter how many years pass...

"AHH!!! Finally! Someone I can agree with!"

While I wasn't around for any of this stuff, this page summarizes my feelings quite well on the current state of computer operating systems.

http://www.deadtroll.com/video/ossuckscable.html
Version 3.12
GAT d- s++:- a14 C++++ UL+ P L+ E? W+ N+ o? K---- w--- O-- M-- V? PS--- PE++ Y+ PGP- t+ 5? X- R+ !tv b+++ DI+++ D+ G+ e- h! !r !z

Berendol
Evil Iggy
Posts: 868
Joined: Mon 11.11.2002, 19:13
Location: Loot Pile
Contact:

Re: Turn to the dark side: OOP and modern technolo

Post by Berendol » Tue 22.07.2003, 04:12

Oh spoony, what is WRONG with you? A Quicktime movie? Fortunately I have not tainted my system with the requisite software... You really should warn people before exposing them to such horrors.

Congratulations. You missed my point entirely. Well, the post wasn't meant for you anyways. Only educated software developers would understand it in the first place, and that's who I was expecting replies from. (Hence its placement in the Mangband Developers forum tree. Man it's hard to keep the flame level down on this sort of thing.) See, it's not about looks. It's about underlying code design deficiencies. Anyone can go to themexp.org or something similar to change the way their system looks, but eye candy does not fix any of the problems underneath the surface. That's what I'm lecturing on, is the code. Here, I'll write in shorter sentences: Old code. Inefficient code. New ideas since 1989. Need to write better code. Not interface, code.
By appreciation, we make excellence in others our own property. (Voltaire)

Maegdae
Giant Mottled Ant Lion
Posts: 218
Joined: Sat 26.10.2002, 16:52

Re: Turn to the dark side: OOP and modern technolo

Post by Maegdae » Tue 22.07.2003, 22:56

Good idea.

Me not know code.  Me know ease-of-use.  Ease-of-use have been useless for long long time.  That make me think code be same way.  Me shutup and go play mangband.  Mangband Good!
Version 3.12
GAT d- s++:- a14 C++++ UL+ P L+ E? W+ N+ o? K---- w--- O-- M-- V? PS--- PE++ Y+ PGP- t+ 5? X- R+ !tv b+++ DI+++ D+ G+ e- h! !r !z

Berendol
Evil Iggy
Posts: 868
Joined: Mon 11.11.2002, 19:13
Location: Loot Pile
Contact:

Re: Turn to the dark side: OOP and modern technolo

Post by Berendol » Wed 23.07.2003, 05:40

[quote author=Maegdae link=board=wishlist;num=1058789334;start=0#3 date=07/22/03 at 22:56:15]Me shutup and go play mangband. [/quote]

A sound idea.

Ease of use is a good thing. You miss the point and blargh forth ONCE AGAIN for the perfect 2 in a row.

I really do wish there was a killfile here... gah!!!!
By appreciation, we make excellence in others our own property. (Voltaire)

Spooky
Black Yeek
Posts: 10
Joined: Mon 28.10.2002, 06:44
Location: Portsmouth, UK
Contact:

Re: Turn to the dark side: OOP and modern technolo

Post by Spooky » Wed 27.08.2003, 06:45

Just to play devils advocate  ;D

The 'ancient' codebase means that I can compile Mangband on the myriad of Unix workstations that I use/look after.  All I need is a C compiler, and maybe the  X libaries if the system has it. I've successfully compiled Mangband on whole heap of Non x86 systems, mainly SGIs, and have brought hours of fun to users who wouldn't have had the option of playing this excellent game otherwise.

I can get XML libraries and build apache and php on most of the systems I look after but thats a lot work and maintaining (apache, php and libxml get updated regularly and often have exploits that open up a whole bucket of security vulnerabilities) just to play the odd game...

Besides its not like its particularly slow or buggy. I have 100Mhz Indy R4000's that run the X client at speeds comparable to x.xx Ghz P4 windows boxes. It would be a shame to lose us 'stuckists' for the sake of improvements that probably aren't needed.

Surely interoperability and compatability is what makes Mangband so widespread? As hard to believe as it sounds not everyone uses windows or linux on x86 ;)
http://www.int13h.com - Its all about control

Berendol
Evil Iggy
Posts: 868
Joined: Mon 11.11.2002, 19:13
Location: Loot Pile
Contact:

Re: Turn to the dark side: OOP and modern technolo

Post by Berendol » Wed 27.08.2003, 18:22

(sharpens fangs)  *Shink!* *Shink!*

Widespread? Widespread?! Honestly, have you ever seen more than 20 people playing at once on the entire MAngband network?

What you really need to do is move beyond the converted Pascal, and rethink the way the game was "written" - perhaps using C++, perhaps something else, perhaps not. I've seen some really clever object-oriented hacks in C. At any rate, it is frustrating beyond belief (seriously, it is) to work on this crock of code, especially when it takes days or weeks to figure out how to do something, even more especially when your users are constantly complaining about how this needs to be changed, or this isn't balanced, or they want this feature or that feature, or this bug is still a problem, or so-and-so killed them, or you need to police your server. You can't charge for the game, or require anyone to sign up with a credit card to prove their age/maturity. (Hence the Maegdae effect, whereby full-time police are needed to squash annoying 14 year olds looking for loopholes, then not telling you about them until they've abused them for a while.) Since there's no requirements to play, other than a client, people get totally out of hand. There's no gratification in working on it, except the one player every few months who says "thanks, it works great" -- even then, it usually is followed by "but you should really do this to it". It was supposed to be a community effort to make this game... I don't think 99% of the community has helped at all! Now, as far as I can see, Crimson and myself have been about the only ones willing to say what we've done differently, and how. When I get ahold of my server again and I get my sources posted, you can look at the comments and see how many things I had to change to implement the simplest features, and how much of an effort I put forth to make the code easier on the eyes.

Now, most Unixes have g++, do they not? It's part of the standard GNU compiler suite, just like make, gcc, and ld. You only need it on one machine, and then only to compile binaries for everyone else on that platform to use. Same with any language, but libc.so is standard on everything. Then again, you can always statically link the libraries in and just distribute a large binary. Perl would help a lot for some functions, and I challenge you to find a Unix that isn't supported by Perl.

I simply suggested PHP, MySQL, and Apache for the purpose of putting in a sort of administrative frontend, or you could write programs like what I had, that generate HTML to be displayed via Boa. I remember wishing the whole time that it was written a lot better, so my job wouldn't be so hard.

Thanks for an educated response! It's the FIRST of its kind here on this thread. I get really aggravated when I think about coding this game lately, so don't think I'm mad at you or anything.

PS... X runs faster and more stably on a 100 MHz machine than any 32-bit Windows ever does on a machine 10-20x faster. To a point, it's not how fast the processor is.. it's how the software was written. And my reasons to rewrite MAngband continue to pop up.
By appreciation, we make excellence in others our own property. (Voltaire)

Spooky
Black Yeek
Posts: 10
Joined: Mon 28.10.2002, 06:44
Location: Portsmouth, UK
Contact:

Re: Turn to the dark side: OOP and modern technolo

Post by Spooky » Thu 28.08.2003, 04:16

(Whips out the anti-venom)  ;)

Ok, so maybe widespread was the wrong word ;) But it does get bundled with every free OS on the planet :) And you're right I've never seen anywhere near 20 people on a server. Our record internally was 9 simultaneous players.

I think I actually do agree with you on the recode, having had to edit chunks of the character colour code to make it more SGI friendly myself. Which I know is trivial compared to the work you chaps do but at least I've looked inside those .c files ;) Maybe my problem was with the changes to the tools and languages involved. I suppose if the whole thing was rewritten but still only used C or C++ and no 'random' linux-esque libraries then there's no reason for me to get worked up.

Whilst you are correct that the GNU suite is available on pretty much every platform ever, I can honestly say that on anything non x86 its particularly lack-lustre compared to the native compilers. I would like to think this will improve with time but with the relentless growth of commodity PCs I can't see it happening.... but thats another rant  ;D

Although I'm not much of a regular here I've been kicking around Mangband for quite a while now and I've always been in touch with the current maintainers offering to help where I can with SGI type issues. For some reason I've never contacted you or Crimson. For this I am truely sorry and I would just like to say thanks for keeping this wonderful game going and giving of your spare time. Keep up the good work. *hangs head in shame*

Heh heh, you're welcome RE: The educated response. I spend a lot of my time avoiding forums in general because of the childishness, the gimme gimme attitudes and people who seem to care more about post counts than content. I guess its the by-product of an ever expanding 'online' world.... but thats another rant too ;D

Any work you do with the recoding I'd love to see... and although I'm not much of a coder if there's anything I can do to help (within reason, asking for a Porche for instance is a no-no ;) ) maybe with testing on weird unix envirnoments? then feel free to ask.
http://www.int13h.com - Its all about control

Berendol
Evil Iggy
Posts: 868
Joined: Mon 11.11.2002, 19:13
Location: Loot Pile
Contact:

Re: Turn to the dark side: OOP and modern technolo

Post by Berendol » Thu 28.08.2003, 18:09

Hmm... *thinks*

You have compiled binaries for non-x86 platforms? Those would be great to have available on the website, especially if they're newer than the ones we have. You'll notice that there are no SGI ports of any version in the download section. Crimson's the guy to talk to though, and who knows if he's AWOL again. Put them on your personal website somewhere and post a link on the forums here, and another person might stumble across it someday and be really happy that he didn't have to compile it, or something  ;D Anyways good work with that, I wasn't aware that SGI machines were ever used for games.
By appreciation, we make excellence in others our own property. (Voltaire)

Spooky
Black Yeek
Posts: 10
Joined: Mon 28.10.2002, 06:44
Location: Portsmouth, UK
Contact:

Re: Turn to the dark side: OOP and modern technolo

Post by Spooky » Fri 29.08.2003, 04:05

Sure, no problem. I can definately give you MIPS3 and MIPS4 compiled binaries for SGI (Obviously the modified source too). I should also be able to provide *BSD for PowerPC... although I'd have to test that  ;) I can probably get Sun SPARC binaries too. I'll email crimson and see if he's interested.

Using SGI for games?? You haven't seen Quake3 until you've seen it on an Octane... or better yet an Onyx powered CAVE environment  ;D

*update*
The SGI MIPS builds are available at http://www.btinternet.com/~spooky_int13h. I'll put them somewhere better next week. Hopefully I'll have the PPC ones done by then.
http://www.int13h.com - Its all about control

Berendol
Evil Iggy
Posts: 868
Joined: Mon 11.11.2002, 19:13
Location: Loot Pile
Contact:

Re: Turn to the dark side: OOP and modern technolo

Post by Berendol » Sat 30.08.2003, 14:32

Re: the instructions on your page...

Is the -z option is present in your tar? If so, you can skip gzip and just "tar -xzvf stuff.tgz" to extract. I'm lazy, so I like shortcuts like that.

By the way, if a Porsche is out of the question, can I get a Viper, or maybe an Audi TT?  ;D

Just a couple more days until I get my source posted!

Ohh... CAVE environment... drools. Does Quake even support the full 6 sides?
By appreciation, we make excellence in others our own property. (Voltaire)

Spooky
Black Yeek
Posts: 10
Joined: Mon 28.10.2002, 06:44
Location: Portsmouth, UK
Contact:

Re: Turn to the dark side: OOP and modern technolo

Post by Spooky » Mon 01.09.2003, 03:39

Yeah, a lot of tar's do support the -z option, but I thought I'd opt for the lowest common denominator. I imagine some SGI people wont have installed the freeware version of tar :P

Certainly, if you're willing buy me an Aston Martin  ;D

Oooh, I suppose once its posted I should probably have a look at compiling it ;)

Quake3 in the CAVE does support all 6 screens and true spatial audio. But from what I remember its not the original engine.  I had a link for it round here somewhere... I think this is it - http://www.visbox.com/cq3a/
http://www.int13h.com - Its all about control

Post Reply