Favourite blogs for Rob's Blog | blog.rwgs.net

My Favourites » Transport Tycoon 3D

March 13, 2007

Presentation Slides

Well, after the 15 minutes of projector issues the presentation went pretty well, slides worked, demo worked, couldn’t ask for too much more. Someone suggested they’d like to see the final slides, so here they:

No videos, obviously, links below,

PDF
Powerpoint 2007
Powerpoint 2000-2003

The two videos from the presentation were:

Landscaping from July 2006
Instancing from Feb 2007

Enjoy.


March 02, 2007

The Presentation: Beginnings of…

Well, this mornng I made a start on the design and opening few slides of my presentation that’ll be on Monday Week 10. It is fairly preliminary stuff for now, so it’ll be sure to get editted a few times before being complete. I’ve PDF’ed and XPS’ed up the 9 slides I currently have.

PDF Version
XPS Version

Luckily one of the copies of Office 2007 I won a few weeks back has arrived so I’ve been playing around with it, trying to avoid the temptation to sound effect every word for ‘comic’ value. Since I’ll almost certainly be using my own desktop in the presentation it does mean I don’t need to worry about any compatibility issues with Open Office “Impress”.

If anyone wanted to attend the presentation at 3pm Monday Week 10 they’re more than welcome. I’m not sure what the policy is on having non DCS students at the presentation itself, but it was called a “public event” – whether that means the Computer Science public or the university public I don’t know, I’ll have to find out.

Meanwhile development still continues apace, as there’s still quite a few bits I want to get done and/or fixed before the 12th.


January 21, 2007

Latest Progress

High resolution version (far better than Google Video) : TT3D Latest


January 12, 2007

More Progress?

Well, where are we? Progress over the Christmas period wasn't as great as I'd hoped for, and certainly I've dropped behind where I would like to be on my timetable.

 List of notable improvements since pre-Christmas:

  • Industries can be built and appear on the map
  • Buildings now occupy the tile(s) on which they are placed and other buildings cannot also be built there.
  • Depots and BusStations are now functionally and visibly different and serve different purposes.
  • Depots and BusStations can be built manually by using the GUI.
  • Depots and BusStations can be clicked on and the relevant windows appear andcan be interacted with.
  • ListBox is complete and can display lists of controls as well as always displaying n items at the top of the Listbox no matter how far up/down it is scrolled.
  • Industry, Vehicle and Station information is all now stored in XML files on disk and are parsed at runtime allowing content to be changed without a recompile.
  • Other miscellaneous fixes and features not worthy of mentioning.

The next point to reach really is a full implementation of Time and Money. What this means is that as time progresses Industries make cargo, this cargo can then be distributed to the stations that have the industry within their catchment area. The cargo is tagged with it's source location, picked up by vehicles from the station and delivered to another industry that accepts it. Once delivered the company is paid depending on how long it took.  Hopefully this should be too much more work, but I've said that before about other features.

It could be argued perhaps that once industries pickup cargo, transport it, then make money, that there is some strategy involved and TT3D now constitutes a game, "fun" is irrelevant for now as there are still too many niggling issues that detract from the fun-factor of the game.

I'd love to suggest a time when I'll next post an update, but I'd only be lying, so until the next time I find myself stuck in DCS for 4 hours with nothing to do...


December 09, 2006

Work Starts Here.

Follow-up to I'm alive from Transport Tycoon 3D

OK, here’s the update that was supposed to be a day or two since the last post…

If I could use one word to describe the progress I’ve made so far this term on TT3D it would probably be “pitiful”. I’ve never quite got in the “wow, this is so awesome” mood that I managed over the summer and go the first 10K lines written, I’m hoping I can pick that back up again starting this weekend.

OpenTTD Industries

According to my specification the last few weeks should have been spent on getting Towns and Industries in the game but it does seem that that is going to be easier said than done. This week has been spent trying to get Industries into the game and it has certainly proved more difficult than imagined.

Industries in Transport Tycoon come in varied shapes and sizes, but I had made the fatal error of assuming they were all rectangular, alas, Oil Wells and a few others scupper me. Each industry has many different visual respresentations, so while some factories are rectangular others might not be. It’s this that made me realise I needed to start loading data in at runtime now rather than hard-code it for a few more weeks and then worry about it later.

So to System.Xml and the creation of an Industries.xml settings file that is parsed at runtime. This data is then fed into the game and the game will choose what respresentation it wants at the time the industry is created. Currently my lack of models means I’m using my Bus Station/Shelter model to respresent almost everything in the game but it isn’t too much of a problem… yet.

My target for the weekend is to have industries of all types placeable within the world. Then I suppose they can’t really start producing “stuff” until I have the concept of “time” in the game, so that means a start date, and time-based movement. We shall see…


November 27, 2006

I'm alive

Expect an update in the next day or two. No surprises though…


August 23, 2006

Progress Video

Well, just less than 24 hours later the first of the three videos I uploaded to google video has been processed. Unfortunately the account settings for GV appear to be somewhat broken, and I only get error pages, so I can't check on the other two yet. Here you go:


August 22, 2006

A Belated Follow–Up

Follow-up to Work Continues from Transport Tycoon 3D

Some weeks go by where I implement features that are instantly visible to those playing and then there's some days/weeks where everything I do is behind the scenes and so it doesn't look like I've done anything. The last couple of weeks has been mainly the latter, although the rewrites to stuff behind the scenes has made it considerably easier going forward to get "stuff" done a lot quicker.

The GUI manager has once again been almost completely rewritten from scratch but will allow me to have much better control over how mouse/keyboard input is handled. Vehicle ViewWindows now follow the vehicle around the map rather than duplicating the main window, and a vehicle's orders can also be displayed in it's own little window.

Two vehicles are now in the world at any one time, making their way between 3 Bus Stations in the order set out in their Orders.

Up until now I've simply been hosting any videos I've made on my webspace in xvid (and occasionally WMV) format. However I've decided it's about time I put them somewhere sensible, so plumped with Google Video – mainly so I can host them in each entry without the user having to download/view the video.

The problem with Google Video so far seems to be that it takes a long time for them to "Process" the video, whether that involves any form of encoding or not I don't know, but as soon as my new video is "Live" I'll post it… 3 hours and counting.


August 08, 2006

Work Continues

I'm going to lay blame for my lack of updates squarely at the door of a) Smallville and b) TT3D itself. Although I've made some pretty good progress I've just not got around to screenshotting/Frapsing any of it lately.

I did however, make a quick build which should probably qualify has version 0.01 to check it worked on other people's machines, so a few 'lucky' people got to try that out. Anyway, I am alive, work is continuing and I hope I'll have something to show by the end of the week.


July 26, 2006

Shader Instancing

Once again a slightly long than intended break from blogging my progress, but until today there hadn’t really been much. For the last 3-4 days I’ve been researching/investigating a technique called “Instancing”. To put it simply, if you want to draw the same object many times over, you might as well just give the graphics card one copy of the object, and a list of places you want it drawn, rather than lots of copies and lots of locations.

For example, if I wanted someone to go and post 6 newspapers in my road, I probably wouldn’t say:

“Go and post a newspaper to 4 Western Road”
“Go and post a newspaper to 8 Western Road”
“Go and post a newspaper to 15 Western Road”
“Go and post a newspaper to 16 Western Road”
“Go and post a newspaper to 23 Western Road”
“Go and post a newspaper to 42 Western Road”

I’d just be wasting my breath, it could be put a lot simpler:

“Go and post a newspaper to [4, 8, 15, 16, 23, 42] Western Road”

While it doesn’t actually make delivering the newspapers any quicker for the delivery guy, theres less time spent awkwardly listening to me reel off “Go and post a newspaper to x Western Road” 16,000 times…, this is basically what instancing can do for drawing geometry/meshes in 3D graphics.

Theres a few different ways of implementing instancing, which I won’t go into, but suffice to say some are a) faster and b) better supported than others. While it might have made my life (and performance of the game) better if I’d used Hardware Instancing, 80%+ of people reading this probably then wouldn’t be able to play the game. So, I went with Shader Instancing, and it seems to be pretty quick.

To demonstrate, believe it or not, I’ve made a video. The video shows my game running with NVPerfHUD4 running over the top, this gives me lots of information about the graphics card etc etc. It also allows me to step through the individual stages in rendering a single frame of the game.

The map shown is 256 X 256 squares (the size of maps in the original “Transport Tycoon”) and is gradually covered with 65,536 depot/bus stations, one for every square on the map. With every square covered, we’re drawing 2,300,000 polygons per frame, an incredible amount. Had I tried this same test without Shader Instancing you might have mistook the game for a very slow slideshow of still images.

If you couldn’t tell already, I’m pretty pleased with the work involved in getting this done, and it really does mean I can start doing much more impressive things without the framerate taking a huge hit.

I’ve written enough for now, back to work. :)

Download video (Xvid, 11MB)


July 17, 2006

Unsnagged

Follow-up to A slight snag… from Transport Tycoon 3D

I posted just a few days ago slightly peeved at myself that I'd made such a rookie mistake with regards to my grid. Well, thankfully the fixes actually took a lot less time than I imagined, and by Saturday morning everything was in working order again with the new "4 squares" rather than two.

So soldiering on with Landscaping, and the GUI window associated with landscaping I did, and it's already looking fairly polished. Users can raise and lower land, and then use the level tool to flatten an area of land to a given height. I won't bore you too much with where the remaining areas are to polish up as they certainly won't be there too much longer.

Something that has worked surprisingly well was the small indicator (in fact, just a white cube) showing which vertex you are currently hovering over… something best demonstrated in a video!

Download video (Xvid, 4.4MB) – Average Quality, Small Filesize
Download video (WMV, 6.4MB) – Average Quality, Larger Filesize


July 14, 2006

A slight snag…

Well, there's no beating about the bush with this one, I've made a bit of a mistake. The problem isn't exactly easy to describe, but the crux of the matter is that 2 triangles per square isn't gonna cut it on the grid, I need to change for 4.

My plan for raising/lowering land (landscaping) was to be able to simply raise a corner, and have the four corresponding tiles (each corner is shared by 4 tiles) have their terrain change appropriately. As link demonstrates, the triangles to the left and right of the raised point are fine, the ones in front and behind are wrong.

So, the change to 4 triangles per grid square has a few of problems associated with it:

a) I need an extra vertex per square (in the middle) to be able to draw my 4 triangles, thus increasing memory requirements.
b) I have to draw twice as many triangles as I'd hoped, hurting performance there.
c) It's going to mean rewriting a substantial portion of the code I've already written, except this time, the rewrite is going to be even more difficult than it was before.

It certainly won't be impossible, and I should be able to have most of it back in order by the end of the weekend, but it's certainly a bit of a setback. On the bright side, once I'm done, I can demonstrate landscaping in a video, something I was about to do before I realised my mistake…


July 12, 2006

New GUI and Assorted Features

New VehicleWindow

Most of the work over the last few days has been on getting a skeleton GUI in place that can help me when I'm trying to work out how different features interact/interfere with each other. For example, if you aren't trying to click a button on a window, you don't also want the click to go "through" and onto the grid behind and build some road.

I also got round to working out how to turn on Mipmapping, which a) makes the grid look 1000 times better, and b) gives about a 6–7 times performance boost, since it's drawing lower resolution textures further away from the camera.

The green car representing, well… every vehicle under the sun will stay for a while longer until I get round to replacing it with something resembling a bus, but it's hardly urgent. Tonight's work is on "Landscaping", which means hopefully by this time tomorrow you'll be able to raise, lower, and even up land… that's the theory at least…


July 06, 2006

Vehicle Cameras and New Road Building

Bit of a gap since my last entry, but I'm really back in full swing now, and hope for a productive few months.

Road building/networks have almost be completely rewritten from scratch to make it infinitely more useable, now no knowledge of "where" to click in a square is required.

In a previous post I showed off the multiple "View Windows" which were essentially a view of the world through a separate camera, however at the time they simply showed the same view as the main camera. Fortunately now, these windows can now not only be in a different place in the world, but also follow vehicles around!

Today's video is slightly larger than before, 15MB, still Xvid, and demonstrates the new road building and a working Vehicle Camera in a window. Here it is. Enjoy.


June 16, 2006

Viewport Mania

Managed to get into the swing of making TT3D again yesterday, and probably one of the more important features looks well on it's way to be finished.

Anyone that's played Transport Tycoon will know that any vehicle can be clicked on brings up a small (or large, if dragged) viewport window that shows a live view of what the vehicle is doing. I've added a screenshot into the June 2006 gallery of me playing around with 6 viewport windows which currently only draw the same as the main game screen, but can very easily be changed to follow vehicles around the map.

Once again I've been making videos, this one is slightly larger in size than the ones before, but demonstrates 16 viewport windows open at once while I build some road and set a vehicle going. Click here for the 5MB video . As always the video is Xvid encoded, so if you don't have the xvid codecs installed, your best bet is trusty VLC Player .

Today I shall probably try and get some more substantial looking GUI'ness to the game, as it makes my life a lot easier.


June 14, 2006

All Exams Finished

Phew, all done, the last of the 8 exams finished at 5pm this afternoon, so I should be able to start work again on TT3D very soon.

I've still got to practice for the GT4 tournament (mentioned in a previous post) on June 30–July 2, but I'm sure I'll try and get some more features (and stability) in the game before I head to Paris. I'm certainly going to be spending a lot of time on the project over the summer, but thankfully since it's my 3rd Year Project, I can't back out of making it and give up, so it will happen.

If I implement anything cool between now and June 30 I'll be sure to snap/video it and post it here, so, until then have a good rest of term.


May 22, 2006

Some call it procrastination…

So I got a little bored of revision… and turned to the blog again. Nothing particularly earth–shattering has changed. I've added the gallery/rss buttons again on the left hand side, and managed to put my Xbox Live gamercard in the top right hand corner.

I've decided to create a gallery for each month that I'm developing TTDotNet/TT3D/[whatever else I refer to it as] so it's a bit easier to see the progress I make as time goes by. I've only got some screenshots from back in April, May seemed to be a month of short 'in–game' videos and revision, meaning I've not made much progress of late. Hopefully as soon as the exams have finished, and I've competed at GT4 at the ESWC at the end of June, I can really get my head down and crack on with some actual features.


May 09, 2006

No Transport Tycoon 3D At E3 2006

I know, it's gutting news, but I couldn't take time out of development to have a booth at E3 this year for TT3D. Perhaps in 2007 2008 never.

May 05, 2006

Road–Dragging / AutoRoad Complete

In what really should be one of my last things in TT3D before I start revising solidly, I implemented dragging of roads, not /quite/ as easy as it sounds given each square is only 2 triangles. A lot of the code that went into it will help a lot when it comes to doing work on Rail too.

Being able to build road networks a lot faster should help with testing as well, as before today it was click click click for every half tile you wanted… Anyway, another ~400KB video of road dragging, and if I post again, you'll know revision isn't quite going as planned.


May 04, 2006

Road Pathfinding Complete

Managed to finish the javacc a little quicker than I had expected, so spent the evening doing some more work on the road networks. While the actual method of placing roads is still a little shakey (half squares at a time, no dragging) it builds up a graph data structure to store the network. Currently every square is a node in the graph, but I've already implemented the concept of a "path" from point A to B, so just need to add a little extra functionality to remove straight lines as nodes.

On the pathfinding front, I think I am probably done. I did hope (before I started coding) that I'd be able to abstract rail/road networks into a single "network", but have opted not to, at least for now. Although they share many characteristics, signalling on rail networks is going to be a big enough pain that having the road network separate will make my life easier.

I chose A* pathfinding for a few reasons really, a) it seems generally to be the "fastest" of all the graph searching algorithms, b) OpenTTD uses it, so it must be good, and c) It's not as hard to implement as it might first seem. For a bit of extra reading, Wikipedia is a good place to start, while A* For Beginners does a fairly good job of explaining it.

No screenshot this time, just a video of the pathfinding doing it's stuff. A snip at 546K (xvid) it just illustrates a vehicle knows where it's going. Animation around corners and non–tiling road textures are the least of my worries at the moment :).