Page 1 of 1

Summer!

Posted: Sun Jun 17, 2012 3:11 am
by mattykins
I'm on Summer vacation now! :D Passed all of my finals with good marks, finished the year with a 3.2 GPA. I'm now a junior in high school lol(11th out of 12 years for those outside of the USA) :)

More importantly though Summer means no school and no school means more development time! I have a lot I want to work on and so much free time its crazy! My language of choice over the past few months has been Python, i've used it almost exclusively. And if I used another language it was just to integrate with a python script to make it more efficient or something.

One project i'm working on that you guys might find interesting since you are all into MMOs is a text based MMORPG through a telnet connection. It will mimic most browser based MMOs in that you have x amount of action points, you replenish your points once per minute etc etc. However its all done through a terminal with a telnet connection. I haven't gotten too far on it but i thought it would be a fun little niche game. It's also client-less because it uses telnet, so all you need is putty or a linux based terminal (ie cygwin, gnome, xterm).

Other than that i've been just learning as much as I can with Python , i feel like i've gotten to know Python a lot better than i know C# or C++ or anything like that. Lots and lots of little projects etc.

I wanted to ask all of you though if there were any little projects you suggest i try, for the sheer purpose of learning more about the language. I've found the best way to learn is through projects you know you won't be able to complete with your current knowledge, as they force you to learn something knew and painstakingly read through the documentation. :)

Re: Summer!

Posted: Sun Jun 17, 2012 7:02 am
by Jackolantern
The type of game you are referring to is a "MUD" ;) Us old-heads are quite familiar with them, since before Everquest and Ultima Online came out (not counting Meridian 59, since that was not so good), they were your only option for an online, multiplayer RPG. I played my share of them and have very fond memories! I played a really cool X-Files themed MUD on AOL sometime around 1996. It was actually amazing, and I wish there was still some way to play it. There were usually about 50 - 100 players on, and the admins actually acted as X-Files type monsters, and would lay clues players had to follow to find them. There was little combat, and you actually had to follow rules to use your gun and make a quick little "report" to the bureau every time you used it, meaning that the game was largely puzzle and interaction based. It was awesome lol.

I am actually also working on a MUD-type project, except I am really not using Telnet, instead opting to create a browser-based client with some enhancements. I am hopefully going to be using Node for the back-end, since creating a Java multithreaded websocket server is a little more than I want to get into right now lol.

As for a project, I would suggest to make a simple chat room (telnet is fine). You will need every piece of the experience of making a chat room to create a MUD.

Re: Summer!

Posted: Sun Jun 17, 2012 9:53 am
by vitinho444
Hey lucky matty Lol, i still got my finals, and im on the 11th / 12 years, and in my country the finals are in this year and in the next one.

My final for Biology is on tuesday, and for Physics is on Monday next week.

Re: Summer!

Posted: Sun Jun 17, 2012 1:53 pm
by Ark
You guys need to have 12 years on education? :lol: :lol: Lucky me I graduated on 11th :D

Re: Summer!

Posted: Sun Jun 17, 2012 5:41 pm
by mattykins
I knew it was called a MUD, i probably should have just said that;) haha.
Also I am almost done with a telnet based chatroom! I attempted to clone what most IRC clients look like. Here is the code for it if you are all interested :)

Code: Select all

import sys, socket, thread

s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.bind(('', 23))
client_list = []
message_list = [""]*23

def listen():
        print "Listening for clients on port 23 (telnet)"
        while True:
                s.listen(5)
                conn, addr = s.accept()
                client_list.append((conn, addr))
                print "New connection from %s" % str(addr)
                thread.start_new_thread(handle, (conn,addr,))

def handle(conn, addr):
        conn.recv(1024)
        conn.send("Enter your nick: ")
        nick = conn.recv(1024)
        nick = nick[0:(len(nick)-2)]
        conn.send("\x1b[24;0H\x1b[2J\x1b[23;0H\x1b[K################################################################################\x1b[24;0H%s" % ("<" + nick + ">"))
        conn.setblocking(0)
        dead = False
        message_list.insert(0, "%s joined"% nick)
        message_list.pop()
        for y in client_list:
                                for x in range(23):
                                        y[0].send("\x1b[%s;0H%s\x1b[24;0H" % (str(22-x), message_list[x]))
        while not dead:
                dat = "%%BLANK%%"
                try: dat = conn.recv(1024)
                except: pass
                if dat == "":
                        dead = True
                elif not dat == "%%BLANK%%":
                        conn.send("\x1b[24;0H\x1b[2J\x1b[23;0H\x1b[K################################################################################\x1b[24;0H%s" % ("<" + nick + ">"))
                        curMsg = "%s: %s" % (nick,dat)
                        message_list.insert(0, curMsg)
                        message_list.pop()

                        for y in client_list:
                                for x in range(23):
                                        y[0].send("\x1b[%s;0H%s\x1b[24;0H" % (str(22-x), message_list[x]))

                        conn.send("\x1b[24;0H%s" % ("<" + nick + ">"))


        conn.close()
        client_list.remove((conn, addr))
        message_list.insert(0, "%s quit"% nick)
        message_list.pop()
        for y in client_list:
                                for x in range(23):
                                        y[0].send("\x1b[%s;0H%s\x1b[24;0H" % (str(22-x), message_list[x]))
        print "Connection with %s closed, AKA %s" % (str(addr), nick)


thread.start_new_thread(listen, ())

while True: pass

If you look at the strings i'm sending I'm using a lot of VT100 codes to mess with screen refreshing and cursor location :) It was actually pretty interesting learning about those.

I just need to tweak these codes a bit to fix display issues but other than that the chatroom is done

Wow talk about nostalgia. I just realized how noob most of the questions I used to ask all of you were :) I can't thank this site enough for helping me get started <3 I never thought i'd be writing multithreaded servers like this and stuff when I started. In fact i probably didn't even know what multithreaded meant! Everyone here at indie resource is amazing.