Monday, April 30, 2018

Still On the Manual Thing

The manual is slow and steady, but while reformatting and reviewing it, I have lots of ideas for tutorials and guided tours now. I'm also jotting down ideas on how to implement the lessons in a back-of-the-napkin kind of way. As I said before, the keyfiles are simple list of what key was pressed and when. It does not save mouse clicks, and on top of which, the mouse is disabled when recording a keyfile anyway. However, one of the interesting things about ROE is that it has object list of all the buttons in the game. The button object info also includes the locations and sizes of them so I'll probably be capitalizing on that to highlight buttons that were pressed with a callout to the tutorial text.

Speaking of callouts, reproducing them in the manual is kind of tedious. If it isn't obvious, I'm using LibreOffice. Sadly, the callouts native to that program have boxes around the text elements. This means I'm having to do the text elements and the line separately. Looking at the original scanned manual, it appears that the graphics were physically pasted into the paper and the lines were drawn with pen. This is a massive improvement.

Anyways, back to putting my editor's hat on.

Saturday, April 28, 2018

Manual Labor

I've decided to make it a weekend project to finish the manual. At least get it current and into some kind of  baseline. I've had to update some graphics a little but most of it is simply pushing things into the right areas and putting pagebreaks just so. 

It's yet another unglamorous thing. But it's been fun updating some of the icons to Unicode. Sadly the symbols used for PageUp/PageDown and Home/End were not the ones that the Unicode standard chose. (But are the ones in the game) so I had to make due with a graphic.

Speaking of graphic I updated some of the lineart to SVG. Looks pretty snazzy.

All of this work is giving me ideas for tutorials. I think I have about five or six of them in my head now. I finalize them when I'm done with the manual. I'm on page 87 of 220 after a days worth of work.

Thursday, April 26, 2018

Keyfiles and Tutorials

I was able to knock out the keyfile/demo system today. It was pretty simple. I can now record and play back keyboard inputs as the basis of the upcoming tutorial system. However, it then became a question of... What should I tutor?

ROE has kind of an esoteric interface. It's one of the things I find charming about the game. However you shouldn't have to read a 220 page manual to learn how to play content anymore. Current gamers, for all of their nostalgia, reminisce about when games came with booklets. I can relate. However, here's a little tidbit. Right now I'm learning how to play breach so I can get the IGS linking done properly. That game is not very intuitive at all! It's 126 page manual, (Which also doubles as it's copy protection), is a bit heavy interspaced with stories and lore. However, you have to get to the end to find the quick-start tutorial and the key bindings. Another thing is RTSs have grown a little and there are conventions nowadays that didn't exist in 1991.

Giving the manual a facelift.
It get an idea what is important, I decided to end-to-end the ROE manual. While cracking it open, I figured while I had it, I might as well work on updating that as well. When I get the ROE sourcecode, it came with the manual in both DOC and Adobe Pagemaker 4 formats. Sadly, there is nothing that is going to crack open the Pagemaker files. The last program that could open those was version 7 and Adobe redirects you to InDesign, which can't open them at all. Such is progress I guess.

So I'm updating the DOC files, that seem a bit out of date. I'm filling in the gaps from a scanned PDF of the original manual. It's looking good, and while I go through it, I'll be getting together a tutorial syllabus and implementing what I think is important. Most likely there will be a run though of the Shakedown Cruise. This may require me to do a little datafile shenanigans as it will require me to make a commander and start a game that won't mess up the player's settings.

I'm also mapping what the actual command line arguments are for the game. I know most of them, but it's best get get them all written down somewhere.


Wednesday, April 25, 2018

Zoom Works - All Options Complete

Zoomed 16:10 on 16:9 display. Side borders are visible.
After straightening out my math I was able to get the Zoom option to work. I also added some bilinear filtering to make zoom and stretch options look a little better. It makes things a touch blurry, but That will look better when the HD graphics are implemented.

My next task is the Demo/Tutorial system. The demo system in this game uses what's called a "keyfile", which is a timed list of recorded keys pushed during gameplay. I have a sample demo file, but it doesn't have much. While I was checking the filesystem functions for the keyfiles, I saw that my data path variables could stand to be a global so that any function could use them. I streamlined that a bit.

During the initial porting process, I had an issue with the keyfiles before so I left them alone. The problem was I couldn't process the accelerator keys. I actually don't think I'll need these as all the commands I have run across so far don't use them. Especially as I'm going to use the keyfiles for tutorials. The idea is that with every keypress, a bubble will pop up explaining why that button was pressed. That tandem script will be found in a .tut file with the same name. The game only uses one demo file called "rules.dem" but I will take advantage that the keyfile loader allows for different filenames. The idea is the tutorials will be found in the F1 Help function. Right now it just gives a general blurb about the screen you are on. After adding the Option button, I should have no problem modifying the help system. I'll have to come up with a syllabus. Most likely I'll have it auto-play though the shakedown cruise mission as the "final" tutorial.

I've been working a little extra to make up for my lost GDC time. My Trello TODO list is getting shorter too :)

Tuesday, April 24, 2018

Stretch and Squish

Ship builder in 1080p. It's cooler then it looks
The ability to stretch the game full screen corner to corner works, along with the mouse. Going along with this was a little optimization to the rendering flow. I'm now prototyping the "Zoom-Maintain Aspect Ratio", but I started it late in the day and my brain is having difficulties mathing the proportions right. The aspect ratio is backwards so it's taking my 1280x800 picture and squishing it into a neat 1280x720. (i.e., it's applying the 16:9 aspect ratio of my screen onto the picture, and not the other way around.)


After the display squishing is done, the next project is the keyfiles, which should be turned into a Tutorial system. The keyfiles were originally the prerecorded input used for "demos", which was popular in the 90s. I may extend this a bit with a commentary file that is read in tandem.

It may not look like much, but it's going better then I imagined. 

Monday, April 23, 2018

Seamless

Overlap at the corners
So I was able to correct the seam problems. Most of it was overthinking the problem. What I was doing was tweaking the corners to try and hide the very edge of the texture. What I wound up doing was remodeling the cube to have the edges overlap by a tiny amount. That was able to fix the seam issue once and for all. On the right is the model I used. It was just a matter of making a cube and then "pushing" in each face a little bit.

I fixed the FadeIn() fader. It wasn't anything than needed a rewrite, just some order of operations were backwards. I also just got the starfield implemented.  I've having the border  update when the game updates the screen. Keep in mind that ROE updates the screen asynchronously. This means the border rotates faster on some screens then on others. This is actually a good thing, as it allows me to look for bottlenecks. ROE is not a computationally complex game, but some screens are giving me less then 10 FPS and my CPU is spinning up to 100%. Some screens "pause" input which causes everything to freeze until you press "OK". During my optimization pass I will need to get the background spinning as fast as possible and then I'll put in a timer to get the updates consistent. However, for now, the background is implemented. Now on to the squishy/stretchy bits.

The rotating starfield is ubiquitous while in full screen mode.

Sunday, April 22, 2018

Crossing the Border

Full screen experiment using a test border
So this implementation of the border code is going much more smoothy then I thought it would. I haven't started on the squishy/stretchy bits yet, but I have been able to shim in where to render the background. Even better, this allows the theme to have semi-transparent screens so that the background will show from underneath. I have the (admittingly unoptimized) skybox code functional. I have a "lab" that I develop experiments in. It's a completely different solution then the ROE project. I've used it in the past to work out color tinting, audio mixing issues, and other odds and ends to check if what I'm attempting if feasible. If it looks good, it goes into the main code with a little cleanup. In fact, the options menu was one of the first times I wrote a whole chunk of functionality in situ. Much of that required functions in the game itself

Seam errors
 As far is the skybox code goes, everything rolls in an lazy clockwise corkscrew. I have the camera slowly yawing and pitching to give it a slow precession. I am having a problem with my texture seams that I still have to work out. In Allegro, the textures repeat and so if you have a dark edge on one side and a bright edge on the other, the interpolation will sometimes "bleed" though. What you normally do is clamp the textures so you don't get rendering errors, but I don't seem to have that functionality in Allegro out of the box. There is a OpenGL extension I can use, but I think I can work with that I've got. If anything I can give the edges a little "push" outside the cube to hide that.

Sadly when fading in with the new border, it looks like garbage.  I'm going to need to recode the "fade in from black" function again, making it my 4th rewrite. The original game used a simple CULT fade, but I don't have that in Allegro 5 and instead rely on layers going from opaque to transparent on a timer. I think I may need to "Fix Once and for All" that code once and for all.

Saturday, April 21, 2018

Skybox


Testing the skybox UV mapping
So I decided to do things the "hard" way and make the starfield border a skybox. It just seemed like a better way to render it. If I would of gone with the 2D tile route, I wold have had to deal with a rotating a tile matrix and repeating textures. With a sky box I can make the stars pan, roll, and pitch in any direction with no repeats. So far everything works well. I have to remove a lot of the extra cruft and you can also see the skybox seams. I've played with skyboxes in the past with Blender so that's pretty easy off-by-one error you fix. As far as the textures go, I'm going to need to do some perspective correction, resolution boosting, and a apply a little little bicubic filtering as well. I know doing the silly 3D thing is kind of overkill, especially when most of it is going to be covered up by the game. However, what I'm envisioning in my minds eye is holding up and it should look much cooler then a boring black border.

I actually had to make the cube by hand, and manually set the UV points. I'm kind of glad I only had 36 vertexes to deal with. I'm also dealing with some pretty primitive 3D so I don't have to worry about surface normals pointing in the wrong direction. (They all are, which is why the numbers are backwards). This also means my skybox is also inside out , but as it's stars, it't not really a problem.

It Feels good to be back in the programming seat again. I'm going to need to fix this 3rd shift sleeping schedule soon.

Making sure the textures align.

Friday, April 20, 2018

Starfield

When you deal with aspect ratios, there is always going to be the question of what you do with the border. This is a big issue as ROE was originally designed for a 4:3 monitor. As I espoused in the past, the game was 320x200 which is a 16:10 aspect ratio. Doing a little research, from 2003 to 2008 16:10 displays were super popular for computers. It seems they were just square enough for laptops, and desktop uses like the extra height. In 2008, the market abruptly shifted to 16:9 to match TVs. The idea is, just make one aspect ratio to keep the cost down. Android phones, however, still retain the 16:10 aspect ratio.

Now that the options menu is done, I need to add the Zoom/stretch modes. In Native and Zoom mode I'm going to have a border. I plan to fill this space with an animated starfield.

My rendered border tile
I found a real cool free program that generates starscapes. It actually generates a skybox. For now I'm just using a texture that I rendered and then edited in Gimp to make it tileable. However, on second thought, I may look into the skybox idea. The upshot is that the borders will slowly be moving. Not fast, but more of a graceful roll with a comet streaking every once in a while. It may even change directions. Right now I'm doing rendering experiments to see if it matches what I'm envisioning in my head. I may devote the weekend to this experiment.

I was able to remove two cards off the trello list into the done pile. I'm no longer adding things to the "Todo" side so the alpha is good and underway.

I want to have a beta by June.

Thursday, April 19, 2018

More Darkwork

I'm still on the options menu. It can flip from full screen to windows mode and it can set the audio settings. I'm quite proud of myself as I can set the audio with sliders or clicking the buttons and with or without the mouse. I'm learning how the GUI works in this system and I'll be using what I know to attack things down the line.

It's taking a little longer then normal, but I'm now back in the saddle. That trip to GDC really knocked me out and it took a lot to get back into the proper headspace again. Tomorrow I'll be doing the text input and hopefully will be going on to the new graphic modes. It's really nice to be able to run the game without editing the config file anymore. The only other "Big" addition I'll be making is the demo system into a tutorial system. It's just a matter of extending the keyfiles a bit. Looking at my Engineering tasks in Trello, that's that and IGS integration, which is coming along as I work the filesystem. 

Wednesday, April 18, 2018

More Options Work

Still working my 3rd shift schedule. No glamorous screenshots. I'm still working on getting options to work right. Most of my work so far on ROE has been to get old functions to function and try and get the game to run as out of the box as possible. In this alpha phase I'm actually adding in functions that were not there before. For extra hard-mode credits, I'm actually using the original Nermal API. Keep in mind, there is nothing stopping me from adding functions in Nermal (I have actually extended it somewhat). What is different now is I'm adding functions into the game proper.

There's a lot of gluing and pixel counting.

I have (yet) another hacky solution to my themes. When the game runs "stand alone" the theme folders will be in the same directory as the executable. However, as I'm writing the game, they are currently not. Visual Studio is doing some path magic where my default folder is my working directory and the executable has been sequestered off into a "Debug" folder. Now that I explicitly name theme folders I need a copy of them with the executable, which botches up my working directory and saving my resources to Git. In Linux this would be no problem to solve as I could just make a symlink to the theme folder and call it a day. In Windows however....

In Windows you do exactly the same thing.

Did you know that Windows systems after Visa support symlinks? Yea, me neither! Actually NTFS 3.1 could do it in Windows XP, but XP's shell has issues with it. Now I have a duplicate theme folder that will change when I update from my working directory. Pretty cool.


Tuesday, April 17, 2018

A Slight Rework

My sleeping schedule is all shot again. I got up on Monday night and just decided to just work 3rd shift. I decided to rework the options menu. It looks so much better and appears like it belongs now. The reason why I'm using the "Classic Theme" is to keep things consistent. When I start implementing the new theme(s) I want to use "Classic" as my template.

Short of some hacks, I am able to read the config data for the most part. I discovered that my theme engine is quite hacky and needs to be corrected. Also, converting a char from 0-255 to a string from 0-100 requires and ugly cast to float. I something I can fix, my brain power is empty now. Also the sliders don't move when you click on them with a mouse. I'll steal that code from the captain builder.

This options menu covers everything from the installer with a few things cut. There is no audio on/off as setting the volume to 0 does the same thing. Also, the game auto detects a pointer device and will give a pointer if appropriate. As you saw from my touch demo, it hides the pointer automatically in that mode.

There is still some cleaning up the theme code and then starting on the Squish/Stretch rendering of the display. I *will* lose my blitter and my mouse when I do this, but it's better to break these and fix them then to have something break and not even know.
 

Friday, April 13, 2018

Keeping Options Open

Every once in a while I'll have an inconvenience get under my skin and I'll will want to fix something "Once and for all". I did this for the Nermal library and then for the BlitBit() function. (Something I rewrote three times).  Now that I'm in the mode of getting ROE feature complete, it was time to attack the "Options" button.

Layout is still in work.
Originally options were set when you installed the game. I added an options button, but all it did was change from windowed to fullscreen and required a restart I'm now adding options and putting in controls. It doesn't work quite yet, but when I get this functional, I'll be off to break/fix the scaling code. When I was at GDC, there was a developer there that made a "retro" game in 4:3 and came up with a slick way to animate the dead space on the sides when it was displayed on a 16:9 display. I told the chap that I as going to straight up steal his idea. He was happy to let me ape the design. I know that once I start messing with aspect ratios it's going to be all over the place. I might as have the option available to put things back when it inevitably screws up so I'm not hex editing the config file all the time. The listing in the screenshot should be all the options I need for this game.

I need to make a few buttons in the menu and get the input right, but this is going to be my pet project for a while.

Thursday, April 12, 2018

Easter Egg Hunting

Breach2 import works
So I have the ability to load Breach2 commanders now, which is nice. I only have a handful of filesystem functions left that depend on the stdio.h library. While playing the game, I noticed that if a mission had an enemy named "FWRP" that my communications  picture changed from the alen form to a human FWRP officer. I went hunting down where that was and that's where I discovered the "Easter Egg" aliens. I knew they were there as I had a graphic for them, but I never saw it loaded and I assumed that it was some legacy fluff.

Nope!

Turns out that there is a list if 14 alien names that will change the image of what your race will look like. They are listed below.

"'EJYO' DIVI'" =  Captain Picard
"TERRAN" = Blue Superhero(?)
"TLHINGAN" = Klingon
"FWRP" = Federated World Reserve Personal (In universe)
"FWSF MARINE" = Federated World Star Fleet Marine (In universe)
"ROMULUSNGAN" = Romulan
"OVERLORD" = Devil
"ALLIANCE SSE" (In universe)
"MARVIN MARTIAN" = Loony Tunes chatacter
"UNITED PLANETS" = (In universe)
"ROBBY ROBOTS" = Robot from "Forbidden Planet"
"GORT" = Robot from "The day the Earth Stood Still"
"METALUNAN MUTANT" Alien from "This Island Earth"
"CONRAD NEAL" - Dog with a bow tie

I tried making a Marvin Martian race and, yup... Easter Egg still worked. Sadly, those are going to have to be unceremoniously ditched except for the in-universe races. Cute Egg though.

Sorry Marvin :(

Wednesday, April 11, 2018

Breach 2 Integration

Breach 2 Detection code is in now. See the new Options button?
So I'm still trying to kick out the rest of the filesystem stuff and I'm working on the integration for Breach 2. This means that I need to make plans about how a theoretical Breach 2 game is going to install if I ever port it to Windows.  First thing is that the data files are going to be installed in a set location and I have that all planned out. Next is the Breach 2 commander conversion code, which I unceremoniously dumped a few weeks ago and now have to put back. I have some new code where I can detect if B2 is installed and then grab the files without asking for a path first. After this will be some backtracking to figure out why my mission loader is misbehaving. It's not only crashing, but some missions are being misread, but I'm pretty sure it's the IGS data that's embedded in the file. Emails went out to some people I met at GDC. I have a project request too, so I'll see what that is all about.

I also have to say, thank goodness I documented much of the core functions in  Doxygen. It's making adding buttons (Like my new "Options" at the top) and alert dialogs so much easier to do.



Tuesday, April 10, 2018

Wise from your Gwave!

Hey, It's been a while! Looking good! How are the kids? That cool.. Oh where have I been. Well, I wish I could say it was a long story but it was a double-whammy of being sick and a profound desire to just take a break.

I'm back for what it's worth.

Artist's rendering of my fate
It all kinda started on Friday at GDC. I had awaken from my slumber with what could only be described as my insides desperately wanting to get out. There are only two ways anything was going to exit my body and my entire digestive system was giving it a go at both ends. You know in the movies where Death decides to pay you a visit and it's always this skeletal from in a black robe and scythe? Well, remember that he's just one of the Four Horsemen of the Apocalypse. For some reason, Pestilence decided to stop by. I can imagine he was having a great time wandering about GDC in his green cloak, quiver, and bow. I'm almost positive he delighted in putting on every HTC Vive, Oculus, and PlayStation VR at the event. I mean, he did have a job to do. There were so many people from all over the world crammed into one place. I made an effort not to put my face into any virtual reality mask, but it was all for naught.

At 3:30am on Friday, a knock comes to my door. I get up and open it, and there, I swear to God, stood Pestilence.

"Hey dude," He says. "Mind if I chill for a bit at your place for a bit?"

I thought about refusing, but over looking over his shoulder into the parking lot, death was hanging out on his pale horse. He waved at me with a grin.

"That's cool", I said, like I had a choice. "I have an extra bed and the Wifi is free. The password is on the desk. If you don't mind. I have to go to the bathroom now and empty the contents of my stomach in the most uncomfortable way biologically possible."

"Sweet!", Pestilence said, letting himself in and jumping into the extra bed. "Do they have cable here?"

"BLLUUAAARRGGAGGAHHHHHH" I said into the toilet.

I was supposed to checkout that day at 11:00am. I was planning on spending the rest of the day a GDC with my luggage tucked away and catch my red-eye home. I wound up having to pay an extra day at the hotel. I ordered room online with means the rate went to $140 for the extra 10 hours. When my alarm woke me again at 8:00 at night, the horseman was still in the other bed on his phone. I got up and packed as best I could and made my way to the office. My green cloaked friend followed. The front desk was very accommodating and, upon hearing that I haven't eaten anything all day, offered me a pizza slice. When I opened the box, Pestilence tapped my on the back with one of his arrows.

"I wouldn't eat that if I were you." He advised. "It's your call though!"

I nursed the pizza slice until I got to the airport.

The next couple of hours were kind of a blur. I honestly don't remember how I got back to Wisconsin. I kind of remember during the flight, Pestilence coming back from the bathroom and sitting next to me. I groggily rolled my head over to his direction. He was playing Candy Crush Saga.

"Look dude." I said. "I don't mean to be rude, but why are you following me?"

"Oh!" Pestilence replied, looking up from his phone. "I have this deal with the airline. I'm dead-heading to Chicago. There is this thing going on at the Jardine Water plant next to the mouth of the Chicago River. It's gonna be lit!"

"I bet"

When I got back home that Saturday morning, (I don't recall driving home, but my car is definitively in the parking lot), I fell exhausted in my bed, and spent the next week there. I have discovered that the older I get, the time to spring back from being sick gets a little longer. Not excessive, but it's noticeable. Whenever I do get sick I tend to have a persistent cough that hangs out a little longer then normal. But, as a parting gift, Pestilence decided that a bout of bronchitis would be a great way of saying goodbye.

During this time, coding was the furthest thing from my mind. I decided to just write off the whole adventure as a two week vacation. On Monday I had discovered that getting back into the code was such an awful experience I had no idea what to do. I had bookmarks all over the place. Trello in-works that were not in work, and other tasks that just seemed to be too monumental to attempt. I was drained and due to me work stoppage felt like Sisyphus at the bottom of the mountain.

I compiled the code I had. It still worked. I'm am now at my seat and ready to
start in what feel like starting over. I'm here now... I'm feeling OK. Thanks for asking :)