PDA

View Full Version : Milestone 3



RonHiler
11-05-2007, 11:06 AM
Alright, now that we've released M2, and fixed my silly vertex buffer overrun bug, I'll be starting M3 pretty shortly (I'm going to do a quick update to the character planner, but it'll be VERY quick). I'll also be posting version 3 of the design doc shortly, which has grown a few more pages again.

M3 is not going to be a very glamorous one, I'm afraid. In fact, it adds nothing to the gameplay aspects of MD at all. It's all about the Credits screen and the Options screen (where you select resolutions and set volumes and such). Of all the milestones, this one is probably going to be the least interesting, to be totally honest.

I put it up front because I thought it important to have the credits screen working as soon as possible. Not that I particularly care about seeing my name on the game, but if anyone else works on it (like Shane already has), they deserve to have their name appear, and I'd rather just be able to do that instead of having to just make vague promises about putting them in.

On the good side, most of the heavy work for M3 has (once again) already been done. A lot of the setup work for changing options was completed in Milestone 1 where the user machine was analyzed and enumerated, so I already have a full list of things to put into the option selection panels, and that's really the hard part. The options screen will need to be designed (i.e. placing text and buttons and stuff), but that's not difficult (just a little tedious).

The credits screen will be the same one as we had previously, because I thought that worked pretty well.

So, hopefully, it will go fairly quickly, and we can move on to more interesting work.

Shane Christopher
11-05-2007, 04:09 PM
Me and my gf (art degree :)) are gonna revamp the user interface. I showed her what's there right now and it's pretty obvious the entire lot needs a bit of a redo. How hard would it be to have seperate graphics for each of the panels in the main game screen? Right now the stretching of the same graphic for each pane looks pretty bad.

RonHiler
11-05-2007, 04:54 PM
Cool! Thank you, and thank her for me! My bad programmer graphics do need to be replaced, hehe.

It's quite easy to have different graphics, though I have to do it through code (there's no ini file that sets the textures, so you can't do it without a recompile). But in terms of coding, it's a one line change per panel.

Pix
11-05-2007, 05:37 PM
(there's no ini file that sets the textures, so you can't do it without a recompile).

Insert retching sound here.

:)

RonHiler
11-05-2007, 08:15 PM
Heh, I know Pix. That's a feature that is complex enough that it probably would be feature creep for me to add it. Once we hit version 1.00, I can start putting in these "wish list" kind of things, and I'll set up some sort of configuration file to let you do your own skinning. Maybe an xml file of some sort.

Shane Christopher
11-06-2007, 03:44 AM
xml is a nice way of doing it. Civ4 used a system just like that which let modders change the entire interface. Not that I'm looking for anything like that :)

At the moment I can do it all in a mockup in photoshop. The graphics that are there at the moment can just be changed in the folder to see how they look. I was sure I did a different background for the menu at some point but I can't seem to find it. Was the background that's there at the moment mine?

RonHiler
11-06-2007, 07:32 AM
No, the selection screen background is one I did, which is why it's not very good. It's basically a bunch of pictures I scanned from a book then did some post-processing with in PSP. I'm not even sure that it's entirely legal to do that, heh. So I would not mind in the least if there was a different background put in for that screen :)

RonHiler
11-10-2007, 08:43 AM
Well, there are 12 steps in M3, and I'm now working on number 7, so we're over halfway there numerically. In actual work, I expect the last four steps will take the longest.

RonHiler
11-18-2007, 10:20 AM
So I just now finished step 7 of M3, which was all about the drop down selection box. Not particularly exciting stuff, I know. But all these UI elements have to be in, so they've got to be coded, heh.

Now the drop down selection box actually consists of a read only edit box plus a selection box (plus a bit of it's own code), so I had to add those first, so in actual fact we got three new UI elements for the price of one. A lot of this stuff had already been coded (in Enzyme) though I went through the code and upgraded it to my current programming standards.

We now have several UI elements that use bounded text (where the text has the possibility of being cut off on one side or another due to being contained in a certain space). You might be surprised how often we have to deal with bounded text, so far we have the progress bar, edit box, text box, selection box, drop down selection box, and check box classes, all of which use the bounded text drawing function.

You may remember from M2 the bounded text function was seriously fubared. As I was adding in the new UI elements, it got increasingly obvious I was going to have to deal with this function once and for all (not that I wasn't planning on doing that anyway in this Milestone, but I was putting it off as long as I could). This function is relatively complex, because not only does it have to deal with cutting off text on all four sides of the bounding box, it also has to deal with extra spacing on all four sides as well. So there are a lot of permutations to deal with. Anyway, the bottom line is I went through this function (in fact, I ripped the entire thing out and recoded it from scratch) and it now works perfectly in all cases, at least as far as I can tell. Even the progress bar, which probably has the most complex use of bounded text, seems to be working just as intended.

So that's what took a while for this step. As of right now, that kills all the remaining known bugs in MD from the second milestone. Moving on to step 8, which is the slider bar class. ooooooohhhhh! :D

Shane Christopher
11-20-2007, 09:46 AM
The life of a programmer is never dull!

RonHiler
11-20-2007, 10:56 AM
Heh, yeah except this particular Milestone is pretty dull, I'm afraid. Ah well, it has to be done, and better to get it done early on than later.

Speaking of which, I'm working on steps 9-11 now, which is all about user settings (9 is display settings, 10 is sound settings, and 11 is keyboard/mouse settings).

I have the interface more or less set up, but I'm not entirely sure what settings to give to the players to adjust. Currently for display I have Adapter selection box, a fullscreen/windowed mode toggle, and a resolution selection box. I think I want to add a gamma adjust to that. But is there anything else I should put in?

For sound, I will put in a volume control (obviously) and perhaps a card/driver selection, but I can't think of anything else to add.

And for keyboard/mouse, I have absolutely no clue what to put. I guess we could put in key bindings. I don't think there are really a whole lot of those, though, this is primarily a mouse driven game.

Any suggestions? The options screen I really intended (for this milestone) to just set up and get a few obvious things working, then add to it bit by bit as we work through the milestones and it becomes more obvious what kind of things we need to have in there.

Shane Christopher
11-20-2007, 11:33 AM
Graphics wise I would reckon that we will end up having varying levels of detail for the terrain so that it could run on lower end cards and shine on higher end. For example a lower end card by only be able to have the terrain tiles as 256x256 and dropping to 128x128 as you zoom out or whatever the values end up being. A high end card would be able to use 512x512 for every tile visible.

Then we have anistropic filtering and AA if we ever see any corners. Anti-Aliasing for textures could be an option too. Obviously these would be disabled for low end systems.

For sound I would reckon we could have a choice between software and hardware, maybe a limit to the amount of sounds playable at once? Really not that big a deal as even a soundblaster Pro can play 64 sounds at once I believe. Probably far more then we'll ever need.

As for keys/mouse like you said they'll become apparent as we go on. I'd like to see keyboard shortcuts for pretty much every action possible for hardcore players :)

RonHiler
11-21-2007, 10:30 AM
Graphics wise I would reckon that we will end up having varying levels of detail for the terrain so that it could run on lower end cards and shine on higher end. For example a lower end card by only be able to have the terrain tiles as 256x256 and dropping to 128x128 as you zoom out or whatever the values end up being. A high end card would be able to use 512x512 for every tile visible.

Hmmm, interesting thought. I currently have 100 available slots for the 512 map textures, 200 for the 256 textures, and 400 for the 128 textures. If we gave the player a slider with three or four settings, we could make those values changable. So people with more memory on their cards could have more 512 slots. That's a good idea, and easy to implement. I don't want to put esoteric values in the options panel though. Maybe we just give them a slider called "Main Map Memory" and give them Low, Mid, and High settings.

The rest of your suggestions are good too. AA for textures is simple to set up. Not sure about doing FSAA, it might blur the text, which is bad, but I would be all for texture AAing on specific textures.

I think what I'll do is set up the basic ones (and maybe the map memory thing) and we'll work the others into subsequent milestones as needed.

RonHiler
11-27-2007, 03:24 PM
Okay, so M3 is moving along pretty nicely. We hit a slowdown when I hit step 9, but I knew that was going to happen. On the good side, I'm almost through it, and I anticipate steps 10 and 11 will be fairly easy as they are pretty similar to step 9, only with less nuances (plus a lot of the setup work for 10 and 11 was done concurrently with step 9).

Looking through the recent log files for the game, I seem to have a bug somehwere in one of the UI elements that is on the configuration page. Most likely the dropdown selection boxes, I would suspect. They are causing the offscreen surface that holds text to continually release and recreate, which it's not supposed to do (it is supposed to do that if the text being placed there is bigger than the surface, but otherwise it's supposed to remain in memory). So something there is definitely amiss.

But other than that, things are looking pretty decent. The display settnigs are being properly pulled from the enumerator and presented, and you can select new settings, and very shortly it will actually apply those new settings, which is kind of a key point :)

Shane Christopher
11-27-2007, 04:04 PM
Gonna have to get me one of them there listy things..

RonHiler
12-05-2007, 01:15 PM
So you're probably thinking to yourself, "self," (you thought), "Ron said we were toward the bottom of the M3 list over a week ago, but there's been no news! What happened! Don't tell me he's gotten distracted by another game/project/article/story/home-improvement-project/etc again!".

No, I haven't :) I got hung up by a fairly nasty bug, so we're still pretty much in the same place we were, which is the very near end of step 9 (with parts of step 10 and 11 complete).

The deal is the program starts off in windowed mode by default. So far so good. If you then go to the options screen and change it to fullscreen mode, it will do so. Still good so far. But now if you change it again back to windowed mode, under certain conditions (i.e. if the windowed resolution is lower than what you had in your fullscreen mode), it would go to windowed mode, but the draw area would cover the entire window, rather than just the client area of the window.

It was a nasty horrendous bug to track down, because it's kind of internal to windows (or at least the way Windows and Direct3D interact with each other). I actually haven't killed it yet, but at least I now know why it's happening, I just have to figure out a way to slip a fix for it in there. I have a pretty good idea of how to fix it, but it's going to take some trial and error, which is the sort of thing that could take 3 minutes or 3 days.

So that's where we are at at the moment. Once I kill this bug (and I'm going to throw up a confirmation timer window), we'll be on to the next step, which is options for the sound. Which *should* be quite simple.

Hopefully :)

Shane Christopher
12-06-2007, 09:48 AM
Sounds like a bad one, hope you get it sorted out okay.

Before I realised what was happening with the repeat keystrokes I had a bug when changing resolution in fullscreen. It would be changing to 800x600 but then change to 1280x1024 so quickly that the screen area it was drawing on would only be the top left 800x600 rectangle, windows showed through on the rest of the screen and the program itself thought it was drawing for the full 1280x1024 screen so you could only see half the screen area you should have.

Was very weird but once I figured out that it was just flying headlong through the resolution changes I managed to stop it. Basically I was using the one key to cycle through resolutions to test them. Because of the repeat keystrokes it was cycling through them too quickly. Now I'm using a different key for each resolution. Now when it repeats it's repeating the same resolution so I don't get that problem.

RonHiler
12-11-2007, 09:34 AM
Alright, allow me to rant for a minute.

The bug I talked about above, where when you dropped to windowed mode after being in fullscreen where the graphics would draw over the top of the entire window rather than just in the client area? You know the one.

Well, I fixed it a couple of days ago. Worked and everything, I fully tested it and was satisfied the fix had done the trick. Happy, I moved on to working on the confirmation box (it's a message box that appears when you change your display settings. It's needed because, although your card will support the settings you select (because the program has already determined that before it offered you the option), your monitor might not, so it's possible to get into a setting where the screen is all messed up). So I'm working on that for the last couple of days, and it's causing me no end of grief itself. Sometimes what should be the easiest things are the ones that turn into the biggest pain in the ass.

And as I'm testing the thing this morning, I realize the switch to windowed mode is causing that same bug again that I just fixed two days ago. For what is literally no apparent reason, the bug has come back! This just makes me crazy! I removed the code I had added over the last couple of days and put everything back as near as I could tell to the way it was. And still we are getting this bug despite the fact that the fix I had added is still there.

This kind of thing absolutely makes me nuts. Combine that with the fact that resolution changing deals with Window and Direct3D setup commands which is without question my least favorite area of programming, because it's all stuff that is mostly out of your direct control (you just call API functions and hope everything works like it's supposed to, which half the time they don't). I don't mind UI programming or rules or file reading or AI or any of that stuff, but this particular area is my arch-nemisis. I'd take complex polygon triangulation routines any day of the week over this kind of crap. At least that follows logical rules of math, and if something doesn't work it's my fault, not the fault of some esoteric crappy Windows code which I have no clue on how to best fix.

So yeah, I'm more than a bit frustrated right at the moment. I'll get through it, to be sure, but it sure would be nice if I could get through it soon, you know, with my sanity intact!

RonHiler
12-12-2007, 10:21 AM
Well, what a difference 24 hours makes, heh. I refixed the window bug, and it seems to be playing with all the other code nicely. And I also have fixed the confirmation box, so the bugs are gone at this point. I'm continuing on. Have to finish up the functionality of the confirmation box (so that it does the revert and accept thing) and we're done with this step.

It's already been well over a month on Milestone 3, which is longer than I wanted to spend on it, so I'm going to try to push to get this done as soon as I can.

Strike
12-12-2007, 07:17 PM
Sometimes the best way to smash bugs is to get a good nap ;)

Which is what I'm going to go do right now.

RonHiler
12-13-2007, 02:27 PM
Sometimes the best way to smash bugs is to get a good nap ;)
Aye, that's the truth, heh

RonHiler
12-21-2007, 07:57 AM
Alright guys, I am now basiclly finished with steps 9, 10, and 11 of Mielstone 3. I have to do a little bit of minor work on the buttons to make sure they enable and disable at appropriate points (trivial), but otherwise everything works.

As I said before, there's really not a whole lot of options in the options screens at this point. For the display, you can select your adapter, the resolution, and whether or not to be in windowed mode or fullscreen mode. For the sound, you can adjust the master volume. For the keyboard, there is nothing there ;) I will add to these more over time, but I just wanted to get the basics set up for now. Adding to it is easy, getting it all set up was the hard part.

So I'm on to the final step of this milestone, which is the configuration file. It really shouldn't be all that hard, it's essentially just reading a text file, and I've done that about a million times lately :) And, of course, applying what it reads to the settings (but I just got finished setting all that up in the options screen, so that should also be pretty easy).

So we're pretty close to being done with this one. Which is good, it hasn't exactly been my favorite milestone, heh. The next one will be more interesting, as it has to do with building the player race.

Shane Christopher
12-21-2007, 11:30 AM
You are allowed half a day off for christmas, now get back to work.

RonHiler
12-22-2007, 02:13 PM
And what if I finish before Christmas? Do I get the entire day? :)

Milestone 3 has now been completed and I've uploaded it to the website. Check the download page for the newest version, and there are new screenshots available as well.

Shane, I have to give you my sincerest apologies. I forgot to give you credit for the AVI in the credit file. I've done it now on my internal version, so it will be in the next release. You did get credit for 2D artwork :)

Let me know if you (by which I mean anyone) find any bugs.

Next up will be an update of the Design Doc (presuming there is no hot fix for this one), and then we'll be off on Milestone 4 - The Race File.

Shane Christopher
12-27-2007, 06:01 AM
Don't worry about the credits, I'll survive! :)

Hope your christmas was good. Just got back from my parents to find our apartment water heater had burst. Yay.. luckily I got back just in time to stop it flooding everything. It looks like it burst today as the mains went but the freezer is still frozen up. Lucky I didn't leave it a few more days before I came back or the entire place would be under water!