Considering how often I have little to nothing to write about in these posts, I've decided to try switching to weekly updates rather than daily. Hopefully this will mean longer, more interesting posts. So from now on, I'll be doing a post every Tuesday.
Tuesday, October 29, 2013
Updated Concept Sketch
Thursday, October 24, 2013
Until We Meet Again
Still debugging. Not much else to say really. It's looking like I'll be pretty busy today and tomorrow (in addition to being away this weekend). So no posts until next Tuesday. Hopefully, there will be some concept art doodles by then.
Wednesday, October 23, 2013
Compile, Run, Crash
Well, I'm now using the new math library in the game, but there are still bugs I have to fix. I'll be house sitting this weekend so there won't be any posts on Saturday, Sunday, or Monday. I also won't have my computer with me, so I won't be able to work on the game. I'll try to get in some drawing time and maybe have some concept art to show by next week.
Tuesday, October 22, 2013
Still on a Tangent, but Winding Down
I'm still on my math tangent, but I'm winding down. I finally understand spinors and multivectors well enough to implement the basics. I found a really good primer on geometric algebra which filled in a few gaps in my knowledge and cleared up some misconceptions that I had.
My plan is to finish up a basic implementation of spinors (generalizations of complex numbers / quaternions), and then replace the hard coded math library I've been using with this general one. Why? Mostly because I can. My game doesn't really require super complex math, but it may come in handy.
I've been trying to get away from some of the bad math used in computer science, not just in this game, but in all my coding projects. In addition to basing things on geometric algebra, I'm also using tau (2 pi) instead of pi. Despite the work it took to learn these concepts (and more importantly, how they change traditional theories), I can happily say that they've actually made things easier.
My plan is to finish up a basic implementation of spinors (generalizations of complex numbers / quaternions), and then replace the hard coded math library I've been using with this general one. Why? Mostly because I can. My game doesn't really require super complex math, but it may come in handy.
I've been trying to get away from some of the bad math used in computer science, not just in this game, but in all my coding projects. In addition to basing things on geometric algebra, I'm also using tau (2 pi) instead of pi. Despite the work it took to learn these concepts (and more importantly, how they change traditional theories), I can happily say that they've actually made things easier.
Sunday, October 20, 2013
More Links!
So yep, I'm still working on math stuff. I should probably stop, because it's not really necessary for the game, but I'm enjoying the tangent.
So here's a list of some nice games you might not of heard of!
Papers, Please - A game about stamping passports at the border. All about making tough choices.
Shelter - In this game you play as a mother badger protecting her young from the dangers of the world.
Space Chem - From a while back. An awesome puzzle game about chemistry (sort of).
Last Year's PAX 10 - All good games. Check the link for descriptions. Towerfall and Ridiculous Fishing were particularly good.
My family is visiting today, and I probably won't have much time to work. I think I'll skip tomorrow's post. Be back on Tuesday!
So here's a list of some nice games you might not of heard of!
Papers, Please - A game about stamping passports at the border. All about making tough choices.
Shelter - In this game you play as a mother badger protecting her young from the dangers of the world.
Space Chem - From a while back. An awesome puzzle game about chemistry (sort of).
Last Year's PAX 10 - All good games. Check the link for descriptions. Towerfall and Ridiculous Fishing were particularly good.
My family is visiting today, and I probably won't have much time to work. I think I'll skip tomorrow's post. Be back on Tuesday!
Saturday, October 19, 2013
I Got Nothin', Have Some Reading Material
Still working on more of the same. Since I don't have much I can say about my personal progress, I'll put up some links! For fellow programmers out there (or anyone mathematically inclined), I would highly recommend reading up on Exterior Algebra (also known as Grassmann Algebra) and Geometric Algebra. Both are ways of extending Vector Spaces to be more useful and awesome. The two are very similar, but Geometric Algebra is more powerful.
Eric Lengyel gave a very good presentation on Exterior (Grassmann) Algebra at GDC 2012 (one that I saw in person!). It goes over what Exterior Algebra is, why everything you know about rotations and lighting is a lie, and what some good applications are.
Probably won't have much to report tomorrow either, so I'll try to dig up some non-mathy links to share then.
Edit: Retroactively linking a really good Geometric Algebra primer.
Eric Lengyel gave a very good presentation on Exterior (Grassmann) Algebra at GDC 2012 (one that I saw in person!). It goes over what Exterior Algebra is, why everything you know about rotations and lighting is a lie, and what some good applications are.
Probably won't have much to report tomorrow either, so I'll try to dig up some non-mathy links to share then.
Edit: Retroactively linking a really good Geometric Algebra primer.
Friday, October 18, 2013
Another Day in the Land of Math
Nothing much to report. Just making slow progress. I also drudged up an old vector/matrix library that I want to use. I'm making a few changes to it to incorporate things I've learned since writing it.
Thursday, October 17, 2013
The Job Process
Finished up the revisions to pathfinding. I've been thinking about how to get the robots to automatically pick up and finish jobs, and this is the process I'm going to use.
In general, jobs may depend on other jobs being completed. Most will require at least one hauling job to move something from one place to another. The only part of that process I'm still shaky on is finding the best robot for a given job. For example, how far away does a well qualified robot have to be before it's better to just pick a nearby under qualified robot?
- Create job at location. Jobs have required resources and required labor.
- Find the nearest available resources and create a hauling job for each one.
- Find the nearest and most qualified robot to complete the job.
- Once all resources have been gathered, signal the robot to come complete the task.
In general, jobs may depend on other jobs being completed. Most will require at least one hauling job to move something from one place to another. The only part of that process I'm still shaky on is finding the best robot for a given job. For example, how far away does a well qualified robot have to be before it's better to just pick a nearby under qualified robot?
Wednesday, October 16, 2013
Variation
Still refactoring code, but making good progress. For one thing, there can now be multiple terrain types. The grid is now fully 3 dimensional. Pathfinding will now consider not only the tiles the bot is moving through, but the tiles it has to move over as well. Objects and units have been consolidated into a common type, and there can now be multiple objects on a single tile. Basically, all changes under the hood. It's not much, but here's a screenshot showing off multiple terrain types.
Tuesday, October 15, 2013
Pause for Maintinence
Whelp, I inadvertently ended up taking another day off. Sort of. Laundry and dishes had been piling up so I decided to take care of those and ended up spending the whole day cleaning. So yeah, sorry for another day of no progress.
Monday, October 14, 2013
And On the Seventh Day, He Had a Hangover
Well, it's a little late for a 'morning' post, but here it is. I had a great time at my friends party. So great in fact, that I spent all of Sunday recovering from it. I did, however, get a lot done before the party. Unfortunately, that mostly involved refactoring, so no new screenshots. Still working toward getting some AI and having a better rendering pipeline. Made some changes to the way pathfinding is set up, which I'm hoping will be more efficient and flexible. That's all for now!
Saturday, October 12, 2013
Architecting Robot Intelligences
TL;DL, it's going to take me a while to get real, interesting gameplay, so I'm putting last week's goal on hold. I'll still be working on it, but I'll focus on other things in my posts until I get a little further along.
Did some more work on fleshing out a rendering pipeline today. It's a little new for me. I'm familiar with graphics programming, but I've never had to set up a pipeline for it. The projects I've worked on either had someone else working on that or were too small to need a robust pipeline. It's an annoying problem because there is an absolute 'best' solution (fewest possible GL calls), but in practice, it's better just to settle for a 'good' solution.
As far as actual gameplay goes, I did a little work on that as well. You can use the menu to create build orders now, but I still have to write some AI to make the robots actually carry out those orders. And the more I think about it, the more I realize that that's going to take a while. Since orders can be scattered about the map arbitrarily, I need some way to determine which robot is closest and most qualified to carry out the order. In principle, there could be obstacles in the way (for example, a wall that you had built earlier), which means it's more complicated than just picking the closest robot.
I also need to somehow keep track of which robots are working on which jobs. The robot needs to know so it can work on the job, and the job has to somehow be marked as 'in progress' so that other robots don't take it. Additionally, resources are needed to complete jobs, so those have to be moved to the job site, meaning that I need to give the robots an inventory.
No post tomorrow, I'll be out with friends. And I think I'm going to start writing posts in the morning rather than before bed, so next post should beSunday Monday morning.
Did some more work on fleshing out a rendering pipeline today. It's a little new for me. I'm familiar with graphics programming, but I've never had to set up a pipeline for it. The projects I've worked on either had someone else working on that or were too small to need a robust pipeline. It's an annoying problem because there is an absolute 'best' solution (fewest possible GL calls), but in practice, it's better just to settle for a 'good' solution.
As far as actual gameplay goes, I did a little work on that as well. You can use the menu to create build orders now, but I still have to write some AI to make the robots actually carry out those orders. And the more I think about it, the more I realize that that's going to take a while. Since orders can be scattered about the map arbitrarily, I need some way to determine which robot is closest and most qualified to carry out the order. In principle, there could be obstacles in the way (for example, a wall that you had built earlier), which means it's more complicated than just picking the closest robot.
I also need to somehow keep track of which robots are working on which jobs. The robot needs to know so it can work on the job, and the job has to somehow be marked as 'in progress' so that other robots don't take it. Additionally, resources are needed to complete jobs, so those have to be moved to the job site, meaning that I need to give the robots an inventory.
No post tomorrow, I'll be out with friends. And I think I'm going to start writing posts in the morning rather than before bed, so next post should be
Friday, October 11, 2013
Rendered Speechless
Slow day. Still thinking on how exactly I want to do things. I took off on a tangent and started thinking about ways I could make a better rendering pipeline. Not much else to say today. Probably no post tomorrow Saturday night. A friend invited me to a housewarming party, and I expect there will be drinking.
Thursday, October 10, 2013
Debugging: Hours of Hard Work Just to Break Even
Today I fleshed out the GUI system and made it usable. I added in a sub-menu to test it out; it should be easy enough to fill out the items as I need them. Aside from that, I got sidetracked with a handful of annoying bugs that took a while to track down. One was in my bitmap importer. It was turning some of my textures red. There was another with a small change I made to the input system. Turns out I just wasn't calling the function. The goal for tomorrow is to be able to order robots to be built. Not sure how long it'll take me to write AI for the bots to actually carry out those orders. I've been playing a little Dwarf Fortress in my spare time hoping that I might pick up some ideas on how to implement it. Additionally, I headed into the city and had a few beers with some people I know, because it's important to leave the house occasionally.
Tuesday, October 8, 2013
Uneventful
I'm trying to put together some kind of event system for the menus. It's making me miss C#. I love C++, but its pretty much terrible when it comes to event driven systems. The whole thing's proving to be a bit more tricky than I anticipated. I've never really thought in depth about how to make a good GUI from a programming perspective. Will continue working on it and have another post tomorrow.
What's On the Menu
Today I renovated the text renderer. Once drawing text was no longer a huge hassle, I started working on the GUI and now I finally have one! The buttons don't do anything yet, but they're there and they're being drawn. Here's a break down of what each button is for:
- Log - Opens up the mission log. This lists important events in the order they have occurred.
- Construct - Choose robots and/or buildings that you want built.
- Orders - Order your robots to perform certain tasks, like mining and paving roads.
- Stockpiles - Designate where resources and other items are to be stored.
- Mission - Checklist of mission goals.
- Robots - A list of all your robots and what they're doing.
- Jobs - A list of jobs in progress and which robots are working on them.
- Priorities - Order the importance of various tasks.
- Status - General status.
Obviously, those are all subject to change, as is the layout and sizing. Tomorrow I will work on getting the buttons to actually do things.
Saturday, October 5, 2013
Slow and Steady
Didn't get a whole lot done today. Some, but not a lot. Slowly dissecting a giant main function into proper classes. Did some thinking about how I want to do the GUI. Worked on improving text rendering a little to make working on the GUI easier. Been making slow progress these past few days, but progress nonetheless.
Pause
Didn't work on the game yesterday. I did that thing where one goes out into the world and socializes with other people. I'll also be taking Sunday off to spend time with family.
Friday, October 4, 2013
All Work and No PLY
Whelp, I got sort of sidetracked today. I figured I'd work on writing some code to import models. I started an OBJ importer a while ago, but abandoned it. I worked on it briefly, but then decided to look into some other formats. I've written an FBX importer before. I'm not a fan of the format, for many reasons. I'm in no hurry to use it again any time soon. Additionally, I'm planning on using Blender for modeling. While Blender does have an FBX exporter, it doesn't officially support importing FBXs, which is inconvenient to say the least.
So I looked into STL and PLY. It didn't take long for me to dismiss STL, but I was quite taken with PLY. I started writing an importer. By the time I had nearly finished it, I had started thinking about how often I seem to write parsing code and decided it was about time I just wrote something that can handle regular expressions. By the time I had done a little of that, the day was spent.
I'm not sure how much more time I'll end up spending on those things. It may be a few days, or I may set it aside for a while and get back to focusing on the game. In any case, I'll leave you with an appropriate comic from XKCD.
So I looked into STL and PLY. It didn't take long for me to dismiss STL, but I was quite taken with PLY. I started writing an importer. By the time I had nearly finished it, I had started thinking about how often I seem to write parsing code and decided it was about time I just wrote something that can handle regular expressions. By the time I had done a little of that, the day was spent.
I'm not sure how much more time I'll end up spending on those things. It may be a few days, or I may set it aside for a while and get back to focusing on the game. In any case, I'll leave you with an appropriate comic from XKCD.
Thursday, October 3, 2013
Another Day, Another Blog Post
Not much of note happened today. I've mostly been refactoring code. Which is to say, I've been fairly productive but have little to show for it. My goal for the upcoming week is to have all these things happening:
- Player can create orders to build the Basic and Solar robots.
- Robots automatically carry out these orders.
- Solar robots gather energy from the sun.
- Other robots receive energy from Solar bots when they're running low.
Once I have that much, it should be easy to build more off of it. I also thought up some more possible resource types: hydrogen and carbon. Plastics are mostly made up of these two elements. Thus, these elements would go into 'fast' robots (to complement silicon for 'smart' robots and iron for 'strong' robots). Hopefully tomorrow's post will be more interesting.
Wednesday, October 2, 2013
A* is Born
I finished up implementing A* today. There were a lot of bugs I had to work though, but it seems to be working now. There's still a minor bug left. Under certain conditions robots will go through an extra square. It's weird, but predictable and doesn't break anything so I'll look into it later.
For those familiar with A*, I'm using an unusual heuristic that I learned from one of my professes in college. The robots can only move to adjacent squares, diagonals included. The heuristic returns the shortest possible distance obeying those rules. It's cheaper than Euclidean distance, but more accurate than Manhattan or Chebyshev. Incidentally, because the robots can only take those kind of paths, the heuristic is also admissible (it'll never over estimate the distance).
I've also added a travel cost to each tile. This can be used to make tiles more difficult to travel through. For example, rocky terrain would have a higher cost than paved roads. Here's a picture of the pathfinding in action. The black tiles are walls, and the green tiles are the tiles considered by the algorithm. The robot is moving from left to right.
For those familiar with A*, I'm using an unusual heuristic that I learned from one of my professes in college. The robots can only move to adjacent squares, diagonals included. The heuristic returns the shortest possible distance obeying those rules. It's cheaper than Euclidean distance, but more accurate than Manhattan or Chebyshev. Incidentally, because the robots can only take those kind of paths, the heuristic is also admissible (it'll never over estimate the distance).
I've also added a travel cost to each tile. This can be used to make tiles more difficult to travel through. For example, rocky terrain would have a higher cost than paved roads. Here's a picture of the pathfinding in action. The black tiles are walls, and the green tiles are the tiles considered by the algorithm. The robot is moving from left to right.
Tuesday, October 1, 2013
How Shall I Path to Thee, Let Me Count the Ways
Worked on pathfinding today. I'm a little disappointed in myself that it's taking me more than a day to implement A*, but in my defense, I was trying to be clever about it. I want the game world to be as close to Mars in size as possible. Obviously, I'm not going to be pathfinding for the whole planet at once. I plan to only simulate the area the player is focused on at any time, while approximating time passing in other areas. However, the more efficient I can make things, the larger the area I can surround the player with. For now though, I think I'm gonna strip it down and make things simple. I can complicate matters later.
Subscribe to:
Posts (Atom)