Code design poll

A place to discuss everything Dragon related that doesn't fall into the other categories.
Post Reply
Julian
Posts: 51
Joined: Mon Nov 21, 2011 1:06 pm

Code design poll

Post by Julian »

Before I start - apologies for being a bit off-topic but I'd like you collective opinions on a slightly dragon related teaser

First some background and context. A couple of months ago Richard Garriot (the man behind the Ultima games) posted up his original game code complete for a coding competition, this same code became Akalabeth and evolved into Ultima i. The same code was "ported" to become Ring of Darkness (ported being a vague term here but the similarities between these games is undeniable). The competition was to get the game working either through a web browser or through the unity framework. For a bit of fun I entered the competition and chose to use Javascript mainly because of the simplicity in converting 80s era basic into a modern untyped script language. Simplicity came back to bite me in the rear as I'd failed to think through how to get keyboard input in a strictly single threaded scripting environment and ended up writing a fair chunk of code to turn the original code into an event driven engine. Having submitted my entry I figured why let all that work go to waste. I can't publish the game code I'd produced for the competition as the T&Cs prevent that but I can certainly re-use my creativity and methods so I came up with a plan - create a new game, in the style of those (very) early cRPGs with more than a hint to Garriot's work and to Humphrey's own interpretation that was the cause of many wasted hours for a lot of dragon owners. The guideline was simple, just code like the old days, let it grow and evolve.

The problem is that I've struck upon a problem in terms of design consistency.

The original games were strictly text only - in fact the original Garriot code was just a player wandering around a dungeon type map. I've used an interpretation of RoD's world as a broader sheet though, sticking to text only but frankly it is hard work as there is little to guide around the map and it is down to just dumb exploration unless you know where you're going - not particularly user friendly but very much of that era. At the moment it feels more reminiscent of the likes of ADOM (http://www.adom.de/) but without any modern visualisation. Having coded up the world map and town map gameplay I need to decide what to do with the dungeon map gameplay. Garriot went for the blind text only (you have to request a render of the local area when you want it), his later games though produced a basic 3D view using line drawing (sound familiar?). RoD uses exactly the same view. Producing line drawing in Javascript is a nightmare but I have ways to simulate this however it would then make the dungeon map game completely at odds to the rest of the game and that also irks me.

So to the point then - what would be the better option?

1) Stick with the strict text-only rule and no auto-visualisation
2) Ditch the text-only for the dungeon and do the line drawing 3D
3) Go even more retro and use ASCII art 3D
4) Go roguelike and maintain an ASCII map at all times
5) Go RoD style and abandon the text-only rule completely

There are plenty of grey areas there too so I'm open to suggestion.

I'm reluctant at this stage to provide a link to the site as it really is not finished (although it is playable) and I have a significant bug to fix that causes the game to freeze at random. If you're desperate to see it, just ask
Mdemon101
Posts: 16
Joined: Fri May 30, 2014 4:50 pm

Re: Code design poll

Post by Mdemon101 »

I'd go ROD style. I loved that game and would be nice to see a new variation on that theme. If it ever sees the light of day will it be available to play on a 32 or 64 or am I missing the point of the whole code design competition? All the best with it any way!
Julian
Posts: 51
Joined: Mon Nov 21, 2011 1:06 pm

Re: Code design poll

Post by Julian »

The point of the competition was to turn the original code (complete with hideous typos and bad grammar) into a game that would run in a modern browser on pretty much any modern computer. Sadly that doesn't include 8 or 16 bit computers although a well spec'd Amiga might be man enough (just).

For most people though it should be possible to play the game on any computer running Windows XP or later, Apple OSX or Linux all provided they can run javascript, it doesn't even need to be a particularly quick version of the language as I am really not stressing it although there are a number of implementation improvements needed as the game grows and I need to sort or access data more quickly.

In theory it should be relatively easy to reverse engineer the code to work on a '32 but it would need attention to the compact nature of the design data - one of the horrible aspects of modern programming is how lax you can be on memory efficiency without any obvious implications. The current code stands at about 200k including the rather substantial jquery libraries to provide cross-platform consistency. I could ditch a large chunk of that, compress the data and re-factor the code - the result with basic token compression would reduce the current code and data down to about 14k but I'd likely add another 10k in data before I'm finished assuming I stay with the current design decisions. That would certainly be a worthy coding experiment.

As soon as we start talking graphics however the size bloats rapidly
Mdemon101
Posts: 16
Joined: Fri May 30, 2014 4:50 pm

Re: Code design poll

Post by Mdemon101 »

Thanks for the explanation, especially so a layman like me can understand it! All the best with the project and I 'll keep an eye out on this thread to see when it's finished.
Julian
Posts: 51
Joined: Mon Nov 21, 2011 1:06 pm

Re: Code design poll

Post by Julian »

In the light of no other responses (yet) I've started playing around with the text console emulation and a graphics viewport to the end of achieving those signature wireframe views.

It works out that you need approximately 50 distinct graphic objects to achieve the desired results - drawing these in wireframe would take up a lot less memory as you're just following a formula but as I mentioned before Javascript doesn't do line drawing. With just greyscale to worry about I can compress the images massively with old school gif and even add in a few tease effects like dimming and fading in the distance. Obviously such effects would break the rules but the potential is there.

Would be nice to see a little more feedback but I guess this isn't a particularly high traffic area...
Julian
Posts: 51
Joined: Mon Nov 21, 2011 1:06 pm

Re: Code design poll

Post by Julian »

Just as a little tease - after a couple hours of code hacking and a lot more drawing and calculating what I feel is a suitable scale and vanishing point this is what I get:

Image

The viewport is currently overlaid so it looks a bit wrong but this is why I don't want to start handing out URLs until I'm good and ready.

The rendering engine turned out to be beautifully simple and requires about 40k of relatively large graphic blocks, about 100 lines of javascript and a lookup table of about 1k - inappropriate for a 32k computer but then I wouldn't use graphic blocks for that - line drawing instead plus the resolution would be signficiantly lower. The viewport shown is 648x308 - dropping that to 256x121 (same proportions) would drop the images down to under 10k - still far too large of course. A set of line drawing instructions would be a fraction still of that.
Julian
Posts: 51
Joined: Mon Nov 21, 2011 1:06 pm

Re: Code design poll

Post by Julian »

A little more work last night, a few tweeks and I have a working engine. The map is limited to just open and closed blocks as I need to create the images for other types (doors, pits, ladders, etc)

You can see it in action here:

http://youtu.be/3r1OE9b8PLw
Post Reply