"GreaterMUD" ANSI compliance (MegaMud)?

Started by erek, January 22, 2006, 04:41:15 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Score..

So far, I can write about 12000 Random Characters per second, with some random background colors behind about half of the characters with great speed.  Even though when thats going on, the CPU peaks to about 25% I think its acceptable.  Not like that amount of data gets rendered when playing mud anyway.

So what's yer viewpoint on using DirectX?   Do you think that dependency will be a big problem?

I'm kinda diggin it so far..  Never really got into it much before.  But so far, using it is simular to GDI, little easier in some ways. 

I don't have a problem using dx9 but I know older machines sometimes have problems with it.

You should think about maybe allowing it to use MMudexplorer type database files to query the realm data from. This would open up a lot of possibilities for you to work with.

TCA

or...you could ask us if you ahve a question...we know.

Lol, umm.... no on the DirectX ;)

What exactly is causing the CPU usage, processing the incoming ANSI or rendering it?? DirectX isn't going to help you with processing, and rendering colored text on a control shouldn't take up much CPU at all.? For starters, forget the panel.? Create your own control from scratch and do your rendering using GDI+.? You'll have to keep track of the current location on the terminal manually.? Use a queue-styled buffer to get the info from the host and have your rendering loop plow through the contents of the buffer character by character, parsing ansi codes on the fly.? I had a working sample that used very little CPU, but I must have lost it in one of my many formatting sessions. :(


TGS v1.0 (coming soon)

Hrmph :)

I did the control part...

Thats what I started with.   The processing isn't as fast as I'd like, but that wasn't where my bottle neck was. I was using GDI to draw the screen, it was just horribly slow.

Like I said, maybe it was my approach. 

The processing of the ansi stored characters and their attributes in a collection of a collection.

I basically created a Terminal Class, which had a collection of  TerminalRows, which had a collection of TerminalCharacters.

The processing would handle the current cursor position, as well as each individual characters attributes.  ForeColor, BackColor, Blink, Hidden, Visible, Underline, Reverse, and of course the actual character.

OnPaint would simply draw y0-24 -> x0-79 characters.

The way I read the RFC on escape sequences lead me to believe this would be the most efficiant approach.  Maybe thats where my issue is.

Either way, I've run into problems with the directX route as well.   Drawing on a form is cake, but drawing to a control ended up rendering blurry text.  Though I chalk that up to my lack of knowledge with the managed directx library :)

Well I'm not sure what I did that was different, but I simply painted out the DirectX code in the paint event, and replaced it with the equiv drawString method and everything is fine...  It parsed a welcome screen just fine...

Like I said, I don't know whats different..

Gonna go ahead and clean the code up some, get the telnet socket connected to the client, and do some asthetics... Cursor, menu's etc..

Gotta say, now I feel kinda silly :)


I have a few ideas for this for its later development:

A map/path, loop interface that would let you highlight a travel path on a map just by checking off the rooms you want it to travel through when auto walking. This way if you think very graphicly you could just draw your loop or path and not actually have to walk it in the first place.

I think a better way of figuring out a lost characters location would involve using a mudexplore like room database. The first step would be to search the database for a room with the same name and same available exits. If more than one is found the next step would be to remove rooms from the possible room list by looking into adjacent rooms and comparing their available exits to the possible locations. The third step would be to then travel to an adjacent room and repeat the steps until the location is known. Since this requires less random walking it would be safer for the characters and should also be more efficient.

I?m also thinking that if it always knows where you are then it shouldn?t need as many defined paths just a list of destination rooms. It could then build the paths as it uses them. Which would be a more useful way of going about making paths provided content is updated frequently.

Similarly using a mudexplorer like room database. I was thinking if you could get it to write the scripts just using the room/map numbers and waypoints instead of using just the map directions. So if you wanted to write a script to walk from say Silvermere to Khaz you would just set the start and stop points and the program would pick the shortest path and pull any necessary special commands directly from the real room data. If you wanted it to take a different path then you would just set in waypoints that it would have to walk through and it would follow from start room to waypoint 1,2,3 and on till it reaches the end room.

Another nice idea would be a loop builder that uses the regen room data to determine the most efficient loop in an area. Perhaps it could convert them to waypoints and have it build a loop using that data. Maybe have it so you can set sets of max min room/map numbers in and then let it auto configure the loop from the room numbers the user provided and available data.

Another nice function would be a way of synchronizing database information from whatever server you play on so before it enters the realm it can check the server for content updates. This would be a nice way of always being up to date.

TCA




Quote from: The Crazy Animal on March 03, 2006, 12:53:26 AM
I have a few ideas for this for its later development:

A map/path, loop interface that would let you highlight a travel path on a map just by checking off the rooms you want it to travel through when auto walking. This way if you think very graphicly you could just draw your loop or path and not actually have to walk it in the first place.

I think a better way of figuring out a lost characters location would involve using a mudexplore like room database. The first step would be to search the database for a room with the same name and same available exits. If more than one is found the next step would be to remove rooms from the possible room list by looking into adjacent rooms and comparing their available exits to the possible locations.

This is what I had in mind, though it should really only need to do it once, from that point on, it'll know what room/map number its in.

Quote from: The Crazy Animal on March 03, 2006, 12:53:26 AM
The third step would be to then travel to an adjacent room and repeat the steps until the location is known. Since this requires less random walking it would be safer for the characters and should also be more efficient.

I?m also thinking that if it always knows where you are then it shouldn?t need as many defined paths just a list of destination rooms. It could then build the paths as it uses them. Which would be a more useful way of going about making paths provided content is updated frequently.

Similarly using a mudexplorer like room database. I was thinking if you could get it to write the scripts just using the room/map numbers and waypoints instead of using just the map directions. So if you wanted to write a script to walk from say Silvermere to Khaz you would just set the start and stop points and the program would pick the shortest path and pull any necessary special commands directly from the real room data. If you wanted it to take a different path then you would just set in waypoints that it would have to walk through and it would follow from start room to waypoint 1,2,3 and on till it reaches the end room.

I've given this some thought in the past, and I haven't yet come up with a way to do a search like this efficiantly...

Quote from: The Crazy Animal on March 03, 2006, 12:53:26 AM
Another nice idea would be a loop builder that uses the regen room data to determine the most efficient loop in an area. Perhaps it could convert them to waypoints and have it build a loop using that data. Maybe have it so you can set sets of max min room/map numbers in and then let it auto configure the loop from the room numbers the user provided and available data.
Good Idea...

Quote from: The Crazy Animal on March 03, 2006, 12:53:26 AM
Another nice function would be a way of synchronizing database information from whatever server you play on so before it enters the realm it can check the server for content updates. This would be a nice way of always being up to date.
Interesting, but I don't know if it'd work.  Though I think auto updating dat files will be important...   to hell with a full reinstall everytime a new mud version comes out :)
TCA




Quote

Anyone know how to display "Extended Ascii" characters through GDI?

I'm stumped...
Been testing the term on numerous bbs's to get the ANSI parsing workin right, and there are a few that won't even display due to this issue.

I've looked all over, and I can't find squat on it, minus Uniscribe/MultiByteToWideChar which don't work in GDI+

Not sure what to do here...   I could conver the characters to something else..   or try to detect them and manually draw the glyphs, but I think that would cause a performance hit...  especially withthe shaded boxes.

Good to see you're still thinking/working on this.  This is more of an encouragement post than a help one.... keep up the good work!  ;)
If we can hit that bulls-eye, the rest of the dominoes will fall like a house of cards.? Check-mate!

Quote from: Stylez on March 04, 2006, 04:45:22 PMAnyone know how to display "Extended Ascii" characters through GDI?

Should just automatically work if you have the right font selected. You can use a raster (bitmap) font like "Terminal" (which ships with Windows, so you can rely on everyone having it), or you can use an opentype/truetype font like "Lucida Console" (which ships with recent versions of Windows, anyways). Both of those should have high/extended ASCII characters.

If nothing else, try to get a font editor and make your own (for your purposes you only need to create 255 characters, so it's not like you'd be creating all sorts of funky characters). If you make your own, you can embed it in your executable as a resource and access it that way.

Ooh, here's a feature I'd like to see that pisses me off severely in megamud.

I like that your char will stop before entering a boss room.  But it's REALLY annoying when you're level 50 and you stop before entering the mad wizard or giant spider.  I'd like to see a "Stop before entering if below level" type parameter for each monster (or for bosses rather).
If we can hit that bulls-eye, the rest of the dominoes will fall like a house of cards.? Check-mate!

That has nothing to do with us we didnt make megamud, and have no plans to make a new megamud.

I wasn't talking to you DC :P

I was talking to Stylez.  You da man  ;D
If we can hit that bulls-eye, the rest of the dominoes will fall like a house of cards.? Check-mate!