Okay, obviously we still need do some things, and, you know, eventually get Forge War online and everything, but the blog has been officially moved and I kind of like my new home.
Yeah, so, uh, not sure what else to say. Check it out. Not much to see at the moment, but it will only grow and get better from here. Yay!
So coding has been moving along. I’ve moved into the quest phase of the game and working in C# has provided one continued annoyance for me.
All right, in AS3, when I want to grab a variable dynamically (as in do I want to grab “Player1Quest” or “Player2Quest” depending on if some other variable “i” is 1 or 2), then that is totally easy. I set up a construction: this[“Player”+i+”Quest”], and I can grab the variable by constructing the string of its name. If I’m grabbing a movie clip object or something it gets a little more complicated, but there’s still a simple way to do it.
No so in C# my friends! Well, there may be a way, but I have yet to find it, and I’ve done some looking. So instead of doing something like:
I have 2 options – the smart way and the stupid way. Of course, up until this point, I’ve been using the stupid way. The stupid way being a series of “if” statements that add a much of needless lines to your code:
This is dumb.
The other way is to not have a different variables for all this player quest business and instead just have an array called “PlayerQuest.” Oh, holy crap, I’m a genius. Or at least not a moron. Then you can just be, like:
So much better! And I was doing this for some things, but I think I got hung up if the variable was already an array and for some reason I was apprehensive about making a 2D array. Or if it was a 2D array and I had to make a 3D array. Because I’m afraid of brackets I guess?
I don’t know, but I decided I needed to go back and condense all my variables into arrays before the stupidity got too much out of hand, so that was exciting, and now I can get on with my life.
Well, work continues on the Flash version of Forge War. I haven’t quite hit the next milestone – the market phase – but I’m pretty close.
I mean, the actual market phase is done, and that was much rougher than I expected. So much communication between the clients and the server, with bidding back and forth and players passing in different capacities. And then when a player acquires a card, in most situations you just stick it in their inventory, but other one-shot cards give resources or allow worker or overseer movements, so that needs to be resolved and then transitioned back into market bidding. And having to double-check everything with the server is so annoying…
It probably wasn’t the best way to do it, but I took, like, 1 or 2 weeks and just coded everything for market interactions without testing it at all. Then I had to spend July 4 weekend debugging the ridiculous beast and it nearly drove me insane. Not quite, but I did break my mouse in frustration. The cursor sort of wobbles about now, make it very hard to make graphics and get headshots in Borderlands 2. Very troublesome.
So anyway, that was that, but in addition to the bidding process, the market phase is also about interacting with the merchant and using market stalls, so that’s what I’m finishing up now. I’m probably half-way through coding the merchant, and the market stalls shouldn’t be too hard.
After I’ve finished with the market, I’m gonna take a small break (the quest phase scares me!) to work on designing a website. Soon (before GenCon at least) I’ll be moving this blog over to this new website (cephalofair.com? maybe?), where the Flash game will also be hosted, as well as some board game reviews probably. Exciting business.
I also need to work on getting a page for Forge War on BoardGameGeek.com. They say you need to have an actual finished, produced game to have a page, but I’m not sure what that means. Obviously I’m not waiting until after the Kickstarter. In fact, I really need it before GenCon. I think once I have all the stage 1 art done and have the board art printed on an actual piece of quad-fold cardboard, then it will be a real game and I can take some pictures and submit a BGG request.
Anyway, so there’s all that to look forward to. Pretty soon I’ll have the times I’ll be in the First Exposure Playtest Hall at GenCon, so I’ll share that. Good times!
Well, sometime last week I finished programming the first actual phase of the Forge War – placing overseers in the mine and moving them around. Each piece of this code puzzle has its own challenges, and I don’t think moving overseers around is the hardest part, but it did have its kinks. Plus it’s the third of 6 milestones I’ve sort of mapped out for the project, so I’m half-way done I guess?
Anyway, the first of the kinks is just the idea of moving around on a hex grid. From any space, you can move in 6 different directions – not exactly Cartesian. I didn’t research the best way to do this at all, but just came up with my own (probably inefficient) system of using 3 coordinates, and any movement changes 2 of the 3 coordinates. I probably could have gotten away with just 2, since that is sufficient to define any point, but then movement would either change 1 or both of the coordinates. I think my way is more consistent and consistency helped with the coding.
So then of course movement is stopped by the edge of the mine or an overseer or after jumping over a series of workers, which was easy. Then came the matter of flipping over workers jumped, which was also easy, except in the situation where you jump over your own worker, in which case it goes to the guy who has the fewest workers on the board. This is essentially a player order calculation, since fewest number of workers also determines who goes first. I would have to program this at some point anyway, so you just go over every hex in the mine and count up everyone’s workers. If there’s a tie, look at money, etc.
The annoying thing is that everything has to be programmed for 2, 3 and 4 players. Often times this can be accomplished using the player count in a calculation, but more often it’s just a lot of if statements.
The MORE annoying thing is that most of the code has to be written both player-side and server side, which are in different languages, which totally suuuuuucks. All calculations have to be written server side, since Rule #1 of multiplayer programming is to never trust the information a player is sending you. Really, it’s just about getting the most basic information about what the player wants to do – like, say, move from hex 555 to hex 577 – check if it is actually that player’s turn, check if the move is valid, then perform all calculations for that move – like, how did that move affect the board and how did that move affect each players’ inventory – and finally send those calculations back to the players so that their seen information can be updated.
And that’s all well and good, except I want the player to be able to see how his move affects the board and the inventories before he confirms it, and to actually be able to cancel the move if it doesn’t do what he thought it would do. This is very helpful for learning the game, which is the ultimate goal of programming an online version of a board game in the first place. So that means all the calculations the server will make have to be made by the client before communicating with the server.
The final problem was looking for worker unions after a move has been made. Groups of contiguous same-colored workers of a specific population are removed from the board. Luckily I had been doing very similar calculations in Lazy Robots for shift-clicking a group of contiguous boxes, so I just had to translate that thinking to three coordinates and it worked out just fine…both times.
So, yeah, pretty dry post, but that’s what’s going on. Of course, another idea for a game came to me while I was waiting in the car while my hot wife picked up some flowers for her mother’s birthday. It’s just a very simple 2-player card game that could be really cool and really easy to produce, but is going to take a significant amount of balancing to get it just right. I’m sure I’ll get around to talking about it more later.
I read recently that video game developers have far more ideas for games floating around in their head than they could ever produce in their and I guess it’s the same with board games.
Well, it was a bumpy road, but I’ve finally finished the second milestone for coding Forge War – initializing the board.
It really doesn’t seem like much when you first think about it – just deal out some cards, put some resources in the mine and start everybody off with their initial cash, quest tokens, adventurers and weapon plans. But in order to really do all that right, you pretty much have to plan out the structure for coding the entire game and make sure that the initialization fits into that grand plan.
For instance, all players start off with the copper dagger and copper sword weapon plans, so I could have just animated the cards for those two plans in each player’s market tabs and said I had initialized the game, but then I would have no framework for adding future market cards to the market tab and all the code I had written to do the initialization animation would probably have been useless because I would have had to gone back later to fix it to be more versatile. So instead I started it off being versatile, so each player was attributed an array of market cards, and the the animation code looked at that array and arranged all cards in that array into the market tab.
Maybe that was a simple example, but doing that for everything added up to quite a lot of work that I feel good about.
I basically laid down a strong foundation for all future code to build upon instead of just throwing boards together and hoping that they would stay standing in the end.
I made a video demonstration of all the features I’ve done so far. Now I’m just going to start coding in gameplay order from there, starting with placing overseers in the mine (super-easy) and then moving the overseers around on the hex grid (umm…yeah, need to think about this one some more…I think the easiest way is probably to use 3 indices).
In other news, I’m changing the name of Dungeon Hunters to Tribal Assault, and I am trying to work on that a bit more, as circumstances may have pushed forward the time that I want to Kickstart the project…maybe. But anyway, I need to work on making the game more hospitable to larger numbers of players and start playtesting it again at the board game nights I go to.
Super-excited about the future!
Okay, so my laptop is hosed. If I could, I’d like to eulogize it a bit. I just feel bad, really. I never treated it well, was irresponsible with keeping it maintained, and ultimately paid a hefty price when a little TLC was all it needed to keep going.
Essentially, as I’ve mentioned before, the laptop had been overheating for a while. The initial problem was a faulty fan, which caused some major issues. That was eventually resolved, but it left some lasting effects on the thermal paste applied to the heat sink. So a year after the fan was resolved, the thermal paste started to give out. Instead of just resolving the issue, however, I just bought a big laptop fan to stick under it and then proceeded to watch the overheating issue continue to degrade. I guess I just didn’t want to lose my computer for a week to get it repaired and didn’t realize that with a $10 tube of thermal compound and a little internet research I could have easily solved the problem myself. I’m particularly upset about this issue because this irresponsibility eventually led to the destruction of my video card and processor. Seriously, I am an idiot for letting this happen.
It wasn’t even very hot outside, but it had been warming up after a few months of winter cold. And I hadn’t turned the fan on and just left the laptop running. I was also baking cookies, so that might have turned the heat up a bit. And the laptop just decided it had had enough. Boom. No more laptop. Unless you want to pay the Geek Squad more money than you initially paid for it to repair it. No, no thanks, I think I’ll pass on that.
So now I need a new computer and there are a few issues running through my head. First of all, I still want a computer capable of gaming, as that is something I enjoy, but on the other hand, I feel I need to reprimand myself for my irresponsibility. “Why should I buy you another $1500 laptop that you’re just going to break again?”
So I compromised with myself on a desktop. It would be cheaper, and if I just so happened to break something down the road, I could much more easily fix it, and it wouldn’t cost nearly as much. Plus a desktop would be much less prone to overheating – the Achilles heel of all my laptops.
After some research, I realized the most cheap and best option for desktop computing is to just build your own. I have never built my own computer, but I am a smart person, and there are plenty of online tutorials, so I figured, why not? If I can save $500 doing it, get better parts and actually get to know the inside of my computer, so that if something does go wrong, I will better know how to fix it, then that seems like a winning situation, and all it would require is a little learning.
I found a couple good gaming templates to go off of, and set about ordering about $500 worth of parts to make a computer that would easily cost 2 or 3 times that from Dell. Hopefully by the weekend or early next week I’ll get all the components together and take the plunge.
And then I’ll be able to get to work again on coding and other stuff! Holy crap I haven’t done anything useful in a week and half, and it is harrowing for my psyche. Seriously.
There is only so much Mage Knight one can play.